Analysis Software
Documentation for sPHENIX simulation 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  public:
26  PHG4MicromegasDigitizer(const std::string &name = "PHG4MicromegasDigitizer");
27 
29  int InitRun(PHCompositeNode *) override;
30 
32  int process_event(PHCompositeNode *topNode) override;
33 
35  void SetDefaultParameters() override;
36 
37  private:
39  double add_noise() const;
40 
42  double m_adc_threshold = 2700;
43 
45  double m_enc = 670;
46 
48  double m_pedestal = 50000;
49 
51  double m_volts_per_charge = 20;
52 
55 
58 
60 
61  static constexpr double m_adc_per_volt = 1024. / 2200;
62 
64  class Deleter
65  {
66  public:
68  void operator()(gsl_rng *rng) const { gsl_rng_free(rng); }
69  };
70 
72 
73  std::unique_ptr<gsl_rng, Deleter> m_rng;
74 };
75 
76 #endif