ATLAS Offline Software
Loading...
Searching...
No Matches
TauAnalysisTools::TauEfficiencyCorrectionsTool Class Reference

#include <TauEfficiencyCorrectionsTool.h>

Inheritance diagram for TauAnalysisTools::TauEfficiencyCorrectionsTool:
Collaboration diagram for TauAnalysisTools::TauEfficiencyCorrectionsTool:

Public Types

Definition of the StoreGate-like object's definition
typedef ServiceHandle< StoreGateSvcMetaStore_t
 Type of the metadata store object in Athena.
typedef const ServiceHandle< StoreGateSvc > & MetaStorePtr_t
 Type of the metadata store pointer in standalone mode.

Public Member Functions

 TauEfficiencyCorrectionsTool (const std::string &sName)
 Create a proper constructor for Athena.
 ~TauEfficiencyCorrectionsTool ()
virtual StatusCode initialize ()
 Function initialising the tool.
virtual StatusCode beginInputFile ()
 Function called when a new input file is opened.
virtual void printConfig () const
 Print tool configuration.
virtual CP::CorrectionCode getEfficiencyScaleFactor (const xAOD::TauJet &xTau, double &eff, unsigned int iRunNumber=0)
 Get the tau efficiency scale factor.
virtual CP::CorrectionCode applyEfficiencyScaleFactor (const xAOD::TauJet &xTau, unsigned int iRunNumber=0)
 Decorate the tau with its efficiency scale factor.
virtual bool isAffectedBySystematic (const CP::SystematicVariation &systematic) const
 returns: whether this tool is affected by the given systematics
virtual CP::SystematicSet affectingSystematics () const
 returns: the list of all systematics this tool can be affected by
virtual CP::SystematicSet recommendedSystematics () const
 returns: the list of all systematics this tool recommends to use
virtual StatusCode applySystematicVariation (const CP::SystematicSet &systConfig)
 effects: configure this tool for the given list of systematic variations.
virtual bool isSupportedRunNumber (int) const
 check if run number is supported in recommendations
virtual StatusCode sysInitialize ()
 Function initialising the tool in the correct way in Athena.
virtual void print () const
 Print the state of the tool.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
Functions providing access to the input/output metadata
MetaStorePtr_t inputMetaStore () const
 Accessor for the input metadata store.
MetaStorePtr_t outputMetaStore () const
 Accessor for the output metadata store.
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.
Callback functions helping in metadata reading/writing
void setUseIncidents (const bool flag)
virtual void handle (const Incident &inc)
 Function receiving incidents from IncidentSvc/TEvent.
virtual StatusCode endInputFile ()
 Function called when the currently open input file got completely processed.
virtual StatusCode metaDataStop ()
 Function called when the tool should write out its metadata.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode firstEvent ()
StatusCode beginEvent ()
 Function called when a new events is loaded.
std::string ConvertJetIDToString (const int iLevel) const
std::string ConvertEleIDToString (const int iLevel) const
std::string ConvertTriggerIDToString (const int iLevel) const
std::string GetTriggerSFMeasurementString () const
StatusCode initializeTools_2025_prerec ()
StatusCode readRandomRunNumber ()
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< std::string > m_sInputFilePathRecoHadTau {this, "InputFilePathRecoHadTau", ""}
Gaudi::Property< std::string > m_sInputFilePathEleIDHadTau {this, "InputFilePathEleIDHadTau", ""}
Gaudi::Property< std::string > m_sInputFilePathEleIDElectron {this, "InputFilePathEleIDElectron", ""}
Gaudi::Property< std::string > m_sInputFilePathJetIDHadTau {this, "InputFilePathJetIDHadTau", ""}
Gaudi::Property< std::string > m_sInputFilePathTriggerHadTau {this, "InputFilePathTriggerHadTau", ""}
Gaudi::Property< std::string > m_sRecommendationTag {this, "RecommendationTag", "2025-prerec"}
Gaudi::Property< std::string > m_sTriggerName {this, "TriggerName", ""}
Gaudi::Property< bool > m_bReadRandomRunNumber {this, "AutoTriggerYear", false}
Gaudi::Property< std::string > m_sTriggerSFMeasurement {this, "TriggerSFMeasurement", "combined"}
Gaudi::Property< bool > m_bUseTauSubstructure {this, "UseTauSubstructure", false}
Gaudi::Property< int > m_iJetIDLevel {this, "JetIDLevel", static_cast<int>(JETIDNONE)}
Gaudi::Property< int > m_iEleIDLevel {this, "EleIDLevel", static_cast<int>(ELEIDNONE)}
Gaudi::Property< std::string > m_sCampaign {this, "Campaign", ""}
Gaudi::Property< bool > m_useFastSim {this, "useFastSim", false}
Gaudi::Property< bool > m_bSkipTruthMatchCheck {this, "SkipTruthMatchCheck", false}
Gaudi::Property< std::vector< int > > m_vecEfficiencyCorrectionTypes {this, "EfficiencyCorrectionTypes", {}}
std::vector< int > m_vEfficiencyCorrectionTypes
std::vector< asg::AnaToolHandle< ITauEfficiencyCorrectionsTool > * > m_vCommonEfficiencyTools
std::vector< asg::AnaToolHandle< ITauEfficiencyCorrectionsTool > * > m_vTriggerEfficiencyTools
std::string m_sInputFilePathDecayModeHadTau
std::string m_sVarName
bool m_bIsData
bool m_bIsConfigured
bool m_firstEvent = false
unsigned int m_iRunNumber
MetaStore_t m_inputMetaStore
 Object accessing the input metadata store.
MetaStore_t m_outputMetaStore
 Object accessing the output metadata store.
bool m_beginInputFileCalled
 Flag helping to discover when the tool misses the opening of the first input file.
bool m_useIncidents
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 31 of file TauEfficiencyCorrectionsTool.h.

Member Typedef Documentation

◆ MetaStore_t

Type of the metadata store object in Athena.

Definition at line 66 of file AsgMetadataTool.h.

◆ MetaStorePtr_t

Type of the metadata store pointer in standalone mode.

Definition at line 68 of file AsgMetadataTool.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TauEfficiencyCorrectionsTool()

TauAnalysisTools::TauEfficiencyCorrectionsTool::TauEfficiencyCorrectionsTool ( const std::string & sName)

Create a proper constructor for Athena.

Create a constructor for standalone usage

Definition at line 18 of file TauEfficiencyCorrectionsTool.cxx.

◆ ~TauEfficiencyCorrectionsTool()

TauAnalysisTools::TauEfficiencyCorrectionsTool::~TauEfficiencyCorrectionsTool ( )

Definition at line 27 of file TauEfficiencyCorrectionsTool.cxx.

28{
29 for (auto tTool : m_vCommonEfficiencyTools)
30 delete tTool;
31}

Member Function Documentation

◆ affectingSystematics()

CP::SystematicSet TauAnalysisTools::TauEfficiencyCorrectionsTool::affectingSystematics ( ) const
virtual

returns: the list of all systematics this tool can be affected by

Implements CP::IReentrantSystematicsTool.

Definition at line 192 of file TauEfficiencyCorrectionsTool.cxx.

193{
194 CP::SystematicSet sAffectingSystematics;
195 for (auto it = m_vCommonEfficiencyTools.begin(); it != m_vCommonEfficiencyTools.end(); it++)
196 sAffectingSystematics.insert((**it)->affectingSystematics());
197 return sAffectingSystematics;
198}
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set

◆ applyEfficiencyScaleFactor()

CP::CorrectionCode TauAnalysisTools::TauEfficiencyCorrectionsTool::applyEfficiencyScaleFactor ( const xAOD::TauJet & xTau,
unsigned int iRunNumber = 0 )
virtual

Decorate the tau with its efficiency scale factor.

Implements TauAnalysisTools::ITauEfficiencyCorrectionsTool.

Definition at line 163 of file TauEfficiencyCorrectionsTool.cxx.

164{
165 if (m_bIsData)
167
168 ANA_CHECK_SET_TYPE (CP::CorrectionCode);
170
171 for (auto it = m_vCommonEfficiencyTools.begin(); it != m_vCommonEfficiencyTools.end(); it++)
172 {
173 CP::CorrectionCode tmpCorrectionCode = (**it)->applyEfficiencyScaleFactor(xTau, m_iRunNumber);
174 if (tmpCorrectionCode != CP::CorrectionCode::Ok)
175 return tmpCorrectionCode;
176 }
178}
#define ANA_CHECK(EXP)
check whether the given expression was successful
#define ANA_CHECK_SET_TYPE(TYPE)
set the type for ANA_CHECK to report failures
@ Ok
The correction was done successfully.

◆ applySystematicVariation()

StatusCode TauAnalysisTools::TauEfficiencyCorrectionsTool::applySystematicVariation ( const CP::SystematicSet & systConfig)
virtual

effects: configure this tool for the given list of systematic variations.

any requested systematics that are not affecting this tool will be silently ignored (unless they cause other errors). failures: systematic unknown failures: requesting multiple variations on the same systematic (e.g. up & down) failures: requesting an unsupported variation on an otherwise supported systematic (e.g. a 2 sigma variation and the tool only supports 1 sigma variations) failures: unsupported combination of supported systematic failures: other tool specific errors

Implements CP::ISystematicsTool.

Definition at line 211 of file TauEfficiencyCorrectionsTool.cxx.

212{
213 for (auto it = m_vCommonEfficiencyTools.begin(); it != m_vCommonEfficiencyTools.end(); it++)
214 if ((**it)->applySystematicVariation(sSystematicSet) == StatusCode::FAILURE)
215 return StatusCode::FAILURE;
216 return StatusCode::SUCCESS;
217}

◆ beginEvent()

StatusCode TauAnalysisTools::TauEfficiencyCorrectionsTool::beginEvent ( )
privatevirtual

Function called when a new events is loaded.

Dummy implementation that can be overridden by the derived tool.

Reimplemented from asg::AsgMetadataTool.

Definition at line 85 of file TauEfficiencyCorrectionsTool.cxx.

86{
87 if (!m_bIsConfigured)
88 {
89 const xAOD::EventInfo* xEventInfo = nullptr;
90 ATH_CHECK(evtStore()->retrieve(xEventInfo,"EventInfo"));
92 m_bIsConfigured = true;
93 }
94
95 if (!m_firstEvent){
97 m_firstEvent = true;
98
99 }
100 if (m_bIsData)
101 return StatusCode::SUCCESS;
102
103 const xAOD::EventInfo* xEventInfo = nullptr;
104 ATH_CHECK(evtStore()->retrieve(xEventInfo, "EventInfo"));
105
107 {
108 // Reset the number at the beginning of event
109 m_iRunNumber = 0;
110 }
111
112 return StatusCode::SUCCESS;
113}
#define ATH_CHECK
Evaluate an expression and check for errors.
ServiceHandle< StoreGateSvc > & evtStore()
bool eventType(EventType type) const
Check for one particular bitmask value.
@ IS_SIMULATION
true: simulation, false: data
retrieve(aClass, aKey=None)
Definition PyKernel.py:110
EventInfo_v1 EventInfo
Definition of the latest event info version.

◆ beginInputFile()

StatusCode TauAnalysisTools::TauEfficiencyCorrectionsTool::beginInputFile ( )
virtual

Function called when a new input file is opened.

Dummy implementation that can be overridden by the derived tool.

Reimplemented from asg::AsgMetadataTool.

Definition at line 400 of file TauEfficiencyCorrectionsTool.cxx.

401{
402 if (inputMetaStore()->contains<xAOD::FileMetaData>("FileMetaData")) {
403 const xAOD::FileMetaData* fmd = nullptr;
404 ATH_CHECK( inputMetaStore()->retrieve( fmd, "FileMetaData" ) );
405 std::string simType("");
406 bool result = fmd->value( xAOD::FileMetaData::simFlavour , simType );
407 // if no result -> no simFlavor metadata, so must be data
408 if(result) std::transform(simType.begin(), simType.end(), simType.begin(), ::toupper);
409
410 if( simType.find("ATLFAST3") != std::string::npos && !m_useFastSim){
411 ATH_MSG_WARNING("Input file is AF3 sample but you are _not_ using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"true\"");
412 } else if (simType.find("FULLG4")!=std::string::npos && m_useFastSim){
413 ATH_MSG_WARNING("Input file is full simulation but you are using AF3 corrections and uncertainties, you should set \"useFastSim\" to \"false\"");
414 }
415 }
416
417 return StatusCode::SUCCESS;
418}
#define ATH_MSG_WARNING(x)
MetaStorePtr_t inputMetaStore() const
Accessor for the input metadata store.
@ simFlavour
Fast or Full sim [string].
bool value(MetaDataType type, std::string &val) const
Get a pre-defined string value out of the object.
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:114
FileMetaData_v1 FileMetaData
Declare the latest version of the class.

◆ ConvertEleIDToString()

std::string TauAnalysisTools::TauEfficiencyCorrectionsTool::ConvertEleIDToString ( const int iLevel) const
private

Definition at line 442 of file TauEfficiencyCorrectionsTool.cxx.

443{
444 switch(iLevel)
445 {
446 case ELEIDRNNTIGHT:
447 return "eleRNNTight";
448 case ELEIDRNNMEDIUM:
449 return "eleRNNMedium";
450 case ELEIDRNNLOOSE:
451 return "eleRNNLoose";
452 default:
453 ATH_MSG_WARNING("No valid EleID level passed.");
454 return "";
455 }
456}

◆ ConvertJetIDToString()

std::string TauAnalysisTools::TauEfficiencyCorrectionsTool::ConvertJetIDToString ( const int iLevel) const
private

Definition at line 421 of file TauEfficiencyCorrectionsTool.cxx.

422{
423 switch(iLevel)
424 {
425 case JETIDNONE:
426 return "none";
427 case JETIDRNNVERYLOOSE:
428 ATH_MSG_WARNING("Efficiency corrections for JETIDRNNVERYLOOSE working point are not supported.");
429 return "";
430 case JETIDRNNLOOSE:
431 return "jetrnnsigloose";
432 case JETIDRNNMEDIUM:
433 return "jetrnnsigmedium";
434 case JETIDRNNTIGHT:
435 return "jetrnnsigtight";
436 default:
437 ATH_MSG_WARNING("No valid JetID level passed.");
438 return "";
439 }
440}

◆ ConvertTriggerIDToString()

std::string TauAnalysisTools::TauEfficiencyCorrectionsTool::ConvertTriggerIDToString ( const int iLevel) const
private

Definition at line 459 of file TauEfficiencyCorrectionsTool.cxx.

460{
461 switch(iLevel)
462 {
463 case JETIDRNNLOOSE:
464 return "loose";
465 case JETIDRNNMEDIUM:
466 return "medium";
467 case JETIDRNNTIGHT:
468 return "tight";
469 default:
470 ATH_MSG_WARNING("No valid TriggerID level passed.");
471 return "";
472 }
473}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ endInputFile()

StatusCode asg::AsgMetadataTool::endInputFile ( )
protectedvirtualinherited

Function called when the currently open input file got completely processed.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in BookkeeperDumperTool, BookkeeperTool, xAODMaker::TriggerMenuMetaDataTool, and xAODMaker::TruthMetaDataTool.

Definition at line 193 of file AsgMetadataTool.cxx.

193 {
194
195 // Return gracefully:
196 return StatusCode::SUCCESS;
197 }

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ firstEvent()

StatusCode TauAnalysisTools::TauEfficiencyCorrectionsTool::firstEvent ( )
private

Definition at line 77 of file TauEfficiencyCorrectionsTool.cxx.

78{
79 const xAOD::EventInfo* xEventInfo = nullptr;
80 ATH_CHECK(evtStore()->retrieve(xEventInfo, "EventInfo"));
81
82 return StatusCode::SUCCESS;
83}

◆ getEfficiencyScaleFactor()

CP::CorrectionCode TauAnalysisTools::TauEfficiencyCorrectionsTool::getEfficiencyScaleFactor ( const xAOD::TauJet & xTau,
double & eff,
unsigned int iRunNumber = 0 )
virtual

Get the tau efficiency scale factor.

Implements TauAnalysisTools::ITauEfficiencyCorrectionsTool.

Definition at line 138 of file TauEfficiencyCorrectionsTool.cxx.

140{
141 eff = 1.;
142
143 if (m_bIsData)
145
146 ANA_CHECK_SET_TYPE (CP::CorrectionCode);
148
149 for (auto it = m_vCommonEfficiencyTools.begin(); it != m_vCommonEfficiencyTools.end(); it++)
150 {
151 if ( !(**it)->isSupportedRunNumber(m_iRunNumber) )
152 continue;
153 double dToolEff = 1.;
154 CP::CorrectionCode tmpCorrectionCode = (**it)->getEfficiencyScaleFactor(xTau, dToolEff, m_iRunNumber);
155 if (tmpCorrectionCode != CP::CorrectionCode::Ok)
156 return tmpCorrectionCode;
157 eff *= dToolEff;
158 }
160}

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::TEvent, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }

◆ getName()

const std::string & asg::AsgTool::getName ( const void * ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::TEvent, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ GetTriggerSFMeasurementString()

std::string TauAnalysisTools::TauEfficiencyCorrectionsTool::GetTriggerSFMeasurementString ( ) const
private

Definition at line 476 of file TauEfficiencyCorrectionsTool.cxx.

477{
478 std::string sMeasurement = "_comb_";
479
480 if (m_sTriggerSFMeasurement == "Ztautau")
481 sMeasurement = "_Ztt_";
482 else if (m_sTriggerSFMeasurement == "ttbar")
483 sMeasurement = "_ttbar_";
484 else if (m_sTriggerSFMeasurement != "combined")
485 ATH_MSG_WARNING("Trigger scale factor measurement \'" << m_sTriggerSFMeasurement << "\' is not supported. \'combined\' is used instead.");
486
487 return sMeasurement;
488}

◆ handle()

void asg::AsgMetadataTool::handle ( const Incident & inc)
protectedvirtualinherited

Function receiving incidents from IncidentSvc/TEvent.

Reimplemented in Trig::TrigDecisionTool.

Definition at line 135 of file AsgMetadataTool.cxx.

135 {
136
137 // Tell the user what's happening:
138 ATH_MSG_VERBOSE( "Callback received with incident: " << inc.type() );
139
140 // Call the appropriate member function:
141 if( inc.type() == IncidentType::BeginInputFile ) {
143 if( beginInputFile().isFailure() ) {
144 ATH_MSG_FATAL( "Failed to call beginInputFile()" );
145 throw std::runtime_error( "Couldn't call beginInputFile()" );
146 }
147 } else if( inc.type() == IncidentType::EndInputFile ) {
148 if( endInputFile().isFailure() ) {
149 ATH_MSG_FATAL( "Failed to call endInputFile()" );
150 throw std::runtime_error( "Couldn't call endInputFile()" );
151 }
152 } else if( inc.type() == IncidentType::BeginEvent ) {
153 // If the tool didn't catch the begin input file incident for the
154 // first input file of the job, then call the appropriate function
155 // now.
156 if( ! m_beginInputFileCalled ) {
158 if( beginInputFile().isFailure() ) {
159 ATH_MSG_FATAL( "Failed to call beginInputFile()" );
160 throw std::runtime_error( "Couldn't call beginInputFile()" );
161 }
162 }
163 if( beginEvent().isFailure() ) {
164 ATH_MSG_FATAL( "Failed to call beginEvent()" );
165 throw std::runtime_error( "Couldn't call beginEvent()" );
166 }
167
168 #ifdef XAOD_STANDALONE
169 } else if( inc.type() == IncidentType::MetaDataStop ) {
170 if( metaDataStop().isFailure() ) {
171 ATH_MSG_FATAL( "Failed to call metaDataStop()" );
172 throw std::runtime_error( "Couldn't call metaDataStop()" );
173 }
174
175 #endif // XAOD_STANDALONE
176 } else {
177 ATH_MSG_WARNING( "Unknown incident type received in AsgMetaDataTool: " << inc.type() );
178 }
179
180 return;
181 }
#define ATH_MSG_FATAL(x)
#define ATH_MSG_VERBOSE(x)
virtual StatusCode beginInputFile()
Function called when a new input file is opened.
virtual StatusCode beginEvent()
Function called when a new events is loaded.
bool m_beginInputFileCalled
Flag helping to discover when the tool misses the opening of the first input file.
virtual StatusCode endInputFile()
Function called when the currently open input file got completely processed.
virtual StatusCode metaDataStop()
Function called when the tool should write out its metadata.

◆ initialize()

StatusCode TauAnalysisTools::TauEfficiencyCorrectionsTool::initialize ( void )
virtual

Function initialising the tool.

Reimplemented from asg::AsgTool.

Definition at line 34 of file TauEfficiencyCorrectionsTool.cxx.

35{
36 ATH_MSG_INFO( "Initializing TauEfficiencyCorrectionsTool" );
37
39
41 ATH_MSG_WARNING("Truth match check will be skipped. This is ONLY FOR TESTING PURPOSE!");
42
43 // check efficiency correction type
45 {
46 ATH_MSG_ERROR("Could not retrieve any EfficiencyCorrectionType");
47 return StatusCode::FAILURE;
48 }
49
50 if(m_sRecommendationTag == "2025-prerec") {
52 } else {
53 ATH_MSG_ERROR("Unknown RecommendationTag " << m_sRecommendationTag);
54 return StatusCode::FAILURE;
55 }
56
57 // for (auto tCommonEfficiencyTool : m_vCommonEfficiencyTools)
58 for (auto it = m_vCommonEfficiencyTools.begin(); it != m_vCommonEfficiencyTools.end(); it++)
59 {
60 ATH_CHECK((**it).setProperty("OutputLevel", this->msg().level()));
61 ATH_CHECK((**it).initialize());
62 }
63
64 // Add the affecting systematics to the global registry
65 CP::SystematicRegistry& registry = CP::SystematicRegistry::getInstance();
66 if (!registry.registerSystematics(*this))
67 {
68 ATH_MSG_ERROR ("Unable to register the systematics");
69 return StatusCode::FAILURE;
70 }
71
73
74 return StatusCode::SUCCESS;
75}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
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
virtual void printConfig() const
Print tool configuration.
Gaudi::Property< std::vector< int > > m_vecEfficiencyCorrectionTypes

◆ initializeTools_2025_prerec()

StatusCode TauAnalysisTools::TauEfficiencyCorrectionsTool::initializeTools_2025_prerec ( )
private

Definition at line 220 of file TauEfficiencyCorrectionsTool.cxx.

221{
222 std::string sDirectory = "TauAnalysisTools/" + std::string(sSharedFilesVersion) + "/EfficiencyCorrections/";
223 for (auto iEfficiencyCorrectionType : m_vEfficiencyCorrectionTypes){
224
225 if (iEfficiencyCorrectionType == SFJetIDHadTau)
226 {
227 if (m_sInputFilePathJetIDHadTau.empty()) {
228 if(m_useFastSim) {
229 ATH_MSG_WARNING("No fast-sim recommendation for Tau RNN, using full sim");
230 }
231
232 if(m_sCampaign=="mc23"){
233 m_sInputFilePathJetIDHadTau = sDirectory + "RNNID_TrueHadTau_mc23_v2.root";
234 } else if (m_sCampaign=="mc20"){
235 m_sInputFilePathJetIDHadTau = sDirectory + "RNNID_TrueHadTau_mc20_v1.root";
236 }
237 }
238 m_sVarName = "TauScaleFactorJetIDHadTau";
239
240 std::string sJetIDWP = ConvertJetIDToString(m_iJetIDLevel);
241 if (sJetIDWP.empty()) {
242 ATH_MSG_WARNING("Could not find valid ID working point. Skip ID efficiency corrections.");
243 continue;
244 }
245
246 asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>* tTool = new asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>("TauAnalysisTools::CommonEfficiencyTool/JetIDHadTauTool", this);
247 m_vCommonEfficiencyTools.push_back(tTool);
248 ATH_CHECK(tTool->setProperty("InputFilePath", m_sInputFilePathJetIDHadTau));
249 ATH_CHECK(tTool->setProperty("VarName", m_sVarName));
250 ATH_CHECK(tTool->setProperty("SkipTruthMatchCheck", m_bSkipTruthMatchCheck));
251 ATH_CHECK(tTool->setProperty("WP", sJetIDWP));
252 }
253 else if (iEfficiencyCorrectionType == SFRecoHadTau)
254 {
255 if (m_sInputFilePathRecoHadTau.empty()) m_sInputFilePathRecoHadTau = sDirectory + "Reco_TrueHadTau_2026_v0.root";
256 m_sVarName = "TauScaleFactorReconstructionHadTau";
257
258 asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>* tTool = new asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>("TauAnalysisTools::CommonEfficiencyTool/RecoHadTauTool", this);
259 m_vCommonEfficiencyTools.push_back(tTool);
260 ATH_CHECK(tTool->setProperty("InputFilePath", m_sInputFilePathRecoHadTau));
261 ATH_CHECK(tTool->setProperty("VarName", m_sVarName));
262 ATH_CHECK(tTool->setProperty("SkipTruthMatchCheck", m_bSkipTruthMatchCheck));
263 }
264 else if (iEfficiencyCorrectionType == SFEleIDHadTau)
265 {
266 if (m_sInputFilePathEleIDHadTau.empty()) {
267 if( m_iEleIDLevel == static_cast<int>(ELEIDRNNLOOSE)){
268 m_sInputFilePathEleIDHadTau = sDirectory + "EleRNN_TrueHadTau_2026_eRNNLoose.root";
269 } else if( m_iEleIDLevel == static_cast<int>(ELEIDRNNMEDIUM)){
270 m_sInputFilePathEleIDHadTau = sDirectory + "EleRNN_TrueHadTau_2026_eRNNMedium.root";
271 } else {
272 ATH_MSG_ERROR("SFEleIDHadTau correction not supported for EleIDLevel="<<m_iEleIDLevel);
273 return StatusCode::FAILURE;
274 }
275 }
276 m_sVarName = "TauScaleFactorEleIDHadTau";
277
278 asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>* tTool = new asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>("TauAnalysisTools::CommonEfficiencyTool/EleIDHadTauTool", this);
279 m_vCommonEfficiencyTools.push_back(tTool);
280 ATH_CHECK(tTool->setProperty("InputFilePath", m_sInputFilePathEleIDHadTau));
281 ATH_CHECK(tTool->setProperty("VarName", m_sVarName));
282 ATH_CHECK(tTool->setProperty("SkipTruthMatchCheck", m_bSkipTruthMatchCheck));
283 ATH_CHECK(tTool->setProperty("WP", ConvertEleIDToString(m_iEleIDLevel)));
284 ATH_CHECK(tTool->setProperty("UseTauSubstructure", false));
285 }
286 else if (iEfficiencyCorrectionType == SFEleIDElectron)
287 {
288 // the path must be updated once RNN eVeto SFs are available
289 if (m_sInputFilePathEleIDElectron.empty()) {
290 if(m_useFastSim) {
291 ATH_MSG_WARNING("No fast-sim recommendation for tau electron veto, using full sim");
292 }
293
294 if(m_sCampaign=="mc23"){
295 if( m_iJetIDLevel == static_cast<int>(JETIDRNNLOOSE)){
296 m_sInputFilePathEleIDElectron = sDirectory + "EleRNN_TrueElectron_2022_looseRNNTauID_1p.root";
297 } else if( m_iJetIDLevel == static_cast<int>(JETIDRNNMEDIUM)){
298 m_sInputFilePathEleIDElectron = sDirectory + "EleRNN_TrueElectron_2022_mediumRNNTauID_1p.root";
299 }
300 else {
301 ATH_MSG_ERROR("SFEleIDElectron correction not supported for JetIDLevel="<<m_iJetIDLevel);
302 return StatusCode::FAILURE;
303 }
304 } else if(m_sCampaign=="mc20"){
305 if( m_iJetIDLevel == static_cast<int>(JETIDRNNLOOSE)){
306 m_sInputFilePathEleIDElectron = sDirectory + "EleRNN_TrueElectron_Run2_looseRNNTauID_1p.root";
307 } else if( m_iJetIDLevel == static_cast<int>(JETIDRNNMEDIUM)){
308 m_sInputFilePathEleIDElectron = sDirectory + "EleRNN_TrueElectron_Run2_mediumRNNTauID_1p_v1.root";
309 }
310 else {
311 ATH_MSG_ERROR("SFEleIDElectron correction not supported for JetIDLevel="<<m_iJetIDLevel);
312 return StatusCode::FAILURE;
313 }
314 }
315 }
316 m_sVarName = "TauScaleFactorEleIDElectron";
317
318 asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>* tTool = new asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>("TauAnalysisTools::CommonEfficiencyTool/EleIDElectronTool", this);
319 m_vCommonEfficiencyTools.push_back(tTool);
320 ATH_CHECK(tTool->setProperty("InputFilePath", m_sInputFilePathEleIDElectron));
321 ATH_CHECK(tTool->setProperty("VarName", m_sVarName));
322 ATH_CHECK(tTool->setProperty("SkipTruthMatchCheck", m_bSkipTruthMatchCheck));
323 ATH_CHECK(tTool->setProperty("WP", ConvertEleIDToString(m_iEleIDLevel)));
324 ATH_CHECK(tTool->setProperty("UseTauSubstructure", false));
325
326 } else if (iEfficiencyCorrectionType == SFTriggerHadTau){
327
328 if (m_sTriggerName.empty()) {
329 ATH_MSG_ERROR("Property \"Trigger\" was not set, please provide a trigger name.");
330 return StatusCode::FAILURE;
331 }
332 if (m_sInputFilePathTriggerHadTau.empty()) {
333 // Determine the input file name from the given trigger name.
334 if(m_sCampaign=="mc23a"){
335 if (m_sTriggerName.value().find("mediumRNN_tracktwoMVA") != std::string::npos) {
336 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN/Trigger_TrueHadTau_data2022"+GetTriggerSFMeasurementString()+m_sTriggerName+".root";
337 }
338 else {
339 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");
340 return StatusCode::FAILURE;
341 }
342 } else if(m_sCampaign=="mc23d"){
343 if (m_sTriggerName.value().find("mediumRNN_tracktwoMVA") != std::string::npos) {
344 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN/Trigger_TrueHadTau_data2023"+GetTriggerSFMeasurementString()+m_sTriggerName+".root";
345 }
346 else {
347 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");
348 return StatusCode::FAILURE;
349 }
350 } else if(m_sCampaign=="mc20"){
351 if (m_sTriggerName.value().find("tracktwoEF") != std::string::npos) {
352 // check explicitly tau160 as the root file for this trigger was renamed
353 if (m_sTriggerName.value().find("tau160") != std::string::npos) {
354 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN_R22/Trigger_TrueHadTau_data2018_comb_HLT_tau160L1TAU100_medium1_tracktwoEF_v1.root";
355 } else {
356 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN_R22/Trigger_TrueHadTau_data2018"+GetTriggerSFMeasurementString()+m_sTriggerName+".root";
357 }
358 } else if (m_sTriggerName.value().find("tracktwo") != std::string::npos) {
359 // check explicitly tau160 as the root file for this trigger was renamed
360 if (m_sTriggerName.value().find("tau160") != std::string::npos) {
361 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN_R22/Trigger_TrueHadTau_data161718_comb_HLT_tau160_medium1_tracktwo_v1.root";
362 } else if (m_sTriggerName.value().find("tau125") != std::string::npos) {
363 // fall back to R21 recommendations for tau125 as currently SFs are not available for this trigger
364 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN/Trigger_TrueHadTau_2019-summer_data161718_comb_HLT_tau125_medium1_tracktwo.root";
365 } else if (m_sTriggerName.value().find("tau60") != std::string::npos) {
366 // SFs for tau60 are only for partial period
367 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN_R22/Trigger_TrueHadTau_data1718"+GetTriggerSFMeasurementString()+m_sTriggerName+".root";
368 } else {
369 m_sInputFilePathTriggerHadTau = sDirectory+"Trigger/RNN_R22/Trigger_TrueHadTau_data161718"+GetTriggerSFMeasurementString()+m_sTriggerName+".root";
370 }
371 } else {
372 ATH_MSG_ERROR("Trigger " << m_sTriggerName << " is not supported. Please fix \"TriggerName\" property. If this is correct, then please contact the tau trigger coordinators");
373 return StatusCode::FAILURE;
374 }
375 } else {
376 ATH_MSG_ERROR("SFs are not available for " << m_sCampaign << " campaign. If the config is correct, then please contact the tau trigger coordinators");
377 return StatusCode::FAILURE;
378 }
379 }
380 m_sVarName = "TauScaleFactorTriggerHadTau";
381
382 asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>* tTool = new asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>("TauAnalysisTools::CommonEfficiencyTool/TriggerHadTauTool", this);
383 m_vCommonEfficiencyTools.push_back(tTool);
384 ATH_CHECK(tTool->setProperty("InputFilePath", m_sInputFilePathTriggerHadTau));
385 ATH_CHECK(tTool->setProperty("VarName", m_sVarName));
386 ATH_CHECK(tTool->setProperty("SkipTruthMatchCheck", m_bSkipTruthMatchCheck));
387 ATH_CHECK(tTool->setProperty("WP", ConvertTriggerIDToString(m_iJetIDLevel)));
388 ATH_CHECK(tTool->setProperty("DoTauTrig", true));
389 }
390 else {
391 ATH_MSG_WARNING("unsupported EfficiencyCorrectionsType with enum " << iEfficiencyCorrectionType);
392 }
393 }
394
395 return StatusCode::SUCCESS;
396}
static const char *const sSharedFilesVersion
Version of the calibration files.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ inputMetaStore()

AsgMetadataTool::MetaStorePtr_t asg::AsgMetadataTool::inputMetaStore ( ) const
inherited

Accessor for the input metadata store.

Definition at line 93 of file AsgMetadataTool.cxx.

93 {
94
95#ifdef XAOD_STANDALONE
96 return &m_inputMetaStore;
97#else // XAOD_STANDALONE
98 return m_inputMetaStore;
99#endif // XAOD_STANDALONE
100 }
MetaStore_t m_inputMetaStore
Object accessing the input metadata store.

◆ isAffectedBySystematic()

bool TauAnalysisTools::TauEfficiencyCorrectionsTool::isAffectedBySystematic ( const CP::SystematicVariation & systematic) const
virtual

returns: whether this tool is affected by the given systematics

Implements CP::ISystematicsTool.

Definition at line 182 of file TauEfficiencyCorrectionsTool.cxx.

183{
184 for (auto it = m_vCommonEfficiencyTools.begin(); it != m_vCommonEfficiencyTools.end(); it++)
185 if ((**it)->isAffectedBySystematic(systematic))
186 return true;
187 return false;
188}

◆ isSupportedRunNumber()

virtual bool TauAnalysisTools::TauEfficiencyCorrectionsTool::isSupportedRunNumber ( int iRunNumber) const
inlinevirtual

check if run number is supported in recommendations

Implements TauAnalysisTools::ITauEfficiencyCorrectionsTool.

Definition at line 71 of file TauEfficiencyCorrectionsTool.h.

72 {
73 return true;
74 };

◆ metaDataStop()

StatusCode asg::AsgMetadataTool::metaDataStop ( )
protectedvirtualinherited

Function called when the tool should write out its metadata.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in BookkeeperDumperTool, BookkeeperTool, xAODMaker::TriggerMenuMetaDataTool, and xAODMaker::TruthMetaDataTool.

Definition at line 209 of file AsgMetadataTool.cxx.

209 {
210
211 // Return gracefully:
212 return StatusCode::SUCCESS;
213 }

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ outputMetaStore()

AsgMetadataTool::MetaStorePtr_t asg::AsgMetadataTool::outputMetaStore ( ) const
inherited

Accessor for the output metadata store.

Definition at line 102 of file AsgMetadataTool.cxx.

102 {
103
104#ifdef XAOD_STANDALONE
105 return &m_outputMetaStore;
106#else // XAOD_STANDALONE
107 return m_outputMetaStore;
108#endif // XAOD_STANDALONE
109 }
MetaStore_t m_outputMetaStore
Object accessing the output metadata store.

◆ print()

◆ printConfig()

void TauAnalysisTools::TauEfficiencyCorrectionsTool::printConfig ( ) const
virtual

Print tool configuration.

Definition at line 116 of file TauEfficiencyCorrectionsTool.cxx.

117{
118 ATH_MSG_DEBUG( "TauEfficiencyCorrectionsTool with name " << name() << " is configured as follows:" );
119 for (auto iEfficiencyCorrectionType : m_vEfficiencyCorrectionTypes) {
120 ATH_MSG_DEBUG( " EfficiencyCorrectionTypes " << iEfficiencyCorrectionType );
121 }
122 ATH_MSG_DEBUG( " InputFilePathRecoHadTau " << m_sInputFilePathRecoHadTau );
123 ATH_MSG_DEBUG( " InputFilePathEleIDHadTau " << m_sInputFilePathEleIDHadTau );
124 ATH_MSG_DEBUG( " InputFilePathEleIDElectron " << m_sInputFilePathEleIDElectron );
125 ATH_MSG_DEBUG( " InputFilePathJetIDHadTau " << m_sInputFilePathJetIDHadTau );
126 ATH_MSG_DEBUG( " InputFilePathDecayModeHadTau " << m_sInputFilePathDecayModeHadTau );
127 ATH_MSG_DEBUG( " InputFilePathTriggerHadTau " << m_sInputFilePathTriggerHadTau );
128 ATH_MSG_DEBUG( " RecommendationTag " << m_sRecommendationTag );
129 ATH_MSG_DEBUG( " TriggerName " << m_sTriggerName );
130 ATH_MSG_DEBUG( " UseTauSubstructure " << m_bUseTauSubstructure );
131 ATH_MSG_DEBUG( " JetIDLevel " << m_iJetIDLevel );
132 ATH_MSG_DEBUG( " EleIDLevel " << m_iEleIDLevel );
133 ATH_MSG_DEBUG( " Campaign " << m_sCampaign );
134 ATH_MSG_DEBUG( " useFastSim " << m_useFastSim);
135}
#define ATH_MSG_DEBUG(x)

◆ readRandomRunNumber()

StatusCode TauAnalysisTools::TauEfficiencyCorrectionsTool::readRandomRunNumber ( )
private

Definition at line 490 of file TauEfficiencyCorrectionsTool.cxx.

491{
492 // read the random run rumber from the EventInfo
494 {
495 static const SG::ConstAccessor<unsigned int> acc_rnd("RandomRunNumber");
496 const xAOD::EventInfo* eventInfo = nullptr;
497 if (!evtStore()->contains<xAOD::EventInfo>("EventInfo") || !evtStore()->retrieve(eventInfo, "EventInfo").isSuccess())
498 {
499 ANA_MSG_ERROR("Could not retrieve EventInfo");
500 return StatusCode::FAILURE;
501 }
502
503 if (!acc_rnd.isAvailable(*eventInfo))
504 {
505 ANA_MSG_ERROR("Failed to find the RandomRunNumber decoration. Call the apply() method from the PileupReweightingTool beforehand to get period dependent SFs.");
506 return StatusCode::FAILURE;
507 }
508
509 m_iRunNumber = acc_rnd(*eventInfo);
510
511 ANA_MSG_VERBOSE("Read RandomRunNumber as " << m_iRunNumber);
512 }
513
514 return StatusCode::SUCCESS;
515}
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_MSG_VERBOSE(xmsg)
Macro printing verbose messages.

◆ recommendedSystematics()

CP::SystematicSet TauAnalysisTools::TauEfficiencyCorrectionsTool::recommendedSystematics ( ) const
virtual

returns: the list of all systematics this tool recommends to use

Implements CP::IReentrantSystematicsTool.

Definition at line 202 of file TauEfficiencyCorrectionsTool.cxx.

203{
204 CP::SystematicSet sRecommendedSystematics;
205 for (auto it = m_vCommonEfficiencyTools.begin(); it != m_vCommonEfficiencyTools.end(); it++)
206 sRecommendedSystematics.insert((**it)->recommendedSystematics());
207 return sRecommendedSystematics;
208}

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setUseIncidents()

void asg::AsgMetadataTool::setUseIncidents ( const bool flag)
inlineprotectedinherited

Definition at line 132 of file AsgMetadataTool.h.

133 {
135 }
bool flag
Definition master.py:29

◆ sysInitialize()

StatusCode asg::AsgMetadataTool::sysInitialize ( )
virtualinherited

Function initialising the tool in the correct way in Athena.

This function is used to set up the callbacks from IncidentSvc in Athena at the right time during initialisation, without the user having to do anything special in his/her code.

Reimplemented from AthCommonDataStore< AthCommonMsg< AlgTool > >.

Definition at line 115 of file AsgMetadataTool.cxx.

115 {
116
117#ifndef XAOD_STANDALONE
118 if (m_useIncidents) {
119 // Connect to the IncidentSvc:
120 ServiceHandle< IIncidentSvc > incSvc( "IncidentSvc", name() );
121 ATH_CHECK( incSvc.retrieve() );
122
123 // Set up the right callbacks: don't rethrow exceptions, any failure and we should end
124 incSvc->addListener( this, IncidentType::BeginEvent, 0, false );
125 }
126 // Let the base class do its thing:
127 ATH_CHECK( AlgTool::sysInitialize() );
128
129#endif // not XAOD_STANDALONE
130
131 // Return gracefully:
132 return StatusCode::SUCCESS;
133 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_beginInputFileCalled

bool asg::AsgMetadataTool::m_beginInputFileCalled
privateinherited

Flag helping to discover when the tool misses the opening of the first input file.

Definition at line 126 of file AsgMetadataTool.h.

◆ m_bIsConfigured

bool TauAnalysisTools::TauEfficiencyCorrectionsTool::m_bIsConfigured
private

Definition at line 117 of file TauEfficiencyCorrectionsTool.h.

◆ m_bIsData

bool TauAnalysisTools::TauEfficiencyCorrectionsTool::m_bIsData
private

Definition at line 116 of file TauEfficiencyCorrectionsTool.h.

◆ m_bReadRandomRunNumber

Gaudi::Property<bool> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_bReadRandomRunNumber {this, "AutoTriggerYear", false}
private

Definition at line 101 of file TauEfficiencyCorrectionsTool.h.

101{this, "AutoTriggerYear", false};

◆ m_bSkipTruthMatchCheck

Gaudi::Property<bool> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_bSkipTruthMatchCheck {this, "SkipTruthMatchCheck", false}
private

Definition at line 108 of file TauEfficiencyCorrectionsTool.h.

108{this, "SkipTruthMatchCheck", false};

◆ m_bUseTauSubstructure

Gaudi::Property<bool> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_bUseTauSubstructure {this, "UseTauSubstructure", false}
private

Definition at line 103 of file TauEfficiencyCorrectionsTool.h.

103{this, "UseTauSubstructure", false};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_firstEvent

bool TauAnalysisTools::TauEfficiencyCorrectionsTool::m_firstEvent = false
private

Definition at line 118 of file TauEfficiencyCorrectionsTool.h.

◆ m_iEleIDLevel

Gaudi::Property<int> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_iEleIDLevel {this, "EleIDLevel", static_cast<int>(ELEIDNONE)}
private

Definition at line 105 of file TauEfficiencyCorrectionsTool.h.

105{this, "EleIDLevel", static_cast<int>(ELEIDNONE)};

◆ m_iJetIDLevel

Gaudi::Property<int> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_iJetIDLevel {this, "JetIDLevel", static_cast<int>(JETIDNONE)}
private

Definition at line 104 of file TauEfficiencyCorrectionsTool.h.

104{this, "JetIDLevel", static_cast<int>(JETIDNONE)};

◆ m_inputMetaStore

MetaStore_t asg::AsgMetadataTool::m_inputMetaStore
privateinherited

Object accessing the input metadata store.

Definition at line 119 of file AsgMetadataTool.h.

◆ m_iRunNumber

unsigned int TauAnalysisTools::TauEfficiencyCorrectionsTool::m_iRunNumber
private

Definition at line 119 of file TauEfficiencyCorrectionsTool.h.

◆ m_outputMetaStore

MetaStore_t asg::AsgMetadataTool::m_outputMetaStore
privateinherited

Object accessing the output metadata store.

Definition at line 121 of file AsgMetadataTool.h.

◆ m_sCampaign

Gaudi::Property<std::string> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sCampaign {this, "Campaign", ""}
private

Definition at line 106 of file TauEfficiencyCorrectionsTool.h.

106{this, "Campaign", ""};

◆ m_sInputFilePathDecayModeHadTau

std::string TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sInputFilePathDecayModeHadTau
private

Definition at line 114 of file TauEfficiencyCorrectionsTool.h.

◆ m_sInputFilePathEleIDElectron

Gaudi::Property<std::string> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sInputFilePathEleIDElectron {this, "InputFilePathEleIDElectron", ""}
private

Definition at line 96 of file TauEfficiencyCorrectionsTool.h.

96{this, "InputFilePathEleIDElectron", ""};

◆ m_sInputFilePathEleIDHadTau

Gaudi::Property<std::string> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sInputFilePathEleIDHadTau {this, "InputFilePathEleIDHadTau", ""}
private

Definition at line 95 of file TauEfficiencyCorrectionsTool.h.

95{this, "InputFilePathEleIDHadTau", ""};

◆ m_sInputFilePathJetIDHadTau

Gaudi::Property<std::string> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sInputFilePathJetIDHadTau {this, "InputFilePathJetIDHadTau", ""}
private

Definition at line 97 of file TauEfficiencyCorrectionsTool.h.

97{this, "InputFilePathJetIDHadTau", ""};

◆ m_sInputFilePathRecoHadTau

Gaudi::Property<std::string> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sInputFilePathRecoHadTau {this, "InputFilePathRecoHadTau", ""}
private

Definition at line 94 of file TauEfficiencyCorrectionsTool.h.

94{this, "InputFilePathRecoHadTau", ""};

◆ m_sInputFilePathTriggerHadTau

Gaudi::Property<std::string> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sInputFilePathTriggerHadTau {this, "InputFilePathTriggerHadTau", ""}
private

Definition at line 98 of file TauEfficiencyCorrectionsTool.h.

98{this, "InputFilePathTriggerHadTau", ""};

◆ m_sRecommendationTag

Gaudi::Property<std::string> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sRecommendationTag {this, "RecommendationTag", "2025-prerec"}
private

Definition at line 99 of file TauEfficiencyCorrectionsTool.h.

99{this, "RecommendationTag", "2025-prerec"};

◆ m_sTriggerName

Gaudi::Property<std::string> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sTriggerName {this, "TriggerName", ""}
private

Definition at line 100 of file TauEfficiencyCorrectionsTool.h.

100{this, "TriggerName", ""};

◆ m_sTriggerSFMeasurement

Gaudi::Property<std::string> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sTriggerSFMeasurement {this, "TriggerSFMeasurement", "combined"}
private

Definition at line 102 of file TauEfficiencyCorrectionsTool.h.

102{this, "TriggerSFMeasurement", "combined"};

◆ m_sVarName

std::string TauAnalysisTools::TauEfficiencyCorrectionsTool::m_sVarName
private

Definition at line 115 of file TauEfficiencyCorrectionsTool.h.

◆ m_useFastSim

Gaudi::Property<bool> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_useFastSim {this, "useFastSim", false}
private

Definition at line 107 of file TauEfficiencyCorrectionsTool.h.

107{this, "useFastSim", false};

◆ m_useIncidents

bool asg::AsgMetadataTool::m_useIncidents
privateinherited

Definition at line 128 of file AsgMetadataTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vCommonEfficiencyTools

std::vector< asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>* > TauAnalysisTools::TauEfficiencyCorrectionsTool::m_vCommonEfficiencyTools
private

Definition at line 112 of file TauEfficiencyCorrectionsTool.h.

◆ m_vecEfficiencyCorrectionTypes

Gaudi::Property<std::vector<int> > TauAnalysisTools::TauEfficiencyCorrectionsTool::m_vecEfficiencyCorrectionTypes {this, "EfficiencyCorrectionTypes", {}}
private

Definition at line 109 of file TauEfficiencyCorrectionsTool.h.

109{this, "EfficiencyCorrectionTypes", {}};

◆ m_vEfficiencyCorrectionTypes

std::vector<int> TauAnalysisTools::TauEfficiencyCorrectionsTool::m_vEfficiencyCorrectionTypes
private

Definition at line 111 of file TauEfficiencyCorrectionsTool.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_vTriggerEfficiencyTools

std::vector< asg::AnaToolHandle<ITauEfficiencyCorrectionsTool>* > TauAnalysisTools::TauEfficiencyCorrectionsTool::m_vTriggerEfficiencyTools
private

Definition at line 113 of file TauEfficiencyCorrectionsTool.h.


The documentation for this class was generated from the following files: