Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4IHCAL_PHG4IHCALDETECTOR_H
0004 #define G4IHCAL_PHG4IHCALDETECTOR_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 PHG4IHCalDisplayAction;
0019 class PHParameters;
0020 class PHG4Subsystem;
0021 class PHG4GDMLConfig;
0022 class RawTowerGeomContainer;
0023 
0024 class PHG4IHCalDetector : public PHG4Detector
0025 {
0026  public:
0027   //! constructor
0028   PHG4IHCalDetector(PHG4Subsystem *subsys, PHCompositeNode *Node, PHParameters *parameters, const std::string &dnam);
0029 
0030   //! destructor
0031   ~PHG4IHCalDetector() override;
0032 
0033   //! construct
0034   void ConstructMe(G4LogicalVolume *world) override;
0035 
0036   void Print(const std::string &what = "ALL") const override;
0037 
0038   //!@name volume accessors
0039   //@{
0040   int IsInIHCal(G4VPhysicalVolume *) const;
0041   //@}
0042 
0043   void SuperDetector(const std::string &name) { m_SuperDetector = name; }
0044   const std::string &SuperDetector() const { return m_SuperDetector; }
0045   int get_Layer() const { return m_Layer; }
0046   G4AssemblyVolume *ConstructHcalScintillatorAssembly(G4LogicalVolume *hcalenvelope);
0047   void ConstructHcalSingleScintillators(G4LogicalVolume *hcalenvelope);
0048   int ConsistencyCheck() const;
0049   std::tuple<int, int, int> GetLayerTowerId(G4VPhysicalVolume *volume) const;
0050   int GetSectorId(G4VPhysicalVolume *volume) const;
0051 
0052  private:
0053   void AddGeometryNode();
0054   int map_towerid(const int tower_id);
0055   int map_layerid(const int layer_id);
0056   int ConstructIHCal(G4LogicalVolume *sandwich);
0057   std::tuple<int, int, int> ExtractLayerTowerId(const unsigned int isector, G4VPhysicalVolume *volume);
0058   PHG4IHCalDisplayAction *m_DisplayAction{nullptr};
0059   PHParameters *m_Params{nullptr};
0060   G4AssemblyVolume *m_ScintiMotherAssembly{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_Active{0};
0075   int m_AbsorberActive{0};
0076 
0077   int m_Layer{0};
0078 
0079   std::string m_SuperDetector;
0080   std::set<G4LogicalVolume *> m_SteelAbsorberLogVolSet;
0081   std::set<G4LogicalVolume *> m_ScintiTileLogVolSet;
0082   std::map<G4VPhysicalVolume *, std::tuple<int, int, int>> m_ScintiTilePhysVolMap;
0083   std::map<G4VPhysicalVolume *, int> m_AbsorberPhysVolMap;
0084 
0085   std::string m_GDMPath;
0086   std::string m_TowerGeomNodeName;
0087 };
0088 
0089 #endif  // G4IHCAL_PHG4IHCALDETECTOR_H