44 std::unique_ptr< TFile > fSF( TFile::Open(sInputFilePath.c_str(),
"READ") );
47 ATH_MSG_FATAL(
"Could not open file " << sInputFilePath.c_str());
48 return StatusCode::FAILURE;
58 return StatusCode::FAILURE;
60 return StatusCode::SUCCESS;
81 double dCorrection = 1.;
88 return tmpCorrectionCode;
94 double dTotalSystematic2 = 0;
95 double dDirection = 0;
102 double dUncertaintySyst = 0;
103 tmpCorrectionCode =
getValue(it->second,
109 return tmpCorrectionCode;
112 dDirection = syst.parameter();
115 dUncertaintySyst *= dDirection;
118 dTotalSystematic2 += dUncertaintySyst * dUncertaintySyst;
122 dDirection = (dDirection > 0) ? +1 : -1;
125 dCorrection *= 1 + dDirection * std::sqrt(dTotalSystematic2);
129 xDiTau.
setP4( xDiTau.
pt() * dCorrection,
130 xDiTau.
eta(), xDiTau.
phi(), xDiTau.
m());
147 "There's a possible memory leak!" );
152 xDiTauCopy->makePrivateStore( xDiTau );
165 return sys.find(systematic) != sys.end();
205 return StatusCode::SUCCESS;
209 double dDirection = 0.;
211 for (
auto& sSyst : sSystematicSet)
217 ATH_MSG_VERBOSE(
"unsupported systematic variation: "<< sSyst.basename()<<
"; skipping this one");
221 if (sSyst.parameter() * dDirection < 0)
223 ATH_MSG_ERROR(
"unsupported set of systematic variations, you should either use only \"UP\" or only \"DOWN\" systematics in one set!");
225 return StatusCode::FAILURE;
227 dDirection = sSyst.parameter();
231 ATH_MSG_ERROR(
"unsupported set of systematic variations, you should not combine \"TAUS_{TRUE|FAKE}_SME_TOTAL\" with other systematic variations!");
233 return StatusCode::FAILURE;
237 sSystematicSetAvailable.
insert(sSyst);
243 return StatusCode::SUCCESS;
257 TIter itNext(fFile->GetListOfKeys());
258 while ((kKey = (TKey*)itNext()))
260 TClass *cClass = gROOT->GetClass(kKey->GetClassName());
261 std::string sKeyName = kKey->GetName();
263 if (!cClass->InheritsFrom(
"TH3"))
266 T tObj = (T)kKey->ReadObj();
267 tObj->SetDirectory(0);
268 mMap[sKeyName] = tObj;
276 std::vector<std::string> vInputFilePath;
278 std::string sInputFileName = vInputFilePath.back();
281 std::vector<std::string> vSplitInputFilePath = {};
282 split(sInputFileName,
'_',vSplitInputFilePath);
283 std::string sEfficiencyType = vSplitInputFilePath.at(0);
284 std::string sTruthType = vSplitInputFilePath.at(1);
285 std::transform(sEfficiencyType.begin(), sEfficiencyType.end(), sEfficiencyType.begin(), toupper);
286 std::transform(sTruthType.begin(), sTruthType.end(), sTruthType.begin(), toupper);
287 std::string sSystematicBaseString =
"TAUS_"+sTruthType+
"_SME_"+sEfficiencyType+
"_";
296 std::vector<std::string> vSplitNP = {};
297 split(mSF.first,
'_',vSplitNP);
298 std::string sNP = vSplitNP.at(0);
299 std::string sNPUppercase = vSplitNP.at(0);
302 if (sNP ==
"sf")
continue;
305 bool bIsRecommended =
false;
306 if (isupper(sNP.at(0)))
307 bIsRecommended =
true;
310 std::transform(sNPUppercase.begin(), sNPUppercase.end(), sNPUppercase.begin(), toupper);
311 std::string sSystematicString = sSystematicBaseString+sNPUppercase;
323 ATH_MSG_DEBUG(
"connected histogram base name " << sNP <<
" with systematic " <<sSystematicString);
331 double& dEfficiencyScaleFactor)
const
333 TH3* hHist =
m_mDTSF.at(sHistName);
336 ATH_MSG_ERROR(
"Histogram with name "<<sHistName<<
" was not found in input file.");
340 double dX =
m_fX(xDiTau);
341 double dY =
m_fY(xDiTau);
342 double dZ =
m_fZ(xDiTau);
345 dX = std::max(dX,hHist->GetXaxis()->GetXmin());
346 dY = std::max(dY,hHist->GetYaxis()->GetXmin());
347 dZ = std::max(dZ,hHist->GetZaxis()->GetXmin());
349 dX = std::min(dX,hHist->GetXaxis()->GetXmax() * .999);
350 dY = std::min(dY,hHist->GetYaxis()->GetXmax() * .999);
351 dZ = std::min(dZ,hHist->GetZaxis()->GetXmax() * .999);
353 int iBin = hHist->FindFixBin(dX,dY,dZ);
354 dEfficiencyScaleFactor = hHist->GetBinContent(iBin);
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Return value from object correction CP tools.
@ Error
Some error happened during the object correction.
@ Ok
The correction was done successfully.
Class to wrap a set of SystematicVariations.
std::string name() const
returns: the systematics joined into a single string.
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
size_t size() const
returns: size of the set
void setP4(double pt, double eta, double phi, double m)
Set methods for IParticle values.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double m() const
The invariant mass of the particle.
virtual double pt() const
The transverse momentum ( ) of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
DiTauJet_v1 DiTauJet
Definition of the current version.