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

#include <DiTauEfficiencyCorrectionsTool.h>

Inheritance diagram for TauAnalysisTools::DiTauEfficiencyCorrectionsTool:
Collaboration diagram for TauAnalysisTools::DiTauEfficiencyCorrectionsTool:

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

 DiTauEfficiencyCorrectionsTool (const std::string &sName)
 Create a proper constructor for Athena.
 ~DiTauEfficiencyCorrectionsTool ()
virtual StatusCode initialize ()
 Function initialising the tool.
virtual void printConfig () const
 Print tool configuration.
virtual CP::CorrectionCode getEfficiencyScaleFactor (const xAOD::DiTauJet &xDiTau, double &eff)
 Get the ditau Efficiency Scale Factor as a return value.
virtual CP::CorrectionCode applyEfficiencyScaleFactor (const xAOD::DiTauJet &xDiTau)
 decorate the ditau jet with eff scale factor
virtual bool isAffectedBySystematic (const CP::SystematicVariation &systematic) const
 returns whether this tool is affected by the given systematic
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)
 apply systematic variations
virtual bool isSupportedRunNumber (int) const
 check if run number is supperted 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 beginInputFile ()
 Function called when a new input file is opened.
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 beginEvent ()
 Function called when a new events is loaded.
std::string ConvertJetIDToString (const int iLevel) const
StatusCode initializeTools_2017_moriond ()
 Initialize Moriond 2017 recommendations.
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_sInputFilePathJetIDHadTau {this, "InputFilePathJetIDHadTau", ""}
Gaudi::Property< std::string > m_sVarNameJetIDHadTau {this, "VarNameJetIDHadTau", ""}
Gaudi::Property< std::string > m_sRecommendationTag {this, "RecommendationTag", "2017-moriond"}
Gaudi::Property< int > m_iJetIDLevel {this, "JetIDLevel", static_cast<int>(JETIDBDTTIGHT)}
Gaudi::Property< bool > m_bSkipTruthMatchCheck {this, "SkipTruthMatchCheck", false}
Gaudi::Property< std::vector< int > > m_vEfficiencyCorrectionTypes {this, "EfficiencyCorrectionTypes", {SFJetIDHadTau}}
std::vector< asg::AnaToolHandle< IDiTauEfficiencyCorrectionsTool > * > m_vCommonEfficiencyTools
bool m_bIsData
bool m_bIsConfigured
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 29 of file DiTauEfficiencyCorrectionsTool.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

◆ DiTauEfficiencyCorrectionsTool()

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

Create a proper constructor for Athena.

Definition at line 25 of file DiTauEfficiencyCorrectionsTool.cxx.

26 : asg::AsgMetadataTool( sName )
28 , m_bIsData(false)
29 , m_bIsConfigured(false)
30{
31}
std::vector< asg::AnaToolHandle< IDiTauEfficiencyCorrectionsTool > * > m_vCommonEfficiencyTools

◆ ~DiTauEfficiencyCorrectionsTool()

TauAnalysisTools::DiTauEfficiencyCorrectionsTool::~DiTauEfficiencyCorrectionsTool ( )

Definition at line 34 of file DiTauEfficiencyCorrectionsTool.cxx.

35{
36 for (auto tTool : m_vCommonEfficiencyTools)
37 delete tTool;
38}

Member Function Documentation

◆ affectingSystematics()

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

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

Implements CP::IReentrantSystematicsTool.

Definition at line 154 of file DiTauEfficiencyCorrectionsTool.cxx.

155{
156 CP::SystematicSet sAffectingSystematics;
157 for (auto it = m_vCommonEfficiencyTools.begin(); it != m_vCommonEfficiencyTools.end(); it++)
158 sAffectingSystematics.insert((**it)->affectingSystematics());
159 return sAffectingSystematics;
160}
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set

◆ applyEfficiencyScaleFactor()

CP::CorrectionCode TauAnalysisTools::DiTauEfficiencyCorrectionsTool::applyEfficiencyScaleFactor ( const xAOD::DiTauJet & xDiTau)
virtual

decorate the ditau jet with eff scale factor

Parameters
xDiTau: reco DiTauJet
Returns
CP::CorrectionCode

Implements TauAnalysisTools::IDiTauEfficiencyCorrectionsTool.

Definition at line 126 of file DiTauEfficiencyCorrectionsTool.cxx.

127{
128 if (m_bIsData)
130
131 for (auto it = m_vCommonEfficiencyTools.begin(); it != m_vCommonEfficiencyTools.end(); it++)
132 {
133 CP::CorrectionCode tmpCorrectionCode = (**it)->applyEfficiencyScaleFactor(xDiTau);
134 if (tmpCorrectionCode != CP::CorrectionCode::Ok)
135 {
136 return tmpCorrectionCode;
137 }
138 }
140}
@ Ok
The correction was done successfully.

◆ applySystematicVariation()

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

apply systematic variations

Implements CP::ISystematicsTool.

Definition at line 175 of file DiTauEfficiencyCorrectionsTool.cxx.

176{
177 for (auto it = m_vCommonEfficiencyTools.begin(); it != m_vCommonEfficiencyTools.end(); it++)
178 if ((**it)->applySystematicVariation(sSystematicSet) == StatusCode::FAILURE)
179 {
180 return StatusCode::FAILURE;
181 }
182 return StatusCode::SUCCESS;
183}

◆ beginEvent()

StatusCode TauAnalysisTools::DiTauEfficiencyCorrectionsTool::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 79 of file DiTauEfficiencyCorrectionsTool.cxx.

80{
81 if (!m_bIsConfigured)
82 {
83 const xAOD::EventInfo* xEventInfo = nullptr;
84 ATH_CHECK(evtStore()->retrieve(xEventInfo,"EventInfo"));
86 m_bIsConfigured = true;
87 }
88
89 return StatusCode::SUCCESS;
90}
#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 asg::AsgMetadataTool::beginInputFile ( )
protectedvirtualinherited

Function called when a new input file is opened.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in AsgElectronEfficiencyCorrectionTool, BookkeeperDumperTool, BookkeeperTool, PMGTools::PMGTruthWeightTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, TauAnalysisTools::TauSmearingTool, Trig::TrigDecisionTool, Trig::xAODBunchCrossingTool, TrigConf::xAODConfigTool, xAODMaker::TriggerMenuMetaDataTool, and xAODMaker::TruthMetaDataTool.

Definition at line 185 of file AsgMetadataTool.cxx.

185 {
186
187 // Return gracefully:
188 return StatusCode::SUCCESS;
189 }

◆ ConvertJetIDToString()

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

Definition at line 219 of file DiTauEfficiencyCorrectionsTool.cxx.

220{
221 switch(iLevel)
222 {
223 case JETIDNONE:
224 return "ditaureconstruction";
225 break;
227 return "jetbdtsigveryloose";
228 break;
229 case JETIDBDTLOOSE:
230 return "jetbdtsigloose";
231 break;
232 case JETIDBDTMEDIUM:
233 return "jetbdtsigmedium";
234 break;
235 case JETIDBDTTIGHT:
236 return "jetbdtsigtight";
237 break;
238 default:
239 assert(false && "No valid ID level passed. Breaking up ...");
240 break;
241 }
242 return "";
243}

◆ 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

◆ getEfficiencyScaleFactor()

CP::CorrectionCode TauAnalysisTools::DiTauEfficiencyCorrectionsTool::getEfficiencyScaleFactor ( const xAOD::DiTauJet & xDiTau,
double & eff )
virtual

Get the ditau Efficiency Scale Factor as a return value.

Parameters
xDiTau: reco DiTauJet
eff: reference to output variable where efficiency is returned
Returns
CP::CorrectionCode

Implements TauAnalysisTools::IDiTauEfficiencyCorrectionsTool.

Definition at line 106 of file DiTauEfficiencyCorrectionsTool.cxx.

108{
109 eff = 1.;
110
111 if (m_bIsData)
113
114 for (auto it = m_vCommonEfficiencyTools.begin(); it != m_vCommonEfficiencyTools.end(); it++)
115 {
116 double dToolEff = 1.;
117 CP::CorrectionCode tmpCorrectionCode = (**it)->getEfficiencyScaleFactor(xDiTau, dToolEff);
118 if (tmpCorrectionCode != CP::CorrectionCode::Ok)
119 return tmpCorrectionCode;
120 eff *= dToolEff;
121 }
123}

◆ 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.

◆ 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)
#define ATH_MSG_WARNING(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::DiTauEfficiencyCorrectionsTool::initialize ( void )
virtual

Function initialising the tool.

Reimplemented from asg::AsgTool.

Definition at line 42 of file DiTauEfficiencyCorrectionsTool.cxx.

43{
44 // Greet the user:
45 ATH_MSG_INFO( "Initializing DiTauEfficiencyCorrectionsTool" );
46
48 ATH_MSG_WARNING("Truth match check will be skipped. This is ONLY FOR TESTING PURPOSE!");
49
50 if (m_sRecommendationTag == "2017-moriond")
52 else
53 {
54 ATH_MSG_FATAL("Unknown RecommendationTag: "<<m_sRecommendationTag);
55 return StatusCode::FAILURE;
56 }
57
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
StatusCode initializeTools_2017_moriond()
Initialize Moriond 2017 recommendations.
virtual void printConfig() const
Print tool configuration.

◆ initializeTools_2017_moriond()

StatusCode TauAnalysisTools::DiTauEfficiencyCorrectionsTool::initializeTools_2017_moriond ( )
private

Initialize Moriond 2017 recommendations.

Definition at line 188 of file DiTauEfficiencyCorrectionsTool.cxx.

189{
190 std::string sDirectory = "TauAnalysisTools/" + std::string(sSharedFilesVersion) + "/EfficiencyCorrections/";
191 for (auto iEfficiencyCorrectionType : m_vEfficiencyCorrectionTypes)
192 {
193 if (iEfficiencyCorrectionType == SFJetIDHadTau)
194 {
195 // only set vars if they have been configured by the user
196 if (m_sInputFilePathJetIDHadTau.empty()) {
197 sDirectory = "TauAnalysisTools/00-04-00/EfficiencyCorrections/";
198 m_sInputFilePathJetIDHadTau = sDirectory+"JetID_TrueHadDiTau_2017-fall.root";
199 }
200 if (m_sVarNameJetIDHadTau.empty()) m_sVarNameJetIDHadTau = "DiTauScaleFactorJetIDHadTau";
201
202 asg::AnaToolHandle<IDiTauEfficiencyCorrectionsTool>* tTool = new asg::AnaToolHandle<IDiTauEfficiencyCorrectionsTool>("JetIDHadTauTool", this);
203 m_vCommonEfficiencyTools.push_back(tTool);
204 ATH_CHECK(ASG_MAKE_ANA_TOOL(*tTool, TauAnalysisTools::CommonDiTauEfficiencyTool));
205 ATH_CHECK(tTool->setProperty("InputFilePath", m_sInputFilePathJetIDHadTau));
206 ATH_CHECK(tTool->setProperty("VarName", m_sVarNameJetIDHadTau));
207 ATH_CHECK(tTool->setProperty("SkipTruthMatchCheck", m_bSkipTruthMatchCheck));
208 ATH_CHECK(tTool->setProperty("WP", ConvertJetIDToString(m_iJetIDLevel)));
209 }
210 else
211 {
212 ATH_MSG_WARNING("unsupported EfficiencyCorrectionsType with enum " << iEfficiencyCorrectionType);
213 }
214 }
215 return StatusCode::SUCCESS;
216}
#define ASG_MAKE_ANA_TOOL(handle, type)
create the tool in the given tool handle
static const char *const sSharedFilesVersion
Version of the calibration files.
Gaudi::Property< std::vector< int > > m_vEfficiencyCorrectionTypes

◆ 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::DiTauEfficiencyCorrectionsTool::isAffectedBySystematic ( const CP::SystematicVariation & systematic) const
virtual

returns whether this tool is affected by the given systematic

returns: whether this tool is affected by the given systematis

Parameters
systematic
Returns
true
false

Implements CP::ISystematicsTool.

Definition at line 144 of file DiTauEfficiencyCorrectionsTool.cxx.

145{
146 for (auto it = m_vCommonEfficiencyTools.begin(); it != m_vCommonEfficiencyTools.end(); it++)
147 if ((**it)->isAffectedBySystematic(systematic))
148 return true;
149 return false;
150}

◆ isSupportedRunNumber()

virtual bool TauAnalysisTools::DiTauEfficiencyCorrectionsTool::isSupportedRunNumber ( int ) const
inlinevirtual

check if run number is supperted in recommendations

Parameters
iRunNumber
Returns
true if ditau recommendations support this run
Note
currently no implementaion exists, alwasys returns true

Definition at line 93 of file DiTauEfficiencyCorrectionsTool.h.

94 {
95 return true;
96 };

◆ 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::DiTauEfficiencyCorrectionsTool::printConfig ( ) const
virtual

Print tool configuration.

Definition at line 94 of file DiTauEfficiencyCorrectionsTool.cxx.

95{
96 ATH_MSG_DEBUG( "DiTauEfficiencyCorrectionsTool with name " << name() << " is configured as follows:" );
97 for (auto iEfficiencyCorrectionType : m_vEfficiencyCorrectionTypes) {
98 ATH_MSG_DEBUG( " EfficiencyCorrectionTypes " << iEfficiencyCorrectionType );
99 }
100 ATH_MSG_DEBUG( " InputFilePathJetIDHadTau " << m_sInputFilePathJetIDHadTau );
101 ATH_MSG_DEBUG( " VarNameJetIDHadTau " << m_sVarNameJetIDHadTau );
102 ATH_MSG_DEBUG( " RecommendationTag " << m_sRecommendationTag );
103}
#define ATH_MSG_DEBUG(x)

◆ recommendedSystematics()

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

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

Implements CP::IReentrantSystematicsTool.

Definition at line 164 of file DiTauEfficiencyCorrectionsTool.cxx.

165{
166 CP::SystematicSet sRecommendedSystematics;
167 for (auto it = m_vCommonEfficiencyTools.begin(); it != m_vCommonEfficiencyTools.end(); it++)
168 {
169 sRecommendedSystematics.insert((**it)->recommendedSystematics());
170 }
171 return sRecommendedSystematics;
172}

◆ 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::DiTauEfficiencyCorrectionsTool::m_bIsConfigured
private

Definition at line 117 of file DiTauEfficiencyCorrectionsTool.h.

◆ m_bIsData

bool TauAnalysisTools::DiTauEfficiencyCorrectionsTool::m_bIsData
private

Definition at line 116 of file DiTauEfficiencyCorrectionsTool.h.

◆ m_bSkipTruthMatchCheck

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

Definition at line 112 of file DiTauEfficiencyCorrectionsTool.h.

112{this, "SkipTruthMatchCheck", 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_iJetIDLevel

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

Definition at line 111 of file DiTauEfficiencyCorrectionsTool.h.

111{this, "JetIDLevel", static_cast<int>(JETIDBDTTIGHT)};

◆ m_inputMetaStore

MetaStore_t asg::AsgMetadataTool::m_inputMetaStore
privateinherited

Object accessing the input metadata store.

Definition at line 119 of file AsgMetadataTool.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_sInputFilePathJetIDHadTau

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

Definition at line 108 of file DiTauEfficiencyCorrectionsTool.h.

108{this, "InputFilePathJetIDHadTau", ""};

◆ m_sRecommendationTag

Gaudi::Property<std::string> TauAnalysisTools::DiTauEfficiencyCorrectionsTool::m_sRecommendationTag {this, "RecommendationTag", "2017-moriond"}
private

Definition at line 110 of file DiTauEfficiencyCorrectionsTool.h.

110{this, "RecommendationTag", "2017-moriond"};

◆ m_sVarNameJetIDHadTau

Gaudi::Property<std::string> TauAnalysisTools::DiTauEfficiencyCorrectionsTool::m_sVarNameJetIDHadTau {this, "VarNameJetIDHadTau", ""}
private

Definition at line 109 of file DiTauEfficiencyCorrectionsTool.h.

109{this, "VarNameJetIDHadTau", ""};

◆ 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<IDiTauEfficiencyCorrectionsTool>* > TauAnalysisTools::DiTauEfficiencyCorrectionsTool::m_vCommonEfficiencyTools
private

Definition at line 115 of file DiTauEfficiencyCorrectionsTool.h.

◆ m_vEfficiencyCorrectionTypes

Gaudi::Property<std::vector<int> > TauAnalysisTools::DiTauEfficiencyCorrectionsTool::m_vEfficiencyCorrectionTypes {this, "EfficiencyCorrectionTypes", {SFJetIDHadTau}}
private

Definition at line 113 of file DiTauEfficiencyCorrectionsTool.h.

113{this, "EfficiencyCorrectionTypes", {SFJetIDHadTau}};

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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