![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
19 :
asg::AsgMetadataTool( sName )
20 , m_vCommonEfficiencyTools()
21 , m_vTriggerEfficiencyTools()
23 , m_bIsConfigured(false)
26 , m_tTauSelectionToolHandle(
"")
70 ATH_MSG_DEBUG(
"Initializing TauEfficiencyCorrectionsTool using TauSelectionTool" );
95 ATH_MSG_WARNING(
"Scale factors for RNN eVeto (TIGHT) are not available yet");
114 ATH_MSG_WARNING(
"Scale factors for decay mode ID are not available yet");
118 return StatusCode::SUCCESS;
124 ATH_MSG_INFO(
"Initializing TauEfficiencyCorrectionsTool" );
127 ATH_MSG_WARNING(
"Truth match check will be skipped. This is ONLY FOR TESTING PURPOSE!");
136 ATH_MSG_ERROR(
"Either use a TauSelectionTool handle or EfficiencyCorrectionTypes, not both.");
137 return StatusCode::FAILURE;
141 if(tauSelectionTool ==
nullptr) {
143 return StatusCode::FAILURE;
146 ATH_MSG_ERROR(
"Failed to determine scale factors using TauSelectionTool");
147 return StatusCode::FAILURE;
154 ATH_MSG_ERROR(
"Could not retrieve any EfficiencyCorrectionType");
155 return StatusCode::FAILURE;
159 ATH_MSG_WARNING(
"2022-prerec tag are pre-recommendations and still under development.");
164 return StatusCode::FAILURE;
170 ATH_CHECK((**it).setProperty(
"OutputLevel", this->msg().level()));
175 ATH_CHECK((**it).setProperty(
"OutputLevel", this->msg().level()));
181 if (!
registry.registerSystematics(*
this))
184 return StatusCode::FAILURE;
189 return StatusCode::SUCCESS;
199 ANA_MSG_WARNING(
"Could not determine MC campaign from run number! The mu dependent systematic of the trigger scale factors should not be trusted. Current (" << xEventInfo->
runNumber() <<
"). Will only print this warning once." );
203 ANA_MSG_WARNING(
"TauEfficiency callibrations from 2022-prerec are not recommended for Run2 MC. Will only print this warning once." );
205 return StatusCode::SUCCESS;
224 return StatusCode::SUCCESS;
234 return StatusCode::SUCCESS;
238 return StatusCode::SUCCESS;
241 return StatusCode::SUCCESS;
247 ATH_MSG_DEBUG(
"TauEfficiencyCorrectionsTool with name " <<
name() <<
" is configured as follows:" );
249 ATH_MSG_DEBUG(
" EfficiencyCorrectionTypes " << iEfficiencyCorrectionType );
276 double&
eff,
unsigned int ,
unsigned int )
290 double dToolEff = 1.;
293 return tmpCorrectionCode;
300 double dToolEff = 1.;
301 CP::CorrectionCode tmpCorrectionCode = (**it)->getEfficiencyScaleFactor(xTau, dToolEff);
303 return tmpCorrectionCode;
322 return tmpCorrectionCode;
330 return tmpCorrectionCode;
340 if ((**it)->isAffectedBySystematic(systematic))
343 if ((**it)->isAffectedBySystematic(systematic))
354 sAffectingSystematics.
insert((**it)->affectingSystematics());
356 sAffectingSystematics.
insert((**it)->affectingSystematics());
357 return sAffectingSystematics;
366 sRecommendedSystematics.
insert((**it)->recommendedSystematics());
368 sRecommendedSystematics.
insert((**it)->recommendedSystematics());
369 return sRecommendedSystematics;
376 if ((**it)->applySystematicVariation(sSystematicSet) == StatusCode::FAILURE)
377 return StatusCode::FAILURE;
379 if ((**it)->applySystematicVariation(sSystematicSet) == StatusCode::FAILURE)
380 return StatusCode::FAILURE;
381 return StatusCode::SUCCESS;
391 std::string sDirectory =
"TauAnalysisTools/" + std::string(sSharedFilesVersion) +
"/EfficiencyCorrections/";
400 ATH_MSG_ERROR(
"isAFII property is now deprecated, please use useFastSim property and AF3 samples");
401 return StatusCode::FAILURE;
403 ATH_MSG_WARNING(
"No fast-sim recommendation for Tau RNN, using full sim");
411 if (sJetIDWP.empty()) {
412 ATH_MSG_WARNING(
"Could not find valid ID working point. Skip ID efficiency corrections.");
441 ATH_MSG_ERROR(
"isAFII property is now deprecated, please use useFastSim property and AF3 samples");
442 return StatusCode::FAILURE;
444 ATH_MSG_WARNING(
"No fast-sim recommendation for tau electron veto, using full sim");
476 if (sJetIDWP.empty()) {
477 ATH_MSG_WARNING(
"Could not find valid ID working point. Skip ID efficiency corrections.");
493 ATH_MSG_ERROR(
"Property \"Trigger\" was not set, please provide a trigger name.");
494 return StatusCode::FAILURE;
503 if (
m_sTriggerName.find(
"mediumRNN_tracktwoMVA") != std::string::npos) {
506 else if (
m_sTriggerName.find(
"tracktwoEF") != std::string::npos) {
509 else if (
m_sTriggerName.find(
"tau160_medium1") != std::string::npos) {
520 return StatusCode::FAILURE;
533 ATH_MSG_WARNING(
"unsupported EfficiencyCorrectionsType with enum " << iEfficiencyCorrectionType);
537 return StatusCode::SUCCESS;
544 if (
inputMetaStore()->contains<xAOD::FileMetaData>(
"FileMetaData")) {
547 std::string simType(
"");
552 if (simType.find(
"ATLFASTII")!=std::string::npos){
553 ATH_MSG_WARNING(
"Input file is AFII sample which should be replaced by AF3 as this will be the only atlas fast simulation supported by TauCP");
554 }
else if( simType.find(
"ATLFAST3") != std::string::npos && !
m_useFastSim){
555 ATH_MSG_WARNING(
"Input file is AF3 sample but you are _not_ using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"true\"");
556 }
else if (simType.find(
"FULLG4")!=std::string::npos &&
m_useFastSim){
557 ATH_MSG_WARNING(
"Input file is full simulation but you are using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"false\"");
561 return StatusCode::SUCCESS;
572 ATH_MSG_WARNING(
"Efficiency corrections for JETIDRNNVERYLOOSE working point are not supported.");
575 return "jetrnnsigloose";
577 return "jetrnnsigmedium";
579 return "jetrnnsigtight";
591 return "eleRNNTight";
593 return "eleRNNMedium";
595 return "eleRNNLoose";
622 std::string sMeasurement =
"_comb_";
625 sMeasurement =
"_Ztt_";
627 sMeasurement =
"_ttbar_";
640 if (!
evtStore()->contains<xAOD::EventInfo>(
"EventInfo") || !
evtStore()->
retrieve(eventInfo,
"EventInfo").isSuccess())
643 return StatusCode::FAILURE;
648 ANA_MSG_ERROR(
"Failed to find the RandomRunNumber decoration. Call the apply() method from the PileupReweightingTool beforehand to get period dependent SFs.");
649 return StatusCode::FAILURE;
657 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Class to wrap a set of SystematicVariations.
Helper class to provide constant type-safe access to aux data.
#define ATH_MSG_VERBOSE(x)
@ IS_SIMULATION
true: simulation, false: data
uint32_t runNumber() const
The current event's run number.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a tau jet.
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
Class describing the basic event information.
@ Ok
The correction was done successfully.
#define ATH_MSG_WARNING(x)
This module implements the central registry for handling systematic uncertainties with CP tools.
Return value from object correction CP tools.
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.
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.