Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4TpcPadPlaneReadout.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4TpcPadPlaneReadout.h
1 #ifndef G4TPC_PHG4TPCPADPLANEREADOUT_H
2 #define G4TPC_PHG4TPCPADPLANEREADOUT_H
3 
4 #include "PHG4TpcPadPlane.h"
5 #include "TpcClusterBuilder.h"
6 
8 #include <gsl/gsl_rng.h>
9 
10 #include <TH2F.h>
11 
12 #include <array>
13 #include <climits>
14 #include <cmath>
15 #include <string> // for string
16 #include <vector>
17 
18 class PHCompositeNode;
19 //class PHG4CellContainer;
22 class TNtuple;
24 class TrkrHitTruthAssoc;
25 
27 {
28  public:
29  PHG4TpcPadPlaneReadout(const std::string &name = "PHG4TpcPadPlaneReadout");
30 
31  ~PHG4TpcPadPlaneReadout() override;
32 
33  int InitRun(PHCompositeNode *topNode) override;
34 
35  void UseGain(const int flagToUseGain);
36  void ReadGain();
37 
38  void SetDriftVelocity(double vd) override { drift_velocity = vd; }
39  void SetReadoutTime(float t) override { extended_readout_time = t; }
40  // otherwise warning of inconsistent overload since only one MapToPadPlane methow is overridden
42 
43  void MapToPadPlane(TpcClusterBuilder& tpc_clustbuilder, TrkrHitSetContainer *single_hitsetcontainer, TrkrHitSetContainer *hitsetcontainer, TrkrHitTruthAssoc * /*hittruthassoc*/, const double x_gem, const double y_gem, const double t_gem, const unsigned int side, PHG4HitContainer::ConstIterator hiter, TNtuple * /*ntpad*/, TNtuple * /*nthit*/) override;
44 
45  void SetDefaultParameters() override;
46  void UpdateInternalParameters() override;
47 
48  private:
49  // void populate_rectangular_phibins(const unsigned int layernum, const double phi, const double cloud_sig_rp, std::vector<int> &pad_phibin, std::vector<double> &pad_phibin_share);
50  void populate_zigzag_phibins(const unsigned int side, const unsigned int layernum, const double phi, const double cloud_sig_rp, std::vector<int> &pad_phibin, std::vector<double> &pad_phibin_share);
51  void populate_tbins(const double t, const std::array<double, 2> &cloud_sig_tt, std::vector<int> &adc_tbin, std::vector<double> &adc_tbin_share);
52 
53  double check_phi(const unsigned int side, const double phi, const double radius);
54 
57 
59 
60  std::array<double, 3> MinRadius;
61  std::array<double, 3> MaxRadius;
62 
63  static constexpr int NSides = 2;
64  static constexpr int NSectors = 12;
65  static const int NRSectors = 3;
66 
67  double sigmaT = NAN;
68  std::array<double, 2> sigmaL;
69  std::array<double, 3> PhiBinWidth;
70  double drift_velocity = 8.0e-03; // default value, override from macro
71  float extended_readout_time = 0; //ns
72  int NTBins = INT_MAX;
73  int m_NHits = 0;
74  // Using Gain maps is turned off by default
75  int m_flagToUseGain = 0;
76  // gaussian sampling
77  static constexpr double _nsigmas = 5;
78 
79  double averageGEMGain = NAN;
80 
81  std::array< std::array< std::vector<double>, NRSectors >, NSides > sector_min_Phi_sectors;
82  std::array< std::array< std::vector<double>, NRSectors >, NSides > sector_max_Phi_sectors;
83 
84  // return random distribution of number of electrons after amplification of GEM for each initial ionizing electron
86  gsl_rng *RandomGenerator = nullptr;
87 
88  TH2F *h_gain[2] = {nullptr};
89 
90 };
91 
92 #endif