Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4OuterHcalDetector.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4OuterHcalDetector.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef G4DETECTORS_PHG4OUTERHCALDETECTOR_H
4 #define G4DETECTORS_PHG4OUTERHCALDETECTOR_H
5 
6 #include <g4main/PHG4Detector.h>
7 
8 #include <Geant4/G4Types.hh> // for G4double
9 
10 #pragma GCC diagnostic push
11 #pragma GCC diagnostic ignored "-Wshadow"
12 #pragma GCC diagnostic ignored "-Wpedantic"
13 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
14 #include <CGAL/Exact_circular_kernel_2.h>
15 #include <CGAL/point_generators_2.h>
16 #pragma GCC diagnostic pop
17 
18 #include <map>
19 #include <set>
20 #include <string> // for string
21 #include <utility> // for pair
22 #include <vector>
23 
24 class G4AssemblyVolume;
25 class G4LogicalVolume;
26 class G4VPhysicalVolume;
27 class G4VSolid;
28 class PHCompositeNode;
31 class PHParameters;
32 class PHG4Subsystem;
34 
36 {
37  public:
38  typedef CGAL::Exact_circular_kernel_2 Circular_k;
39  typedef CGAL::Point_2<Circular_k> Point_2;
41  PHG4OuterHcalDetector(PHG4Subsystem *subsys, PHCompositeNode *Node, PHParameters *params, const std::string &dnam);
42 
44  ~PHG4OuterHcalDetector() override;
45 
47  void ConstructMe(G4LogicalVolume *world) override;
48 
49  void Print(const std::string &what = "ALL") const override;
50 
52 
53  int IsInOuterHcal(G4VPhysicalVolume *) const;
55 
57  const std::string SuperDetector() const { return m_SuperDetector; }
58  int get_Layer() const { return m_Layer; }
59  void ShiftSecantToTangent(Point_2 &lowleft, Point_2 &upleft, Point_2 &upright, Point_2 &lowright);
60  int ConsistencyCheck() const;
61  void SetTiltViaNcross();
62  int CheckTiltAngle() const;
63  void ConstructHcalSingleScintillators(G4LogicalVolume *hcalenvelope);
64  G4VSolid *ConstructScintillatorBox(G4LogicalVolume *hcalenvelope);
65  std::pair<int, int> GetLayerTowerId(G4VPhysicalVolume *volume) const;
66 
67  protected:
68  void AddGeometryNode();
69  int ConstructOuterHcal(G4LogicalVolume *hcalenvelope);
70  G4VSolid *ConstructSteelPlate(G4LogicalVolume *hcalenvelope);
71  G4AssemblyVolume *ConstructHcalScintillatorAssembly(G4LogicalVolume *hcalenvelope);
72  G4double x_at_y(Point_2 &p0, Point_2 &p1, G4double yin);
75  PHParameters *m_Params = nullptr;
76  G4AssemblyVolume *m_ScintiMotherAssembly = nullptr;
77  G4VSolid *m_SteelCutoutForMagnetG4Solid = nullptr;
78  double m_InnerRadius = NAN;
79  double m_OuterRadius = NAN;
80  double m_SizeZ = NAN;
81  double m_ScintiTileX = NAN;
82  double m_ScintiTileXLower = NAN;
83  double m_ScintiTileXUpper = NAN;
84  double m_ScintiTileZ = NAN;
85  double m_ScintiTileThickness = NAN;
86  double m_ScintiGap = NAN;
87  double m_ScintiInnerRadius = NAN;
88  double m_ScintiOuterRadius = NAN;
89  double m_TiltAngle = NAN;
90  double m_EnvelopeInnerRadius = NAN;
91  double m_EnvelopeOuterRadius = NAN;
92  double m_EnvelopeZ = NAN;
93  double m_VolumeEnvelope = NAN;
94  double m_VolumeSteel = NAN;
95  double m_VolumeScintillator = NAN;
96 
99 
100  int m_ActiveFlag = 0;
102 
103  int m_Layer = 0;
106  std::vector<G4VSolid *> m_ScintiTilesVec;
107  std::set<G4VPhysicalVolume *> m_SteelAbsorberVec;
108  std::map<G4VPhysicalVolume *, std::pair<int, int>> m_ScintiTilePhysVolMap;
111 };
112 
113 #endif