CMS 3D CMS Logo

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
8 #include <iostream>
9 
10 BscG4Hit::BscG4Hit() : entry(0., 0., 0.), entrylp(0., 0., 0.), exitlp(0., 0., 0.) {
11  elem = 0.f;
12  hadr = 0.f;
13  theIncidentEnergy = 0.f;
14  theTimeSlice = 0.;
15  theTrackID = -1;
16  theUnitID = 0;
17  thePabs = 0.f;
18  theTof = 0.f;
19  theEnergyLoss = 0.f;
20  theParticleType = 0;
21  theUnitID = 0;
22  theTrackID = -1;
23  theThetaAtEntry = -10000.f;
24  thePhiAtEntry = -10000.f;
25  theParentId = 0;
26  theProcessId = 0;
27 
28  theX = 0.f;
29  theY = 0.f;
30  theZ = 0.f;
31  theVx = 0.f;
32  theVy = 0.f;
33  theVz = 0.f;
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  theProcessId = right.theProcessId;
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 
67 const BscG4Hit& BscG4Hit::operator=(const BscG4Hit& right) {
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  theProcessId = right.theProcessId;
86 
87  theX = right.theX;
88  theY = right.theY;
89  theZ = right.theZ;
90 
91  theVx = right.theVx;
92  theVy = right.theVy;
93  theVz = right.theVz;
94 
95  return *this;
96 }
97 
98 void BscG4Hit::setEntry(const G4ThreeVector& v) {
99  entry = v;
100  theX = v.x();
101  theY = v.y();
102  theZ = v.z();
103 }
104 
106  elem += aHit.getEM();
107  hadr += aHit.getHadr();
108  theEnergyLoss = elem + hadr;
109 }
110 
111 void BscG4Hit::Print() { edm::LogVerbatim("ForwardSim") << (*this); }
112 
113 void BscG4Hit::addEnergyDeposit(float em, float hd) {
114  elem += em;
115  hadr += hd;
116  theEnergyLoss = elem + hadr;
117 }
118 
119 void BscG4Hit::setHitPosition(const G4ThreeVector& v) {
120  theX = v.x();
121  theY = v.y();
122  theZ = v.z();
123 }
124 
125 void BscG4Hit::setVertexPosition(const G4ThreeVector& v) {
126  theVx = v.x();
127  theVy = v.y();
128  theVz = v.z();
129 }
130 
131 std::ostream& operator<<(std::ostream& os, const BscG4Hit& hit) {
132  os << " Data of this BscG4Hit are:" << std::endl
133  << " hitEntryLocalP: " << hit.getEntryLocalP() << std::endl
134  << " hitExitLocalP: " << hit.getExitLocalP() << std::endl
135  << " Time slice ID: " << hit.getTimeSliceID() << std::endl
136  << " Time slice : " << hit.getTimeSlice() << std::endl
137  << " Tof : " << hit.getTof() << std::endl
138  << " EnergyDeposit = " << hit.getEnergyDeposit() << std::endl
139  << " elmenergy = " << hit.getEM() << std::endl
140  << " hadrenergy = " << hit.getHadr() << std::endl
141  << " EnergyLoss = " << hit.getEnergyLoss() << std::endl
142  << " ParticleType = " << hit.getParticleType() << std::endl
143  << " Pabs = " << hit.getPabs() << std::endl
144  << " Energy of primary particle (ID = " << hit.getTrackID() << ") = " << hit.getIncidentEnergy() << " (MeV)"
145  << std::endl
146  << " Entry point in Bsc unit number " << hit.getUnitID() << " is: " << hit.getEntry() << " (mm)" << std::endl;
147  os << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
148  return os;
149 }
Log< level::Info, true > LogVerbatim
float theVx
Definition: BscG4Hit.h:130
void setHitPosition(const G4ThreeVector &)
Definition: BSCG4Hit.cc:119
void setEntry(const G4ThreeVector &xyz)
Definition: BSCG4Hit.cc:98
float theVy
Definition: BscG4Hit.h:131
float theX
Definition: BscG4Hit.h:117
float theVz
Definition: BscG4Hit.h:132
std::ostream & operator<<(std::ostream &os, const BscG4Hit &hit)
Definition: BSCG4Hit.cc:131
G4ThreeVector entry
Definition: BscG4Hit.h:103
int theUnitID
Definition: BscG4Hit.h:115
void Print() override
Definition: BSCG4Hit.cc:111
BscG4Hit()
Definition: BSCG4Hit.cc:10
int theProcessId
Definition: BscG4Hit.h:129
float theEnergyLoss
Definition: BscG4Hit.h:122
float elem
Definition: BscG4Hit.h:109
float theTof
Definition: BscG4Hit.h:121
int theTrackID
Definition: BscG4Hit.h:112
int theParticleType
Definition: BscG4Hit.h:123
const BscG4Hit & operator=(const BscG4Hit &right)
Definition: BSCG4Hit.cc:67
float hadr
Definition: BscG4Hit.h:110
float thePabs
Definition: BscG4Hit.h:120
float getHadr() const
Definition: BscG4Hit.h:44
float getEM() const
Definition: BscG4Hit.h:38
float theIncidentEnergy
Definition: BscG4Hit.h:111
void addEnergyDeposit(float em, float hd)
Definition: BSCG4Hit.cc:113
float theZ
Definition: BscG4Hit.h:119
~BscG4Hit() override
Definition: BSCG4Hit.cc:36
G4ThreeVector exitlp
Definition: BscG4Hit.h:108
void setVertexPosition(const G4ThreeVector &)
Definition: BSCG4Hit.cc:125
int theParentId
Definition: BscG4Hit.h:128
float theThetaAtEntry
Definition: BscG4Hit.h:125
float thePhiAtEntry
Definition: BscG4Hit.h:126
double theTimeSlice
Definition: BscG4Hit.h:113
G4ThreeVector entrylp
Definition: BscG4Hit.h:107
float theY
Definition: BscG4Hit.h:118