CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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) {
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 
72 const BscG4Hit& BscG4Hit::operator=(const BscG4Hit &right) {
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 BscG4Hit::getEntry() const {return entry;}
116 void BscG4Hit::setEntry(const G4ThreeVector& xyz) { entry = xyz; }
117 
118 G4ThreeVector BscG4Hit::getEntryLocalP() const {return entrylp;}
119 void BscG4Hit::setEntryLocalP(const G4ThreeVector& xyz1) { entrylp = xyz1; }
120 
121 G4ThreeVector BscG4Hit::getExitLocalP() const {return exitlp;}
122 void BscG4Hit::setExitLocalP(const G4ThreeVector& xyz1) { exitlp = xyz1; }
123 
124 double BscG4Hit::getEM() const {return elem; }
125 void BscG4Hit::setEM (double e) { elem = e; }
126 
127 double BscG4Hit::getHadr() const {return hadr; }
128 void BscG4Hit::setHadr (double e) { hadr = e; }
129 
132 
133 G4int BscG4Hit::getTrackID() const {return theTrackID; }
135 
136 unsigned int BscG4Hit::getUnitID() const {return theUnitID; }
137 void BscG4Hit::setUnitID (unsigned int i) { theUnitID = i; }
138 
139 double BscG4Hit::getTimeSlice() const {return theTimeSlice; }
141 int BscG4Hit::getTimeSliceID() const {return (int)theTimeSlice;}
142 
143 void BscG4Hit::addEnergyDeposit(double em, double hd)
144  {elem += em ; hadr += hd;}
145 
146 double BscG4Hit::getEnergyDeposit() const {return elem+hadr;}
147 
148 float BscG4Hit::getPabs() const {return thePabs;}
149 float BscG4Hit::getTof() const {return theTof;}
150 float BscG4Hit::getEnergyLoss() const {return theEnergyLoss;}
152 
153 void BscG4Hit::setPabs(float e) {thePabs = e;}
154 void BscG4Hit::setTof(float e) {theTof = e;}
157 
159 float BscG4Hit::getPhiAtEntry() const{ return thePhiAtEntry;}
160 
163 
164 float BscG4Hit::getX() const{ return theX;}
165 void BscG4Hit::setX(float t){theX = t;}
166 
167 float BscG4Hit::getY() const{ return theY;}
168 void BscG4Hit::setY(float t){theY = t;}
169 
170 float BscG4Hit::getZ() const{ return theZ;}
171 void BscG4Hit::setZ(float t){theZ = t;}
172 
173 int BscG4Hit::getParentId() const {return theParentId;}
175 
176 float BscG4Hit::getVx() const{ return theVx;}
177 void BscG4Hit::setVx(float t){theVx = t;}
178 
179 float BscG4Hit::getVy() const{ return theVy;}
180 void BscG4Hit::setVy(float t){theVy = t;}
181 
182 float BscG4Hit::getVz() const{ return theVz;}
183 void BscG4Hit::setVz(float t){theVz = t;}
184 
185 
186 
187 
188 
189 std::ostream& operator<<(std::ostream& os, const BscG4Hit& hit) {
190  os << " Data of this BscG4Hit are:" << std::endl
191  << " hitEntryLocalP: " << hit.getEntryLocalP() << std::endl
192  << " hitExitLocalP: " << hit.getExitLocalP() << std::endl
193  << " Time slice ID: " << hit.getTimeSliceID() << std::endl
194  << " Time slice : " << hit.getTimeSlice() << std::endl
195  << " Tof : " << hit.getTof() << std::endl
196  << " EnergyDeposit = " << hit.getEnergyDeposit() << std::endl
197  << " elmenergy = " << hit.getEM() << std::endl
198  << " hadrenergy = " << hit.getHadr() << std::endl
199  << " EnergyLoss = " << hit.getEnergyLoss() << std::endl
200  << " ParticleType = " << hit.getParticleType() << std::endl
201  << " Pabs = " << hit.getPabs() << std::endl
202  << " Energy of primary particle (ID = " << hit.getTrackID()
203  << ") = " << hit.getIncidentEnergy() << " (MeV)"<<std::endl
204  << " Entry point in Bsc unit number " << hit.getUnitID()
205  << " is: " << hit.getEntry() << " (mm)" << std::endl;
206  os << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
207  << std::endl;
208  return os;
209 
210 }
211 
212 
float getVy() const
Definition: BSCG4Hit.cc:179
void setTof(float e)
Definition: BSCG4Hit.cc:154
int i
Definition: DBlmapReader.cc:9
float theVx
Definition: BscG4Hit.h:130
void setEntry(const G4ThreeVector &xyz)
Definition: BSCG4Hit.cc:116
G4ThreeVector getEntryLocalP() const
Definition: BSCG4Hit.cc:118
float getPhiAtEntry() const
Definition: BSCG4Hit.cc:159
float theVy
Definition: BscG4Hit.h:131
void setVx(float p)
Definition: BSCG4Hit.cc:177
int getParticleType() const
Definition: BSCG4Hit.cc:151
G4int getTrackID() const
Definition: BSCG4Hit.cc:133
float getVz() const
Definition: BSCG4Hit.cc:182
float theX
Definition: BscG4Hit.h:117
float theVz
Definition: BscG4Hit.h:132
G4ThreeVector entry
Definition: BscG4Hit.h:105
void setTrackID(int i)
Definition: BSCG4Hit.cc:134
void setEnergyLoss(float e)
Definition: BSCG4Hit.cc:155
void setParentId(int p)
Definition: BSCG4Hit.cc:174
int theUnitID
Definition: BscG4Hit.h:115
void setUnitID(unsigned int i)
Definition: BSCG4Hit.cc:137
float getTof() const
Definition: BSCG4Hit.cc:149
float getPabs() const
Definition: BSCG4Hit.cc:148
BscG4Hit()
Definition: BSCG4Hit.cc:9
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
void setVy(float p)
Definition: BSCG4Hit.cc:180
void setY(float t)
Definition: BSCG4Hit.cc:168
unsigned int getUnitID() const
Definition: BSCG4Hit.cc:136
float getY() const
Definition: BSCG4Hit.cc:167
float theEnergyLoss
Definition: BscG4Hit.h:122
float theTof
Definition: BscG4Hit.h:121
int getTimeSliceID() const
Definition: BSCG4Hit.cc:141
int theParticleType
Definition: BscG4Hit.h:123
void setThetaAtEntry(float t)
Definition: BSCG4Hit.cc:161
tuple d
Definition: ztail.py:151
void setX(float t)
Definition: BSCG4Hit.cc:165
void setPabs(float e)
Definition: BSCG4Hit.cc:153
double getHadr() const
Definition: BSCG4Hit.cc:127
void setEntryLocalP(const G4ThreeVector &xyz1)
Definition: BSCG4Hit.cc:119
const BscG4Hit & operator=(const BscG4Hit &right)
Definition: BSCG4Hit.cc:72
float thePabs
Definition: BscG4Hit.h:120
void setPhiAtEntry(float f)
Definition: BSCG4Hit.cc:162
double hadr
Definition: BscG4Hit.h:109
~BscG4Hit()
Definition: BSCG4Hit.cc:38
double f[11][100]
float getThetaAtEntry() const
Definition: BSCG4Hit.cc:158
void addEnergyDeposit(double em, double hd)
Definition: BSCG4Hit.cc:143
G4int theTrackID
Definition: BscG4Hit.h:111
void setEM(double e)
Definition: BSCG4Hit.cc:125
void setTimeSlice(double d)
Definition: BSCG4Hit.cc:140
void setParticleType(short i)
Definition: BSCG4Hit.cc:156
void Print()
Definition: BSCG4Hit.cc:111
void setVz(float p)
Definition: BSCG4Hit.cc:183
float theZ
Definition: BscG4Hit.h:119
G4ThreeVector exitlp
Definition: BscG4Hit.h:107
G4ThreeVector getExitLocalP() const
Definition: BSCG4Hit.cc:121
int theParentId
Definition: BscG4Hit.h:129
float theThetaAtEntry
Definition: BscG4Hit.h:126
float thePhiAtEntry
Definition: BscG4Hit.h:127
double theTimeSlice
Definition: BscG4Hit.h:113
float getVx() const
Definition: BSCG4Hit.cc:176
double getEnergyDeposit() const
Definition: BSCG4Hit.cc:146
double elem
Definition: BscG4Hit.h:108
G4ThreeVector getEntry() const
Definition: BSCG4Hit.cc:115
double theIncidentEnergy
Definition: BscG4Hit.h:110
void setZ(float t)
Definition: BSCG4Hit.cc:171
G4ThreeVector entrylp
Definition: BscG4Hit.h:106
void setHadr(double e)
Definition: BSCG4Hit.cc:128
double getIncidentEnergy() const
Definition: BSCG4Hit.cc:130
int getParentId() const
Definition: BSCG4Hit.cc:173
float getZ() const
Definition: BSCG4Hit.cc:170
tuple cout
Definition: gather_cfg.py:121
float getX() const
Definition: BSCG4Hit.cc:164
void setExitLocalP(const G4ThreeVector &xyz1)
Definition: BSCG4Hit.cc:122
void setIncidentEnergy(double e)
Definition: BSCG4Hit.cc:131
double getTimeSlice() const
Definition: BSCG4Hit.cc:139
double getEM() const
Definition: BSCG4Hit.cc:124
float getEnergyLoss() const
Definition: BSCG4Hit.cc:150
float theY
Definition: BscG4Hit.h:118