36 ATH_MSG_INFO(
"Initializing TauEfficiencyCorrectionsTool" );
41 ATH_MSG_WARNING(
"Truth match check will be skipped. This is ONLY FOR TESTING PURPOSE!");
46 ATH_MSG_ERROR(
"Could not retrieve any EfficiencyCorrectionType");
47 return StatusCode::FAILURE;
54 return StatusCode::FAILURE;
60 ATH_CHECK((**it).setProperty(
"OutputLevel", this->msg().level()));
69 return StatusCode::FAILURE;
74 return StatusCode::SUCCESS;
79 return StatusCode::SUCCESS;
98 return StatusCode::SUCCESS;
109 return StatusCode::SUCCESS;
115 ATH_MSG_DEBUG(
"TauEfficiencyCorrectionsTool with name " << name() <<
" is configured as follows:" );
117 ATH_MSG_DEBUG(
" EfficiencyCorrectionTypes " << iEfficiencyCorrectionType );
136 double& eff,
unsigned int )
150 double dToolEff = 1.;
153 return tmpCorrectionCode;
172 return tmpCorrectionCode;
182 if ((**it)->isAffectedBySystematic(systematic))
193 sAffectingSystematics.
insert((**it)->affectingSystematics());
194 return sAffectingSystematics;
203 sRecommendedSystematics.
insert((**it)->recommendedSystematics());
204 return sRecommendedSystematics;
211 if ((**it)->applySystematicVariation(sSystematicSet) == StatusCode::FAILURE)
212 return StatusCode::FAILURE;
213 return StatusCode::SUCCESS;
219 std::string sDirectory =
"TauAnalysisTools/" + std::string(
sSharedFilesVersion) +
"/EfficiencyCorrections/";
234 if (sJetIDWP.empty()) {
235 ATH_MSG_WARNING(
"Could not find valid ID working point. Skip ID efficiency corrections.");
244 ATH_CHECK(tTool->setProperty(
"WP", sJetIDWP));
249 m_sVarName =
"TauScaleFactorReconstructionHadTau";
266 return StatusCode::FAILURE;
277 ATH_CHECK(tTool->setProperty(
"UseTauSubstructure",
false));
284 ATH_MSG_WARNING(
"No fast-sim recommendation for tau electron veto, using full sim");
295 return StatusCode::FAILURE;
305 return StatusCode::FAILURE;
317 ATH_CHECK(tTool->setProperty(
"UseTauSubstructure",
false));
322 ATH_MSG_ERROR(
"Property \"Trigger\" was not set, please provide a trigger name.");
323 return StatusCode::FAILURE;
328 if (
m_sTriggerName.value().find(
"mediumRNN_tracktwoMVA") != std::string::npos) {
332 ATH_MSG_ERROR(
"Trigger " <<
m_sTriggerName <<
" is not supported for " <<
m_sCampaign <<
" campaign. Please fix \"TriggerName\" property. In case of doubt please consult with TauTrigger coordinators");
333 return StatusCode::FAILURE;
336 if (
m_sTriggerName.value().find(
"mediumRNN_tracktwoMVA") != std::string::npos) {
340 ATH_MSG_ERROR(
"Trigger " <<
m_sTriggerName <<
" is not supported for " <<
m_sCampaign <<
" campaign. Please fix \"TriggerName\" property. In case of doubt please consult with TauTrigger coordinators");
341 return StatusCode::FAILURE;
344 if (
m_sTriggerName.value().find(
"tracktwoEF") != std::string::npos) {
351 }
else if (
m_sTriggerName.value().find(
"tracktwo") != std::string::npos) {
355 }
else if (
m_sTriggerName.value().find(
"tau125") != std::string::npos) {
358 }
else if (
m_sTriggerName.value().find(
"tau60") != std::string::npos) {
365 ATH_MSG_ERROR(
"Trigger " <<
m_sTriggerName <<
" is not supported. Please fix \"TriggerName\" property. If this is correct, then please contact the tau trigger coordinators");
366 return StatusCode::FAILURE;
369 ATH_MSG_ERROR(
"SFs are not available for " <<
m_sCampaign <<
" campaign. If the config is correct, then please contact the tau trigger coordinators");
370 return StatusCode::FAILURE;
381 ATH_CHECK(tTool->setProperty(
"DoTauTrig",
true));
384 ATH_MSG_WARNING(
"unsupported EfficiencyCorrectionsType with enum " << iEfficiencyCorrectionType);
388 return StatusCode::SUCCESS;
398 std::string simType(
"");
401 if(result) std::transform(simType.begin(), simType.end(), simType.begin(), ::toupper);
403 if( simType.find(
"ATLFAST3") != std::string::npos && !
m_useFastSim){
404 ATH_MSG_WARNING(
"Input file is AF3 sample but you are _not_ using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"true\"");
405 }
else if (simType.find(
"FULLG4")!=std::string::npos &&
m_useFastSim){
406 ATH_MSG_WARNING(
"Input file is full simulation but you are using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"false\"");
410 return StatusCode::SUCCESS;
421 ATH_MSG_WARNING(
"Efficiency corrections for JETIDRNNVERYLOOSE working point are not supported.");
424 return "jetrnnsigloose";
426 return "jetrnnsigmedium";
428 return "jetrnnsigtight";
440 return "eleRNNTight";
442 return "eleRNNMedium";
444 return "eleRNNLoose";
471 std::string sMeasurement =
"_comb_";
474 sMeasurement =
"_Ztt_";
476 sMeasurement =
"_ttbar_";
493 return StatusCode::FAILURE;
498 ANA_MSG_ERROR(
"Failed to find the RandomRunNumber decoration. Call the apply() method from the PileupReweightingTool beforehand to get period dependent SFs.");
499 return StatusCode::FAILURE;
507 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
static const char *const sSharedFilesVersion
Version of the calibration files.
ServiceHandle< StoreGateSvc > & evtStore()
Return value from object correction CP tools.
@ Ok
The correction was done successfully.
This module implements the central registry for handling systematic uncertainties with CP tools.
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
StatusCode registerSystematics(const IReentrantSystematicsTool &tool)
effects: register all the systematics from the tool
Class to wrap a set of SystematicVariations.
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
bool eventType(EventType type) const
Check for one particular bitmask value.
@ IS_SIMULATION
true: simulation, false: data
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
EventInfo_v1 EventInfo
Definition of the latest event info version.
TauJet_v3 TauJet
Definition of the current "tau version".
FileMetaData_v1 FileMetaData
Declare the latest version of the class.