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/";
226 ATH_MSG_WARNING(
"No fast-sim recommendation for Tau RNN, using full sim");
238 if (sJetIDWP.empty()) {
239 ATH_MSG_WARNING(
"Could not find valid ID working point. Skip ID efficiency corrections.");
248 ATH_CHECK(tTool->setProperty(
"WP", sJetIDWP));
253 m_sVarName =
"TauScaleFactorReconstructionHadTau";
270 return StatusCode::FAILURE;
281 ATH_CHECK(tTool->setProperty(
"UseTauSubstructure",
false));
288 ATH_MSG_WARNING(
"No fast-sim recommendation for tau electron veto, using full sim");
299 return StatusCode::FAILURE;
309 return StatusCode::FAILURE;
321 ATH_CHECK(tTool->setProperty(
"UseTauSubstructure",
false));
326 ATH_MSG_ERROR(
"Property \"Trigger\" was not set, please provide a trigger name.");
327 return StatusCode::FAILURE;
332 if (
m_sTriggerName.value().find(
"mediumRNN_tracktwoMVA") != std::string::npos) {
336 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");
337 return StatusCode::FAILURE;
340 if (
m_sTriggerName.value().find(
"mediumRNN_tracktwoMVA") != std::string::npos) {
344 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");
345 return StatusCode::FAILURE;
348 if (
m_sTriggerName.value().find(
"tracktwoEF") != std::string::npos) {
355 }
else if (
m_sTriggerName.value().find(
"tracktwo") != std::string::npos) {
359 }
else if (
m_sTriggerName.value().find(
"tau125") != std::string::npos) {
362 }
else if (
m_sTriggerName.value().find(
"tau60") != std::string::npos) {
369 ATH_MSG_ERROR(
"Trigger " <<
m_sTriggerName <<
" is not supported. Please fix \"TriggerName\" property. If this is correct, then please contact the tau trigger coordinators");
370 return StatusCode::FAILURE;
373 ATH_MSG_ERROR(
"SFs are not available for " <<
m_sCampaign <<
" campaign. If the config is correct, then please contact the tau trigger coordinators");
374 return StatusCode::FAILURE;
385 ATH_CHECK(tTool->setProperty(
"DoTauTrig",
true));
388 ATH_MSG_WARNING(
"unsupported EfficiencyCorrectionsType with enum " << iEfficiencyCorrectionType);
392 return StatusCode::SUCCESS;
402 std::string simType(
"");
405 if(
result) std::transform(simType.begin(), simType.end(), simType.begin(), ::toupper);
407 if( simType.find(
"ATLFAST3") != std::string::npos && !
m_useFastSim){
408 ATH_MSG_WARNING(
"Input file is AF3 sample but you are _not_ using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"true\"");
409 }
else if (simType.find(
"FULLG4")!=std::string::npos &&
m_useFastSim){
410 ATH_MSG_WARNING(
"Input file is full simulation but you are using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"false\"");
414 return StatusCode::SUCCESS;
425 ATH_MSG_WARNING(
"Efficiency corrections for JETIDRNNVERYLOOSE working point are not supported.");
428 return "jetrnnsigloose";
430 return "jetrnnsigmedium";
432 return "jetrnnsigtight";
444 return "eleRNNTight";
446 return "eleRNNMedium";
448 return "eleRNNLoose";
475 std::string sMeasurement =
"_comb_";
478 sMeasurement =
"_Ztt_";
480 sMeasurement =
"_ttbar_";
497 return StatusCode::FAILURE;
502 ANA_MSG_ERROR(
"Failed to find the RandomRunNumber decoration. Call the apply() method from the PileupReweightingTool beforehand to get period dependent SFs.");
503 return StatusCode::FAILURE;
511 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.