12 std::unique_ptr<TFile> adcFile(TFile::Open(
filename.c_str(),
"READ"));
13 static const std::map<TString, PATCore::ParticleType::Type> pN = {
17 for (
const auto & [ptclName, ptclType] : pN) {
18 m_hcorr[ptclType].reset(
dynamic_cast<TProfile2D*
>(
19 adcFile->Get(Form(
"linearity_%s", ptclName.Data()))));
20 m_hcorr[ptclType]->SetDirectory(
nullptr);
29 float etGeV =
et / 1000.;
40 TProfile2D*
hh =
it->second.get();
42 float aeta = std::abs(etaCalo);
46 int ix =
hh->GetXaxis()->FindBin(aeta);
47 int iy =
hh->GetYaxis()->FindBin(etGeV);
48 float y =
hh->GetYaxis()->GetBinCenter(iy);
58 int iyc =
hh->GetYaxis()->FindBin(40.);
61 corr =
hh->GetBinContent(ix, iy1);
62 if (iy1 >
hh->GetYaxis()->GetNbins())
63 corr =
hh->GetBinContent(ix, iy0);
65 float y0 =
hh->GetYaxis()->GetBinCenter(iy0);
66 float y1 =
hh->GetYaxis()->GetBinCenter(iy1);
70 ATH_MSG_ERROR(
"Unknown particle type " << pType<<
" in LinearityADC::getCorr");
73 float c0 =
hh->GetBinContent(ix, iy0) -
it->second->GetBinContent(ix, iyc);
74 float c1 =
hh->GetBinContent(ix, iy1) -
it->second->GetBinContent(ix, iyc);
76 corr = (
c1 * (etGeV - y0) +
c0 * (
y1 - etGeV)) / (
y1 - y0);