ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4MicromegasDigitizer.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4MicromegasDigitizer.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 
4 #ifndef G4MICROMEGAS_PHG4MICROMEGASDIGITIZER_H
5 #define G4MICROMEGAS_PHG4MICROMEGASDIGITIZER_H
6 
12 #include <fun4all/SubsysReco.h>
13 
14 #include <phparameter/PHParameterInterface.h>
15 
16 #include <gsl/gsl_rng.h>
17 
18 #include <memory>
19 #include <string> // for string
20 
21 class PHCompositeNode;
22 
24 {
25 
26  public:
27  PHG4MicromegasDigitizer(const std::string &name = "PHG4MicromegasDigitizer");
28 
30  int InitRun(PHCompositeNode*) override;
31 
33  int process_event(PHCompositeNode *topNode) override;
34 
36  void SetDefaultParameters() override;
37 
38  private:
39 
41  double add_noise() const;
42 
44  double m_adc_threshold = 2700;
45 
47  double m_enc = 670;
48 
50  double m_pedestal = 50000;
51 
53  double m_volts_per_charge = 20;
54 
57 
60 
62 
63  static constexpr double m_adc_per_volt = 1024./2200;
64 
66  class Deleter
67  {
68  public:
70  void operator() (gsl_rng* rng) const { gsl_rng_free(rng); }
71  };
72 
74 
75  std::unique_ptr<gsl_rng, Deleter> m_rng;
76 
77 };
78 
79 #endif