DetectorResponse.h
Go to the documentation of this file.
1 
10 #ifndef __DetectorResponse_h_
11 #define __DetectorResponse_h_
12 
13 
14 #include <vector>
15 #include <map>
16 #include <cmath>
17 #include <string>
18 
19 #define NTYPES 6
20 #define NCDFMAX 300
21 #ifndef UNDEF
22 #define UNDEF -100
23 #endif
24 #define DEBUG_RESP 0
25 
26 // NOTE : no distinction between muon decay in flight and at rest.
27 
28 
29 namespace TabulatedTankSimulatorNS {
30 
31  //
32  const double UnitPerPE_wcd = 1. / 244.3;
33  const double UnitPerPE_scin = 1. / 15.65;
34  const double UnitPerPE_md = 1.;
35 
36  // Enlarge Area factor ( WCD -> radius*f , ASCII -> lengh*f, widht*f )
37  const double fEnlargeArea = 2.;
38 
39  // Auger Water Cherenkov
40  const double tankh = 120.;
41  const double tankr = 180.;
42 
43  // Scintillator 2 m^2
44  const double scinlength = 180.;
45  const double scinwidth = 108.;
46  const double scinheight = 1.;
47 
48  // Muon detector: 64 strips in 2 sides with 5.12 m^2 each
49  const double nMD = 2.;
50  const double MDlength = 400.;
51  const double MDwidth = 128.;
52  const double MDheight = 1.;
53  const double SatLevelMD = 20.; // In a 25 [ns] window for a 64 strips detector
54 
55  const double MDBoundary = 50.; // In G4 particles are injected in a larger area to account for MS
56  const double MDAreaRatio = (MDwidth + 2 * MDBoundary)* (MDlength + 2 * MDBoundary) / (MDlength* MDwidth);
57 
58  /*CDF for one Specie and (to,ke)*/
59  class PeCDF {
60  public:
61  int itype; // [0] Muon [1] Electron [2] Gamma [3] MuonLow [4] MichelElectron [5] MichelElectronLow
62  double lke, theta, theta_deg; //--KE in GeV, theta in rad, theta in deg
63  double mean, rms, median;
65  int PeCut;
67  std::vector <std::pair<int, double> > prob; //-- Differential Probabilities (removed after CDFs are created)
68  std::vector <std::pair<int, double> > cdf; //-- Cummulative Probability Distribution
69  };
70 
71 
72  /*Tank Response Class*/
73 
75 
76  private:
77  // WCD [VEM] / ASCII [VEM 1 GeV] / AMIGA [muon reaching bottom part of the detector]
78  double UnitPerPE;
79  int NPECUT;
80 
82 
83  std::string fDataDir;
84  int fDetectorType; // [0] Auger Water Cherenkov [1] ASCII [2] AMIGA
85  int iGrid; // [0] Auger Water Cherenkov [1] ASCII [2] AMIGA
87 
88  public:
89  DetectorResponse(bool flag = false, int DetectorType = 0 , bool UseEnlargeArea = false);
91 
92  double GetUnitPerPE()
93  {
94  return UnitPerPE;
95  }
96  int GetiGrid()
97  {
98  return iGrid;
99  }
100  double Interpolate(double* x, double* y, double f);
101  double GetSignalBin(double f, PeCDF& fPeCDF);
102 
103  bool IsHit(double ke, double theta, int itype , double f);
104  double GetPe(double ke, double theta, int itype , double f); // f= -100 Mean Interpolation | f=(0,1) CDF Interpolation
105 
106  int GetBin(double lkeo, double to, int itype, int* ibins, bool& flag);
107  PeCDF GetCDF(int itype, int ibin);
108  const char* GetParticleName(int itype);
109 
110  bool ReadG4File(PeCDF& pCDF, PeCDF& pCDF_dec);
111  void SetUpCDFs(PeCDF* pCDF);
112 
113  bool ReadCDFFile(std::vector<PeCDF>* fCDFs, int size);
114  bool WriteCDFFile(std::vector<PeCDF>* fCDFs);
115 
116  double GetAreaProj(int itype, double theta, double ke); // Projected area on ground
117  double GetAreaPerp(int itype, double theta, double ke); // Perpendicular Area
118  double GetRelativeTrack(double theta); // Relative track of a throughgoing particle
119 
120  };
121 
122 
123 } //
124 
125 
126 #endif // __DetectorResponse_h_
127 
128 // Configure (x)emacs for this file ...
129 // Local Variables:
130 // mode:c++
131 // compile-command: "make -C .. -k"
132 // End:
DetectorResponse(bool flag=false, int DetectorType=0, bool UseEnlargeArea=false)
bool ReadCDFFile(std::vector< PeCDF > *fCDFs, int size)
double GetAreaPerp(int itype, double theta, double ke)
double GetAreaProj(int itype, double theta, double ke)
bool ReadG4File(PeCDF &pCDF, PeCDF &pCDF_dec)
double GetPe(double ke, double theta, int itype, double f)
std::vector< std::pair< int, double > > prob
bool WriteCDFFile(std::vector< PeCDF > *fCDFs)
bool IsHit(double ke, double theta, int itype, double f)
double GetSignalBin(double f, PeCDF &fPeCDF)
double Interpolate(double *x, double *y, double f)
std::vector< std::pair< int, double > > cdf
int GetBin(double lkeo, double to, int itype, int *ibins, bool &flag)

, generated on Tue Sep 26 2023.