ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4TpcDigitizer.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4TpcDigitizer.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef G4TPC_PHG4TPCDIGITIZER_H
4 #define G4TPC_PHG4TPCDIGITIZER_H
5 
6 #include <fun4all/SubsysReco.h>
7 
8 #include <trackbase/TrkrDefs.h>
9 #include <trackbase/TrkrHitSet.h>
10 
11 #include <map>
12 #include <string> // for string
13 #include <utility> // for pair, make_pair
14 #include <vector>
15 
16 #include <gsl/gsl_rng.h>
17 
18 class PHCompositeNode;
19 
21 {
22  public:
23  PHG4TpcDigitizer(const std::string &name = "PHG4TpcDigitizer");
24  ~PHG4TpcDigitizer() override;
25 
27  int Init(PHCompositeNode * /*topNode*/) override { return 0; }
28 
30  int InitRun(PHCompositeNode *topNode) override;
31 
33  int process_event(PHCompositeNode *topNode) override;
34 
36  int End(PHCompositeNode * /*topNode*/) override { return 0; };
37 
38  void set_adc_scale(const int layer, const unsigned int max_adc, const float energy_per_adc)
39  {
40  _max_adc.insert(std::make_pair(layer, max_adc));
41  _energy_scale.insert(std::make_pair(layer, energy_per_adc));
42  }
43 
44  void SetTpcMinLayer(const int minlayer) { TpcMinLayer = minlayer; };
45  void SetADCThreshold(const float thresh) { ADCThreshold = thresh; };
46  void SetENC(const float enc) { TpcEnc = enc; };
47 
48  private:
51  float added_noise();
52 
53  unsigned int TpcMinLayer;
54  float ADCThreshold;
55  float TpcEnc;
56  float Pedestal;
58 
61 
62  std::vector<std::vector<TrkrHitSet::ConstIterator> > phi_sorted_hits;
63  std::vector<std::vector<TrkrHitSet::ConstIterator> > z_sorted_hits;
64 
65  std::vector<float> adc_input;
66  std::vector<TrkrDefs::hitkey> adc_hitid;
67  std::vector<int> is_populated;
68 
69  // settings
70  std::map<int, unsigned int> _max_adc;
71  std::map<int, float> _energy_scale;
72 
74  gsl_rng *RandomGenerator;
75 };
76 
77 #endif