5 #ifndef JETCALIBTOOLS_PURESIDUAL3DCORRECTION_H
6 #define JETCALIBTOOLS_PURESIDUAL3DCORRECTION_H
43 pt_ref = pt_ref - areaCorr - calibration3D;
95 const std::string ¶m3D_name =
"param3D",
96 const std::string ¶mDelta_name =
"paramDeltaPt",
97 const std::string &etaBins_name =
"etaBins"
99 std::unique_ptr<TFile> tmpF(TFile::Open(
fileName.c_str() ));
100 std::vector<float> * etaBins_v = (std::vector<float>*)tmpF->Get(etaBins_name.c_str());
101 std::vector<double>
tmp(etaBins_v->begin(), etaBins_v->end() );
103 TList *param3D_l = (TList*) tmpF->Get(param3D_name.c_str());
105 TList *param3D_p0 = (TList*) param3D_l->At(0);
107 TList *param3D_p1 = (TList*) param3D_l->At(1);
110 TList *param3D_p2 =
nullptr;
112 param3D_p2 = (TList*) param3D_l->At(2);
116 for(
size_t i=0 ;
i<(etaBins_v->size()-1);
i++){
128 TList* paramDelta_l = (TList*) tmpF->Get(paramDelta_name.c_str());
146 int nTot = refHisto->GetNcells();
147 TAxis * xax = refHisto->GetXaxis();
148 TAxis * yax = refHisto->GetYaxis();
149 float xscale = 1./(xax->GetXmax()-xax->GetXmin()); xscale *= xscale;
150 float yscale = 1./(yax->GetXmax()-yax->GetXmin()); yscale *= yscale;
151 int nbinX = xax->GetNbins();
152 int nbinY = yax->GetNbins();
157 for(
int xi=1;xi<nbinX+1;xi++)
for(
int yi=1;yi<nbinY+1;yi++) {
158 int bi = refHisto->GetBin(xi,yi);
159 if(refHisto->GetBinContent( bi ) >-999.)
continue;
162 float x0 = xax->GetBinCenter(xi);
163 float y0 = yax->GetBinCenter(yi);
166 for(
int xj=1;xj<nbinX+1;xj++)
for(
int yj=1;yj<nbinY+1;yj++) {
167 int bj = refHisto->GetBin(xj,yj);
168 if(refHisto->GetBinContent( bj ) <=-999.)
continue;
169 float x = xax->GetBinCenter(xj);
170 float y = yax->GetBinCenter(yj);
171 float dr2 = (x0-
x)*(x0-
x)*xscale+(y0-
y)*(y0-
y)*yscale;
172 if(dr2<minDr2){ minDr2 = dr2; clBin = bj;}
234 if ( (
p0<= -999.9) || (
p1<=-999.9) )
return 0;
238 if (
p2<=-999.9 )
return 0;
251 if ( (
p0<= -999.9) || (
p1<=-999.9) )
return 0;
255 if (
p2<=-999.9 )
return 0;