22 #include <Geant4/G4IonisParamMat.hh>
23 #include <Geant4/G4Material.hh>
24 #include <Geant4/G4MaterialCutsCouple.hh>
25 #include <Geant4/G4ParticleDefinition.hh>
26 #include <Geant4/G4Step.hh>
27 #include <Geant4/G4StepPoint.hh>
28 #include <Geant4/G4StepStatus.hh>
29 #include <Geant4/G4String.hh>
30 #include <Geant4/G4SystemOfUnits.hh>
31 #include <Geant4/G4ThreeVector.hh>
32 #include <Geant4/G4TouchableHandle.hh>
33 #include <Geant4/G4Track.hh>
34 #include <Geant4/G4TrackStatus.hh>
35 #include <Geant4/G4Types.hh>
36 #include <Geant4/G4VTouchable.hh>
37 #include <Geant4/G4VUserTrackInformation.hh>
51 absorberhits_(nullptr),
53 savehitcontainer(nullptr),
64 aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
67 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
68 G4double eion = (aStep->GetTotalEnergyDeposit()
69 - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
71 const G4Track* aTrack = aStep->GetTrack();
73 const int layer_id = 0;
80 bool geantino =
false;
84 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0
85 && aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino")
90 G4StepPoint * prePoint = aStep->GetPreStepPoint();
91 G4StepPoint * postPoint = aStep->GetPostStepPoint();
108 fiber_ID = prePoint->GetTouchable()->GetReplicaNumber(1);
109 tower_ID = prePoint->GetTouchable()->GetReplicaNumber(2);
110 sector_ID = prePoint->GetTouchable()->GetReplicaNumber(3);
116 fiber_ID = prePoint->GetTouchable()->GetReplicaNumber(0);
117 tower_ID = prePoint->GetTouchable()->GetReplicaNumber(1);
118 sector_ID = prePoint->GetTouchable()->GetReplicaNumber(2);
123 tower_ID = prePoint->GetTouchable()->GetReplicaNumber(0);
124 sector_ID = prePoint->GetTouchable()->GetReplicaNumber(1);
136 scint_id = prePoint->GetTouchable()->GetReplicaNumber(2);
140 scint_id = prePoint->GetTouchable()->GetReplicaNumber(1);
144 scint_id = prePoint->GetTouchable()->GetReplicaNumber(0);
151 switch (prePoint->GetStepStatus())
164 hit->
set_x(0, prePoint->GetPosition().x() /
cm);
165 hit->
set_y(0, prePoint->GetPosition().y() /
cm);
166 hit->
set_z(0, prePoint->GetPosition().z() /
cm);
169 hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
179 if ( G4VUserTrackInformation*
p = aTrack->GetUserInformation() )
200 if ( G4VUserTrackInformation*
p = aTrack->GetUserInformation() )
223 hit->
set_x(1, postPoint->GetPosition().x() /
cm);
224 hit->
set_y(1, postPoint->GetPosition().y() /
cm);
225 hit->
set_z(1, postPoint->GetPosition().z() /
cm);
227 hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
241 static bool once =
true;
242 if (once and edep > 0)
247 cout <<
"PHG4SpacalPrototypeSteppingAction::UserSteppingAction::"
250 <<
" use scintillating light model at each Geant4 steps. "
251 <<
"First step: " <<
"Material = "
252 << aTrack->GetMaterialCutsCouple()->GetMaterial()->GetName()
253 <<
", " <<
"Birk Constant = "
254 << aTrack->GetMaterialCutsCouple()->GetMaterial()->GetIonisation()->GetBirksConstant()
255 <<
"," <<
"edep = " << edep <<
", " <<
"eion = " << eion
256 <<
", " <<
"light_yield = " << light_yield << endl;
277 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
292 if (postPoint->GetStepStatus() == fGeomBoundary ||
293 postPoint->GetStepStatus() == fWorldBoundary||
294 aTrack->GetTrackStatus() == fStopAndKill)
333 string absorbernodename;
346 hits_ = findNode::getClass<PHG4HitContainer>(topNode, hitnodename.c_str());
347 absorberhits_ = findNode::getClass<PHG4HitContainer>(topNode,
348 absorbernodename.c_str());
352 std::cout <<
"PHG4SpacalPrototypeSteppingAction::SetTopNode - unable to find "
353 << hitnodename << std::endl;
359 std::cout <<
"PHG4SpacalPrototypeSteppingAction::SetTopNode - unable to find "
360 << absorbernodename << std::endl;