 |
ATLAS Offline Software
|
Go to the documentation of this file.
24 , m_bSFIsAvailableDiTau(false)
25 , m_bSFIsAvailableCheckedDiTau(false)
43 ATH_MSG_INFO(
"Initializing CommonDiTauEfficiencyTool" );
49 m_mSF = std::make_unique< tSFMAP >();
50 std::unique_ptr< TFile > fSF( TFile::Open( sInputFilePath.c_str(),
"READ" ) );
53 ATH_MSG_FATAL(
"Could not open file " << sInputFilePath.c_str());
54 return StatusCode::FAILURE;
61 std::vector<std::string> vInputFilePath;
72 return StatusCode::FAILURE;
74 return StatusCode::SUCCESS;
85 double& dEfficiencyScaleFactor)
90 dEfficiencyScaleFactor = 1.;
96 dEfficiencyScaleFactor);
99 return tmpCorrectionCode;
106 double dTotalSystematic2 = 0.;
107 double dDirection = 0.;
115 double dUncertaintySyst = 0.;
118 dDirection = syst.parameter();
121 std::string sHistName =
it->second;
122 if (dDirection>0) sHistName+=
"_up";
123 else sHistName+=
"_down";
127 tmpCorrectionCode =
getValue(sHistName,
133 return tmpCorrectionCode;
136 dUncertaintySyst *= dDirection;
139 dTotalSystematic2 += dUncertaintySyst * dUncertaintySyst;
143 dDirection = (dDirection > 0.) ? 1. : -1.;
146 dEfficiencyScaleFactor *= 1. + dDirection * std::sqrt(dTotalSystematic2);
172 ATH_MSG_DEBUG(
m_sVarName <<
" decoration is available on first ditau processed, switched of applyEfficiencyScaleFactor for further ditaus.");
173 ATH_MSG_DEBUG(
"If an application of efficiency scale factors needs to be redone, please pass a shallow copy of the original ditau.");
184 return tmpCorrectionCode;
199 TIter itNext(fFile->GetListOfKeys());
200 while ((kKey = (TKey*)itNext()))
204 std::string sKeyName = kKey->GetName();
206 std::vector<std::string> vSplitName = {};
207 split(sKeyName,
'_',vSplitName);
208 if (vSplitName[0] ==
"sf")
214 if (sKeyName.find(
"_up_") != std::string::npos or sKeyName.find(
"_down_") != std::string::npos)
218 size_t iPos = sKeyName.find(
'_');
244 std::vector<std::string> vSplitInputFilePath = {};
246 std::string sEfficiencyType = vSplitInputFilePath.at(0);
247 std::string sTruthType = vSplitInputFilePath.at(1);
248 std::transform(sEfficiencyType.begin(), sEfficiencyType.end(), sEfficiencyType.begin(), toupper);
249 std::transform(sTruthType.begin(), sTruthType.end(), sTruthType.begin(), toupper);
250 std::string sSystematicBaseString =
"TAUS_"+sTruthType+
"_EFF_"+sEfficiencyType+
"_";
255 for (
auto mSF : *
m_mSF)
258 std::vector<std::string> vSplitNP = {};
259 split(mSF.first,
'_',vSplitNP);
260 std::string sNP = vSplitNP.at(0);
261 std::string sNPUppercase = vSplitNP.at(0);
263 if (sNP ==
"sf")
continue;
265 bool bIsRecommended =
false;
266 if (isupper(sNP.at(0)))
267 bIsRecommended =
true;
269 std::transform(sNPUppercase.begin(), sNPUppercase.end(), sNPUppercase.begin(), toupper);
270 std::string sSystematicString = sSystematicBaseString+sNPUppercase;
280 ATH_MSG_DEBUG(
"connected base name " << sNP <<
" with systematic " <<sSystematicString);
292 double& dEfficiencyScaleFactor)
const
295 auto it = mSF.find (sHistName);
298 ATH_MSG_ERROR(
"Object with name "<<sHistName<<
" was not found in input file.");
300 for (
auto eEntry : mSF)
313 double dVars[3] = {dX, dY, dZ};
316 return (std::get<1>(tTuple))(std::get<0>(tTuple), dEfficiencyScaleFactor, dVars);
324 return acc( xDiTau ) * 0.001;
332 return acc( xDiTau ) * 0.001;
340 return acc( xDiTau );
size_t size() const
returns: size of the set
Class to wrap a set of SystematicVariations.
@ Error
Some error happened during the object correction.
Helper class to provide type-safe access to aux data.
::StatusCode StatusCode
StatusCode definition for legacy code.
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
@ Ok
The correction was done successfully.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Return value from object correction CP tools.