18 const std::string& thisname,
bool setInterpolation)
19 :
asg::AsgMessaging(thisname.c_str()) {
22 std::unique_ptr<TFile> gainFile(TFile::Open(
filename.c_str(),
"READ"));
25 (TH1*)(gainFile->Get(
"alpha_specialGainRun"))))
33 sprintf(
name,
"gain_Impact_elec_%d",
i);
37 sprintf(
name,
"gain_Impact_conv_%d",
i);
41 sprintf(
name,
"gain_Impact_unco_%d",
i);
47 sprintf(
name,
"gain_Impact_elec_%d_medium",
i);
52 sprintf(
name,
"gain_Impact_conv_%d_medium",
i);
57 sprintf(
name,
"gain_Impact_unco_%d_medium",
i);
62 sprintf(
name,
"gain_Impact_elec_%d_low",
i);
67 sprintf(
name,
"gain_Impact_conv_%d_low",
i);
72 sprintf(
name,
"gain_Impact_unco_%d_low",
i);
108 bool useL2GainUncertainty,
110 double aeta = std::fabs(etaCalo_input);
114 else if (aeta < 1.37)
116 else if (aeta < 1.52)
118 else if (aeta < 1.80)
120 else if (aeta < 2.50)
124 ATH_MSG_VERBOSE(
"GainUncertainty::getUncertainty " << etaCalo_input <<
" "
125 << et_input <<
" " << ptype
126 <<
" ibin " << ibin);
129 if (et_input > 999999.)
136 TH1* hImpact =
nullptr;
147 "Trying to get Gain correction of not allowed particle type");
162 "Trying to get Gain correction of not allowed particle type");
176 "Trying to get Gain correction of not allowed particle type");
181 double max_et = hImpact->GetXaxis()->GetBinUpEdge(hImpact->GetNbinsX());
183 if (0.001 * et_input > max_et) {
184 et_input = (max_et - 1.) * 1000.;
189 impact = hImpact->Interpolate(0.001 * et_input);
191 "L2 gain impact without interpolation: "
192 << hImpact->GetBinContent(hImpact->FindFixBin(0.001 * et_input)));
194 << hImpact->Interpolate(0.001 * et_input));
196 impact = hImpact->GetBinContent(hImpact->FindFixBin(0.001 * et_input));
200 if (useL2GainUncertainty)
201 ATH_MSG_INFO(
"Applying 100% uncertainy on l2 gain corrections");
208 double_t sigmaE = alphaG * impact / impactZee;
210 ATH_MSG_VERBOSE(
"alpha_specialGainRun, gain_impact_Zee, impact, sigmaE = "
211 << alphaG <<
" " << impactZee <<
" " << impact <<
" "