Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:19:24

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4MAIN_PHG4STACKINGACTION_H
0004 #define G4MAIN_PHG4STACKINGACTION_H
0005 
0006 #include <Geant4/G4ClassificationOfNewTrack.hh>
0007 
0008 #include <string>
0009 
0010 class G4Track;
0011 class PHCompositeNode;
0012 
0013 class PHG4StackingAction
0014 {
0015  public:
0016   PHG4StackingAction(const std::string& name, const int i = 0);
0017   virtual ~PHG4StackingAction() = default;
0018 
0019   //! stacking action. This gets called by the stacking action when a new track is generated
0020   // It can classify those tracks (urgent, wait, kill, postpone to next event)
0021   // default return in G4 is fUrgent
0022   virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* /*aTrack*/) { return fUrgent; }
0023   virtual void PrepareNewEvent() {}
0024   virtual void Verbosity(const int i) { m_Verbosity = i; }
0025   virtual int Verbosity() const { return m_Verbosity; }
0026   virtual int Init() { return 0; }
0027 
0028   virtual void SetInterfacePointers(PHCompositeNode*) { return; }
0029   virtual void Print(const std::string& /*what*/) const { return; }
0030   const std::string &GetName() const { return m_Name; }
0031   void SetName(const std::string& name) { m_Name = name; }
0032 
0033  private:
0034   int m_Verbosity {0};
0035   std::string m_Name;
0036 };
0037 
0038 #endif  // G4MAIN_PHG4STACKINGACTION_H