CMS 3D CMS Logo

PPSPixelG4Hit.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: PPS
4 // Class : PPSPixelG4Hit
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author:
10 // Created: Tue May 16 10:14:34 CEST 2006
11 //
12 
13 // system include files
14 
15 // user include files
18 #include <iostream>
19 
20 //
21 // constructors and destructor
22 //
23 
24 PPSPixelG4Hit::PPSPixelG4Hit() : MeanPosition_(0), theEntryPoint_(0), theExitPoint_(0) {
25  elem_ = 0.;
26  hadr_ = 0.;
27  theIncidentEnergy_ = 0.;
28  theTrackID_ = -1;
29  theUnitID_ = 0;
30  theTimeSlice_ = 0.;
31 
32  theX_ = 0.;
33  theY_ = 0.;
34  theZ_ = 0.;
35  thePabs_ = 0.;
36  theTof_ = 0.;
37  theEnergyLoss_ = 0.;
38  theParticleType_ = 0;
39  theThetaAtEntry_ = 0.;
40  thePhiAtEntry_ = 0.;
41  theParentId_ = 0;
42  theVx_ = 0.;
43  theVy_ = 0.;
44  theVz_ = 0.;
45  thePx_ = 0;
46  thePy_ = 0;
47  thePz_ = 0;
48  theVPx_ = 0;
49  theVPy_ = 0;
50  theVPz_ = 0;
51 }
52 
55 
56  elem_ = right.elem_;
57  hadr_ = right.hadr_;
59  theTrackID_ = right.theTrackID_;
60  theUnitID_ = right.theUnitID_;
62 
63  theX_ = right.theX_;
64  theY_ = right.theY_;
65  theZ_ = right.theZ_;
66  thePabs_ = right.thePabs_;
67  theTof_ = right.theTof_;
70 
75  theParentId_ = right.theParentId_;
76  theVx_ = right.theVx_;
77  theVy_ = right.theVy_;
78  theVz_ = right.theVz_;
79  thePx_ = right.thePx_;
80  thePy_ = right.thePy_;
81  thePz_ = right.thePz_;
82  theVPx_ = right.theVPx_;
83  theVPy_ = right.theVPy_;
84  theVPz_ = right.theVPz_;
85 }
86 
89  elem_ = right.elem_;
90  hadr_ = right.hadr_;
92  theTrackID_ = right.theTrackID_;
93  theUnitID_ = right.theUnitID_;
95 
96  theX_ = right.theX_;
97  theY_ = right.theY_;
98  theZ_ = right.theZ_;
99  thePabs_ = right.thePabs_;
100  theTof_ = right.theTof_;
103 
108  theParentId_ = right.theParentId_;
109  theVx_ = right.theVx_;
110  theVy_ = right.theVy_;
111  theVz_ = right.theVz_;
112  thePx_ = right.thePx_;
113  thePy_ = right.thePy_;
114  thePz_ = right.thePz_;
115  theVPx_ = right.theVPx_;
116  theVPy_ = right.theVPy_;
117  theVPz_ = right.theVPz_;
118 
119  return *this;
120 }
121 
123  elem_ += aHit.eM();
124  hadr_ += aHit.hadr();
125 }
126 
127 void PPSPixelG4Hit::Print() { edm::LogInfo("PPSPixelG4Hit") << (*this); }
128 
129 const G4ThreeVector& PPSPixelG4Hit::entryPoint() const { return theEntryPoint_; }
130 
131 void PPSPixelG4Hit::setEntryPoint(const G4ThreeVector& xyz) { theEntryPoint_ = xyz; }
132 
133 const G4ThreeVector& PPSPixelG4Hit::exitPoint() const { return theExitPoint_; }
134 
135 void PPSPixelG4Hit::setExitPoint(const G4ThreeVector& xyz) { theExitPoint_ = xyz; }
136 
137 double PPSPixelG4Hit::eM() const { return elem_; }
138 void PPSPixelG4Hit::setEM(double e) { elem_ = e; }
139 
140 double PPSPixelG4Hit::hadr() const { return hadr_; }
141 void PPSPixelG4Hit::setHadr(double e) { hadr_ = e; }
142 
145 
146 int PPSPixelG4Hit::trackID() const { return theTrackID_; }
148 
149 uint32_t PPSPixelG4Hit::unitID() const { return theUnitID_; }
150 void PPSPixelG4Hit::setUnitID(uint32_t i) { theUnitID_ = i; }
151 
152 double PPSPixelG4Hit::timeSlice() const { return theTimeSlice_; }
154 int PPSPixelG4Hit::timeSliceID() const { return (int)theTimeSlice_; }
155 
156 void PPSPixelG4Hit::addEnergyDeposit(double em, double hd) {
157  elem_ += em;
158  hadr_ += hd;
159 }
160 
161 double PPSPixelG4Hit::energyDeposit() const { return elem_ + hadr_; }
162 
163 float PPSPixelG4Hit::p() const { return thePabs_; }
164 float PPSPixelG4Hit::tof() const { return theTof_; }
165 float PPSPixelG4Hit::energyLoss() const { return theEnergyLoss_; }
167 float PPSPixelG4Hit::px() const { return thePx_; }
168 float PPSPixelG4Hit::py() const { return thePy_; }
169 float PPSPixelG4Hit::pz() const { return thePz_; }
170 float PPSPixelG4Hit::vPx() const { return theVPx_; }
171 float PPSPixelG4Hit::vPy() const { return theVPy_; }
172 float PPSPixelG4Hit::vPz() const { return theVPz_; }
173 
174 void PPSPixelG4Hit::setP(float e) { thePabs_ = e; }
175 void PPSPixelG4Hit::setPx(float e) { thePx_ = e; }
176 void PPSPixelG4Hit::setPy(float e) { thePy_ = e; }
177 void PPSPixelG4Hit::setPz(float e) { thePz_ = e; }
178 void PPSPixelG4Hit::setVPx(float e) { theVPx_ = e; }
179 void PPSPixelG4Hit::setVPy(float e) { theVPy_ = e; }
180 void PPSPixelG4Hit::setVPz(float e) { theVPz_ = e; }
181 void PPSPixelG4Hit::setTof(float e) { theTof_ = e; }
184 
186 float PPSPixelG4Hit::phiAtEntry() const { return thePhiAtEntry_; }
187 
190 
191 float PPSPixelG4Hit::x() const { return theX_; }
192 void PPSPixelG4Hit::setX(float t) { theX_ = t; }
193 
194 float PPSPixelG4Hit::y() const { return theY_; }
195 void PPSPixelG4Hit::setY(float t) { theY_ = t; }
196 
197 float PPSPixelG4Hit::z() const { return theZ_; }
198 void PPSPixelG4Hit::setZ(float t) { theZ_ = t; }
199 
200 int PPSPixelG4Hit::parentId() const { return theParentId_; }
202 
203 float PPSPixelG4Hit::vx() const { return theVx_; }
204 void PPSPixelG4Hit::setVx(float t) { theVx_ = t; }
205 
206 float PPSPixelG4Hit::vy() const { return theVy_; }
207 void PPSPixelG4Hit::setVy(float t) { theVy_ = t; }
208 
209 float PPSPixelG4Hit::vz() const { return theVz_; }
210 void PPSPixelG4Hit::setVz(float t) { theVz_ = t; }
211 
212 std::ostream& operator<<(std::ostream& os, const PPSPixelG4Hit& hit) {
213  os << " Data of this PPSPixelG4Hit are:\n"
214  << " Time slice ID: " << hit.timeSliceID() << "\n"
215  << " EnergyDeposit = " << hit.energyLoss() << "\n"
216  << " Energy of primary particle (ID = " << hit.trackID() << ") = " << hit.incidentEnergy() << " (MeV)"
217  << "\n"
218  << " Local entry and exit points in PPS unit number " << hit.unitID() << " are: " << hit.entryPoint() << " (mm)"
219  << hit.exitPoint() << " (mm)"
220  << "\n"
221  << " Global posizion in PPS unit number " << hit.unitID() << " are: " << hit.meanPosition() << " (mm)"
222  << "\n"
223  << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
224  return os;
225 }
void setParticleType(short i)
float z() const
void setPy(float e)
void addEnergyDeposit(double em, double hd)
std::ostream & operator<<(std::ostream &os, const PPSPixelG4Hit &hit)
const PPSPixelG4Hit & operator=(const PPSPixelG4Hit &right)
float py() const
double hadr() const
double incidentEnergy() const
void setExitPoint(const G4ThreeVector &)
float energyLoss() const
int parentId() const
float px() const
double theTimeSlice_
uint32_t unitID() const
float theEnergyLoss_
int particleType() const
void setP(float e)
void setEM(double e)
float vx() const
float y() const
void setVy(float p)
G4ThreeVector theExitPoint_
const G4ThreeVector & entryPoint() const
void Print() override
const G4ThreeVector & exitPoint() const
void setVPz(float e)
float thePhiAtEntry_
void setPz(float e)
void setPhiAtEntry(float f)
double timeSlice() const
float p() const
float thetaAtEntry() const
void setParentId(int p)
void setY(float t)
void setHadr(double e)
void setX(float t)
G4ThreeVector theEntryPoint_
void setTof(float e)
uint32_t theUnitID_
int timeSliceID() const
double f[11][100]
void setPx(float e)
float pz() const
void setTimeSlice(double d)
void setEntryPoint(const G4ThreeVector &)
double eM() const
float theThetaAtEntry_
d
Definition: ztail.py:151
float tof() const
double energyDeposit() const
void setThetaAtEntry(float t)
Log< level::Info, false > LogInfo
float vz() const
void setVx(float p)
G4ThreeVector MeanPosition_
float x() const
float vy() const
void setTrackID(int i)
void setVPx(float e)
void setUnitID(uint32_t i)
float vPz() const
float vPy() const
void setVz(float p)
double theIncidentEnergy_
void setVPy(float e)
float vPx() const
int trackID() const
void setZ(float t)
void setIncidentEnergy(double e)
void setEnergyLoss(float e)
float phiAtEntry() const