Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 09:21:39

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