|
ATLAS Offline Software
|
Go to the documentation of this file.
26 , m_bSFIsAvailableDiTau(false)
27 , m_bSFIsAvailableCheckedDiTau(false)
45 ATH_MSG_INFO(
"Initializing CommonDiTauEfficiencyTool" );
51 m_mSF = std::make_unique< tSFMAP >();
52 std::unique_ptr< TFile > fSF( TFile::Open( sInputFilePath.c_str(),
"READ" ) );
55 ATH_MSG_FATAL(
"Could not open file " << sInputFilePath.c_str());
56 return StatusCode::FAILURE;
63 std::vector<std::string> vInputFilePath;
74 return StatusCode::FAILURE;
76 return StatusCode::SUCCESS;
87 double& dEfficiencyScaleFactor,
unsigned int ,
unsigned int )
92 dEfficiencyScaleFactor = 1.;
98 dEfficiencyScaleFactor);
101 return tmpCorrectionCode;
108 double dTotalSystematic2 = 0.;
109 double dDirection = 0.;
117 double dUncertaintySyst = 0.;
120 dDirection = syst.parameter();
123 std::string sHistName =
it->second;
124 if (dDirection>0) sHistName+=
"_up";
125 else sHistName+=
"_down";
129 tmpCorrectionCode =
getValue(sHistName,
135 return tmpCorrectionCode;
138 dUncertaintySyst *= dDirection;
141 dTotalSystematic2 += dUncertaintySyst * dUncertaintySyst;
145 dDirection = (dDirection > 0.) ? 1. : -1.;
148 dEfficiencyScaleFactor *= 1. + dDirection * std::sqrt(dTotalSystematic2);
164 unsigned int iRunNumber,
unsigned int iMu)
175 ATH_MSG_DEBUG(
m_sVarName <<
" decoration is available on first ditau processed, switched of applyEfficiencyScaleFactor for further ditaus.");
176 ATH_MSG_DEBUG(
"If an application of efficiency scale factors needs to be redone, please pass a shallow copy of the original ditau.");
187 return tmpCorrectionCode;
202 TIter itNext(fFile->GetListOfKeys());
203 while ((kKey = (TKey*)itNext()))
207 std::string sKeyName = kKey->GetName();
209 std::vector<std::string> vSplitName = {};
210 split(sKeyName,
'_',vSplitName);
211 if (vSplitName[0] ==
"sf")
217 if (sKeyName.find(
"_up_") != std::string::npos or sKeyName.find(
"_down_") != std::string::npos)
221 size_t iPos = sKeyName.find(
'_');
247 std::vector<std::string> vSplitInputFilePath = {};
249 std::string sEfficiencyType = vSplitInputFilePath.at(0);
250 std::string sTruthType = vSplitInputFilePath.at(1);
251 std::transform(sEfficiencyType.begin(), sEfficiencyType.end(), sEfficiencyType.begin(), toupper);
252 std::transform(sTruthType.begin(), sTruthType.end(), sTruthType.begin(), toupper);
253 std::string sSystematicBaseString =
"TAUS_"+sTruthType+
"_EFF_"+sEfficiencyType+
"_";
261 for (
auto mSF : *
m_mSF)
264 std::vector<std::string> vSplitNP = {};
265 split(mSF.first,
'_',vSplitNP);
266 std::string sNP = vSplitNP.at(0);
267 std::string sNPUppercase = vSplitNP.at(0);
269 if (sNP ==
"sf")
continue;
271 bool bIsRecommended =
false;
272 if (isupper(sNP.at(0)))
273 bIsRecommended =
true;
275 std::transform(sNPUppercase.begin(), sNPUppercase.end(), sNPUppercase.begin(), toupper);
276 std::string sSystematicString = sSystematicBaseString+sNPUppercase;
286 ATH_MSG_DEBUG(
"connected base name " << sNP <<
" with systematic " <<sSystematicString);
298 double& dEfficiencyScaleFactor)
const
301 auto it = mSF.find (sHistName);
304 ATH_MSG_ERROR(
"Object with name "<<sHistName<<
" was not found in input file.");
306 for (
auto eEntry : mSF)
319 double dVars[3] = {dX, dY, dZ};
322 return (std::get<1>(tTuple))(std::get<0>(tTuple), dEfficiencyScaleFactor, dVars);
330 return acc( xDiTau ) * 0.001;
338 return acc( xDiTau ) * 0.001;
346 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.
Helper class to provide type-safe access to aux data.