Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4DETECTORS_PHG4HCALDETECTOR_H
0004 #define G4DETECTORS_PHG4HCALDETECTOR_H
0005 
0006 #include <g4main/PHG4Detector.h>
0007 
0008 #include <Geant4/G4Region.hh>
0009 #include <Geant4/G4SystemOfUnits.hh>
0010 #include <Geant4/G4Types.hh>
0011 
0012 #include <map>
0013 #include <string>  // for string
0014 
0015 class G4Material;
0016 class G4LogicalVolume;
0017 class G4UserSteppingAction;
0018 class G4VPhysicalVolume;
0019 class PHCompositeNode;
0020 class PHG4Subsystem;
0021 
0022 class PHG4HcalDetector : public PHG4Detector
0023 {
0024  public:
0025   //! constructor
0026   PHG4HcalDetector(PHG4Subsystem* subsys, PHCompositeNode* Node, const std::string& dnam, const int layer = 0);
0027 
0028   //! destructor
0029   ~PHG4HcalDetector(void) override = default;
0030 
0031   //! construct
0032   void ConstructMe(G4LogicalVolume* world) override;
0033 
0034   void SetRadius(const G4double dbl) { radius = dbl * cm; }
0035   void SetLength(const G4double dbl) { length = dbl * cm; }
0036   void SetPosition(const G4double x, const G4double y, const G4double z)
0037   {
0038     xpos = x * cm;
0039     ypos = y * cm;
0040     zpos = z * cm;
0041   }
0042 
0043   void SetTilt(const double tilt) { _sciTilt = tilt; }
0044   void SetScintWidth(const double wid) { _sciWidth = wid * cm; }
0045   void SetNumScint(const int num) { _sciNum = num; }
0046   void SetScintPhi0(const G4double phi0) { _sciPhi0 = phi0; }  //  in units of sampling cells
0047 
0048   void SetThickness(const G4double dbl) { TrackerThickness = dbl * cm; }
0049   void SetMaterial(const std::string& mat) { material = mat; }
0050   void SetActive(const int i = 1) { active = i; }
0051   void SetAbsorberActive(const int i = 1) { absorberactive = i; }
0052   void SetDetectorType(const std::string& typ) { detector_type = typ; }
0053   int IsInCylinderActive(const G4VPhysicalVolume*);
0054   void SuperDetector(const std::string& name) { superdetector = name; }
0055   const std::string &SuperDetector() const { return superdetector; }
0056   int get_Layer() const { return layer; }
0057   G4UserSteppingAction* GetSteppingAction() override
0058   {
0059     if (_region)
0060       return _region->GetRegionalSteppingAction();
0061     else
0062       return 0;
0063   }
0064 
0065   void Print(const std::string& what = "ALL") const override;
0066 
0067   static int INACTIVE;
0068 
0069  private:
0070   double GetLength(const double phi) const;
0071   G4Material* TrackerMaterial;
0072   G4double TrackerThickness;
0073 
0074   G4LogicalVolume* cylinder_logic;
0075   G4VPhysicalVolume* cylinder_physi;
0076   std::map<const G4VPhysicalVolume*, int> box_vol;
0077 
0078   G4double radius;
0079   G4double length;
0080   G4double xpos, ypos, zpos;
0081   G4double _sciTilt;
0082   G4double _sciWidth;
0083   G4int _sciNum;
0084   G4double _sciPhi0;  //  in units of sampling cells
0085   G4Region* _region;
0086   std::string material;
0087   int active;
0088   int absorberactive;
0089   int layer;
0090   std::string detector_type;
0091   std::string superdetector;
0092 };
0093 
0094 #endif