StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StdEdxModel.h
1 #ifndef StdEdxModel_h
2 #define StdEdxModel_h
3 #include <assert.h>
4 #include "Riostream.h"
5 #include "TROOT.h"
6 #include "TSystem.h"
7 #include "TMath.h"
8 #include "TH1.h"
9 #include "TH2.h"
10 #include "TFile.h"
11 #include "TString.h"
12 #include "TF1.h"
13 #include "TSpline.h"
15 };
16 class StdEdxModel {
17  // Np = no. of primary clusters
18  // ne == n = no. of conductining electorns
19  public:
20  enum ETpcType {kTpcOuter = 0, kTpcInner = 1, kTpcAll};
21  enum EValType {kProb, kdProbdX, kdProbdY};
22  virtual ~StdEdxModel();
23  static StdEdxModel* instance();
24  static Double_t gausw(Double_t *x, Double_t *p); // vesus ksi, w, alpha
25  static Double_t ggaus(Double_t *x, Double_t *p); // versus mu, sigm, alpha
26  static Double_t ggausD(Double_t *x, Double_t *p, Double_t *der = 0); // versus mu, sigm, alpha wth derivatives
27  static Double_t gausexp(Double_t *x, Double_t *p); // versus mu, sigma, k
28  static Double_t gausexpD(Double_t *x, Double_t *p, Double_t *der = 0); // versus mu, sigma, k
29  Double_t dNdx(Double_t poverm, Double_t charge = 1.0);
30  TF1 *dNdxL10F();
31  static Double_t dNdxL10func(Double_t *x, Double_t *p);
32  Double_t dNdxEff(Double_t poverm, Double_t charge = 1.0, Double_t mass = 0.13956995);
33  static Double_t dNdxEffL10func(Double_t *x, Double_t *p);
34  TF1 *dNdxEffL10F();
35  Double_t dNdE();
36  static Double_t saturationFunc(Double_t *x, Double_t *p); // nP saturation versus beta*gamma from TpcRS (nP/dX - dN/dx_model)
37  TF1 *GGaus() {return fGGaus;}
38  TF1 *GausExp() {return fGausExp;}
39  TF1 *Saturation(Int_t particle=0);
40  static Double_t saturationTanH(Double_t *x, Double_t *p); // nP saturation versus beta*gamma from TpcRS (nP/dX - dN/dx_model)
41  TF1 *SaturTanH();
42  static Double_t extremevalueG(Double_t *x, Double_t *p); // Sum of extreme value distribution and Gauss
43  TF1 *ExValG();
44  Double_t keVperElectron() {return TMath::Exp(fLogkeVperElectron);}
45  Double_t GeVperElectron() {return 1e-6*keVperElectron();}
46  Double_t E(Double_t ne) {return ne*GeVperElectron();} // deposited energy GeV from ne
47  Double_t n(Double_t e) {return e/GeVperElectron();} // ne from energy (GeV)
48  Double_t LogE(Double_t Logne) {return fLogkeVperElectron + Logne + TMath::Log(1e-6);} // deposited energy GeV from ne
49  Double_t Logne(Double_t LogE) {return LogE - fLogkeVperElectron - TMath::Log(1e-6);} // ne from energy (GeV)
50  void Parameters(Double_t Np, Double_t *pars, Double_t *dPardNp = 0);
51  Double_t Parameter(Double_t Np, Int_t k = 0, Double_t *dPardNp = 0);
52  static Double_t funParam(Double_t *x, Double_t *p);
53  TF1 *FParam(Int_t l = 0); // l = 0 -> mu, l = 1 -> sigma, l = 2 -> alpha
54  Double_t MukeV(Double_t Np); // log(dE) (keV)
55  Double_t Sigma(Double_t Np) {return Parameter(Np, 1);}
56  Double_t Alpha(Double_t Np) {return Parameter(Np, 2);}
57  Double_t LogdEMPV(Double_t Np) {return LogdEMPVGeV(Np);}
58  Double_t LogdEMPVeV (Double_t Np) {return LogdEMPVkeV(Np) + TMath::Log(1e3);}
59  Double_t LogdEMPVkeV(Double_t Np) {return MukeV(Np);} // log(dE) (keV)
60  Double_t LogdEMPVGeV(Double_t Np) {return MukeV(Np) + TMath::Log(1e-6);} // log(dE) (keV)
61  Double_t Prob(Double_t ee, Double_t Np, Double_t *der = 0); // probability for give log(dE/Np) versus Np
62  static Double_t funcProb(Double_t *x, Double_t *p);
63  TF1 *FProb();
64  static Double_t funcProbP(Double_t *p, Double_t *x);
65  TF1 *FProbP();
66  static Double_t funcProbDer(Double_t *x, Double_t *p);
67  TF1 *FProbDer();
68  Double_t ProbdEGeVlog(Double_t dEGeVLog, Double_t Np, Double_t *der = 0); // probability for give log(dE(GeV)) versus Np
69  void SetScale(Double_t scale = 1.0) {fScale = scale;}
70  Double_t dNdxScale() {return fScale;}
71  static Double_t zMP(Double_t *x, Double_t *p); // most probable log (dE) versus x = log10(p/M) and p[0] = log2dx, p[1] = charge, and p[2] = mass
72  TF1 *ZMP(Double_t log2dx = 1, Double_t charge = 1, Double_t mass = 0.1395699);
73  // from 100 keV Tcut (GEXNor.C)
74  void InitPar();
75  Double_t tmaxL10eV(Double_t betagamma); // eV
76  Double_t bgCorrected(Double_t bg); // Correction for reconstructed bega*gamma
77  Double_t NpCorrection(Double_t betagamma); // Correction for effective no. of primary clusters which produce conducting electrons
78  TH1D *protonEff();
79  private:
80  StdEdxModel();
81  static StdEdxModel *fgStdEdxModel;
82  static Int_t _debug;
83  Double_t fScale;
84  Double_t fTmaxL10eV;
85  Char_t beg[1];
86  Double_t fLogkeVperElectron;
87  TH1D *mdNdx;
88  TH1D *mdNdxL10;
89  TH1D *mLndNdxL10;
90  TH1D *mLndNdxL10Smooth;
91  TSpline5 *mLndNdxL10Spline5;
92  TH1D *mdNdEL10;
93  TF1 *fGGaus;
94  TF1 *fGausExp;
95  TF1 *fpol2F;
96  TF1 *fpol5F;
97  TF1 *fpol6F;
98  TF1 *fpol7F;
99  Char_t end[1];
100  ClassDef(StdEdxModel,0)
101 };
102 #endif