Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:11

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4MAIN_PHG4STEPPINGACTION_H
0004 #define G4MAIN_PHG4STEPPINGACTION_H
0005 
0006 #include <limits>
0007 #include <set>
0008 #include <string>
0009 
0010 class G4Step;
0011 class PHCompositeNode;
0012 class PHG4Hit;
0013 
0014 class PHG4SteppingAction
0015 {
0016  public:
0017   PHG4SteppingAction(const std::string& name, const int i = 0);
0018   virtual ~PHG4SteppingAction() = default;
0019 
0020   //! stepping action. This defines processing of a single step in a given volume
0021   /*!
0022   returns true if hits associated to this step was processed by this detector
0023   \param step pointer to the geant 4 step class
0024   \param was_used: true if the hit was already used by a previously registered subsystem
0025   */
0026   virtual bool UserSteppingAction(const G4Step* step, bool was_used) = 0;
0027 
0028   virtual void Verbosity(const int i) { m_Verbosity = i; }
0029   virtual int Verbosity() const { return m_Verbosity; }
0030   virtual int Init() { return 0; }
0031   virtual int InitWithNode(PHCompositeNode*) { return 0; };
0032   //! get scintillation photon count. It require a custom set SCINTILLATIONYIELD property to work
0033   virtual double GetScintLightYield(const G4Step* step);
0034 
0035   //! get amount of energy that can make scintillation light, in Unit of GeV.
0036   virtual double GetVisibleEnergyDeposition(const G4Step* step);
0037 
0038   //! Extract local coordinate of the hit and save to PHG4Hit
0039   virtual void StoreLocalCoordinate(PHG4Hit* hit, const G4Step* step, const bool do_prepoint, const bool do_postpoint);
0040 
0041   virtual void SetInterfacePointers(PHCompositeNode*) { return; }
0042   virtual void Print(const std::string& /*what*/) const { return; }
0043   const std::string &GetName() const { return m_Name; }
0044   void SetName(const std::string& name) { m_Name = name; }
0045   virtual void SetLightCorrection(const double inner_radius, const double inner_corr, const double outer_radius, const double outer_corr);
0046   virtual double GetLightCorrection(const double r) const;
0047   virtual double GetLightCorrection(const double xpos, const double ypos) const;
0048   virtual bool ValidCorrection() const;
0049 
0050   //! Set the G4HIT node names from Subsystem rather than constructing your own
0051   virtual void SetHitNodeName(const std::string&, const std::string&) { return; }
0052 
0053  private:
0054   int m_Verbosity{0};
0055   double m_LightBalanceInnerRadius{std::numeric_limits<double>::quiet_NaN()};
0056   double m_LightBalanceInnerCorr{std::numeric_limits<double>::quiet_NaN()};
0057   double m_LightBalanceOuterRadius{std::numeric_limits<double>::quiet_NaN()};
0058   double m_LightBalanceOuterCorr{std::numeric_limits<double>::quiet_NaN()};
0059   std::string m_Name;
0060   std::set<std::string> m_ScintLightYieldMissingMaterialSet;
0061 };
0062 
0063 #endif  // G4MAIN_PHG4STEPPINGACTION_H