Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4MAIN_PHG4PHENIXDETECTOR_H
0004 #define G4MAIN_PHG4PHENIXDETECTOR_H
0005 
0006 #include <Geant4/G4Types.hh>  // for G4double
0007 #include <Geant4/G4VUserDetectorConstruction.hh>
0008 
0009 #include <list>
0010 #include <string>  // for string
0011 
0012 class G4LogicalVolume;
0013 class G4VPhysicalVolume;
0014 class PHG4Detector;
0015 class PHG4PhenixDisplayAction;
0016 class PHG4Reco;
0017 
0018 //! this is the main detector construction class, passed to geant to construct the entire phenix detector
0019 class PHG4PhenixDetector : public G4VUserDetectorConstruction
0020 {
0021  public:
0022   //! constructor
0023   PHG4PhenixDetector(PHG4Reco* subsys);
0024 
0025   //! destructor
0026   ~PHG4PhenixDetector() override;
0027 
0028   void Verbosity(const int verb) { m_Verbosity = verb; }
0029   int Verbosity() const { return m_Verbosity; }
0030 
0031   //! register a detector. This is called in PHG4Reco::Init based on which detectors are found on the tree
0032   void AddDetector(PHG4Detector* detector)
0033   {
0034     m_DetectorList.push_back(detector);
0035   }
0036 
0037   //! this is called by geant to actually construct all detectors
0038   G4VPhysicalVolume* Construct() override;
0039 
0040   G4double GetWorldSizeX() const { return WorldSizeX; }
0041 
0042   G4double GetWorldSizeY() const { return WorldSizeY; }
0043   G4double GetWorldSizeZ() const { return WorldSizeZ; }
0044 
0045   void SetWorldSizeX(const G4double sx) { WorldSizeX = sx; }
0046   void SetWorldSizeY(const G4double sy) { WorldSizeY = sy; }
0047   void SetWorldSizeZ(const G4double sz) { WorldSizeZ = sz; }
0048 
0049   void SetWorldShape(const std::string& s) { worldshape = s; }
0050   void SetWorldMaterial(const std::string& s) { worldmaterial = s; }
0051   G4VPhysicalVolume* GetPhysicalVolume(void) { return physiWorld; }
0052 
0053  private:
0054   PHG4PhenixDisplayAction* m_DisplayAction;
0055 
0056   int m_Verbosity;
0057 
0058   //! list of detectors to be constructed
0059 
0060   std::list<PHG4Detector*> m_DetectorList;
0061 
0062   G4LogicalVolume* logicWorld;    // pointer to the logical World
0063   G4VPhysicalVolume* physiWorld;  // pointer to the physical World
0064   G4double WorldSizeX;
0065   G4double WorldSizeY;
0066   G4double WorldSizeZ;
0067   std::string worldshape;
0068   std::string worldmaterial;
0069 };
0070 
0071 #endif  // G4MAIN_PHG4PHENIXDETECTOR_H