Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4OHCalDetector.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4OHCalDetector.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef G4OHCAL_PHG4OHCALDETECTOR_H
4 #define G4OHCAL_PHG4OHCALDETECTOR_H
5 
6 #include <g4main/PHG4Detector.h>
7 
8 #include <cmath> // for NAN
9 #include <map>
10 #include <set>
11 #include <string> // for string
12 #include <tuple>
13 
14 class G4AssemblyVolume;
15 class G4LogicalVolume;
16 class G4VPhysicalVolume;
17 class PHCompositeNode;
20 class PHParameters;
21 class PHG4Subsystem;
22 class PHG4GDMLConfig;
24 
26 {
27  public:
29  PHG4OHCalDetector(PHG4Subsystem *subsys, PHCompositeNode *Node, PHParameters *params, const std::string &dnam);
30 
32  ~PHG4OHCalDetector() override;
33 
35  void ConstructMe(G4LogicalVolume *world) override;
36 
37  void Print(const std::string &what = "ALL") const override;
38 
40 
41  int IsInOHCal(G4VPhysicalVolume *) const;
43 
45  const std::string SuperDetector() const { return m_SuperDetector; }
46  int get_Layer() const { return m_Layer; }
47  int ConsistencyCheck() const;
48  std::tuple<int, int, int> GetRowColumnId(G4VPhysicalVolume *volume) const;
49 
50  private:
51  void AddGeometryNode();
52  int ConstructOHCal(G4LogicalVolume *hcalenvelope);
53  int map_towerid(const int tower_id);
54  int map_layerid(const unsigned int isector, const int layer_id);
55  std::tuple<int, int, int> ExtractLayerTowerId(const unsigned int isector, G4VPhysicalVolume *volume);
58  PHParameters *m_Params = nullptr;
59  G4AssemblyVolume *m_ScintiMotherAssembly = nullptr;
60  G4AssemblyVolume *m_ChimScintiMotherAssembly = nullptr;
61  double m_InnerRadius = NAN;
62  double m_OuterRadius = NAN;
63  double m_SizeZ = NAN;
64  double m_VolumeEnvelope = NAN;
65  double m_VolumeSteel = 0;
67 
68  int m_NumScintiPlates = -9999;
69 
70  int m_ActiveFlag = 0;
72 
73  int m_Layer = 0;
75  std::set<G4LogicalVolume *> m_SteelAbsorberLogVolSet;
76  std::set<G4LogicalVolume *> m_ScintiTileLogVolSet;
77  std::map<G4VPhysicalVolume *, std::tuple<int, int, int>> m_ScintiTilePhysVolMap;
78 
81 
85 };
86 
87 #endif // G4OHCAL_PHG4OHCALDETECTOR_H