EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4MicromegasHitReco.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4MicromegasHitReco.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 
4 #ifndef G4MICROMEGAS_PHG4MICROMEGASHITRECO_H
5 #define G4MICROMEGAS_PHG4MICROMEGASHITRECO_H
6 
13 #include <phparameter/PHParameterInterface.h>
14 
15 #include <fun4all/SubsysReco.h>
16 
17 #include <gsl/gsl_rng.h>
18 #include <memory>
19 #include <string>
20 #include <utility>
21 #include <vector>
22 
24 class PHCompositeNode;
25 class PHG4Hit;
26 class TVector3;
27 
29 {
30 
31  public:
32  explicit PHG4MicromegasHitReco(
33  const std::string &name = "PHG4MicromegasHitReco",
34  const std::string &detector = "MICROMEGAS");
35 
37  int InitRun(PHCompositeNode*) override;
38 
40  int process_event(PHCompositeNode*) override;
41 
43  void SetDefaultParameters() override;
44 
46  void set_tiles( const MicromegasTile::List& tiles )
47  { m_tiles = tiles; }
48 
49  private:
50 
52  std::string bare_geonodename() const
53  { return "CYLINDERGEOM_" + m_detector; }
54 
56  std::string full_geonodename() const
57  { return "CYLINDERGEOM_" + m_detector + "_FULL"; }
58 
61 
63 
64  uint get_primary_electrons( PHG4Hit* ) const;
65 
68 
70  using charge_pair_t = std::pair<int, double>;
71 
73  using charge_list_t = std::vector<charge_pair_t>;
74 
76  charge_list_t distribute_charge( CylinderGeomMicromegas*, uint tileid, const TVector3& local_position, double sigma ) const;
77 
79  std::string m_detector;
80 
82  double m_tmin = -20;
83 
85  double m_tmax = 800;
86 
88  double m_electrons_per_gev = 0;
89 
91  double m_gain = 0;
92 
94  double m_cloud_sigma = 0.04;
95 
97  double m_diffusion_trans = 0.03;
98 
100  bool m_zigzag_strips = true;
101 
104 
106  class Deleter
107  {
108  public:
110  void operator() (gsl_rng* rng) const { gsl_rng_free(rng); }
111  };
112 
114 
115  std::unique_ptr<gsl_rng, Deleter> m_rng;
116 
117 };
118 
119 #endif