/////////////////////////////////////////////////////////////////// // // Code that is executed for every step. This class invokes the scintillation // code, ensuring scintillation occurs for every step. // If the instance was created by PEnergy, call PEnergy AccumulateData function. // // Author: P G Jones // Author: S Langrock -- contact person // // REVISION HISTORY: // 2013-12-15 : P G Jones - new file, code partially from GLG4SteppingAction // 2017-03-10 : W Heintzelman - Add option to call PEnergy AccumulateData // 2018-04-26 : N Barros - Adding methods to control the tracking of long lived particles // /////////////////////////////////////////////////////////////////// #ifndef __RAT_SteppingAction_hh__ #define __RAT_SteppingAction_hh__ #include #include namespace RAT { class SteppingAction : public G4UserSteppingAction { public: SteppingAction( Methods::PEnergy* ptrPEnergy = NULL); // Called by Geant4 for each step simulated // aStep: the step simulated void UserSteppingAction( const G4Step* aStep ); void SetCutoffTime(const double &value); void SetCutoffSteps(const int &value); void SetCutoffVolume(const std::string& value); double GetCutoffTime() {return fEventCutOffTime;} int GetCutoffSteps() {return fEventCutOffSteps;} private: // Max allowed event time and number of steps to track particles double fEventCutOffTime; int fEventCutOffSteps; std::string fEventCutOffVolume; bool fApplyCutoff; // Flag to cause PEnergy::AccumulateData function to be called // Set true by PEnergy when it constructs a SteppingAction instance bool fCallPEnergy; // Pointer to PEnergy object that created an instance of SteppingAction: Methods::PEnergy* fPtrPEnergy; }; } //::RAT #endif