ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4TpcElectronDrift.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4TpcElectronDrift.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 
4 #ifndef G4TPC_PHG4TPCELECTRONDRIFT_H
5 #define G4TPC_PHG4TPCELECTRONDRIFT_H
6 
7 #include <phparameter/PHParameterInterface.h>
8 
10 
11 #include <fun4all/SubsysReco.h>
12 
13 #include <gsl/gsl_rng.h>
14 
15 #include <cmath>
16 #include <memory>
17 #include <string> // for string
18 
19 class PHG4TpcPadPlane;
20 class PHG4TpcDistortion;
21 class PHCompositeNode;
22 class TH1;
23 class TH2;
24 class TH3;
25 class TNtuple;
26 class TFile;
28 class TrkrHitTruthAssoc;
29 class DistortedTrackContainer;
30 
32 {
33  public:
34  PHG4TpcElectronDrift(const std::string &name = "PHG4TpcElectronDrift");
35  ~PHG4TpcElectronDrift() override = default;
36  int Init(PHCompositeNode *) override;
37  int InitRun(PHCompositeNode *) override;
38  int process_event(PHCompositeNode *) override;
39  int End(PHCompositeNode *) override;
40 
41  void SetDefaultParameters() override;
42 
44  void Detector(const std::string &d)
45  {
46  detector = d;
47  }
48 
50  std::string Detector() const
51  {
52  return detector;
53  }
54 
56  void set_seed(const unsigned int iseed);
57 
60 
63 
64  private:
66  void MapToPadPlane(const double x, const double y, const double z, PHG4HitContainer::ConstIterator hiter, TNtuple *ntpad, TNtuple *nthit);
67 
70  std::unique_ptr<TrkrHitSetContainer> temp_hitsetcontainer;
71  std::unique_ptr<TrkrHitSetContainer> single_hitsetcontainer;
72  std::unique_ptr<PHG4TpcPadPlane> padplane;
73 
74  std::unique_ptr<PHG4TpcDistortion> m_distortionMap;
75  int event_num = 0;
77 
79 
80  TH1 *dlong = nullptr;
81  TH1 *dtrans = nullptr;
82  TH2 *hitmapstart = nullptr;
83  TH2 *hitmapend = nullptr;
84  TH2 *z_startmap = nullptr;
85  TH2 *deltaphi = nullptr;
86  TH2 *deltar = nullptr;
87  TH2 *deltaphinodiff = nullptr;
88  TH2 *deltaRphinodiff = nullptr;
89  TH2 *deltaphivsRnodiff = nullptr;
90  TH2 *deltaphinodist = nullptr;
91  TH2 *deltarnodiff = nullptr;
92  TH2 *deltarnodist = nullptr;
93  TH2 *deltaz = nullptr;
95 
96  std::unique_ptr<TFile> m_outf;
97  std::unique_ptr<TFile> EDrift_outf;
98 
99  TNtuple *nt = nullptr;
100  TNtuple *nthit = nullptr;
101  TNtuple *ntfinalhit = nullptr;
102  TNtuple *ntpad = nullptr;
103 
104  std::string detector;
105  std::string hitnodename;
106  std::string seggeonodename;
107 
108  double diffusion_trans = NAN;
110  double diffusion_long = NAN;
112  double drift_velocity = NAN;
113  double tpc_length = NAN;
114  double electrons_per_gev = NAN;
115  double min_active_radius = NAN;
116  double max_active_radius = NAN;
117  double min_time = NAN;
118  double max_time = NAN;
119 
121  class Deleter
122  {
123  public:
125  void operator()(gsl_rng *rng) const { gsl_rng_free(rng); }
126  };
127  std::unique_ptr<gsl_rng, Deleter> RandomGenerator;
128 };
129 
130 #endif // G4TPC_PHG4TPCELECTRONDRIFT_H