LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ActionBase.hh
Go to the documentation of this file.
1 // This file is the header for the @ActionBase@ class.
2 
3 // It is the lowest level base class for Geant user actions. Do not
4 // inherit from this class directly. Instead, use a next level up class, like
5 // @TrackingActionBase@.
6 
7 #ifndef artg4tk_actionBase_ActionBase_hh
8 #define artg4tk_actionBase_ActionBase_hh
9 
10 #include <string>
11 
12 namespace artg4tk {
13 
14  class ActionBase {
15  public:
16  // Constructor. The derived class must call this constructor. It takes a
17  // single string for the name of the action object.
18  ActionBase(std::string myName) : myName_(move(myName)) {}
19 
20  // Destructor
21  virtual ~ActionBase();
22 
23  // Accessor
24  std::string const&
25  myName() const
26  {
27  return myName_;
28  }
29 
30  // h3. Optional methods
31 
32  // Intialize - Instead of putting initialization code into your constructor, put
33  // such code in this initialize method. This method will get called at the correct
34  // time, after particle lists are already constructed and known to geant.
35  virtual void
37  {}
38 
39  private:
40  // A string containing this action object's name
41  std::string myName_;
42  };
43 }
44 
45 #endif /* artg4tk_actionBase_ActionBase_hh */
virtual ~ActionBase()
Definition: ActionBase.cc:4
std::string myName_
Definition: ActionBase.hh:41
virtual void initialize()
Definition: ActionBase.hh:36
ActionBase(std::string myName)
Definition: ActionBase.hh:18
std::string const & myName() const
Definition: ActionBase.hh:25