Step processing method.
55 const G4TouchableHistory* touchable =
dynamic_cast<const G4TouchableHistory*
>(
step->GetPreStepPoint()->GetTouchable());
56 int ladderID = touchable->GetVolume(2)->GetCopyNo();
57 int sensorID = touchable->GetVolume(1)->GetCopyNo();
60 const G4Track& track = *
step->GetTrack();
61 const int trackID = track.GetTrackID();
62 const int pdgCode =
step->GetTrack()->GetDefinition()->GetPDGEncoding();
64 double depEnergy =
step->GetTotalEnergyDeposit();
67 track.GetDefinition(),
68 track.GetMaterialCutsCouple(),
69 step->GetStepLength(),
77 const G4StepPoint& preStep = *
step->GetPreStepPoint();
78 const G4StepPoint& postStep = *
step->GetPostStepPoint();
81 if (
m_tracks.empty() || (!
m_tracks.top().check(trackID, ladderID, sensorID))) {
85 SensorTraversal& traversal =
m_tracks.top();
88 if (traversal.getTrackID() == 0) {
91 const G4ThreeVector preStepPos = preStep.GetPosition() / CLHEP::mm *
Unit::mm;
92 const G4ThreeVector preStepMom = preStep.GetMomentum() / CLHEP::MeV *
Unit::MeV;
93 const double time = preStep.GetGlobalTime() / CLHEP::ns *
Unit::ns;
94 traversal.setInitial(trackID, ladderID, sensorID, pdgCode, isPrimary, preStepPos, preStepMom, time);
96 if (preStep.GetStepStatus() == fGeomBoundary) traversal.hasEntered();
100 const G4ThreeVector postStepPos = postStep.GetPosition() / CLHEP::mm *
Unit::mm;
101 const double length =
step->GetStepLength() / CLHEP::cm *
Unit::cm;
102 traversal.add(postStepPos, depEnergy, visibleEnergy, length);
105 bool isLeaving = (postStep.GetStepStatus() == fGeomBoundary);
106 if (isLeaving) traversal.hasLeft();
109 if (isLeaving || track.GetTrackStatus() >= fStopAndKill) {
110 bool contained = traversal.isContained();
113 if (saved && !contained) {
@ c_PrimaryParticle
bit 0: Particle is primary particle.
static Payload getInfo(Carrier &obj)
Static function to just return UserInformation attached to the obj of type Carrier.
static const double mm
[millimeters]
static const double MeV
[megaelectronvolt]
static const double cm
Standard units with the value = 1.
static const double ns
Standard of [time].
static const double GeV
Standard of [energy, momentum, mass].
bool finishTrack()
finish a track
G4EmSaturation * m_saturationEngine
needed to call Birk's law
std::stack< SensorTraversal > m_tracks
Stack of tracks to keep track of particles.
bool step(G4Step *step, G4TouchableHistory *) override
Step processing method.