12#include <TProfile2D.h>
21 m_file = TFile::Open(filename.c_str());
23 std::cerr <<
"FATAL: cannot open " << filename << std::endl;
26 for (
int iperiod=0;iperiod<6;iperiod++) {
27 for (
int igap=0;igap<2;igap++) {
29 snprintf(name,
sizeof(name),
"h%d%d",iperiod+1,igap);
30 m_hHV[iperiod][igap]=(TProfile2D*) (
m_file->Get(name));
31 if (not
m_hHV[iperiod][igap]) {
32 std::cerr <<
"FATAL: cannot find " << name << std::endl;
47 if (std::fabs(
eta) > 1.5)
return 1.;
48 if (
run<200804)
return 1.;
50 if (
run<204932) iperiod=0;
51 else if (
run<205112) iperiod=1;
52 else if (
run<211670) iperiod=2;
53 else if (
run<212619) iperiod=3;
54 else if (
run<212809) iperiod=4;
58 int ieta=(int)((
eta+1.6)/0.4);
59 if (ieta<0 || ieta>7)
return 1.;
61 int iphi=(int)(
phi*(32./(2*
M_PI)));
66 float hv1 =
m_hHV[iperiod][0]->GetBinContent(ieta+1,iphi+1);
67 float hv2 =
m_hHV[iperiod][1]->GetBinContent(ieta+1,iphi+1);
79 if ((c1+c2)<0.01)
return 1.;
80 float oldScale = (c1+c2);
81 float newScale = (c1*delta1*extra1 + c2*delta2*extra2);
83 float newCorr = oldScale/newScale;
101 float nominal = 2000.;
104 int ieta=(std::fabs(
eta)/0.025);
106 if (ieta>=0 && ieta<16) d = 0.196;
107 else if (ieta>=16 && ieta<32) d = 0.193;
108 else if (ieta>=32 && ieta<48) d = 0.2;
111 if (hv>(nominal-2.))
return 1.;
112 double efield=std::fabs(hv)/(d*1e+3);
113 double enominal=nominal/(d*1e+3);
114 double scale=
Respo(efield, enominal,T);
122 if (e < -999.)
return 1.;
123 if (e < 0.01)
return 0;
124 if ( e > e_nominal )
return 1;
126 float resp = den == 0 ? 0 : (
InvCharge(e_nominal)*
vdrift(e,tempe))/den;
134 if ( e > 2.) q=(1.+0.36/e);
135 else if (e>1e-6) q =(1.04+0.25/e);
142 const float T = tempe;
143 static const float P[6] = {-0.01481,-0.0075,0.141,12.4,1.627,0.317};
144 if ( e < -999.)
return 0.;
145 float vd = (
P[0]*T+1)*(
P[2]*e*std::log(1+ (
P[3]/e)) +
P[4]*std::pow(e,
P[5])) +
P[1]*T;
157 if (hv>1300.)
return 1.;
159 if (
eta<-1.2)
return 0.9925;
160 if (
eta<-0.8)
return 0.9918;
161 if (
eta<-0.4)
return 0.9889;
162 if (
eta<0.)
return 0.9935;
163 if (
eta<0.4)
return 0.9908;
164 if (
eta<0.8)
return 0.99197;
165 if (
eta<1.2)
return 0.9974;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
static float Respo(float e, float e_nominal, float tempe)
static float getDataCorrection(float hv, float eta)
static float getRecoCorrection(float hv, float eta)
static float InvCharge(float e)
float getCorr(int run, float eta, float phi) const
get correction factor to apply to raw EMBPS energy : corrected raw EMBPS energy = correction factor *...
static float getExtraScaleFactor()
corr_HV_EMBPS()
constructor (initialization done there reading a root file for the HV maps per period
static float vdrift(float e, float tempe)
int run(int argc, char *argv[])