51 const char* fullInpFilePath;
52 if (!
m_fname.empty()) fullInpFilePath = gSystem->ExpandPathName (
m_fname.c_str());
53 else fullInpFilePath = gSystem->ExpandPathName (
"$ROOTCOREBIN/data/HIEventUtils/HIRun2PileUp_PbPb5p02_v2.root");
54 if (gSystem->AccessPathName(fullInpFilePath))
throw std::invalid_argument((
"File not found at \"" + (std::string)fullInpFilePath +
"\"").c_str());
56 ATH_MSG_INFO((
"Read pileup cuts from " + (std::string)fullInpFilePath).c_str());
57 TFile*
fIn =
new TFile(fullInpFilePath);
60 hname =
"hEvents";
if (!(
fIn->GetListOfKeys()->Contains(
hname.c_str()))) {
61 fIn->Close();
throw std::invalid_argument((
"Expected histogram \"" +
hname +
"\" not found in \"" +
m_fname +
"\"").c_str());}
62 hname =
"hPileUp";
if (!(
fIn->GetListOfKeys()->Contains(
hname.c_str()))) {
63 fIn->Close();
throw std::invalid_argument((
"Expected histogram \"" +
hname +
"\" not found in \"" +
m_fname +
"\"").c_str());}
64 hname =
"hCut";
if (!(
fIn->GetListOfKeys()->Contains(
hname.c_str()))) {
65 fIn->Close();
throw std::invalid_argument((
"Expected histogram \"" +
hname +
"\" not found in \"" +
m_fname +
"\"").c_str());}
66 hname =
"hEff";
if (!(
fIn->GetListOfKeys()->Contains(
hname.c_str()))) {
67 fIn->Close();
throw std::invalid_argument((
"Expected histogram \"" +
hname +
"\" not found in \"" +
m_fname +
"\"").c_str());}
68 hname =
"hPurity";
if (!(
fIn->GetListOfKeys()->Contains(
hname.c_str()))) {
69 fIn->Close();
throw std::invalid_argument((
"Expected histogram \"" +
hname +
"\" not found in \"" +
m_fname +
"\"").c_str());}
71 m_hEvents = (TH2D*)((TH2D*)
fIn->Get(
"hEvents"))->Clone(
"hEvents_HIPileupTool");
m_hEvents->SetDirectory(0);
72 m_hPileUp = (TH2D*)((TH2D*)
fIn->Get(
"hPileUp"))->Clone(
"hPileUp_HIPileupTool");
m_hPileUp->SetDirectory(0);
73 m_hCut = (TH1D*)((TH1D*)
fIn->Get(
"hCut"))->Clone(
"hCut_HIPileupTool");
m_hCut->SetDirectory(0);
74 m_hEff = (TH1D*)((TH1D*)
fIn->Get(
"hEff"))->Clone(
"hEff_HIPileupTool");
m_hEff->SetDirectory(0);
75 m_hPurity = (TH1D*)((TH1D*)
fIn->Get(
"hPurity"))->Clone(
"hPurity_HIPileupTool");
m_hPurity->SetDirectory(0);
103 for (
int ibx=0;ibx<
m_hPileUp->GetNbinsX();ibx++) {
106 if (
m_hPileUp->Integral(ibx+1,ibx+1,1,NY) == 0) {
m_hCut->SetBinContent(ibx+1,0);
continue;}
109 for (
int iby=0;iby<NY;iby++) {
111 m_hCut->SetBinContent(ibx+1,
m_hPileUp->GetYaxis()->GetBinCenter(NY-iby));
break;
115 for (
int ibx=0;ibx<
m_hEvents->GetNbinsX();ibx++) {
122 double pty = pu_cut/pu_all;
124 if (pu_all!=0)
m_hPurity->SetBinContent(ibx+1,pty);
127 return StatusCode::SUCCESS;
132 bool kPileup =
false;
133 double FCal_Et =
get_et(evShCont);
136 if (nNeutrons >
m_hCut->GetBinContent(
m_hCut->FindFixBin(FCal_Et))) kPileup =
true;
143 FCal_Et =
get_et(evShCont);
144 return m_hEff->GetBinContent(
m_hEff->FindFixBin(FCal_Et));
149 FCal_Et =
get_et(evShCont);
156 Fcal_Et = evShCont.
at(5)->et()*1
e-6;
164 for (
const auto *zdcModule : ZdcCont) {
165 if (zdcModule->zdcType()!=0)
continue;
169 float modE = CalibEnergyAcc(*zdcModule);
172 if (!
isCalib)
throw std::invalid_argument(
"ZDC Module not Calibrated");
202 bool pileup_dec = !
is_pileup(evShCont, ZdcCont);