Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RawTowerDigitizer.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RawTowerDigitizer.h
1 #ifndef G4CALO_RAWTOWERDIGITIZER_H
2 #define G4CALO_RAWTOWERDIGITIZER_H
3 
4 #include <fun4all/SubsysReco.h>
5 
6 #include <phparameter/PHParameters.h>
7 
8 #include <gsl/gsl_rng.h>
9 
10 #include <cmath>
11 #include <string>
12 
13 class CDBTTree;
14 class PHCompositeNode;
15 class RawTower;
16 class TowerInfo;
17 class TowerInfoContainer;
18 class RawTowerContainer;
20 class RawTowerDeadMap;
21 
26 {
27  public:
28  RawTowerDigitizer(const std::string &name = "RawTowerDigitizer");
29  ~RawTowerDigitizer() override;
30 
31  int InitRun(PHCompositeNode *topNode) override;
32  int process_event(PHCompositeNode *topNode) override;
33  void Detector(const std::string &d)
34  {
35  m_Detector = d;
37  }
38  void TowerType(const int type) { m_TowerType = type; }
39  void set_seed(const unsigned int iseed);
40  unsigned int get_seed() const { return m_Seed; }
42  {
47 
52 
55  };
56 
58  {
62  };
63 
66  {
67  return m_DigiAlgorithm;
68  }
69 
70  void
72  {
73  m_DigiAlgorithm = digiAlgorithm;
74  }
75 
76  double
78  {
79  return m_PedstalCentralADC;
80  }
81 
82  void
83  set_pedstal_central_ADC(const double pedstalCentralAdc)
84  {
85  m_PedstalCentralADC = pedstalCentralAdc;
86  }
87 
88  double
90  {
91  return m_PedstalWidthADC;
92  }
93 
94  void
95  set_pedstal_width_ADC(const double pedstalWidthAdc)
96  {
97  m_PedstalWidthADC = pedstalWidthAdc;
98  }
99 
100  double
102  {
103  return m_PhotonElecADC;
104  }
105 
106  void
107  set_photonelec_ADC(const double photonelecAdc)
108  {
109  m_PhotonElecADC = photonelecAdc;
110  }
111 
112  double
114  {
116  }
117 
118  void
119  set_photonelec_yield_visible_GeV(const double photonelecYieldVisibleGeV)
120  {
121  m_PhotonElecYieldVisibleGeV = photonelecYieldVisibleGeV;
122  }
123 
124  double
126  {
127  return m_ZeroSuppressionADC;
128  }
129 
130  void
131  set_zero_suppression_ADC(const double zeroSuppressionAdc)
132  {
133  m_ZeroSuppressionADC = zeroSuppressionAdc;
134  }
135 
136  void
138  {
140  }
141 
142  void
144  {
146  }
147 
148  PHParameters &
150  {
151  return _tower_params;
152  }
153 
156  {
157  return m_RawTowerNodePrefix;
158  }
159 
160  void
161  set_raw_tower_node_prefix(const std::string &rawTowerNodePrefix)
162  {
163  m_RawTowerNodePrefix = rawTowerNodePrefix;
164  }
165 
168  {
169  return m_SimTowerNodePrefix;
170  }
171 
172  void
173  set_sim_tower_node_prefix(const std::string &simTowerNodePrefix)
174  {
175  m_SimTowerNodePrefix = simTowerNodePrefix;
176  }
177 
178  // ! SiPM effective pixel per tower, only used with kSiPM_photon_digitalization
179  void set_sipm_effective_pixel(const unsigned int &d) { m_SiPMEffectivePixel = d; }
180 
181  // ! SiPM effective pixel per tower, only used with kSiPM_photon_digitalization
183 
184  // calo calib decal stuff JEF Feb 2022
185  void set_DoTowerDecal(const bool doTowerDecal,
186  const char *decalFileName = "",
187  const bool doInverse = false)
188  {
189  m_DoDecal = doTowerDecal;
190  m_DecalInverse = doInverse;
191  set_DecalFileName(decalFileName);
192  }
193 
194  void set_DecalFileName(const char *inCalFname)
195  {
196  m_DecalFileName = inCalFname;
197  }
198 
199  void set_UseConditionsDB(const bool setUseCondDB)
200  {
201  m_UseConditionsDB = setUseCondDB;
202  }
203 
205  {
206  m_UseTowerInfo = UseTowerInfo;
207  }
208 
209  private:
210  void CreateNodes(PHCompositeNode *topNode);
211 
217 
222 
224 
227 
230 
231 
232 
235 
237 
240 
243 
245  double m_PhotonElecADC = NAN;
246 
248  double m_PedstalCentralADC = NAN;
249 
251  double m_PedstalWidthADC = NAN;
252 
254  bool m_pedestalFile = false;
255 
257  double m_ZeroSuppressionADC = -1000;
258 
260  bool m_ZeroSuppressionFile = false;
261 
263  int m_TowerType = -1;
264 
265  unsigned int m_Seed = 0;
266 
267  // ! SiPM effective pixel per tower, only used with kSiPM_photon_digitalization
268  // ! sPHENIX EMCal default, 4x Hamamatsu S12572-015P MPPC [sPHENIX TDR]
269  unsigned int m_SiPMEffectivePixel = 40000 * 4;
270 
272 
273  gsl_rng *m_RandomGenerator = nullptr;
274 
275  // calo calibs decal stuff JEF Feb 2022
276  bool m_DoDecal = false;
277  bool m_DecalInverse = false;
278  bool m_Decal = true;
280  bool m_UseConditionsDB = false;
281  CDBTTree *m_CDBTTree = nullptr;
282 
283 
284  RawTowerDigitizer::ProcessTowerType m_UseTowerInfo = RawTowerDigitizer::ProcessTowerType::kBothTowers; // 0 just produce RawTowers, 1 just produce TowerInfo objects, and 2 produce both
285 
286 
287 };
288 
289 #endif /* G4CALO_RAWTOWERDIGITIZER_H */