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