22 G4double edep = aStep->GetTotalEnergyDeposit();
26 if (verboseLevel > 2) {
27 std::cout <<
"TrackerSD skipping step with zero edep" << std::endl
37 hit.
setTrackID(aStep->GetTrack()->GetTrackID());
43 G4StepPoint* prePoint = aStep->GetPreStepPoint();
47 G4StepPoint* postPoint = aStep->GetPostStepPoint();
50 G4ThreeVector start = prePoint->GetPosition();
51 G4ThreeVector end = postPoint->GetPosition();
54 G4ThreeVector mid = 0.5 * (start + end);
55 hit.setPosition(mid.x(), mid.y(), mid.z());
59 sqrt(pow(start.x() - end.x(), 2) + pow(start.y() - end.y(), 2) +
60 pow(start.z() - end.z(), 2));
61 hit.setPathLength(pathLength);
64 hit.setTime(aStep->GetTrack()->GetGlobalTime());
69 G4ThreeVector p = postPoint->GetMomentum();
70 hit.setMomentum(p.x(), p.y(), p.z());
76 prePoint->GetTouchableHandle()->GetHistory()->GetVolume(2)->GetCopyNo();
77 int layer = copyNum / 10;
78 int module = copyNum % 10;
81 hit.setLayerID(layer);
82 hit.setModuleID(module);
85 hit.setEnergy(postPoint->GetTotalEnergy());
86 hit.setPdgID(aStep->GetTrack()->GetDynamicParticle()->GetPDGcode());