9 #include "nutools/G4Base/ExampleAction.h" 13 #include "nutools/G4Base/UserActionFactory.h" 17 #include "Geant4/G4Event.hh" 18 #include "Geant4/G4Track.hh" 19 #include "Geant4/G4ThreeVector.hh" 20 #include "Geant4/G4ParticleDefinition.hh" 21 #include "Geant4/G4PrimaryParticle.hh" 22 #include "Geant4/G4DynamicParticle.hh" 23 #include "Geant4/G4VUserPrimaryParticleInformation.hh" 24 #include "Geant4/G4Step.hh" 25 #include "Geant4/G4StepPoint.hh" 26 #include "Geant4/G4VProcess.hh" 27 #include "Geant4/G4VPhysicalVolume.hh" 28 #include "Geant4/G4VTouchable.hh" 31 #include <TLorentzVector.h> 47 , fStepMsgMaxPerEvt(42)
48 , fTrack2ndMsgMaxPerEvt(2)
76 <<
"ExampleAction::PrintConfig \n" 92 <<
"ExampleAction::BeginOfEventAction EventID=" 93 <<
event->GetEventID();
107 <<
"ExampleAction::EndOfEventAction EventID=" 108 <<
event->GetEventID();
117 G4int parent_id = track->GetParentID();
121 <<
"ExampleAction::PreTrackingAction TrackID=" 122 << track->GetTrackID()
123 <<
" is a " << track->GetParticleDefinition()->GetParticleName();
132 G4int parent_id = track->GetParentID();
134 if ( parent_id > 0 ) {
138 extra_msg =
"...last such message this event";
143 <<
"ExampleAction::PostTrackingAction TrackID=" 144 << track->GetTrackID()
158 extra_msg =
"...last such message this event";
162 <<
"ExampleAction::SteppingAction TrackID=" 163 << step->GetTrack()->GetTrackID()
170 G4ClassificationOfNewTrack
184 G4int parent_id = track->GetParentID();
186 if ( parent_id < 0 ) tsrc =
"postponed (from previous event)";
187 if ( parent_id > 0 ) tsrc =
"secondary";
190 <<
"ExampleAction::StackClassifyNewTrack TrackID=" 191 << track->GetTrackID()
192 <<
" ParentID=" << parent_id <<
" " 193 << track->GetDefinition()->GetParticleName()
194 <<
" (" << tsrc <<
" particle)";
217 <<
"ExampleAction::StackNewStage";
231 <<
"ExampleAction::StackPrepareNewEvent";
void SteppingAction(const G4Step *)
G4UserSteppingAction interface.
void PostTrackingAction(const G4Track *)
G4ClassificationOfNewTrack StackClassifyNewTrack(const G4Track *)
G4UserStackingAction interfaces.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
int fStepMsgMaxPerEvt
shut up about steps
void Config(fhicl::ParameterSet const &pset)
Override Config() to extract any necessary parameters.
int fTrack2ndMsgMaxPerEvt
shut up about 2ndary tracks
void StackPrepareNewEvent()
#define USERACTIONREG3(_ns, _name, _fqname)
void PrintConfig(std::string const &opt)
Override PrintConfig() to print out current configuration.
void BeginOfEventAction(const G4Event *)
T get(std::string const &key) const
int fTrack2ndMsg
of 2ndary track printed this evt?
double fSomeValue
some user config value
int fStepMsg
steps have we printed this evt?
void PreTrackingAction(const G4Track *)
G4UserTrackingAction interfaces.
Event finding and building.
void EndOfEventAction(const G4Event *)