CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
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 
37 
39 
40 
42  theUnitID = right.theUnitID;
43 
44  theTrackID = right.theTrackID;
45  theTof = right.theTof ;
48  thePabs = right.thePabs;
49  elem = right.elem;
50  hadr = right.hadr;
52  theTimeSlice = right.theTimeSlice;
53  entry = right.entry;
54  entrylp = right.entrylp;
55  exitlp = right.exitlp;
58  theParentId = right.theParentId;
59 
60  theX = right.theX;
61  theY = right.theY;
62  theZ = right.theZ;
63 
64  theVx = right.theVx;
65  theVy = right.theVy;
66  theVz = right.theVz;
67 
68 
69 }
70 
71 
73  theUnitID = right.theUnitID;
74 
75  theTrackID = right.theTrackID;
76  theTof = right.theTof ;
79  thePabs = right.thePabs;
80  elem = right.elem;
81  hadr = right.hadr;
83  theTimeSlice = right.theTimeSlice;
84  entry = right.entry;
85  entrylp = right.entrylp;
86  exitlp = right.exitlp;
89  theParentId = right.theParentId;
90 
91  theX = right.theX;
92  theY = right.theY;
93  theZ = right.theZ;
94 
95  theVx = right.theVx;
96  theVy = right.theVy;
97  theVz = right.theVz;
98 
99 
100  return *this;
101 }
102 
103 
105 
106  elem += aHit.getEM();
107  hadr += aHit.getHadr();
108 }
109 
110 
112  std::cout << (*this);
113 }
114 
115 G4ThreeVector FP420G4Hit::getEntry() const {return entry;}
116 void FP420G4Hit::setEntry(const G4ThreeVector& xyz) { entry = xyz; }
117 
118 G4ThreeVector FP420G4Hit::getEntryLocalP() const {return entrylp;}
119 void FP420G4Hit::setEntryLocalP(const G4ThreeVector& xyz1) { entrylp = xyz1; }
120 
121 G4ThreeVector FP420G4Hit::getExitLocalP() const {return exitlp;}
122 void FP420G4Hit::setExitLocalP(const G4ThreeVector& xyz1) { exitlp = xyz1; }
123 
124 double FP420G4Hit::getEM() const {return elem; }
125 void FP420G4Hit::setEM (double e) { elem = e; }
126 
127 double FP420G4Hit::getHadr() const {return hadr; }
128 void FP420G4Hit::setHadr (double e) { hadr = e; }
129 
132 
133 unsigned int FP420G4Hit::getTrackID() const {return theTrackID; }
135 
136 unsigned int FP420G4Hit::getUnitID() const {return theUnitID; }
137 void FP420G4Hit::setUnitID (unsigned int i) { theUnitID = i; }
138 
139 double FP420G4Hit::getTimeSlice() const {return theTimeSlice; }
141 int FP420G4Hit::getTimeSliceID() const {return (int)theTimeSlice;}
142 
143 void FP420G4Hit::addEnergyDeposit(double em, double hd)
144  {elem += em ; hadr += hd;}
145 
146 double FP420G4Hit::getEnergyDeposit() const {return elem+hadr;}
147 
148 float FP420G4Hit::getPabs() const {return thePabs;}
149 float FP420G4Hit::getTof() const {return theTof;}
152 
153 void FP420G4Hit::setPabs(float e) {thePabs = e;}
154 void FP420G4Hit::setTof(float e) {theTof = e;}
158 
161 
164 
165 float FP420G4Hit::getX() const{ return theX;}
166 void FP420G4Hit::setX(float t){theX = t;}
167 
168 float FP420G4Hit::getY() const{ return theY;}
169 void FP420G4Hit::setY(float t){theY = t;}
170 
171 float FP420G4Hit::getZ() const{ return theZ;}
172 void FP420G4Hit::setZ(float t){theZ = t;}
173 
176 
177 float FP420G4Hit::getVx() const{ return theVx;}
178 void FP420G4Hit::setVx(float t){theVx = t;}
179 
180 float FP420G4Hit::getVy() const{ return theVy;}
181 void FP420G4Hit::setVy(float t){theVy = t;}
182 
183 float FP420G4Hit::getVz() const{ return theVz;}
184 void FP420G4Hit::setVz(float t){theVz = t;}
185 
186 
187 
188 
189 
190 std::ostream& operator<<(std::ostream& os, const FP420G4Hit& hit) {
191  os << " Data of this FP420G4Hit are:" << std::endl
192  << " hitEntryLocalP: " << hit.getEntryLocalP() << std::endl
193  << " hitExitLocalP: " << hit.getExitLocalP() << std::endl
194  << " Time slice ID: " << hit.getTimeSliceID() << std::endl
195  << " Time slice : " << hit.getTimeSlice() << std::endl
196  << " Tof : " << hit.getTof() << std::endl
197  << " EnergyDeposit = " << hit.getEnergyDeposit() << std::endl
198  << " elmenergy = " << hit.getEM() << std::endl
199  << " hadrenergy = " << hit.getHadr() << std::endl
200  << " EnergyLoss = " << hit.getEnergyLoss() << std::endl
201  << " ParticleType = " << hit.getParticleType() << std::endl
202  << " ParticleType = " << hit.getParticleType() << std::endl
203  << " Theta at Entry = " << hit.getThetaAtEntry() << std::endl
204  << " Phi at Entry = " << hit.getPhiAtEntry() << std::endl
205  << " X at Entry = " << hit.getX() << std::endl
206  << " Y at Entry = " << hit.getY() << std::endl
207  << " Z at Entry = " << hit.getZ() << std::endl
208  << " VtxX = " << hit.getVx() << std::endl
209  << " VtxY = " << hit.getVy() << std::endl
210  << " VtxZ = " << hit.getVz() << std::endl
211  << " parentID = " << hit.getParentId() << std::endl
212  << " Pabs = " << hit.getPabs() << std::endl
213  << " Energy of primary particle (ID = " << hit.getTrackID()
214  << ") = " << hit.getIncidentEnergy() << " (MeV)"<<std::endl
215  << " Entry point in FP420 unit number " << hit.getUnitID()
216  << " is: " << hit.getEntry() << " (mm)" << std::endl;
217  os << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
218  << std::endl;
219  return os;
220 }
221 
222 
float theTof
Definition: FP420G4Hit.h:122
int i
Definition: DBlmapReader.cc:9
const FP420G4Hit & operator=(const FP420G4Hit &right)
Definition: FP420G4Hit.cc:72
void setY(float t)
Definition: FP420G4Hit.cc:169
double getEnergyDeposit() const
Definition: FP420G4Hit.cc:146
void setPhiAtEntry(float f)
Definition: FP420G4Hit.cc:163
void Print()
Definition: FP420G4Hit.cc:111
float getTof() const
Definition: FP420G4Hit.cc:149
void setVz(float p)
Definition: FP420G4Hit.cc:184
void setEntry(const G4ThreeVector &xyz)
Definition: FP420G4Hit.cc:116
double theIncidentEnergy
Definition: FP420G4Hit.h:111
G4ThreeVector entrylp
Definition: FP420G4Hit.h:107
G4ThreeVector getExitLocalP() const
Definition: FP420G4Hit.cc:121
void setZ(float t)
Definition: FP420G4Hit.cc:172
float getVz() const
Definition: FP420G4Hit.cc:183
double theTimeSlice
Definition: FP420G4Hit.h:114
void setPabs(float e)
Definition: FP420G4Hit.cc:153
int theParentId
Definition: FP420G4Hit.h:130
float getPabs() const
Definition: FP420G4Hit.cc:148
int theParticleType
Definition: FP420G4Hit.h:124
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
void setVx(float p)
Definition: FP420G4Hit.cc:178
void setTrackID(int i)
Definition: FP420G4Hit.cc:134
unsigned int getTrackID() const
Definition: FP420G4Hit.cc:133
void addEnergyDeposit(double em, double hd)
Definition: FP420G4Hit.cc:143
float getVx() const
Definition: FP420G4Hit.cc:177
float getPhiAtEntry() const
Definition: FP420G4Hit.cc:160
tuple d
Definition: ztail.py:151
int getParentId() const
Definition: FP420G4Hit.cc:174
unsigned int getUnitID() const
Definition: FP420G4Hit.cc:136
void setEnergyLoss(float e)
Definition: FP420G4Hit.cc:156
double elem
Definition: FP420G4Hit.h:109
float getVy() const
Definition: FP420G4Hit.cc:180
void setTof(float e)
Definition: FP420G4Hit.cc:154
double hadr
Definition: FP420G4Hit.h:110
double getIncidentEnergy() const
Definition: FP420G4Hit.cc:130
G4int theTrackID
Definition: FP420G4Hit.h:112
G4ThreeVector exitlp
Definition: FP420G4Hit.h:108
double f[11][100]
double getHadr() const
Definition: FP420G4Hit.cc:127
G4ThreeVector getEntryLocalP() const
Definition: FP420G4Hit.cc:118
void setTimeSlice(double d)
Definition: FP420G4Hit.cc:140
float getX() const
Definition: FP420G4Hit.cc:165
float theVy
Definition: FP420G4Hit.h:132
float getEnergyLoss() const
Definition: FP420G4Hit.cc:150
void setEntryLocalP(const G4ThreeVector &xyz1)
Definition: FP420G4Hit.cc:119
void setEM(double e)
Definition: FP420G4Hit.cc:125
void setIncidentEnergy(double e)
Definition: FP420G4Hit.cc:131
float theThetaAtEntry
Definition: FP420G4Hit.h:127
int getTimeSliceID() const
Definition: FP420G4Hit.cc:141
void setX(float t)
Definition: FP420G4Hit.cc:166
void setExitLocalP(const G4ThreeVector &xyz1)
Definition: FP420G4Hit.cc:122
float thePabs
Definition: FP420G4Hit.h:121
float theY
Definition: FP420G4Hit.h:119
int theUnitID
Definition: FP420G4Hit.h:116
int getParticleType() const
Definition: FP420G4Hit.cc:151
void setParticleType(short i)
Definition: FP420G4Hit.cc:157
void setThetaAtEntry(float t)
Definition: FP420G4Hit.cc:162
void setUnitID(unsigned int i)
Definition: FP420G4Hit.cc:137
G4ThreeVector entry
Definition: FP420G4Hit.h:106
float theZ
Definition: FP420G4Hit.h:120
tuple cout
Definition: gather_cfg.py:121
double getEM() const
Definition: FP420G4Hit.cc:124
float theVx
Definition: FP420G4Hit.h:131
G4ThreeVector getEntry() const
Definition: FP420G4Hit.cc:115
float getY() const
Definition: FP420G4Hit.cc:168
void setParentId(int p)
Definition: FP420G4Hit.cc:175
double getTimeSlice() const
Definition: FP420G4Hit.cc:139
float theEnergyLoss
Definition: FP420G4Hit.h:123
float getZ() const
Definition: FP420G4Hit.cc:171
float thePhiAtEntry
Definition: FP420G4Hit.h:128
void addEnergyLoss(float e)
Definition: FP420G4Hit.cc:155
void setHadr(double e)
Definition: FP420G4Hit.cc:128
float getThetaAtEntry() const
Definition: FP420G4Hit.cc:159
float theX
Definition: FP420G4Hit.h:118
float theVz
Definition: FP420G4Hit.h:133
void setVy(float p)
Definition: FP420G4Hit.cc:181