EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4ForwardEcalDetector.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4ForwardEcalDetector.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef G4DETECTORS_PHG4FORWARDECALDETECTOR_H
4 #define G4DETECTORS_PHG4FORWARDECALDETECTOR_H
5 
6 #include <g4main/PHG4Detector.h>
7 
8 #include <Geant4/G4Material.hh>
9 #include <Geant4/G4SystemOfUnits.hh>
10 
11 #include <cassert>
12 #include <map>
13 #include <set>
14 #include <string>
15 #include <utility> // for pair, make_pair
16 
17 class G4LogicalVolume;
18 class G4VPhysicalVolume;
19 class PHCompositeNode;
21 class PHG4Subsystem;
22 class PHG4GDMLConfig;
23 class PHParameters;
24 
32 {
33  public:
35  PHG4ForwardEcalDetector(PHG4Subsystem *subsys, PHCompositeNode *Node, PHParameters *parameters, const std::string &dnam);
36 
39 
41  virtual void ConstructMe(G4LogicalVolume *world);
42 
44  int IsInForwardEcal(G4VPhysicalVolume *) const;
45 
46  void SetTowerDimensions(double dx, double dy, double dz, int type);
47 
48  void DoFullLightProp(bool doProp) { m_doLightProp = doProp; }
49 
50  void SetPlace(double place_in_x, double place_in_y, double place_in_z)
51  {
52  m_PlaceX = place_in_x;
53  m_PlaceY = place_in_y;
54  m_PlaceZ = place_in_z;
55  }
56  void SetPlaceX(double place_x) { m_PlaceX = place_x; }
57  void SetPlaceY(double place_y) { m_PlaceY = place_y; }
58  void SetPlaceZ(double place_z) { m_PlaceZ = place_z; }
59 
60  double GetPlaceX() const { return m_PlaceX; }
61  double GetPlaceY() const { return m_PlaceY; }
62  double GetPlaceZ() const { return m_PlaceZ; }
63 
64  void SetXRot(double rot_in_x) { m_XRot = rot_in_x; }
65  void SetYRot(double rot_in_y) { m_YRot = rot_in_y; }
66  void SetZRot(double rot_in_z) { m_ZRot = rot_in_z; }
67 
68  double GetXRot() const { return m_XRot; }
69  double GetYRot() const { return m_YRot; }
70  double GetZRot() const { return m_ZRot; }
71 
72  double GetRMin(int i) const
73  {
74  assert(i >= 0 && i <= 1);
75  return m_RMin[i];
76  }
77  double GetRMax(int i) const
78  {
79  assert(i >= 0 && i <= 1);
80  return m_RMax[i];
81  }
82 
83  void SetRMin(int i, double val)
84  {
85  assert(i >= 0 && i <= 1);
86  m_RMin[i] = val;
87  }
88  void SetRMax(int i, double val)
89  {
90  assert(i >= 0 && i <= 1);
91  m_RMax[i] = val;
92  }
93 
94  double GetdZ() const { return m_dZ; }
95 
96  void SetdZ(double val) { m_dZ = val; }
97 
98  void SuperDetector(const std::string &name) { m_SuperDetector = name; }
99  const std::string SuperDetector() const { return m_SuperDetector; }
100 
101  int get_Layer() const { return m_Layer; }
102  int get_TowerType() const { return m_TowerType; }
103 
105 
106  private:
107  G4LogicalVolume *ConstructTower(int type);
108  G4LogicalVolume *ConstructTowerType2();
109  G4LogicalVolume *ConstructTowerType3_4_5_6(int type);
110  int PlaceTower(G4LogicalVolume *envelope, G4LogicalVolume *tower[6]);
112  G4Material *GetWLSFiberFEMCMaterial();
113  G4Material *GetScintillatorMaterial();
114  G4Material *GetCoatingMaterial();
115  void SurfaceTable(G4LogicalVolume *vol);
117  {
118  double x;
119  double y;
120  double z;
121  int type;
122  int idx_j;
123  int idx_k;
124  };
125 
127  PHParameters *m_Params = nullptr;
130 
131  /* ECAL tower geometry */
132  double m_TowerDx[7];
133  double m_TowerDy[7];
134  double m_TowerDz[7];
135 
136  double m_XRot = 0.;
137  double m_YRot = 0.;
138  double m_ZRot = 0.;
139 
140  double m_PlaceX = 0.0 * mm;
141  double m_PlaceY = 0.0 * mm;
142  double m_PlaceZ = 3150.0 * mm;
143 
144  double m_RMin[2];
145  double m_RMax[2];
146 
147  double m_dZ = 170 * mm;
148 
149  int m_ActiveFlag = 0;
151  int m_Layer = 0;
152  int m_TowerType = 0;
153 
154  std::string m_SuperDetector = "NONE";
155  std::string m_TowerLogicNamePrefix = "hEcalTower";
156 
157  std::map<std::string, towerposition> m_TowerPositionMap;
158  std::map<std::string, double> m_GlobalParameterMap;
159 
160  std::set<G4LogicalVolume *> m_AbsorberLogicalVolSet;
161  std::set<G4LogicalVolume *> m_ScintiLogicalVolSet;
162 
163  protected:
164  const std::string TowerLogicNamePrefix() const { return m_TowerLogicNamePrefix; }
165  PHParameters *GetParams() const { return m_Params; }
166  void AbsorberLogicalVolSetInsert(G4LogicalVolume *logvol)
167  {
168  m_AbsorberLogicalVolSet.insert(logvol);
169  }
170  void ScintiLogicalVolSetInsert(G4LogicalVolume *logvol)
171  {
172  m_ScintiLogicalVolSet.insert(logvol);
173  }
174  std::map<std::string, double>::const_iterator FindIter(const std::string &name) { return m_GlobalParameterMap.find(name); }
175  std::map<std::string, double>::const_iterator EndIter() { return m_GlobalParameterMap.end(); }
176  void InsertParam(const std::string &parname, double parval) { m_GlobalParameterMap.insert(make_pair(parname, parval)); }
177 
179 };
180 
181 #endif