34 ATH_MSG_INFO(
"Initializing TauEfficiencyCorrectionsTool" );
39 ATH_MSG_WARNING(
"Truth match check will be skipped. This is ONLY FOR TESTING PURPOSE!");
44 ATH_MSG_ERROR(
"Could not retrieve any EfficiencyCorrectionType");
45 return StatusCode::FAILURE;
52 return StatusCode::FAILURE;
57 if (!registry.registerSystematics(*
this))
60 return StatusCode::FAILURE;
65 return StatusCode::SUCCESS;
70 return StatusCode::SUCCESS;
89 return StatusCode::SUCCESS;
100 return StatusCode::SUCCESS;
106 ATH_MSG_DEBUG(
"TauEfficiencyCorrectionsTool with name " << name() <<
" is configured as follows:" );
108 ATH_MSG_DEBUG(
" EfficiencyCorrectionTypes " << iEfficiencyCorrectionType );
127 double& eff,
unsigned int )
140 double dToolEff = 1.;
143 return tmpCorrectionCode;
161 return tmpCorrectionCode;
170 if (
m_tTool->isAffectedBySystematic(systematic))
181 sAffectingSystematics.
insert(
m_tTool->affectingSystematics());
182 return sAffectingSystematics;
190 sRecommendedSystematics.
insert(
m_tTool->recommendedSystematics());
191 return sRecommendedSystematics;
198 return StatusCode::SUCCESS;
204 std::string sDirectory =
"TauAnalysisTools/" + std::string(
sSharedFilesVersion) +
"/EfficiencyCorrections/";
218 return StatusCode::FAILURE;
232 if (sJetIDWP.empty()) {
233 ATH_MSG_WARNING(
"Could not find valid ID working point. Skip ID efficiency corrections.");
238 asg::AsgToolConfig config(
"TauAnalysisTools::CommonEfficiencyTool/JetIDHadTauTool_tauID_"+sJetIDWP);
242 ATH_CHECK(config.setProperty(
"WP", sJetIDWP));
251 m_sVarName =
"TauScaleFactorReconstructionHadTau";
272 return StatusCode::FAILURE;
279 asg::AsgToolConfig config(
"TauAnalysisTools::CommonEfficiencyTool/EleIDHadTauTool_eRNN_"+ele_wp);
283 ATH_CHECK(config.setProperty(
"WP", ele_wp));
284 ATH_CHECK(config.setProperty(
"UseTauSubstructure",
false));
295 ATH_MSG_WARNING(
"No fast-sim recommendation for tau electron veto, using full sim");
307 return StatusCode::FAILURE;
317 return StatusCode::FAILURE;
329 return StatusCode::FAILURE;
339 return StatusCode::FAILURE;
349 asg::AsgToolConfig config(
"TauAnalysisTools::CommonEfficiencyTool/EleIDHadTauTool_eRNN_"+ele_wp);
353 ATH_CHECK(config.setProperty(
"WP", ele_wp));
354 ATH_CHECK(config.setProperty(
"UseTauSubstructure",
false));
363 ATH_MSG_ERROR(
"Property \"Trigger\" was not set, please provide a trigger name.");
364 return StatusCode::FAILURE;
369 if (
m_sTriggerName.value().find(
"mediumRNN_tracktwoMVA") != std::string::npos) {
373 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");
374 return StatusCode::FAILURE;
377 if (
m_sTriggerName.value().find(
"mediumRNN_tracktwoMVA") != std::string::npos) {
381 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");
382 return StatusCode::FAILURE;
385 if (
m_sTriggerName.value().find(
"tracktwoEF") != std::string::npos) {
392 }
else if (
m_sTriggerName.value().find(
"tracktwo") != std::string::npos) {
396 }
else if (
m_sTriggerName.value().find(
"tau125") != std::string::npos) {
399 }
else if (
m_sTriggerName.value().find(
"tau60") != std::string::npos) {
406 ATH_MSG_ERROR(
"Trigger " <<
m_sTriggerName <<
" is not supported. Please fix \"TriggerName\" property. If this is correct, then please contact the tau trigger coordinators");
407 return StatusCode::FAILURE;
410 ATH_MSG_ERROR(
"SFs are not available for " <<
m_sCampaign <<
" campaign. If the config is correct, then please contact the tau trigger coordinators");
411 return StatusCode::FAILURE;
422 ATH_CHECK(config.setProperty(
"WP", sJetIDWP));
423 ATH_CHECK(config.setProperty(
"DoTauTrig",
true));
430 ATH_MSG_WARNING(
"unsupported EfficiencyCorrectionsType with enum " << iEfficiencyCorrectionType);
434 return StatusCode::SUCCESS;
444 std::string simType(
"");
447 if(result) std::transform(simType.begin(), simType.end(), simType.begin(), ::toupper);
449 if( simType.find(
"ATLFAST3") != std::string::npos && !
m_useFastSim){
450 ATH_MSG_WARNING(
"Input file is AF3 sample but you are _not_ using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"true\"");
451 }
else if (simType.find(
"FULLG4")!=std::string::npos &&
m_useFastSim){
452 ATH_MSG_WARNING(
"Input file is full simulation but you are using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"false\"");
456 return StatusCode::SUCCESS;
467 ATH_MSG_WARNING(
"Efficiency corrections for JETIDRNNVERYLOOSE working point are not supported.");
470 return "jetrnnsigloose";
472 return "jetrnnsigmedium";
474 return "jetrnnsigtight";
476 ATH_MSG_WARNING(
"Efficiency corrections for JETIDGNTAUVERYLOOSE working point are not supported.");
479 return "jetgntausigloose";
481 return "jetgntausigmedium";
483 return "jetgntausigtight";
495 return "eleRNNTight";
497 return "eleRNNMedium";
499 return "eleRNNLoose";
526 std::string sMeasurement =
"_comb_";
529 sMeasurement =
"_Ztt_";
531 sMeasurement =
"_ttbar_";
548 return StatusCode::FAILURE;
553 ANA_MSG_ERROR(
"Failed to find the RandomRunNumber decoration. Call the apply() method from the PileupReweightingTool beforehand to get period dependent SFs.");
554 return StatusCode::FAILURE;
562 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(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.
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.