CMS 3D CMS Logo

BSCG4Hit.cc
Go to the documentation of this file.
1 // File: BscG4Hit.cc
3 // Date: 02.2006
4 // Description: Transient Hit class for the Bsc
7 #include <iostream>
8 
9 BscG4Hit::BscG4Hit() : entry(0., 0., 0.), entrylp(0., 0., 0.), exitlp(0., 0., 0.) {
10  elem = 0.f;
11  hadr = 0.f;
12  theIncidentEnergy = 0.f;
13  theTimeSlice = 0.;
14  theTrackID = -1;
15  theUnitID = 0;
16  thePabs = 0.f;
17  theTof = 0.f;
18  theEnergyLoss = 0.f;
19  theParticleType = 0;
20  theUnitID = 0;
21  theTrackID = -1;
22  theThetaAtEntry = -10000.f;
23  thePhiAtEntry = -10000.f;
24  theParentId = 0;
25  theProcessId = 0;
26 
27  theX = 0.f;
28  theY = 0.f;
29  theZ = 0.f;
30  theVx = 0.f;
31  theVy = 0.f;
32  theVz = 0.f;
33 }
34 
36 
38  theUnitID = right.theUnitID;
39 
40  theTrackID = right.theTrackID;
41  theTof = right.theTof;
44  thePabs = right.thePabs;
45  elem = right.elem;
46  hadr = right.hadr;
48  theTimeSlice = right.theTimeSlice;
49  entry = right.entry;
50  entrylp = right.entrylp;
51  exitlp = right.exitlp;
54  theParentId = right.theParentId;
55  theProcessId = right.theProcessId;
56 
57  theX = right.theX;
58  theY = right.theY;
59  theZ = right.theZ;
60 
61  theVx = right.theVx;
62  theVy = right.theVy;
63  theVz = right.theVz;
64 }
65 
66 const BscG4Hit& BscG4Hit::operator=(const BscG4Hit& right) {
67  theUnitID = right.theUnitID;
68 
69  theTrackID = right.theTrackID;
70  theTof = right.theTof;
73  thePabs = right.thePabs;
74  elem = right.elem;
75  hadr = right.hadr;
77  theTimeSlice = right.theTimeSlice;
78  entry = right.entry;
79  entrylp = right.entrylp;
80  exitlp = right.exitlp;
83  theParentId = right.theParentId;
84  theProcessId = right.theProcessId;
85 
86  theX = right.theX;
87  theY = right.theY;
88  theZ = right.theZ;
89 
90  theVx = right.theVx;
91  theVy = right.theVy;
92  theVz = right.theVz;
93 
94  return *this;
95 }
96 
97 void BscG4Hit::setEntry(const G4ThreeVector& v) {
98  entry = v;
99  theX = v.x();
100  theY = v.y();
101  theZ = v.z();
102 }
103 
105  elem += aHit.getEM();
106  hadr += aHit.getHadr();
107  theEnergyLoss = elem + hadr;
108 }
109 
110 void BscG4Hit::Print() { std::cout << (*this); }
111 
112 void BscG4Hit::addEnergyDeposit(float em, float hd) {
113  elem += em;
114  hadr += hd;
115  theEnergyLoss = elem + hadr;
116 }
117 
118 void BscG4Hit::setHitPosition(const G4ThreeVector& v) {
119  theX = v.x();
120  theY = v.y();
121  theZ = v.z();
122 }
123 
124 void BscG4Hit::setVertexPosition(const G4ThreeVector& v) {
125  theVx = v.x();
126  theVy = v.y();
127  theVz = v.z();
128 }
129 
130 std::ostream& operator<<(std::ostream& os, const BscG4Hit& hit) {
131  os << " Data of this BscG4Hit are:" << std::endl
132  << " hitEntryLocalP: " << hit.getEntryLocalP() << std::endl
133  << " hitExitLocalP: " << hit.getExitLocalP() << std::endl
134  << " Time slice ID: " << hit.getTimeSliceID() << std::endl
135  << " Time slice : " << hit.getTimeSlice() << std::endl
136  << " Tof : " << hit.getTof() << std::endl
137  << " EnergyDeposit = " << hit.getEnergyDeposit() << std::endl
138  << " elmenergy = " << hit.getEM() << std::endl
139  << " hadrenergy = " << hit.getHadr() << std::endl
140  << " EnergyLoss = " << hit.getEnergyLoss() << std::endl
141  << " ParticleType = " << hit.getParticleType() << std::endl
142  << " Pabs = " << hit.getPabs() << std::endl
143  << " Energy of primary particle (ID = " << hit.getTrackID() << ") = " << hit.getIncidentEnergy() << " (MeV)"
144  << std::endl
145  << " Entry point in Bsc unit number " << hit.getUnitID() << " is: " << hit.getEntry() << " (mm)" << std::endl;
146  os << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
147  return os;
148 }
BscG4Hit::theVz
float theVz
Definition: BscG4Hit.h:132
BscG4Hit::theVx
float theVx
Definition: BscG4Hit.h:130
BscG4Hit.h
BscG4Hit::BscG4Hit
BscG4Hit()
Definition: BSCG4Hit.cc:9
BscG4Hit::theUnitID
int theUnitID
Definition: BscG4Hit.h:115
BscG4Hit::setVertexPosition
void setVertexPosition(const G4ThreeVector &)
Definition: BSCG4Hit.cc:124
BscG4Hit::thePabs
float thePabs
Definition: BscG4Hit.h:120
mps_splice.entry
entry
Definition: mps_splice.py:68
gather_cfg.cout
cout
Definition: gather_cfg.py:144
findQualityFiles.v
v
Definition: findQualityFiles.py:179
BscG4Hit::addEnergyDeposit
void addEnergyDeposit(float em, float hd)
Definition: BSCG4Hit.cc:112
BscG4Hit::Print
void Print() override
Definition: BSCG4Hit.cc:110
BscG4Hit::theX
float theX
Definition: BscG4Hit.h:117
BscG4Hit::getHadr
float getHadr() const
Definition: BscG4Hit.h:44
BscG4Hit::theParentId
int theParentId
Definition: BscG4Hit.h:128
BscG4Hit::theZ
float theZ
Definition: BscG4Hit.h:119
BscG4Hit::theIncidentEnergy
float theIncidentEnergy
Definition: BscG4Hit.h:111
BscG4Hit::theY
float theY
Definition: BscG4Hit.h:118
BscG4Hit::theProcessId
int theProcessId
Definition: BscG4Hit.h:129
BscG4Hit::theParticleType
int theParticleType
Definition: BscG4Hit.h:123
BscG4Hit::theTimeSlice
double theTimeSlice
Definition: BscG4Hit.h:113
BscG4Hit::entry
G4ThreeVector entry
Definition: BscG4Hit.h:103
BscG4Hit::getEM
float getEM() const
Definition: BscG4Hit.h:38
BscG4Hit::theThetaAtEntry
float theThetaAtEntry
Definition: BscG4Hit.h:125
BscG4Hit::operator=
const BscG4Hit & operator=(const BscG4Hit &right)
Definition: BSCG4Hit.cc:66
BscG4Hit::entrylp
G4ThreeVector entrylp
Definition: BscG4Hit.h:107
BscG4Hit::elem
float elem
Definition: BscG4Hit.h:109
BscG4Hit::theEnergyLoss
float theEnergyLoss
Definition: BscG4Hit.h:122
BscG4Hit::~BscG4Hit
~BscG4Hit() override
Definition: BSCG4Hit.cc:35
BscG4Hit::hadr
float hadr
Definition: BscG4Hit.h:110
BscG4Hit::theVy
float theVy
Definition: BscG4Hit.h:131
BscG4Hit::setHitPosition
void setHitPosition(const G4ThreeVector &)
Definition: BSCG4Hit.cc:118
operator<<
std::ostream & operator<<(std::ostream &os, const BscG4Hit &hit)
Definition: BSCG4Hit.cc:130
BscG4Hit::setEntry
void setEntry(const G4ThreeVector &xyz)
Definition: BSCG4Hit.cc:97
BscG4Hit
Definition: BscG4Hit.h:17
BscG4Hit::theTof
float theTof
Definition: BscG4Hit.h:121
BscG4Hit::theTrackID
int theTrackID
Definition: BscG4Hit.h:112
BscG4Hit::thePhiAtEntry
float thePhiAtEntry
Definition: BscG4Hit.h:126
hit
Definition: SiStripHitEffFromCalibTree.cc:88
BscG4Hit::exitlp
G4ThreeVector exitlp
Definition: BscG4Hit.h:108