Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4SpacalDetector.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4SpacalDetector.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 
12 #ifndef G4DETECTORS_PHG4SPACALDETECTOR_H
13 #define G4DETECTORS_PHG4SPACALDETECTOR_H
14 
15 #include "PHG4CellDefs.h"
17 
18 #include <g4main/PHG4Detector.h>
19 
20 #include <Geant4/G4Transform3D.hh>
21 #include <Geant4/G4Types.hh> // for G4double
22 
23 #include <map>
24 #include <string> // for string
25 #include <utility> // for pair
26 
27 class G4LogicalVolume;
28 class G4UserLimits;
29 class G4VPhysicalVolume;
30 class PHCompositeNode;
31 class PHG4CylinderGeom;
32 class PHG4GDMLConfig;
34 class PHParameters;
35 class PHG4Subsystem;
37 
39 {
40  public:
42 
43  PHG4SpacalDetector(PHG4Subsystem* subsys, PHCompositeNode* Node, const std::string& dnam,
44  PHParameters* parameters, const int layer = 0, bool init_geom = true);
45 
46  ~PHG4SpacalDetector(void) override;
47 
48  void
49  ConstructMe(G4LogicalVolume* world) override;
50 
51  virtual std::pair<G4LogicalVolume*, G4Transform3D>
53 
54  virtual G4LogicalVolume*
55  Construct_Fiber(const G4double length, const std::string& id);
56 
57  void
58  SetActive(const int i = 1)
59  {
60  active = i;
61  }
62 
63  void
64  SetAbsorberActive(const int i = 1)
65  {
66  absorberactive = i;
67  }
68 
69  void
71  {
72  detector_type = typ;
73  }
74 
76 
77  void
79  {
81  }
82 
83  const std::string
84  SuperDetector() const
85  {
86  return superdetector;
87  }
88 
89  int get_Layer() const
90  {
91  return layer;
92  }
93 
94  void
95  Print(const std::string& what = "ALL") const override;
96 
97  const SpacalGeom_t*
98  get_geom() const
99  {
100  return _geom;
101  }
102 
103  virtual PHG4CylinderGeom* clone_geom() const
104  {
105  return new SpacalGeom_t(*_geom);
106  }
107 
108  enum
109  {
112  ABSORBER = -1,
113  SUPPORT = -2,
114  INACTIVE = -100
115  };
116 
118 
119  void CosmicSetup(const int i) { m_CosmicSetupFlag = i; }
120  int CosmicSetup() { return m_CosmicSetupFlag; }
121 
122  private:
124 
125  protected:
126  void AddTowerGeometryNode();
127  void AddCellGeometryNode();
128  std::map<const G4VPhysicalVolume*, int> fiber_core_vol;
129 
131  std::map<const G4VPhysicalVolume*, int> fiber_vol;
132 
134  std::map<const G4VPhysicalVolume*, int> calo_vol;
135 
137  std::map<const G4VPhysicalVolume*, int> block_vol;
138 
139  int active = 0;
140  int absorberactive = 0;
141  int layer = -9999;
144  int m_NumLayers = -1;
145  int m_NumPhiBins = -1;
146  int m_NumEtaBins = -1;
147  double m_Emin = 1e-6;
148  double m_EtaMin = NAN;
149  double m_PhiMin = NAN;
150  double m_EtaStep = NAN;
151  double m_PhiStep = NAN;
154 
155  // G4UserLimits * step_limits;
156  // G4UserLimits * clading_step_limits;
157  G4UserLimits* fiber_core_step_limits = nullptr;
158 
161  // private:
162 
163  SpacalGeom_t* _geom = nullptr;
164 
167 };
168 
169 #endif