Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4OHCAL_PHG4OHCALDETECTOR_H
0004 #define G4OHCAL_PHG4OHCALDETECTOR_H
0005 
0006 #include <g4main/PHG4Detector.h>
0007 
0008 #include <limits>
0009 #include <map>
0010 #include <set>
0011 #include <string>  // for string
0012 #include <tuple>
0013 
0014 class G4AssemblyVolume;
0015 class G4LogicalVolume;
0016 class G4VPhysicalVolume;
0017 class PHCompositeNode;
0018 class PHG4OHCalDisplayAction;
0019 class PHG4OHCalFieldSetup;
0020 class PHParameters;
0021 class PHG4Subsystem;
0022 class PHG4GDMLConfig;
0023 class RawTowerGeomContainer;
0024 
0025 class PHG4OHCalDetector : public PHG4Detector
0026 {
0027  public:
0028   //! constructor
0029   PHG4OHCalDetector(PHG4Subsystem *subsys, PHCompositeNode *Node, PHParameters *params, const std::string &dnam);
0030 
0031   //! destructor
0032   ~PHG4OHCalDetector() override;
0033 
0034   //! construct
0035   void ConstructMe(G4LogicalVolume *world) override;
0036 
0037   void Print(const std::string &what = "ALL") const override;
0038 
0039   //!@name volume accessors
0040   //@{
0041   int IsInOHCal(G4VPhysicalVolume *) const;
0042   //@}
0043 
0044   void SuperDetector(const std::string &name) { m_SuperDetector = name; }
0045   const std::string &SuperDetector() const { return m_SuperDetector; }
0046   int get_Layer() const { return m_Layer; }
0047   int ConsistencyCheck() const;
0048   std::tuple<int, int, int> GetRowColumnId(G4VPhysicalVolume *volume) const;
0049 
0050  private:
0051   void AddGeometryNode();
0052   int ConstructOHCal(G4LogicalVolume *hcalenvelope);
0053   int map_towerid(const int tower_id);
0054   int map_layerid(const unsigned int isector, const int layer_id);
0055   std::tuple<int, int, int> ExtractLayerTowerId(const unsigned int isector, G4VPhysicalVolume *volume);
0056   PHG4OHCalDisplayAction *m_DisplayAction{nullptr};
0057   PHG4OHCalFieldSetup *m_FieldSetup{nullptr};
0058   PHParameters *m_Params{nullptr};
0059   G4AssemblyVolume *m_ScintiMotherAssembly{nullptr};
0060   G4AssemblyVolume *m_ChimScintiMotherAssembly{nullptr};
0061   //! registry for volumes that should not be exported
0062   PHG4GDMLConfig *gdml_config{nullptr};
0063   RawTowerGeomContainer *m_RawTowerGeom{nullptr};
0064 
0065   double m_InnerRadius{std::numeric_limits<double>::quiet_NaN()};
0066   double m_OuterRadius{std::numeric_limits<double>::quiet_NaN()};
0067   double m_SizeZ{std::numeric_limits<double>::quiet_NaN()};
0068   double m_VolumeEnvelope{std::numeric_limits<double>::quiet_NaN()};
0069   double m_VolumeSteel{0};
0070   double m_VolumeScintillator{0};
0071 
0072   int m_NumScintiPlates{-9999};
0073 
0074   int m_ActiveFlag{0};
0075   int m_AbsorberActiveFlag{0};
0076 
0077   int m_Layer{0};
0078   std::string m_SuperDetector;
0079   std::set<G4LogicalVolume *> m_SteelAbsorberLogVolSet;
0080   std::set<G4LogicalVolume *> m_ScintiTileLogVolSet;
0081   std::map<G4VPhysicalVolume *, std::tuple<int, int, int>> m_ScintiTilePhysVolMap;
0082 
0083   std::string m_GDMPath;
0084   std::string m_TowerGeomNodeName;
0085 };
0086 
0087 #endif  // G4OHCAL_PHG4OHCALDETECTOR_H