24 #include <G4Allocator.hh>
25 #include <G4OpticalPhoton.hh>
68 const G4ThreeVector& pre = h.
prePosG4();
69 const G4ThreeVector& post = h.
postPosG4();
70 G4ThreeVector mom = h.
track->GetMomentum();
71 double len = (post-pre).mag() ;
72 double position[] = { (pre.x()+post.x())/2.0,(pre.y()+post.y())/2.0,(pre.z()+post.z())/2.0 };
73 double momentum[] = { mom.x(), mom.y(), mom.z() };
83 const G4ThreeVector& pre = h.
prePosG4();
84 const G4ThreeVector& post = h.
postPosG4();
85 G4ThreeVector mom = h.
track->GetMomentum();
86 double length = (post-pre).mag() ;
87 double momentum[] = { mom.x(), mom.y(), mom.z() };
88 double position[] = { (pre.x()+post.x())/2.0,(pre.y()+post.y())/2.0,(pre.z()+post.z())/2.0 };
95 const G4Track* t = spot->
primary;
96 G4ThreeVector mom = t->GetMomentum();
98 double position[] = { pos.x(), pos.y(), pos.z() };
99 double momentum[] = { mom.x(), mom.y(), mom.z() };
111 :
Geant4HitData(), position(pos), momentum(mom), length(len), energyDeposit(deposit),
112 truth(track_id, pdg_id, deposit, time_stamp, len, pos, mom)
120 :
Geant4HitData(), position(contrib.x, contrib.y, contrib.z),
121 momentum(mom), length(contrib.length), energyDeposit(depo), truth(contrib)
145 position.SetXYZ(0, 0, 0);
146 momentum.SetXYZ(0, 0, 0);
155 G4Track* trk = step->GetTrack();
156 G4ThreeVector trm = trk->GetMomentum();
157 G4ThreeVector pos = pnt->GetPosition();
158 G4ThreeVector mom = pnt->GetMomentum();
159 double dep = step->GetTotalEnergyDeposit();
162 truth.trackID = trk->GetTrackID();
163 truth.pdgID = trk->GetDefinition()->GetPDGEncoding();
164 truth.time = trk->GetGlobalTime();
165 truth.setPosition(pos.x(), pos.y(), pos.z());
166 truth.setMomentum(trm.x(), trm.y(), trm.z());
169 position.SetXYZ(pos.x(), pos.y(), pos.z());
170 momentum.SetXYZ(mom.x(), mom.y(), mom.z());
177 const G4Track* trk = spot->
primary;
179 G4ThreeVector trm = trk->GetMomentum();
181 G4ThreeVector mom = trk->GetMomentum().unit() * dep;
183 this->truth.deposit = dep;
184 this->truth.trackID = trk->GetTrackID();
185 this->truth.time = trk->GetGlobalTime();
186 this->truth.pdgID = trk->GetDefinition()->GetPDGEncoding();
187 this->truth.setPosition(pos.x(), pos.y(), pos.z());
188 this->truth.setMomentum(trm.x(), trm.y(), trm.z());
190 this->energyDeposit = dep;
191 this->position.SetXYZ(pos.x(), pos.y(), pos.z());
192 this->momentum.SetXYZ(mom.x(), mom.y(), mom.z());