ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ECCEdRICHFastPIDMap.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ECCEdRICHFastPIDMap.h
1 // $Id: $
2 
11 #ifndef ECCEdRICHFastPIDMap_H_
12 #define ECCEdRICHFastPIDMap_H_
13 
14 #include "ECCEFastPIDMap.h"
15 
16 #include <string>
17 
18 #include <cmath>
19 
20 class TH2F;
21 class TF1;
22 
23 #include <TGraph.h>
29 public:
31  virtual ~ECCEdRICHFastPIDMap();
32 
34  void dualRICH_aerogel();
35  void dualRICH_C2F6();
36 
38  getFastSmearLogLikelihood(int truth_pid, const double momentum,
39  const double theta) const override;
40 
41  enum type { pi_k, k_p };
42 
44 
46  void setIndex(double val) { mIndex = val; };
47  void setEfficiency(double val) { mEfficiency = val; };
48  void setMinPhotons(double val) { mMinPhotons = val; };
49  void setThresholdMode(bool val) { mThresholdMode = val; };
50 
51  void setChromaticSigma(int n, double *valx, double *valy) {
52  if (mChromaticSigma)
53  delete mChromaticSigma;
54  mChromaticSigma = new TGraph(n, valx, valy);
55  }
56  void setPositionSigma(int n, double *valx, double *valy) {
57  if (mPositionSigma)
58  delete mPositionSigma;
59  mPositionSigma = new TGraph(n, valx, valy);
60  }
61  void setEmissionSigma(int n, double *valx, double *valy) {
62  if (mEmissionSigma)
63  delete mEmissionSigma;
64  mEmissionSigma = new TGraph(n, valx, valy);
65  }
66  void setFieldSigma(int n, double *valx, double *valy) {
67  if (mFieldSigma)
68  delete mFieldSigma;
69  mFieldSigma = new TGraph(n, valx, valy);
70  }
71  void setTrackingSigma(int n, double *valx, double *valy) {
72  if (mTrackingSigma)
73  delete mTrackingSigma;
74  mTrackingSigma = new TGraph(n, valx, valy);
75  }
76 
78  double numSigma(double eta, double p, type PID) const;
79 
80  double cherenkovAngle(double p, double m) const {
81  return acos(sqrt(m * m + p * p) / (mIndex * p));
82  };
83  double cherenkovThreshold(double m) const {
84  return m / sqrt(mIndex * mIndex - 1.);
85  };
86  double numberOfPhotons(double angle) const {
87  return 490. * sin(angle) * sin(angle) * mLength;
88  };
89  double numberOfDetectedPhotons(double angle) const {
90  return numberOfPhotons(angle) * mEfficiency;
91  };
92  double cherenkovAngleSigma(double eta, double p, double m) const;
93 
94  double etaMin() const;
95  double etaMax() const;
97  void setType(EDetector_t val) { mType = val; };
98  void setName(const std::string &val) { mName = val; };
99  void setLength(double val) { mLength = val; };
100  void setRadius(double val) { mRadius = val; };
101  void setPositionZ(double val) { mPositionZ = val; };
102  void setRadiusIn(double val) { mRadiusIn = val; };
103  void setRadiusOut(double val) { mRadiusOut = val; };
104  void setMagneticField(double val) { mMagneticField = val; };
105 
106 protected:
107  // RICH parameters
108  double mIndex = 1.0014; // refractive index
109  double mEfficiency = 0.25; // overall photon detection efficiency
110  double mMinPhotons = 3.; // minimum number of detected photons
111 
112  // contributions to resolution
113  TGraph *mChromaticSigma =
114  nullptr; // chromatic resolution vs. polar angle [rad]
115  TGraph *mPositionSigma = nullptr; // position resolution vs. polar angle [rad]
116  TGraph *mEmissionSigma = nullptr; // emission resolution vs. polar angle [rad]
117  TGraph *mFieldSigma = nullptr; // field resolution vs. polar angle [rad]
118  TGraph *mTrackingSigma = nullptr; // tracking resolution vs. polar angle [rad]
119 
120  // threshold mode
121  bool mThresholdMode = true;
122 
123  bool initialized = false;
124  std::string mName = "genericDetector";
125  std::string mDescription = "Detector description";
127  double mLength = 200.; // [cm]
128  double mRadius = 200.; // [cm]
129  double mPositionZ = 200.; // [cm]
130  double mRadiusIn = 20.; // [cm]
131  double mRadiusOut = 200.; // [cm]
132  double mMagneticField = 2.; // [T]
133 
134  const double mLightSpeed = 29.9792458; // speed of light [cm/ns]
135  const double mMassElectron = 0.00051099891; // electron mass [GeV]
136  const double mMassPion = 0.13957018; // pion mass [GeV]
137  const double mMassKaon = 0.493677; // kaon mass [GeV]
138  const double mMassProton = 0.93827208816; // proton mass [GeV]
139 };
140 
141 #endif /* ECCEdRICHFastPIDMap_H_ */