CMS 3D CMS Logo

FP420G4Hit.cc
Go to the documentation of this file.
1 // File: FP420G4Hit.cc
3 // Date: 02.2006
4 // Description: Transient Hit class for the FP420
7 #include <iostream>
8 
10  entrylp(0);
11  exitlp(0);
12  elem = 0.;
13  hadr = 0.;
14  theIncidentEnergy = 0.;
15  theTimeSlice = 0.;
16  theTrackID = -1;
17  theUnitID = 0;
18  thePabs = 0.;
19  theTof = 0.;
20  theEnergyLoss = 0.;
21  theParticleType = 0;
22  theUnitID = 0;
23  theTrackID = -1;
24  theThetaAtEntry = -10000.;
25  thePhiAtEntry = -10000.;
26  theParentId = 0;
27 
28  theX = 0.;
29  theY = 0.;
30  theZ = 0.;
31  theVx = 0.;
32  theVy = 0.;
33  theVz = 0.;
34 }
35 
37 
39  theUnitID = right.theUnitID;
40 
41  theTrackID = right.theTrackID;
42  theTof = right.theTof;
45  thePabs = right.thePabs;
46  elem = right.elem;
47  hadr = right.hadr;
49  theTimeSlice = right.theTimeSlice;
50  entry = right.entry;
51  entrylp = right.entrylp;
52  exitlp = right.exitlp;
55  theParentId = right.theParentId;
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 
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 
85  theX = right.theX;
86  theY = right.theY;
87  theZ = right.theZ;
88 
89  theVx = right.theVx;
90  theVy = right.theVy;
91  theVz = right.theVz;
92 
93  return *this;
94 }
95 
97  elem += aHit.getEM();
98  hadr += aHit.getHadr();
99 }
100 
101 void FP420G4Hit::Print() { std::cout << (*this); }
102 
103 G4ThreeVector FP420G4Hit::getEntry() const { return entry; }
104 void FP420G4Hit::setEntry(const G4ThreeVector& xyz) { entry = xyz; }
105 
106 G4ThreeVector FP420G4Hit::getEntryLocalP() const { return entrylp; }
107 void FP420G4Hit::setEntryLocalP(const G4ThreeVector& xyz1) { entrylp = xyz1; }
108 
109 G4ThreeVector FP420G4Hit::getExitLocalP() const { return exitlp; }
110 void FP420G4Hit::setExitLocalP(const G4ThreeVector& xyz1) { exitlp = xyz1; }
111 
112 double FP420G4Hit::getEM() const { return elem; }
113 void FP420G4Hit::setEM(double e) { elem = e; }
114 
115 double FP420G4Hit::getHadr() const { return hadr; }
116 void FP420G4Hit::setHadr(double e) { hadr = e; }
117 
120 
121 unsigned int FP420G4Hit::getTrackID() const { return theTrackID; }
123 
124 unsigned int FP420G4Hit::getUnitID() const { return theUnitID; }
125 void FP420G4Hit::setUnitID(unsigned int i) { theUnitID = i; }
126 
127 double FP420G4Hit::getTimeSlice() const { return theTimeSlice; }
129 int FP420G4Hit::getTimeSliceID() const { return (int)theTimeSlice; }
130 
131 void FP420G4Hit::addEnergyDeposit(double em, double hd) {
132  elem += em;
133  hadr += hd;
134 }
135 
136 double FP420G4Hit::getEnergyDeposit() const { return elem + hadr; }
137 
138 float FP420G4Hit::getPabs() const { return thePabs; }
139 float FP420G4Hit::getTof() const { return theTof; }
140 float FP420G4Hit::getEnergyLoss() const { return theEnergyLoss; }
142 
143 void FP420G4Hit::setPabs(float e) { thePabs = e; }
144 void FP420G4Hit::setTof(float e) { theTof = e; }
148 
150 float FP420G4Hit::getPhiAtEntry() const { return thePhiAtEntry; }
151 
154 
155 float FP420G4Hit::getX() const { return theX; }
156 void FP420G4Hit::setX(float t) { theX = t; }
157 
158 float FP420G4Hit::getY() const { return theY; }
159 void FP420G4Hit::setY(float t) { theY = t; }
160 
161 float FP420G4Hit::getZ() const { return theZ; }
162 void FP420G4Hit::setZ(float t) { theZ = t; }
163 
164 int FP420G4Hit::getParentId() const { return theParentId; }
166 
167 float FP420G4Hit::getVx() const { return theVx; }
168 void FP420G4Hit::setVx(float t) { theVx = t; }
169 
170 float FP420G4Hit::getVy() const { return theVy; }
171 void FP420G4Hit::setVy(float t) { theVy = t; }
172 
173 float FP420G4Hit::getVz() const { return theVz; }
174 void FP420G4Hit::setVz(float t) { theVz = t; }
175 
176 std::ostream& operator<<(std::ostream& os, const FP420G4Hit& hit) {
177  os << " Data of this FP420G4Hit are:" << std::endl
178  << " hitEntryLocalP: " << hit.getEntryLocalP() << std::endl
179  << " hitExitLocalP: " << hit.getExitLocalP() << std::endl
180  << " Time slice ID: " << hit.getTimeSliceID() << std::endl
181  << " Time slice : " << hit.getTimeSlice() << std::endl
182  << " Tof : " << hit.getTof() << std::endl
183  << " EnergyDeposit = " << hit.getEnergyDeposit() << std::endl
184  << " elmenergy = " << hit.getEM() << std::endl
185  << " hadrenergy = " << hit.getHadr() << std::endl
186  << " EnergyLoss = " << hit.getEnergyLoss() << std::endl
187  << " ParticleType = " << hit.getParticleType() << std::endl
188  << " ParticleType = " << hit.getParticleType() << std::endl
189  << " Theta at Entry = " << hit.getThetaAtEntry() << std::endl
190  << " Phi at Entry = " << hit.getPhiAtEntry() << std::endl
191  << " X at Entry = " << hit.getX() << std::endl
192  << " Y at Entry = " << hit.getY() << std::endl
193  << " Z at Entry = " << hit.getZ() << std::endl
194  << " VtxX = " << hit.getVx() << std::endl
195  << " VtxY = " << hit.getVy() << std::endl
196  << " VtxZ = " << hit.getVz() << std::endl
197  << " parentID = " << hit.getParentId() << std::endl
198  << " Pabs = " << hit.getPabs() << std::endl
199  << " Energy of primary particle (ID = " << hit.getTrackID() << ") = " << hit.getIncidentEnergy() << " (MeV)"
200  << std::endl
201  << " Entry point in FP420 unit number " << hit.getUnitID() << " is: " << hit.getEntry() << " (mm)" << std::endl;
202  os << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
203  return os;
204 }
float theTof
Definition: FP420G4Hit.h:116
const FP420G4Hit & operator=(const FP420G4Hit &right)
Definition: FP420G4Hit.cc:66
void setY(float t)
Definition: FP420G4Hit.cc:159
double getEnergyDeposit() const
Definition: FP420G4Hit.cc:136
void setPhiAtEntry(float f)
Definition: FP420G4Hit.cc:153
float getTof() const
Definition: FP420G4Hit.cc:139
void setVz(float p)
Definition: FP420G4Hit.cc:174
void setEntry(const G4ThreeVector &xyz)
Definition: FP420G4Hit.cc:104
double theIncidentEnergy
Definition: FP420G4Hit.h:105
G4ThreeVector entrylp
Definition: FP420G4Hit.h:101
G4ThreeVector getExitLocalP() const
Definition: FP420G4Hit.cc:109
void setZ(float t)
Definition: FP420G4Hit.cc:162
float getVz() const
Definition: FP420G4Hit.cc:173
double theTimeSlice
Definition: FP420G4Hit.h:108
void setPabs(float e)
Definition: FP420G4Hit.cc:143
int theParentId
Definition: FP420G4Hit.h:123
float getPabs() const
Definition: FP420G4Hit.cc:138
int theParticleType
Definition: FP420G4Hit.h:118
void setVx(float p)
Definition: FP420G4Hit.cc:168
void setTrackID(int i)
Definition: FP420G4Hit.cc:122
unsigned int getTrackID() const
Definition: FP420G4Hit.cc:121
void addEnergyDeposit(double em, double hd)
Definition: FP420G4Hit.cc:131
float getVx() const
Definition: FP420G4Hit.cc:167
float getPhiAtEntry() const
Definition: FP420G4Hit.cc:150
int getParentId() const
Definition: FP420G4Hit.cc:164
unsigned int getUnitID() const
Definition: FP420G4Hit.cc:124
void setEnergyLoss(float e)
Definition: FP420G4Hit.cc:146
double elem
Definition: FP420G4Hit.h:103
float getVy() const
Definition: FP420G4Hit.cc:170
void setTof(float e)
Definition: FP420G4Hit.cc:144
double hadr
Definition: FP420G4Hit.h:104
double getIncidentEnergy() const
Definition: FP420G4Hit.cc:118
G4int theTrackID
Definition: FP420G4Hit.h:106
G4ThreeVector exitlp
Definition: FP420G4Hit.h:102
void Print() override
Definition: FP420G4Hit.cc:101
double f[11][100]
double getHadr() const
Definition: FP420G4Hit.cc:115
G4ThreeVector getEntryLocalP() const
Definition: FP420G4Hit.cc:106
void setTimeSlice(double d)
Definition: FP420G4Hit.cc:128
float getX() const
Definition: FP420G4Hit.cc:155
float theVy
Definition: FP420G4Hit.h:125
float getEnergyLoss() const
Definition: FP420G4Hit.cc:140
void setEntryLocalP(const G4ThreeVector &xyz1)
Definition: FP420G4Hit.cc:107
~FP420G4Hit() override
Definition: FP420G4Hit.cc:36
void setEM(double e)
Definition: FP420G4Hit.cc:113
void setIncidentEnergy(double e)
Definition: FP420G4Hit.cc:119
float theThetaAtEntry
Definition: FP420G4Hit.h:120
int getTimeSliceID() const
Definition: FP420G4Hit.cc:129
void setX(float t)
Definition: FP420G4Hit.cc:156
void setExitLocalP(const G4ThreeVector &xyz1)
Definition: FP420G4Hit.cc:110
float thePabs
Definition: FP420G4Hit.h:115
float theY
Definition: FP420G4Hit.h:113
int theUnitID
Definition: FP420G4Hit.h:110
int getParticleType() const
Definition: FP420G4Hit.cc:141
void setParticleType(short i)
Definition: FP420G4Hit.cc:147
void setThetaAtEntry(float t)
Definition: FP420G4Hit.cc:152
void setUnitID(unsigned int i)
Definition: FP420G4Hit.cc:125
G4ThreeVector entry
Definition: FP420G4Hit.h:100
std::ostream & operator<<(std::ostream &os, const FP420G4Hit &hit)
Definition: FP420G4Hit.cc:176
float theZ
Definition: FP420G4Hit.h:114
double getEM() const
Definition: FP420G4Hit.cc:112
float theVx
Definition: FP420G4Hit.h:124
G4ThreeVector getEntry() const
Definition: FP420G4Hit.cc:103
float getY() const
Definition: FP420G4Hit.cc:158
void setParentId(int p)
Definition: FP420G4Hit.cc:165
double getTimeSlice() const
Definition: FP420G4Hit.cc:127
float theEnergyLoss
Definition: FP420G4Hit.h:117
float getZ() const
Definition: FP420G4Hit.cc:161
float thePhiAtEntry
Definition: FP420G4Hit.h:121
void addEnergyLoss(float e)
Definition: FP420G4Hit.cc:145
void setHadr(double e)
Definition: FP420G4Hit.cc:116
float getThetaAtEntry() const
Definition: FP420G4Hit.cc:149
float theX
Definition: FP420G4Hit.h:112
float theVz
Definition: FP420G4Hit.h:126
void setVy(float p)
Definition: FP420G4Hit.cc:171