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/";
216 return StatusCode::FAILURE;
230 if (sJetIDWP.empty()) {
231 ATH_MSG_WARNING(
"Could not find valid ID working point. Skip ID efficiency corrections.");
236 asg::AsgToolConfig config(
"TauAnalysisTools::CommonEfficiencyTool/JetIDHadTauTool_tauID_"+sJetIDWP);
240 ATH_CHECK(config.setProperty(
"WP", sJetIDWP));
249 m_sVarName =
"TauScaleFactorReconstructionHadTau";
270 return StatusCode::FAILURE;
277 asg::AsgToolConfig config(
"TauAnalysisTools::CommonEfficiencyTool/EleIDHadTauTool_eRNN_"+ele_wp);
281 ATH_CHECK(config.setProperty(
"WP", ele_wp));
282 ATH_CHECK(config.setProperty(
"UseTauSubstructure",
false));
293 ATH_MSG_WARNING(
"No fast-sim recommendation for tau electron veto, using full sim");
305 return StatusCode::FAILURE;
315 return StatusCode::FAILURE;
321 return StatusCode::FAILURE;
330 return StatusCode::FAILURE;
340 asg::AsgToolConfig config(
"TauAnalysisTools::CommonEfficiencyTool/EleIDHadTauTool_eRNN_"+ele_wp);
344 ATH_CHECK(config.setProperty(
"WP", ele_wp));
345 ATH_CHECK(config.setProperty(
"UseTauSubstructure",
false));
354 ATH_MSG_ERROR(
"Property \"Trigger\" was not set, please provide a trigger name.");
355 return StatusCode::FAILURE;
360 if (
m_sTriggerName.value().find(
"mediumRNN_tracktwoMVA") != std::string::npos) {
364 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");
365 return StatusCode::FAILURE;
368 if (
m_sTriggerName.value().find(
"mediumRNN_tracktwoMVA") != std::string::npos) {
372 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");
373 return StatusCode::FAILURE;
376 if (
m_sTriggerName.value().find(
"tracktwoEF") != std::string::npos) {
383 }
else if (
m_sTriggerName.value().find(
"tracktwo") != std::string::npos) {
387 }
else if (
m_sTriggerName.value().find(
"tau125") != std::string::npos) {
390 }
else if (
m_sTriggerName.value().find(
"tau60") != std::string::npos) {
397 ATH_MSG_ERROR(
"Trigger " <<
m_sTriggerName <<
" is not supported. Please fix \"TriggerName\" property. If this is correct, then please contact the tau trigger coordinators");
398 return StatusCode::FAILURE;
401 ATH_MSG_ERROR(
"SFs are not available for " <<
m_sCampaign <<
" campaign. If the config is correct, then please contact the tau trigger coordinators");
402 return StatusCode::FAILURE;
413 ATH_CHECK(config.setProperty(
"WP", sJetIDWP));
414 ATH_CHECK(config.setProperty(
"DoTauTrig",
true));
421 ATH_MSG_WARNING(
"unsupported EfficiencyCorrectionsType with enum " << iEfficiencyCorrectionType);
425 return StatusCode::SUCCESS;
435 std::string simType(
"");
438 if(result) std::transform(simType.begin(), simType.end(), simType.begin(), ::toupper);
440 if( simType.find(
"ATLFAST3") != std::string::npos && !
m_useFastSim){
441 ATH_MSG_WARNING(
"Input file is AF3 sample but you are _not_ using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"true\"");
442 }
else if (simType.find(
"FULLG4")!=std::string::npos &&
m_useFastSim){
443 ATH_MSG_WARNING(
"Input file is full simulation but you are using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"false\"");
447 return StatusCode::SUCCESS;
458 ATH_MSG_WARNING(
"Efficiency corrections for JETIDRNNVERYLOOSE working point are not supported.");
461 return "jetrnnsigloose";
463 return "jetrnnsigmedium";
465 return "jetrnnsigtight";
467 ATH_MSG_WARNING(
"Efficiency corrections for JETIDGNTAUVERYLOOSE working point are not supported.");
470 return "jetgntausigloose";
472 return "jetgntausigmedium";
474 return "jetgntausigtight";
486 return "eleRNNTight";
488 return "eleRNNMedium";
490 return "eleRNNLoose";
517 std::string sMeasurement =
"_comb_";
520 sMeasurement =
"_Ztt_";
522 sMeasurement =
"_ttbar_";
539 return StatusCode::FAILURE;
544 ANA_MSG_ERROR(
"Failed to find the RandomRunNumber decoration. Call the apply() method from the PileupReweightingTool beforehand to get period dependent SFs.");
545 return StatusCode::FAILURE;
553 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.
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.