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_PHG4INNERHCALDETECTOR_H
0004 #define G4DETECTORS_PHG4INNERHCALDETECTOR_H
0005 
0006 #include <g4main/PHG4Detector.h>
0007 
0008 #pragma GCC diagnostic push
0009 #pragma GCC diagnostic ignored "-Wshadow"
0010 #pragma GCC diagnostic ignored "-Wpedantic"
0011 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
0012 #include <CGAL/Cartesian.h>  // for Cartesian_base_ref_count::...
0013 #include <CGAL/Exact_circular_kernel_2.h>
0014 #include <CGAL/Point_2.h>  // for Point_2
0015 #pragma GCC diagnostic pop
0016 
0017 #include <map>
0018 #include <set>
0019 #include <string>   // for string
0020 #include <utility>  // for pair
0021 #include <vector>
0022 
0023 class G4AssemblyVolume;
0024 class G4LogicalVolume;
0025 class G4VPhysicalVolume;
0026 class G4VSolid;
0027 class PHCompositeNode;
0028 class PHG4InnerHcalDisplayAction;
0029 class PHParameters;
0030 class PHG4Subsystem;
0031 class RawTowerGeomContainer;
0032 
0033 class PHG4InnerHcalDetector : public PHG4Detector
0034 {
0035  public:
0036   typedef CGAL::Exact_circular_kernel_2 Circular_k;
0037   typedef CGAL::Point_2<Circular_k> Point_2;
0038 
0039   //! constructor
0040   PHG4InnerHcalDetector(PHG4Subsystem *subsys, PHCompositeNode *Node, PHParameters *parameters, const std::string &dnam);
0041 
0042   //! destructor
0043   ~PHG4InnerHcalDetector() override;
0044 
0045   //! construct
0046   void ConstructMe(G4LogicalVolume *world) override;
0047 
0048   void Print(const std::string &what = "ALL") const override;
0049 
0050   //!@name volume accessors
0051   //@{
0052   int IsInInnerHcal(G4VPhysicalVolume *) const;
0053   //@}
0054 
0055   void SuperDetector(const std::string &name) { m_SuperDetector = name; }
0056   const std::string &SuperDetector() const { return m_SuperDetector; }
0057   int get_Layer() const { return m_Layer; }
0058   G4VSolid *ConstructSteelPlate(G4LogicalVolume *hcalenvelope);
0059   G4VSolid *ConstructScintillatorBox(G4LogicalVolume *hcalenvelope);
0060   void ShiftSecantToTangent(Point_2 &lowleft, Point_2 &upleft, Point_2 &upright, Point_2 &lowright);
0061 
0062   G4AssemblyVolume *ConstructHcalScintillatorAssembly(G4LogicalVolume *hcalenvelope);
0063   void ConstructHcalSingleScintillators(G4LogicalVolume *hcalenvelope);
0064   int CheckTiltAngle() const;
0065   int ConsistencyCheck() const;
0066   void SetTiltViaNcross();
0067   std::pair<int, int> GetLayerTowerId(G4VPhysicalVolume *volume) const;
0068 
0069  protected:
0070   void AddGeometryNode();
0071   int ConstructInnerHcal(G4LogicalVolume *sandwich);
0072   double x_at_y(Point_2 &p0, Point_2 &p1, double yin);
0073   PHG4InnerHcalDisplayAction *m_DisplayAction = nullptr;
0074   PHParameters *m_Params = nullptr;
0075   G4AssemblyVolume *m_ScintiMotherAssembly = nullptr;
0076   double m_InnerRadius = NAN;
0077   double m_OuterRadius = NAN;
0078   double m_SizeZ = NAN;
0079   double m_ScintiTileX = NAN;
0080   double m_ScintiTileXLower = NAN;
0081   double m_ScintiTileXUpper = NAN;
0082   double m_ScintiTileZ = NAN;
0083   double m_ScintiTileThickness = NAN;
0084   double m_ScintiInnerGap = NAN;
0085   double m_ScintiOuterGap = NAN;
0086   double m_ScintiOuterRadius = NAN;
0087   double m_TiltAngle = NAN;
0088   double m_EnvelopeInnerRadius = NAN;
0089   double m_EnvelopeOuterRadius = NAN;
0090   double m_EnvelopeZ = NAN;
0091   double m_VolumeEnvelope = NAN;
0092   double m_VolumeSteel = NAN;
0093   double m_VolumeScintillator = NAN;
0094 
0095   int m_NumScintiPlates = 0;
0096   int m_NumScintiTilesPos = 0;
0097   int m_NumScintiTilesNeg = 0;
0098 
0099   int m_Active = 0;
0100   int m_AbsorberActive = 0;
0101 
0102   int m_Layer = 0;
0103   std::string m_SuperDetector;
0104   std::set<G4VPhysicalVolume *> m_SteelAbsorberPhysVolSet;
0105   std::map<G4VPhysicalVolume *, std::pair<int, int>> m_ScintiTilePhysVolMap;
0106   std::vector<G4VSolid *> m_ScintiTilesVec;
0107   std::string m_ScintiLogicNamePrefix;
0108   RawTowerGeomContainer *m_RawTowerGeom = nullptr;
0109   std::string m_TowerGeomNodeName;
0110 };
0111 
0112 #endif  // G4DETECTORS_PHG4INNERHCALDETECTOR_H