5 static const double pi;
6 static const double SPiO2;
7 static const double S2;
32 CrystalBall(
double m_,
double s_,
double a_,
double n_){
36 void init(
double m_,
double s_,
double a_,
double n_){
43 double expa = exp(-fa*fa/2);
44 double A = pow(n/fa, n)*expa;
45 double C1 = n/fa/(n-1)*expa;
46 double D1 = 2*SPiO2*erf(fa/S2);
65 double pdf(
double x)
const{
67 if(d<-a)
return NA*pow(B-d, -n);
68 if(d> a)
return NA*pow(B+d, -n);
72 double pdf(
double x,
double ks,
double dm)
const{
73 double d=(x-m-dm)/(s*ks);
74 if(d<-a)
return NA/ks*pow(B-d, -n);
75 if(d> a)
return NA/ks*pow(B+d, -n);
76 return N/ks*exp(-d*d/2);
79 double cdf(
double x)
const{
81 if(d<-a)
return NC / pow(F-s*d/G, n-1);
82 if(d> a)
return NC * (C - pow(F+s*d/G, 1-n) );
83 return Ns*(D-SPiO2*erf(-d/S2));
86 double invcdf(
double u)
const{
87 if(u<cdfMa)
return m + G*(F - pow(NC/u, k) );
88 if(u>cdfPa)
return m - G*(F - pow(C-u/NC, -k) );
89 return m - S2*s*TMath::ErfInverse((D - u/Ns ) / SPiO2);
92 const double CrystalBall::pi = TMath::Pi();
93 const double CrystalBall::SPiO2 = sqrt(TMath::Pi()/2.0);
94 const double CrystalBall::S2 = sqrt(2.0);
99 static const int NMAXETA=12;
100 static const int NMAXTRK=12;
106 double BETA[NMAXETA+1];
107 double ntrk[NMAXETA][NMAXTRK+1];
108 double dtrk[NMAXETA][NMAXTRK+1];
110 double width[NMAXETA][NMAXTRK];
111 double alpha[NMAXETA][NMAXTRK];
112 double power[NMAXETA][NMAXTRK];
114 double rmsA[NMAXETA][NMAXTRK];
115 double rmsB[NMAXETA][NMAXTRK];
116 double rmsC[NMAXETA][NMAXTRK];
118 double kDat[NMAXETA];
119 double kRes[NMAXETA];
121 int getBin(
double x,
const int NN,
const double *b)
const;
125 enum TYPE {MC, Data, Extra};
130 int getEtaBin(
double feta)
const;
131 int getNBinDT(
double v,
int H)
const;
132 int getNBinMC(
double v,
int H)
const;
133 double getUrnd(
int H,
int F,
double v)
const;
135 void init(std::string filename);
141 double Sigma(
double pt,
int H,
int F)
const;
142 double kSpread(
double gpt,
double rpt,
double eta,
int nlayers,
double w)
const;
143 double kSmear(
double pt,
double eta, TYPE type,
double v,
double u)
const;
144 double kSmear(
double pt,
double eta, TYPE type,
double v,
double u,
int n)
const;
145 double kExtra(
double pt,
double eta,
int nlayers,
double u,
double w)
const;
146 double getkDat(
int H)
const{
return kDat[H];}
147 double getkRes(
int H)
const{
return kRes[H];}
153 static const int NMAXETA=22;
154 static const int NMAXPHI=16;
155 static const double MPHI;
160 double BETA[NMAXETA+1];
163 double M[2][NMAXETA][NMAXPHI];
164 double A[2][NMAXETA][NMAXPHI];
165 double D[2][NMAXETA];
169 int getBin(
double x,
const int NN,
const double *b)
const;
170 int getBin(
double x,
const int nmax,
const double xmin,
const double dx)
const;
178 RocOne(std::string filename,
int iTYPE=0,
int iSYS=0,
int iMEM=0);
179 bool checkSYS(
int iSYS,
int iMEM,
int kSYS=0,
int kMEM=0);
180 bool checkTIGHT(
int iTYPE,
int iSYS,
int iMEM,
int kTYPE=0,
int kSYS=0,
int kMEM=0);
182 void init(std::string filename,
int iTYPE=0,
int iSYS=0,
int iMEM=0);
184 double kScaleDT(
int Q,
double pt,
double eta,
double phi)
const;
185 double kScaleMC(
int Q,
double pt,
double eta,
double phi,
double kSMR=1)
const;
186 double kScaleAndSmearMC(
int Q,
double pt,
double eta,
double phi,
int n,
double u,
double w)
const;
187 double kScaleFromGenMC(
int Q,
double pt,
double eta,
double phi,
int n,
double gt,
double w)
const;
188 double kGenSmear(
double pt,
double eta,
double v,
double u, RocRes::TYPE TT=RocRes::Data)
const;
190 double getM(
int T,
int H,
int F)
const{
return M[T][H][F];}
191 double getA(
int T,
int H,
int F)
const{
return A[T][H][F];}
192 double getK(
int T,
int H)
const{
return T==DT?RR.getkDat(H):RR.getkRes(H);}
193 RocRes& getR() {
return RR;}
200 RoccoR(std::string dirname);
203 void init(std::string dirname);
205 double kGenSmear(
double pt,
double eta,
double v,
double u, RocRes::TYPE TT=RocRes::Data,
int s=0,
int m=0)
const;
206 double kScaleDT(
int Q,
double pt,
double eta,
double phi,
int s=0,
int m=0)
const;
208 double kScaleAndSmearMC(
int Q,
double pt,
double eta,
double phi,
int n,
double u,
double w,
int s=0,
int m=0)
const;
209 double kScaleFromGenMC(
int Q,
double pt,
double eta,
double phi,
int n,
double gt,
double w,
int s=0,
int m=0)
const;
212 double getM(
int T,
int H,
int F,
int E=0,
int m=0)
const{
return RC[E][m].getM(T,H,F);}
213 double getA(
int T,
int H,
int F,
int E=0,
int m=0)
const{
return RC[E][m].getA(T,H,F);}
214 double getK(
int T,
int H,
int E=0,
int m=0)
const{
return RC[E][m].getK(T,H);}
216 int Nset()
const{
return RC.size();}
217 int Nmem(
int s=0)
const{
return RC[s].size();}
220 std::vector<std::vector<RocOne> > RC;
Definition: Rochester.h:151
Definition: Rochester.h:97
Definition: Rochester.h:197
Definition: Rochester.h:4