13 #include "Geant4/G4EventManager.hh" 14 #include "Geant4/G4MuonMinus.hh" 15 #include "Geant4/G4MuonPlus.hh" 16 #include "Geant4/G4Run.hh" 17 #include "Geant4/G4Step.hh" 18 #include "Geant4/G4Track.hh" 19 #include "Geant4/G4TrackingManager.hh" 36 G4TrackingManager* trackingMan = G4EventManager::GetEventManager()->GetTrackingManager();
39 if (currTrack->GetParentID() == 0) {
40 trackingMan->SetStoreTrajectory(
true);
43 trackingMan->SetStoreTrajectory(
false);
51 G4cout <<
"### Run " << currRun->GetRunID() <<
" start." << G4endl;
53 artg4tk::ArtG4RunManager::GetRunManager()->SetRandomNumberStore(
true);
65 G4Track* theTrack = currStep->GetTrack();
69 if (theTrack->GetTrackStatus() != fAlive) {
74 if (theTrack->GetParentID() != 0) {
79 G4ParticleDefinition* particleType = theTrack->GetDefinition();
80 if ((particleType == G4MuonPlus::MuonPlusDefinition()) ||
81 (particleType == G4MuonMinus::MuonMinusDefinition())) {
87 G4StepPoint* thePrePoint = currStep->GetPreStepPoint();
88 G4VPhysicalVolume* thePrePV = thePrePoint->GetPhysicalVolume();
89 G4String thePrePVname = thePrePV->GetName();
90 if (thePrePVname(0, 4) ==
"calo") {
96 G4StepPoint* thePostPoint = currStep->GetPostStepPoint();
97 G4VPhysicalVolume* thePostPV = thePostPoint->GetPhysicalVolume();
98 G4String thePostPVname = thePostPV->GetName();
99 if (thePostPVname(0, 4) !=
"calo") {
111 theTrack->SetTrackStatus(fSuspend);
void beginOfRunAction(const G4Run *currentRun) override
ExampleGeneralActionService(fhicl::ParameterSet const &)
void userSteppingAction(const G4Step *theStep) override
void preUserTrackingAction(const G4Track *currTrack) override
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.