Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4OHCAL_PHG4OHCALSTEPPINGACTION_H
0004 #define G4OHCAL_PHG4OHCALSTEPPINGACTION_H
0005 
0006 #include <g4main/PHG4SteppingAction.h>
0007 
0008 #include <string>  // for string
0009 
0010 class G4Step;
0011 class G4VPhysicalVolume;
0012 class PHCompositeNode;
0013 class TowerInfoContainer;
0014 class PHG4OHCalDetector;
0015 class PHParameters;
0016 class PHG4Hit;
0017 class PHG4HitContainer;
0018 class PHG4Shower;
0019 class TH2;
0020 
0021 class PHG4OHCalSteppingAction : public PHG4SteppingAction
0022 {
0023  public:
0024   //! constructor
0025   PHG4OHCalSteppingAction(PHG4OHCalDetector *, PHParameters *parameters);
0026 
0027   //! destructor
0028   ~PHG4OHCalSteppingAction() override;
0029 
0030   //! stepping action
0031   bool UserSteppingAction(const G4Step *, bool) override;
0032 
0033   int InitWithNode(PHCompositeNode *topNode) override;
0034 
0035   //! reimplemented from base class
0036   void SetInterfacePointers(PHCompositeNode *) override;
0037 
0038   void SetHitNodeName(const std::string &type, const std::string &name) override;
0039 
0040   void FieldChecker(const G4Step *);
0041   void EnableFieldChecker(const int i = 1) { m_EnableFieldCheckerFlag = i; }
0042   void CreateNodeTree(PHCompositeNode *topNode);
0043 
0044  private:
0045   bool NoHitSteppingAction(const G4Step *aStep);
0046   //! pointer to the detector
0047   PHG4OHCalDetector *m_Detector{nullptr};
0048 
0049   //! efficiency maps from Mephi
0050   TH2 *m_MapCorrHist[24]{0};
0051   TH2 *m_MapCorrHistChim[24]{0};
0052 
0053   //! pointer to hit container
0054   PHG4HitContainer *m_HitContainer{nullptr};
0055   PHG4HitContainer *m_AbsorberHitContainer{nullptr};
0056   PHG4Hit *m_Hit{nullptr};
0057   PHParameters *m_Params{nullptr};
0058   PHG4HitContainer *m_SaveHitContainer{nullptr};
0059   PHG4Shower *m_SaveShower{nullptr};
0060   G4VPhysicalVolume *m_SaveVolPre{nullptr};
0061   G4VPhysicalVolume *m_SaveVolPost{nullptr};
0062   int m_SaveTrackId{-1};
0063   int m_SavePreStepStatus{-1};
0064   int m_SavePostStepStatus{-1};
0065   int m_EnableFieldCheckerFlag{-1};
0066 
0067   // since getting parameters is a map search we do not want to
0068   // do this in every step, the parameters used are cached
0069   // in the following variables
0070   int m_IsActiveFlag{0};
0071   int m_IsBlackHoleFlag{0};
0072   int m_NScintiPlates{-1};
0073   int m_LightScintModelFlag{0};
0074   bool m_doG4Hit{true};
0075   double m_tmin{-20.};
0076   double m_tmax{60.};
0077   double m_dt{100.};
0078   std::string m_AbsorberNodeName;
0079   std::string m_HitNodeName;
0080 
0081   TowerInfoContainer *m_CaloInfoContainer{nullptr};
0082 };
0083 
0084 #endif  // G4OHCAL_PHG4OHCALSTEPPINGACTION_H