LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
UserAction.h
Go to the documentation of this file.
1 
37 #ifndef G4BASE_UserAction_H
38 #define G4BASE_UserAction_H
39 
40 // The following objects are the arguments to the methods
41 // invoked in the user action classes. In other words, they
42 // contain the variables that we are normally able to record
43 // in Geant.
44 
45 class G4Run;
46 class G4Event;
47 class G4Track;
48 class G4Step;
49 #include "Geant4/G4ClassificationOfNewTrack.hh"
50 
51 #include <string>
52 #include "fhiclcpp/ParameterSet.h"
53 
54 namespace g4b {
55 
56  class UserAction {
57 
58  public:
59 
60  UserAction() {};
61  UserAction(fhicl::ParameterSet const& pset) { Config(pset); }
62  virtual ~UserAction() {};
63 
65  virtual void Config(fhicl::ParameterSet const& /* pset */ ) {};
66 
68  virtual void PrintConfig(std::string const& /* opt */ ) {};
69 
72 
74  virtual void BeginOfRunAction (const G4Run* ) {};
75  virtual void EndOfRunAction (const G4Run* ) {};
76 
78  virtual void BeginOfEventAction(const G4Event*) {};
79  virtual void EndOfEventAction (const G4Event*) {};
80 
82  virtual void PreTrackingAction (const G4Track*) {};
83  virtual void PostTrackingAction(const G4Track*) {};
84 
86  virtual void SteppingAction (const G4Step* ) {};
87 
90  virtual bool ProvidesStacking() { return false; }
92  virtual G4ClassificationOfNewTrack
93  StackClassifyNewTrack(const G4Track*) { return fUrgent; }
94  virtual void StackNewStage() {};
95  virtual void StackPrepareNewEvent() {};
96 
97  // allow self-identification
98  std::string const & GetName() const { return myName; }
99  void SetName(std::string const& name) { myName = name; }
100  private:
101  std::string myName;
102  };
103 
104 } // namespace g4b
105 
106 #endif // G4BASE_UserAction_H
virtual void StackPrepareNewEvent()
Definition: UserAction.h:95
UserAction(fhicl::ParameterSet const &pset)
Definition: UserAction.h:61
virtual void PreTrackingAction(const G4Track *)
G4UserTrackingAction interfaces.
Definition: UserAction.h:82
virtual void EndOfRunAction(const G4Run *)
Definition: UserAction.h:75
virtual void BeginOfEventAction(const G4Event *)
G4UserEventAction interfaces.
Definition: UserAction.h:78
std::string myName
self-knowledge
Definition: UserAction.h:101
virtual void BeginOfRunAction(const G4Run *)
G4UserRunAction interfaces.
Definition: UserAction.h:74
virtual bool ProvidesStacking()
Definition: UserAction.h:90
virtual ~UserAction()
Definition: UserAction.h:62
virtual void StackNewStage()
Definition: UserAction.h:94
virtual G4ClassificationOfNewTrack StackClassifyNewTrack(const G4Track *)
G4UserStackingAction interfaces.
Definition: UserAction.h:93
void SetName(std::string const &name)
Definition: UserAction.h:99
std::string const & GetName() const
Definition: UserAction.h:98
basic interface to Geant4 for ART-based software
virtual void Config(fhicl::ParameterSet const &)
Override Config() to extract any necessary parameters.
Definition: UserAction.h:65
virtual void SteppingAction(const G4Step *)
G4UserSteppingAction interface.
Definition: UserAction.h:86
virtual void PostTrackingAction(const G4Track *)
Definition: UserAction.h:83
virtual void EndOfEventAction(const G4Event *)
Definition: UserAction.h:79
virtual void PrintConfig(std::string const &)
Override PrintConfig() to print out current configuration.
Definition: UserAction.h:68