43 std::unique_ptr< TFile > fSF( TFile::Open(sInputFilePath.c_str(),
"READ") );
46 ATH_MSG_FATAL(
"Could not open file " << sInputFilePath.c_str());
47 return StatusCode::FAILURE;
57 return StatusCode::FAILURE;
59 return StatusCode::SUCCESS;
80 double dCorrection = 1.;
87 return tmpCorrectionCode;
93 double dTotalSystematic2 = 0;
94 double dDirection = 0;
101 double dUncertaintySyst = 0;
108 return tmpCorrectionCode;
111 dDirection = syst.parameter();
114 dUncertaintySyst *= dDirection;
117 dTotalSystematic2 += dUncertaintySyst * dUncertaintySyst;
121 dDirection = (dDirection > 0) ? +1 : -1;
124 dCorrection *= 1 + dDirection * std::sqrt(dTotalSystematic2);
128 xDiTau.
setP4( xDiTau.
pt() * dCorrection,
129 xDiTau.
eta(), xDiTau.
phi(), xDiTau.
m());
146 "There's a possible memory leak!" );
168 TIter itNext(fFile->GetListOfKeys());
169 while ((kKey = (TKey*)itNext()))
171 TClass *cClass = gROOT->GetClass(kKey->GetClassName());
172 std::string sKeyName = kKey->GetName();
174 if (!cClass->InheritsFrom(
"TH3"))
177 T tObj = (T)kKey->ReadObj();
178 tObj->SetDirectory(0);
179 mMap[sKeyName] = tObj;
187 std::vector<std::string> vInputFilePath;
189 std::string sInputFileName = vInputFilePath.back();
192 std::vector<std::string> vSplitInputFilePath = {};
193 split(sInputFileName,
'_',vSplitInputFilePath);
194 std::string sEfficiencyType = vSplitInputFilePath.at(0);
195 std::string sTruthType = vSplitInputFilePath.at(1);
196 std::transform(sEfficiencyType.begin(), sEfficiencyType.end(), sEfficiencyType.begin(), toupper);
197 std::transform(sTruthType.begin(), sTruthType.end(), sTruthType.begin(), toupper);
198 std::string sSystematicBaseString =
"TAUS_"+sTruthType+
"_SME_"+sEfficiencyType+
"_";
210 std::vector<std::string> vSplitNP = {};
211 split(mSF.first,
'_',vSplitNP);
212 std::string sNP = vSplitNP.at(0);
213 std::string sNPUppercase = vSplitNP.at(0);
216 if (sNP ==
"sf")
continue;
219 bool bIsRecommended =
false;
220 if (isupper(sNP.at(0)))
221 bIsRecommended =
true;
224 std::transform(sNPUppercase.begin(), sNPUppercase.end(), sNPUppercase.begin(), toupper);
225 std::string sSystematicString = sSystematicBaseString+sNPUppercase;
237 ATH_MSG_DEBUG(
"connected histogram base name " << sNP <<
" with systematic " <<sSystematicString);
245 double& dEfficiencyScaleFactor)
const
247 TH3* hHist =
m_mDTSF.at(sHistName);
250 ATH_MSG_ERROR(
"Histogram with name "<<sHistName<<
" was not found in input file.");
254 double dX =
m_fX(xDiTau);
255 double dY =
m_fY(xDiTau);
256 double dZ =
m_fZ(xDiTau);
259 dX =
std::max(dX,hHist->GetXaxis()->GetXmin());
260 dY =
std::max(dY,hHist->GetYaxis()->GetXmin());
261 dZ =
std::max(dZ,hHist->GetZaxis()->GetXmin());
263 dX =
std::min(dX,hHist->GetXaxis()->GetXmax() * .999);
264 dY =
std::min(dY,hHist->GetYaxis()->GetXmax() * .999);
265 dZ =
std::min(dZ,hHist->GetZaxis()->GetXmax() * .999);
267 int iBin = hHist->FindFixBin(dX,dY,dZ);
268 dEfficiencyScaleFactor = hHist->GetBinContent(iBin);