Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4DETECTORS_PHG4OUTERHCALDETECTOR_H
0004 #define G4DETECTORS_PHG4OUTERHCALDETECTOR_H
0005 
0006 #include <g4main/PHG4Detector.h>
0007 
0008 #include <Geant4/G4Types.hh>  // for G4double
0009 
0010 #include <CGAL/Exact_circular_kernel_2.h>
0011 #include <CGAL/point_generators_2.h>
0012 
0013 #include <limits>
0014 #include <map>
0015 #include <set>
0016 #include <string>   // for string
0017 #include <utility>  // for pair
0018 #include <vector>
0019 
0020 class G4AssemblyVolume;
0021 class G4LogicalVolume;
0022 class G4VPhysicalVolume;
0023 class G4VSolid;
0024 class PHCompositeNode;
0025 class PHG4OuterHcalDisplayAction;
0026 class PHG4OuterHcalFieldSetup;
0027 class PHParameters;
0028 class PHG4Subsystem;
0029 class RawTowerGeomContainer;
0030 
0031 class PHG4OuterHcalDetector : public PHG4Detector
0032 {
0033  public:
0034   typedef CGAL::Exact_circular_kernel_2 Circular_k;
0035   typedef CGAL::Point_2<Circular_k> Point_2;
0036   //! constructor
0037   PHG4OuterHcalDetector(PHG4Subsystem *subsys, PHCompositeNode *Node, PHParameters *params, const std::string &dnam);
0038 
0039   //! destructor
0040   ~PHG4OuterHcalDetector() override;
0041 
0042   //! construct
0043   void ConstructMe(G4LogicalVolume *world) override;
0044 
0045   void Print(const std::string &what = "ALL") const override;
0046 
0047   //!@name volume accessors
0048   //@{
0049   int IsInOuterHcal(G4VPhysicalVolume *) const;
0050   //@}
0051 
0052   void SuperDetector(const std::string &name) { m_SuperDetector = name; }
0053   const std::string &SuperDetector() const { return m_SuperDetector; }
0054   int get_Layer() const { return m_Layer; }
0055   void ShiftSecantToTangent(Point_2 &lowleft, Point_2 &upleft, Point_2 &upright, Point_2 &lowright) const;
0056   int ConsistencyCheck() const;
0057   void SetTiltViaNcross();
0058   int CheckTiltAngle() const;
0059   void ConstructHcalSingleScintillators(G4LogicalVolume *hcalenvelope);
0060   G4VSolid *ConstructScintillatorBox(G4LogicalVolume *hcalenvelope);
0061   std::pair<int, int> GetLayerTowerId(G4VPhysicalVolume *volume) const;
0062 
0063  protected:
0064   void AddGeometryNode();
0065   int ConstructOuterHcal(G4LogicalVolume *hcalenvelope);
0066   G4VSolid *ConstructSteelPlate(G4LogicalVolume *hcalenvelope);
0067   G4AssemblyVolume *ConstructHcalScintillatorAssembly(G4LogicalVolume *hcalenvelope);
0068   G4double x_at_y(Point_2 &p0, Point_2 &p1, G4double yin);
0069   PHG4OuterHcalDisplayAction *m_DisplayAction {nullptr};
0070   PHG4OuterHcalFieldSetup *m_FieldSetup {nullptr};
0071   PHParameters *m_Params {nullptr};
0072   G4AssemblyVolume *m_ScintiMotherAssembly {nullptr};
0073   G4VSolid *m_SteelCutoutForMagnetG4Solid {nullptr};
0074   double m_InnerRadius {std::numeric_limits<double>::quiet_NaN()};
0075   double m_OuterRadius {std::numeric_limits<double>::quiet_NaN()};
0076   double m_SizeZ {std::numeric_limits<double>::quiet_NaN()};
0077   double m_ScintiTileX {std::numeric_limits<double>::quiet_NaN()};
0078   double m_ScintiTileXLower {std::numeric_limits<double>::quiet_NaN()};
0079   double m_ScintiTileXUpper {std::numeric_limits<double>::quiet_NaN()};
0080   double m_ScintiTileZ {std::numeric_limits<double>::quiet_NaN()};
0081   double m_ScintiTileThickness {std::numeric_limits<double>::quiet_NaN()};
0082   double m_ScintiGap {std::numeric_limits<double>::quiet_NaN()};
0083   double m_ScintiInnerRadius {std::numeric_limits<double>::quiet_NaN()};
0084   double m_ScintiOuterRadius {std::numeric_limits<double>::quiet_NaN()};
0085   double m_TiltAngle {std::numeric_limits<double>::quiet_NaN()};
0086   double m_EnvelopeInnerRadius {std::numeric_limits<double>::quiet_NaN()};
0087   double m_EnvelopeOuterRadius {std::numeric_limits<double>::quiet_NaN()};
0088   double m_EnvelopeZ {std::numeric_limits<double>::quiet_NaN()};
0089   double m_VolumeEnvelope {std::numeric_limits<double>::quiet_NaN()};
0090   double m_VolumeSteel {std::numeric_limits<double>::quiet_NaN()};
0091   double m_VolumeScintillator {std::numeric_limits<double>::quiet_NaN()};
0092 
0093   int m_NumScintiPlates {0};
0094   int m_NumScintiTiles {0};
0095 
0096   int m_ActiveFlag {0};
0097   int m_AbsorberActiveFlag {0};
0098 
0099   int m_Layer {0};
0100   std::string m_SuperDetector;
0101   std::string m_ScintiLogicNamePrefix;
0102   std::vector<G4VSolid *> m_ScintiTilesVec;
0103   std::set<G4VPhysicalVolume *> m_SteelAbsorberVec;
0104   std::map<G4VPhysicalVolume *, std::pair<int, int>> m_ScintiTilePhysVolMap;
0105   RawTowerGeomContainer *m_RawTowerGeom {nullptr};
0106   std::string m_TowerGeomNodeName;
0107 };
0108 
0109 #endif