Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:17:49

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4DETECTORS_PHG4HCALSUBSYSTEM_H
0004 #define G4DETECTORS_PHG4HCALSUBSYSTEM_H
0005 
0006 #include <g4main/PHG4Subsystem.h>
0007 
0008 #include <Geant4/G4String.hh>
0009 #include <Geant4/G4Types.hh>
0010 
0011 #include <string>  // for string
0012 
0013 class PHCompositeNode;
0014 class PHG4Detector;
0015 class PHG4HcalDetector;
0016 class PHG4HcalSteppingAction;
0017 class PHG4SteppingAction;
0018 
0019 class PHG4HcalSubsystem : public PHG4Subsystem
0020 {
0021  public:
0022   //! constructor
0023   PHG4HcalSubsystem(const std::string &name = "HCALCYLINDER", const int layer = 0);
0024 
0025   //! destructor
0026   ~PHG4HcalSubsystem(void) override = default;
0027 
0028   //! init
0029   /*!
0030   creates the detector_ object and place it on the node tree, under "DETECTORS" node (or whatever)
0031   reates the stepping action and place it on the node tree, under "ACTIONS" node
0032   creates relevant hit nodes that will be populated by the stepping action and stored in the output DST
0033   */
0034   int InitRun(PHCompositeNode *) override;
0035 
0036   //! event processing
0037   /*!
0038   get all relevant nodes from top nodes (namely hit list)
0039   and pass that to the stepping action
0040   */
0041   int process_event(PHCompositeNode *) override;
0042 
0043   //! accessors (reimplemented)
0044   PHG4Detector *GetDetector(void) const override;
0045   PHG4SteppingAction *GetSteppingAction(void) const override;
0046 
0047   void SetRadius(const G4double dbl) { radius = dbl; }
0048   void SetLength(const G4double dbl) { length = dbl; }
0049   void SetLengthViaRapidityCoverage(const G4bool bl) { lengthViaRapidityCoverage = bl; }
0050   void SetPosition(const G4double x, const G4double y, const G4double z)
0051   {
0052     xpos = x;
0053     ypos = y;
0054     zpos = z;
0055   }
0056   void SetTilt(const double tilt) { _sciTilt = tilt; }
0057   void SetTiltViaNcross(const int ncross);
0058   void SetScintWidth(const double wid) { _sciWidth = wid; }
0059   void SetNumScint(const int num) { _sciNum = num; }
0060   void SetScintPhi0(const G4double phi0) { _sciPhi0 = phi0; }  //  in units of sampling cells
0061   void SetThickness(const G4double dbl) { TrackerThickness = dbl; }
0062   void SetMaterial(const std::string &mat) { material = mat; }
0063   void SetActive(const int i = 1) { active = i; }
0064   void SetAbsorberActive(const int i = 1) { absorberactive = i; }
0065   void SuperDetector(const std::string &name) { superdetector = name; }
0066   const std::string &SuperDetector() { return superdetector; }
0067 
0068   void SetLightCorrection(float inner_radius, float inner_corr,
0069                           float outer_radius, float outer_corr)
0070   {
0071     light_balance_ = true;
0072     light_balance_inner_radius_ = inner_radius;
0073     light_balance_inner_corr_ = inner_corr;
0074     light_balance_outer_radius_ = outer_radius;
0075     light_balance_outer_corr_ = outer_corr;
0076   }
0077   void SetLightScintModel(const bool b = true)
0078   {
0079     light_scint_model_ = b;
0080   }
0081 
0082   void Print(const std::string &what = "ALL") const override;
0083 
0084  private:
0085   //! detector geometry
0086   /*! defives from PHG4Detector */
0087   PHG4HcalDetector *detector_;
0088 
0089   //! particle tracking "stepping" action
0090   /*! derives from PHG4SteppingActions */
0091   PHG4HcalSteppingAction *steppingAction_;
0092   G4double radius;
0093   G4double length;
0094   G4double xpos, ypos, zpos;
0095   G4bool lengthViaRapidityCoverage;
0096   G4double TrackerThickness;
0097   G4String material;
0098   G4double _sciTilt;
0099   G4double _sciWidth;
0100   G4int _sciNum;
0101   G4double _sciPhi0;  //  in units of sampling cells
0102   int active;
0103   int absorberactive;
0104   int layer;
0105   std::string detector_type;
0106   std::string superdetector;
0107 
0108   bool light_scint_model_;
0109   bool light_balance_;
0110   float light_balance_inner_radius_;
0111   float light_balance_inner_corr_;
0112   float light_balance_outer_radius_;
0113   float light_balance_outer_corr_;
0114 };
0115 
0116 #endif