41 std::unique_ptr< TFile > fSF( TFile::Open(sInputFilePath.c_str(),
"READ") );
44 ATH_MSG_FATAL(
"Could not open file " << sInputFilePath.c_str());
45 return StatusCode::FAILURE;
55 return StatusCode::FAILURE;
57 return StatusCode::SUCCESS;
78 double dCorrection = 1.;
85 return tmpCorrectionCode;
91 double dTotalSystematic2 = 0;
92 double dDirection = 0;
99 double dUncertaintySyst = 0;
106 return tmpCorrectionCode;
109 dDirection = syst.parameter();
112 dUncertaintySyst *= dDirection;
115 dTotalSystematic2 += dUncertaintySyst * dUncertaintySyst;
119 dDirection = (dDirection > 0) ? +1 : -1;
122 dCorrection *= 1 + dDirection * std::sqrt(dTotalSystematic2);
126 xDiTau.
setP4( xDiTau.
pt() * dCorrection,
127 xDiTau.
eta(), xDiTau.
phi(), xDiTau.
m());
144 "There's a possible memory leak!" );
166 TIter itNext(fFile->GetListOfKeys());
167 while ((kKey = (TKey*)itNext()))
169 TClass *cClass = gROOT->GetClass(kKey->GetClassName());
170 std::string sKeyName = kKey->GetName();
172 if (!cClass->InheritsFrom(
"TH3"))
175 T tObj = (T)kKey->ReadObj();
176 tObj->SetDirectory(0);
177 mMap[sKeyName] = tObj;
185 std::vector<std::string> vInputFilePath;
187 std::string sInputFileName = vInputFilePath.back();
190 std::vector<std::string> vSplitInputFilePath = {};
191 split(sInputFileName,
'_',vSplitInputFilePath);
192 std::string sEfficiencyType = vSplitInputFilePath.at(0);
193 std::string sTruthType = vSplitInputFilePath.at(1);
194 std::transform(sEfficiencyType.begin(), sEfficiencyType.end(), sEfficiencyType.begin(), toupper);
195 std::transform(sTruthType.begin(), sTruthType.end(), sTruthType.begin(), toupper);
196 std::string sSystematicBaseString =
"TAUS_"+sTruthType+
"_SME_"+sEfficiencyType+
"_";
205 std::vector<std::string> vSplitNP = {};
206 split(mSF.first,
'_',vSplitNP);
207 std::string sNP = vSplitNP.at(0);
208 std::string sNPUppercase = vSplitNP.at(0);
211 if (sNP ==
"sf")
continue;
214 bool bIsRecommended =
false;
215 if (isupper(sNP.at(0)))
216 bIsRecommended =
true;
219 std::transform(sNPUppercase.begin(), sNPUppercase.end(), sNPUppercase.begin(), toupper);
220 std::string sSystematicString = sSystematicBaseString+sNPUppercase;
232 ATH_MSG_DEBUG(
"connected histogram base name " << sNP <<
" with systematic " <<sSystematicString);
240 double& dEfficiencyScaleFactor)
const
242 TH3* hHist =
m_mDTSF.at(sHistName);
245 ATH_MSG_ERROR(
"Histogram with name "<<sHistName<<
" was not found in input file.");
249 double dX =
m_fX(xDiTau);
250 double dY =
m_fY(xDiTau);
251 double dZ =
m_fZ(xDiTau);
254 dX =
std::max(dX,hHist->GetXaxis()->GetXmin());
255 dY =
std::max(dY,hHist->GetYaxis()->GetXmin());
256 dZ =
std::max(dZ,hHist->GetZaxis()->GetXmin());
258 dX =
std::min(dX,hHist->GetXaxis()->GetXmax() * .999);
259 dY =
std::min(dY,hHist->GetYaxis()->GetXmax() * .999);
260 dZ =
std::min(dZ,hHist->GetZaxis()->GetXmax() * .999);
262 int iBin = hHist->FindFixBin(dX,dY,dZ);
263 dEfficiencyScaleFactor = hHist->GetBinContent(iBin);