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

#include <TauSelectionTool.h>

Inheritance diagram for TauAnalysisTools::TauSelectionTool:

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

 TauSelectionTool (const std::string &name)
 Constructor for standalone usage.
virtual ~TauSelectionTool ()
virtual StatusCode initialize () override
 Function initialising the tool.
virtual const asg::AcceptInfogetAcceptInfo () const override
 Get an object describing the "selection steps" of the tool.
virtual asg::AcceptData accept (const xAOD::IParticle *p) const override
 Get the decision using a generic IParticle pointer.
virtual asg::AcceptData accept (const xAOD::TauJet &tau) const override
 Get the decision for a specific TauJet object.
virtual void setOutFile (TFile *fOutFile) override
 Set output file for control histograms.
virtual void writeControlHistograms () override
 Write control histograms to output file.
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/Event.
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.

Protected Attributes

TFile * m_fOutFile
std::shared_ptr< TH1F > m_hCutFlow
Gaudi::Property< bool > m_bCreateControlPlots {this, "CreateControlPlots", false}
asg::AcceptInfo m_aAccept
 Object used to store selection information.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

 ASG_TOOL_CLASS2 (TauSelectionTool, IAsgSelectionTool, TauAnalysisTools::ITauSelectionTool) friend class TauEfficiencyCorrectionsTool
 Create a proper constructor for Athena.
virtual StatusCode beginEvent () override
 Function called when a new events is loaded.
template<typename T, typename U>
void FillRegionVector (std::vector< T > &vRegion, U tMin, U tMax) const
template<typename T, typename U>
void FillValueVector (std::vector< T > &vRegion, U tVal) const
template<typename T>
void PrintConfigRegion (const std::string &sCutName, std::vector< T > &vRegion) const
template<typename T>
void PrintConfigValue (const std::string &sCutName, std::vector< T > &vRegion) const
template<typename T>
void PrintConfigValue (const std::string &sCutName, T &sVal) const
void setupCutFlowHistogram ()
int convertStrToJetIDWP (const std::string &sJetIDWP) const
int convertStrToEleIDWP (const std::string &sEleIDWP) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::vector< float > m_vPtRegion
std::vector< float > m_vAbsEtaRegion
std::vector< int > m_vAbsCharges
std::vector< unsigned > m_vNTracks
std::vector< float > m_vJetRNNSigTransRegion
std::vector< float > m_vGNTauSigTransRegion
std::string m_sJetIDWP
bool m_useGNTau =false
std::vector< float > m_vEleRNNSigTransRegion
std::string m_sEleIDWP
Gaudi::Property< int > m_iSelectionCuts {this, "SelectionCuts", NoCut}
Gaudi::Property< float > m_dPtMin {this, "PtMin", NAN}
Gaudi::Property< float > m_dAbsEtaMin {this, "AbsEtaMin", NAN}
Gaudi::Property< float > m_dAbsEtaMax {this, "AbsEtaMax", NAN}
Gaudi::Property< float > m_iAbsCharge {this, "AbsCharge", NAN}
Gaudi::Property< float > m_dJetRNNSigTransMin {this, "JetRNNSigTransMin", NAN}
Gaudi::Property< float > m_dGNTauSigTransMin {this, "GNTauSigTransMin", NAN}
Gaudi::Property< float > m_iNTrack {this, "NTrack", NAN}
Gaudi::Property< float > m_dEleRNNSigTransMin {this, "EleRNNSigTransMin", NAN}
Gaudi::Property< int > m_iJetIDWP {this, "JetIDWP", 1}
Gaudi::Property< int > m_iEleIDWP {this, "EleIDWP", 0}
Gaudi::Property< int > m_iEleIDVersion {this, "EleIDVersion", 1}
Gaudi::Property< bool > m_bMuonOLR {this, "MuonOLR", false}
Gaudi::Property< std::vector< float > > m_vecAbsEtaRegion {this, "AbsEtaRegion",{}}
Gaudi::Property< std::vector< int > > m_vecAbsCharges {this, "AbsCharges", {}}
Gaudi::Property< std::vector< unsigned > > m_vecNTracks {this, "NTracks", {}}
Gaudi::Property< std::string > m_sConfigPath {this, "ConfigPath", "TauAnalysisTools/"+std::string(sSharedFilesVersion)+"/Selection/recommended_selection_r22.conf"}
SG::ReadHandleKey< xAOD::MuonContainerm_muonContainerKey {this, "MuonContainerName", "Muons", "Muon container name"}
SG::ReadHandleKey< xAOD::TauJetContainerm_tauContainerKey {this, "TauContainerName", "TauJets", "Tau container name"}
SG::ReadDecorHandleKey< xAOD::TauJetContainerm_eVetoDecorKey {this, "eVetoDecorName", "", "Name of eVeto decoration"}
SG::ReadDecorHandleKey< xAOD::TauJetContainerm_GNTauDecorKey {this, "GNTauDecorName", "", "Name of GnTauID decoration"}
std::map< SelectionCuts, std::unique_ptr< TauAnalysisTools::TauSelectionCut > > m_cMap
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

Friends

class TauSelectionCut
 need to define cut classes to be friends to access protected variables, needed for access of cut thresholds
class TauSelectionCutPt
class TauSelectionCutAbsEta
class TauSelectionCutAbsCharge
class TauSelectionCutNTracks
class TauSelectionCutJetIDWP
class TauSelectionCutRNNJetScoreSigTrans
class TauSelectionCutGNTauScoreSigTrans
class TauSelectionCutRNNEleScoreSigTrans
class TauSelectionCutEleIDWP
class TauSelectionCutMuonOLR

Detailed Description

Definition at line 52 of file TauSelectionTool.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

◆ TauSelectionTool()

TauSelectionTool::TauSelectionTool ( const std::string & name)

Constructor for standalone usage.

Definition at line 20 of file TauSelectionTool.cxx.

21 : asg::AsgMetadataTool( name )
22 , m_sJetIDWP("JETIDNONE")
23 , m_sEleIDWP("ELEIDNONE")
24 , m_fOutFile(nullptr)
25 , m_aAccept( "TauSelection" )
26{}
asg::AcceptInfo m_aAccept
Object used to store selection information.

◆ ~TauSelectionTool()

TauSelectionTool::~TauSelectionTool ( )
virtual

Definition at line 29 of file TauSelectionTool.cxx.

30{
31 m_cMap.clear();
32}
std::map< SelectionCuts, std::unique_ptr< TauAnalysisTools::TauSelectionCut > > m_cMap

Member Function Documentation

◆ accept() [1/2]

asg::AcceptData TauSelectionTool::accept ( const xAOD::IParticle * p) const
overridevirtual

Get the decision using a generic IParticle pointer.

Implements IAsgSelectionTool.

Definition at line 309 of file TauSelectionTool.cxx.

310{
311 // Check if this is a tau:
312 if( xP->type() != xAOD::Type::Tau )
313 {
314 ATH_MSG_ERROR( "accept(...) Function received a non-tau" );
315 return asg::AcceptData (&m_aAccept);
316 }
317
318 // Cast it to a tau:
319 const xAOD::TauJet* xTau = dynamic_cast< const xAOD::TauJet* >( xP );
320 if( ! xTau )
321 {
322 ATH_MSG_FATAL( "accept(...) Failed to cast particle to tau" );
323 return asg::AcceptData (&m_aAccept);
324 }
325
326 // Let the specific function do the work:
327 return accept( *xTau );
328}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
virtual asg::AcceptData accept(const xAOD::IParticle *p) const override
Get the decision using a generic IParticle pointer.
@ Tau
The object is a tau (jet).
Definition ObjectType.h:49
TauJet_v3 TauJet
Definition of the current "tau version".

◆ accept() [2/2]

asg::AcceptData TauSelectionTool::accept ( const xAOD::TauJet & tau) const
overridevirtual

Get the decision for a specific TauJet object.

Implements TauAnalysisTools::ITauSelectionTool.

Definition at line 331 of file TauSelectionTool.cxx.

332{
333 asg::AcceptData acceptData (&m_aAccept);
334
335 int iNBin = 0;
336
338 {
339 // fill cutflow 'All' bin
340 m_hCutFlow->Fill(iNBin);
341 // fill main distributions before all cuts
342 for (const auto& entry : m_cMap)
343 entry.second->fillHistogramCutPre(xTau);
344 }
345 try
346 {
347 for (const auto& entry : m_cMap)
348 {
349 if (m_iSelectionCuts & entry.first)
350 {
351 if (!entry.second->accept(xTau, acceptData))
352 return acceptData;
353 else
354 {
356 {
357 // fill cutflow after each passed cut
358 iNBin++;
359 m_hCutFlow->Fill(iNBin);
360 }
361 }
362 }
363 }
364 }
365 catch (const std::runtime_error& error)
366 {
367 // LEGACY: In practical terms this should probably just throw, not
368 // print a warning/error and then continue on. However, I leave
369 // that to the experts who probably had a reason not to let the
370 // exception escape. For now I just downgraded it from error to
371 // warning and limited the number of warnings (04 Jan 22).
372 static std::atomic<uint64_t> warning_count (0u);
373 auto mycount = ++ warning_count;
374 if (mycount < 10u)
375 {
376 ATH_MSG_WARNING(error.what());
377 if (mycount == 9u)
378 ATH_MSG_WARNING ("this is your last warning");
379 }
380 }
381
382 // fill main distributions after all cuts
384 {
385 for (const auto& entry : m_cMap)
386 entry.second->fillHistogramCut(xTau);
387 }
388
389 // // Return the result:
390 return acceptData;
391}
#define ATH_MSG_WARNING(x)
Gaudi::Property< bool > m_bCreateControlPlots
Gaudi::Property< int > m_iSelectionCuts

◆ ASG_TOOL_CLASS2()

TauAnalysisTools::TauSelectionTool::ASG_TOOL_CLASS2 ( TauSelectionTool ,
IAsgSelectionTool ,
TauAnalysisTools::ITauSelectionTool  )
private

Create a proper constructor for Athena.

◆ beginEvent()

StatusCode TauSelectionTool::beginEvent ( )
overrideprivatevirtual

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 297 of file TauSelectionTool.cxx.

298{
299 return StatusCode::SUCCESS;
300}

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

◆ convertStrToEleIDWP()

int TauSelectionTool::convertStrToEleIDWP ( const std::string & sEleIDWP) const
private

Definition at line 512 of file TauSelectionTool.cxx.

513{
514 if (sEleIDWP == "ELEIDNONE") return int(ELEIDNONE);
515 else if (sEleIDWP == "ELEIDRNNLOOSE") return int(ELEIDRNNLOOSE);
516 else if (sEleIDWP == "ELEIDRNNMEDIUM") return int(ELEIDRNNMEDIUM);
517 else if (sEleIDWP == "ELEIDRNNTIGHT") return int(ELEIDRNNTIGHT);
518
519 ATH_MSG_ERROR( "electron ID working point " << sEleIDWP << " is unknown, the EleIDWP cut will not accept any tau!" );
520 return -1;
521}

◆ convertStrToJetIDWP()

int TauSelectionTool::convertStrToJetIDWP ( const std::string & sJetIDWP) const
private

Definition at line 495 of file TauSelectionTool.cxx.

496{
497 if (sJetIDWP == "JETIDNONE") return int(JETIDNONE);
498 else if (sJetIDWP == "JETIDRNNVERYLOOSE") return int(JETIDRNNVERYLOOSE);
499 else if (sJetIDWP == "JETIDRNNLOOSE") return int(JETIDRNNLOOSE);
500 else if (sJetIDWP == "JETIDRNNMEDIUM") return int(JETIDRNNMEDIUM);
501 else if (sJetIDWP == "JETIDRNNTIGHT") return int(JETIDRNNTIGHT);
502 else if (sJetIDWP == "JETIDGNTAUVERYLOOSE") return int(JETIDGNTAUVERYLOOSE);
503 else if (sJetIDWP == "JETIDGNTAULOOSE") return int(JETIDGNTAULOOSE);
504 else if (sJetIDWP == "JETIDGNTAUMEDIUM") return int(JETIDGNTAUMEDIUM);
505 else if (sJetIDWP == "JETIDGNTAUTIGHT") return int(JETIDGNTAUTIGHT);
506
507 ATH_MSG_ERROR( "jet ID working point "<<sJetIDWP<<" is unknown, the JetIDWP cut will not accept any tau!" );
508 return -1;
509}

◆ 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

◆ FillRegionVector()

template<typename T, typename U>
void TauSelectionTool::FillRegionVector ( std::vector< T > & vRegion,
U tMin,
U tMax ) const
private

Definition at line 443 of file TauSelectionTool.cxx.

444{
445 if (!vRegion.empty())
446 return;
447 if (tMin == tMin) // if tMin is NAN, then this assumption fails and -inf is added to the vector
448 vRegion.push_back(tMin);
449 else
450 vRegion.push_back(-std::numeric_limits<T>::infinity());
451
452 if (tMax == tMax) // if tMax is NAN, then this assumption fails and inf is added to the vector
453 vRegion.push_back(tMax);
454 else
455 vRegion.push_back(std::numeric_limits<T>::infinity());
456}

◆ FillValueVector()

template<typename T, typename U>
void TauSelectionTool::FillValueVector ( std::vector< T > & vRegion,
U tVal ) const
private

Definition at line 460 of file TauSelectionTool.cxx.

461{
462 if (!vRegion.empty())
463 return;
464 if (tVal == tVal) // if tMax is NAN, then this assumption fails and nothing is added to the vector
465 vRegion.push_back(tVal);
466}

◆ getAcceptInfo()

const asg::AcceptInfo & TauSelectionTool::getAcceptInfo ( ) const
overridevirtual

Get an object describing the "selection steps" of the tool.

Implements IAsgSelectionTool.

Definition at line 303 of file TauSelectionTool.cxx.

304{
305 return m_aAccept;
306}

◆ 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::Event 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::Event, 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 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ 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::Event 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::Event, 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/Event.

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_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 TauSelectionTool::initialize ( void )
overridevirtual

Function initialising the tool.

Implements TauAnalysisTools::ITauSelectionTool.

Definition at line 35 of file TauSelectionTool.cxx.

36{
37
40 m_vNTracks = m_vecNTracks.value();
41
42 bool bConfigViaConfigFile = !m_sConfigPath.empty();
43 bool bConfigViaProperties = false;
44 if (!bConfigViaProperties and !std::isnan(m_dPtMin.value())) bConfigViaProperties = true;
45 if (!bConfigViaProperties and !m_vAbsEtaRegion.empty()) bConfigViaProperties = true;
46 if (!bConfigViaProperties and !std::isnan(m_dAbsEtaMin.value())) bConfigViaProperties = true;
47 if (!bConfigViaProperties and !std::isnan(m_dAbsEtaMax.value())) bConfigViaProperties = true;
48 if (!bConfigViaProperties and !m_vAbsCharges.empty()) bConfigViaProperties = true;
49 if (!bConfigViaProperties and !std::isnan(m_iAbsCharge.value())) bConfigViaProperties = true;
50 if (!bConfigViaProperties and !m_vNTracks.empty()) bConfigViaProperties = true;
51 if (!bConfigViaProperties and !std::isnan(m_iNTrack.value())) bConfigViaProperties = true;
52 if (!bConfigViaProperties and !std::isnan(m_dJetRNNSigTransMin.value())) bConfigViaProperties = true;
53 if (!bConfigViaProperties and !std::isnan(m_dGNTauSigTransMin.value())) bConfigViaProperties = true;
54 if (!bConfigViaProperties and m_iJetIDWP != TauAnalysisTools::JetID::JETIDNONE) bConfigViaProperties = true;
55 if (!bConfigViaProperties and !std::isnan(m_dEleRNNSigTransMin.value())) bConfigViaProperties = true;
56 if (!bConfigViaProperties and m_iEleIDWP != 0) bConfigViaProperties = true;
57 if (!bConfigViaProperties and m_bMuonOLR) bConfigViaProperties = true;
58
59 if (bConfigViaConfigFile and bConfigViaProperties)
60 {
61 ATH_MSG_ERROR("Configured tool via setProperty and configuration file, which may lead to unexpected configuration. Please setup the TauSelectionTool using only one of the two methods. For further details please refer to the documentation https://gitlab.cern.ch/atlas/athena/blob/main/PhysicsAnalysis/TauID/TauAnalysisTools/doc/README-TauSelectionTool.rst or contact the TauCP group.");
62 return StatusCode::FAILURE;
63 }
64 if (!bConfigViaConfigFile and !bConfigViaProperties)
65 {
66 ATH_MSG_WARNING("No cut configuration provided, the tool will not do anything. For further details please refer to the documentation:");
67 ATH_MSG_WARNING("https://gitlab.cern.ch/atlas/athena/blob/main/PhysicsAnalysis/TauID/TauAnalysisTools/doc/README-TauSelectionTool.rst");
68 return StatusCode::SUCCESS;
69 }
70
71 if (bConfigViaConfigFile)
72 {
73 TEnv rEnv;
74 std::string sInputFilePath = PathResolverFindCalibFile(m_sConfigPath);
75
76 if (!testFileForEOFContainsCharacters(sInputFilePath))
77 ATH_MSG_WARNING("Config file for TauSelectionTool with path "<<sInputFilePath<<" does not contain an empty last line. The tool might not be properly configured!");
78
79 rEnv.ReadFile(sInputFilePath.c_str(),
80 kEnvAll);
81
82 std::vector<std::string> vCuts;
83 // if Cuts are specified in the config file take these ones, if not take all
84 // specified in the config
85 if (rEnv.Defined("SelectionCuts"))
86 TauAnalysisTools::split(rEnv, "SelectionCuts", ' ', vCuts);
87 else
88 {
89 auto lList = rEnv.GetTable();
90 for( Int_t i = 0; i < lList->GetEntries(); ++i )
91 {
92 vCuts.push_back( lList->At( i )->GetName() );
93 }
94 }
95
96 int iSelectionCuts = 0;
97
98 for (const std::string& sCut : vCuts)
99 {
100 if (sCut == "PtMin")
101 {
102 iSelectionCuts = iSelectionCuts | CutPt;
103 if (std::isnan(m_dPtMin.value()))
104 m_dPtMin = rEnv.GetValue("PtMin",NAN);
105 }
106 else if (sCut == "AbsEtaRegion")
107 {
108 iSelectionCuts = iSelectionCuts | CutAbsEta;
109 if (m_vAbsEtaRegion.empty())
110 TauAnalysisTools::split(rEnv,"AbsEtaRegion", ';', m_vAbsEtaRegion);
111 }
112 else if (sCut == "AbsEtaMin")
113 {
114 iSelectionCuts = iSelectionCuts | CutAbsEta;
115 if (std::isnan(m_dAbsEtaMin.value()))
116 m_dAbsEtaMin = rEnv.GetValue("AbsEtaMin",NAN);
117 }
118 else if (sCut == "AbsEtaMax")
119 {
120 iSelectionCuts = iSelectionCuts | CutAbsEta;
121 if (std::isnan(m_dAbsEtaMax.value()))
122 m_dAbsEtaMax = rEnv.GetValue("AbsEtaMax",NAN);
123 }
124 else if (sCut == "AbsCharges")
125 {
126 iSelectionCuts = iSelectionCuts | CutAbsCharge;
127 if (m_vAbsCharges.empty())
128 TauAnalysisTools::split(rEnv,"AbsCharges", ';', m_vAbsCharges);
129 }
130 else if (sCut == "AbsCharge")
131 {
132 iSelectionCuts = iSelectionCuts | CutAbsCharge;
133 if (std::isnan(m_iAbsCharge.value()))
134 m_iAbsCharge = rEnv.GetValue("AbsCharge",NAN);
135 }
136 else if (sCut == "NTracks")
137 {
138 iSelectionCuts = iSelectionCuts | CutNTrack;
139 if (m_vNTracks.empty())
140 TauAnalysisTools::split(rEnv,"NTracks", ';', m_vNTracks);
141 }
142 else if (sCut == "NTrack")
143 {
144 iSelectionCuts = iSelectionCuts | CutNTrack;
145 if (std::isnan(m_iNTrack.value()))
146 m_iNTrack = rEnv.GetValue("NTrack",NAN);
147 }
148 else if (sCut == "JetRNNSigTransMin")
149 {
150 iSelectionCuts = iSelectionCuts | CutJetRNNScoreSigTrans;
151 if (std::isnan(m_dJetRNNSigTransMin.value()))
152 m_dJetRNNSigTransMin = rEnv.GetValue("JetRNNSigTransMin",NAN);
153 }
154 else if (sCut == "GNTauSigTransMin")
155 {
156 iSelectionCuts = iSelectionCuts | CutGNTauScoreSigTrans;
157 if (std::isnan(m_dGNTauSigTransMin.value()))
158 m_dGNTauSigTransMin = rEnv.GetValue("GNTauSigTransMin",NAN);
159
160 // check if using GNTau
161 m_useGNTau = true;
162 }
163 else if (sCut == "EleRNNSigTransMin")
164 {
165 iSelectionCuts = iSelectionCuts | CutEleRNNScoreSigTrans;
166 if (std::isnan(m_dEleRNNSigTransMin.value()))
167 m_dEleRNNSigTransMin = rEnv.GetValue("EleRNNSigTransMin",NAN);
168 }
169 else if (sCut == "JetIDWP")
170 {
171 iSelectionCuts = iSelectionCuts | CutJetIDWP;
172 if (m_iJetIDWP == JETIDNONE){
173 m_sJetIDWP = rEnv.GetValue("JetIDWP","JETIDNONE");
175 }
176 // check for possible mis-config in Tau selection
177 for (const std::string& checkCut : vCuts){
178 if (checkCut.find("SigTrans") != std::string::npos) {
179 ATH_MSG_ERROR("Misconfig due to JetIDWP and SigTrans cuts both present in the config file. Please CHECK carefully config file again");
180 return StatusCode::FAILURE;
181 }
182 }
183 }
184 else if (sCut == "EleIDWP")
185 {
186 iSelectionCuts = iSelectionCuts | CutEleIDWP;
188 m_sEleIDWP = rEnv.GetValue("EleIDWP","ELEIDNONE");
190 }
191 }
192 else if (sCut == "MuonOLR")
193 {
194 iSelectionCuts = iSelectionCuts | CutMuonOLR;
195 if (!m_bMuonOLR)
196 m_bMuonOLR = rEnv.GetValue("MuonOLR",false);
197 }
198 else ATH_MSG_WARNING("Cut " << sCut << " is not available");
199 }
200
201 if (m_iSelectionCuts == NoCut)
202 m_iSelectionCuts = iSelectionCuts;
203 }
204
205 // check if using GNTau
206 if(m_sJetIDWP.find("GNTAU") != std::string::npos)
207 m_useGNTau = true;
208
209 // initialise the ReadHandleKey of the muon container when the muon veto is applied
211
212 ATH_CHECK( m_tauContainerKey.initialize() );
213
214 // initialise the ReadDecorHandleKey if GNTau is applied
215 if (m_useGNTau) {
216 ATH_CHECK( m_GNTauDecorKey.assign(m_tauContainerKey.key()+".GNTauScoreSigTrans_v0prune"));
217 }
218 ATH_CHECK( m_GNTauDecorKey.initialize( m_useGNTau ) );
219
220 // initialise the ReadDecorHandleKey if eVeto is applied
222 ATH_CHECK( m_eVetoDecorKey.assign(m_tauContainerKey.key()+".RNNEleScoreSigTrans_v"+std::to_string(m_iEleIDVersion)) );
223 }
225
226 // specify all available cut descriptions
227 using map_type = std::map<SelectionCuts, std::unique_ptr<TauAnalysisTools::TauSelectionCut>>;
228 using pair_type = map_type::value_type;
229
230 pair_type elements[] =
231 {
232 {CutPt, std::make_unique<TauAnalysisTools::TauSelectionCutPt>(this)},
233 {CutAbsEta, std::make_unique<TauAnalysisTools::TauSelectionCutAbsEta>(this)},
234 {CutAbsCharge, std::make_unique<TauAnalysisTools::TauSelectionCutAbsCharge>(this)},
235 {CutNTrack, std::make_unique<TauAnalysisTools::TauSelectionCutNTracks>(this)},
236 {CutJetRNNScoreSigTrans, std::make_unique<TauAnalysisTools::TauSelectionCutRNNJetScoreSigTrans>(this)},
237 {CutGNTauScoreSigTrans, std::make_unique<TauAnalysisTools::TauSelectionCutGNTauScoreSigTrans>(this)},
238 {CutJetIDWP, std::make_unique<TauAnalysisTools::TauSelectionCutJetIDWP>(this)},
239 {CutEleRNNScoreSigTrans, std::make_unique<TauAnalysisTools::TauSelectionCutRNNEleScoreSigTrans>(this)},
240 {CutEleIDWP, std::make_unique<TauAnalysisTools::TauSelectionCutEleIDWP>(this)},
241 {CutMuonOLR, std::make_unique<TauAnalysisTools::TauSelectionCutMuonOLR>(this)}
242 };
243
244 m_cMap = { std::make_move_iterator( begin(elements) ), std::make_move_iterator( end(elements) ) };
245
246 ATH_MSG_INFO( "Initializing TauSelectionTool" );
254
257 PrintConfigValue ("AbsCharge", m_vAbsCharges);
258 PrintConfigValue ("NTrack", m_vNTracks);
259 PrintConfigRegion ("RNNJetScoreSigTrans", m_vJetRNNSigTransRegion);
260 PrintConfigRegion ("GNTauScoreSigTrans", m_vGNTauSigTransRegion);
261 PrintConfigRegion ("RNNEleScoreSigTrans", m_vEleRNNSigTransRegion);
262 PrintConfigValue ("JetIDWP", m_sJetIDWP);
263 PrintConfigValue ("JetIDWP ENUM",m_iJetIDWP);
264 PrintConfigValue ("EleIDWP", m_sEleIDWP);
265 PrintConfigValue ("EleIDWP ENUM",m_iEleIDWP);
266 PrintConfigValue ("EleIDVersion",m_iEleIDVersion);
267 PrintConfigValue ("MuonOLR", m_bMuonOLR);
268
269 std::string sCuts = "";
270 if (m_iSelectionCuts & CutPt) sCuts += "Pt ";
271 if (m_iSelectionCuts & CutAbsEta) sCuts += "AbsEta ";
272 if (m_iSelectionCuts & CutAbsCharge) sCuts += "AbsCharge ";
273 if (m_iSelectionCuts & CutNTrack) sCuts += "NTrack ";
274 if (m_iSelectionCuts & CutJetRNNScoreSigTrans) sCuts += "JetRNNScoreSigTrans ";
275 if (m_iSelectionCuts & CutGNTauScoreSigTrans) sCuts += "GNTauScoreSigTrans ";
276 if (m_iSelectionCuts & CutJetIDWP) sCuts += "JetIDWP ";
277 if (m_iSelectionCuts & CutEleRNNScoreSigTrans) sCuts += "EleRNNScoreSigTrans ";
278 if (m_iSelectionCuts & CutEleIDWP) sCuts += "EleIDWP ";
279 if (m_iSelectionCuts & CutMuonOLR) sCuts += "MuonOLR ";
280
281 ATH_MSG_DEBUG( "cuts: " << sCuts);
282
285
286 for ( const auto& entry : m_cMap ) {
287 if ( m_iSelectionCuts &entry.first ) {
288 entry.second->setAcceptInfo(m_aAccept);
289 }
290 }
291
292 return StatusCode::SUCCESS;
293}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
void FillValueVector(std::vector< T > &vRegion, U tVal) const
SG::ReadDecorHandleKey< xAOD::TauJetContainer > m_GNTauDecorKey
Gaudi::Property< float > m_dAbsEtaMax
std::vector< float > m_vJetRNNSigTransRegion
void FillRegionVector(std::vector< T > &vRegion, U tMin, U tMax) const
Gaudi::Property< std::string > m_sConfigPath
Gaudi::Property< std::vector< float > > m_vecAbsEtaRegion
Gaudi::Property< float > m_iNTrack
Gaudi::Property< int > m_iEleIDVersion
void PrintConfigRegion(const std::string &sCutName, std::vector< T > &vRegion) const
SG::ReadDecorHandleKey< xAOD::TauJetContainer > m_eVetoDecorKey
Gaudi::Property< float > m_dEleRNNSigTransMin
int convertStrToJetIDWP(const std::string &sJetIDWP) const
SG::ReadHandleKey< xAOD::TauJetContainer > m_tauContainerKey
Gaudi::Property< std::vector< unsigned > > m_vecNTracks
Gaudi::Property< float > m_dAbsEtaMin
SG::ReadHandleKey< xAOD::MuonContainer > m_muonContainerKey
Gaudi::Property< float > m_dPtMin
std::vector< float > m_vEleRNNSigTransRegion
int convertStrToEleIDWP(const std::string &sEleIDWP) const
std::vector< float > m_vGNTauSigTransRegion
Gaudi::Property< float > m_dGNTauSigTransMin
Gaudi::Property< std::vector< int > > m_vecAbsCharges
void PrintConfigValue(const std::string &sCutName, std::vector< T > &vRegion) const
Gaudi::Property< float > m_dJetRNNSigTransMin
Gaudi::Property< float > m_iAbsCharge
void split(const std::string &sInput, const char cDelim, std::vector< std::string > &vOut)
bool testFileForEOFContainsCharacters(const std::string &sFileName)
returns true if last line in file is empty or the line starts with the number sign

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

◆ 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()

◆ PrintConfigRegion()

template<typename T>
void TauSelectionTool::PrintConfigRegion ( const std::string & sCutName,
std::vector< T > & vRegion ) const
private

Definition at line 470 of file TauSelectionTool.cxx.

471{
472 unsigned int iNumRegion = vRegion.size()/2;
473 for( unsigned int iRegion = 0; iRegion < iNumRegion; iRegion++ )
474 {
475 ATH_MSG_DEBUG( sCutName<<": " << vRegion.at(iRegion*2) << " to " << vRegion.at(iRegion*2+1) );
476 }
477}

◆ PrintConfigValue() [1/2]

template<typename T>
void TauSelectionTool::PrintConfigValue ( const std::string & sCutName,
std::vector< T > & vRegion ) const
private

Definition at line 481 of file TauSelectionTool.cxx.

482{
483 for (auto tVal : vRegion)
484 ATH_MSG_DEBUG( sCutName<<": " << tVal );
485}

◆ PrintConfigValue() [2/2]

template<typename T>
void TauSelectionTool::PrintConfigValue ( const std::string & sCutName,
T & sVal ) const
private

Definition at line 489 of file TauSelectionTool.cxx.

490{
491 ATH_MSG_DEBUG( sCutName<<": " << tVal );
492}

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

◆ setOutFile()

void TauSelectionTool::setOutFile ( TFile * fOutFile)
overridevirtual

Set output file for control histograms.

Implements TauAnalysisTools::ITauSelectionTool.

Definition at line 394 of file TauSelectionTool.cxx.

395{
396 m_fOutFile = fOutFile;
397}

◆ setupCutFlowHistogram()

void TauSelectionTool::setupCutFlowHistogram ( )
private

Definition at line 419 of file TauSelectionTool.cxx.

420{
421 // count number of cuts
422 int iNBins = 0;
423 for (const auto& entry : m_cMap)
424 if (m_iSelectionCuts & entry.first)
425 iNBins++;
426 // create cutflow histogram with iNBins+1 bins, where first bin is 'All' bin
427 m_hCutFlow = std::make_shared<TH1F>("hCutFlow","CutFlow;; events",iNBins+1,0,iNBins+1);
428 m_hCutFlow->GetXaxis()->SetBinLabel(1,"All");
429
430 // reusing this variable to reduce overhead
431 iNBins = 2;
432 // set bin labels
433 for (const auto& entry : m_cMap)
434 if (m_iSelectionCuts & entry.first)
435 {
436 m_hCutFlow->GetXaxis()->SetBinLabel(iNBins, entry.second->getName().c_str());
437 iNBins++;
438 }
439}

◆ 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

◆ writeControlHistograms()

void TauSelectionTool::writeControlHistograms ( )
overridevirtual

Write control histograms to output file.

create output directory

write cutflow histogram

Implements TauAnalysisTools::ITauSelectionTool.

Definition at line 400 of file TauSelectionTool.cxx.

401{
403 ATH_MSG_WARNING("CreateControlPlots was set to true, but no valid file pointer was provided");
405 {
407 m_fOutFile->mkdir((this->name()+"_control").c_str());
408 m_fOutFile->cd((this->name()+"_control").c_str());
410 m_hCutFlow->Write();
411
412 for (const auto& entry : m_cMap)
413 entry.second->writeControlHistograms();
414 }
415}

◆ TauSelectionCut

friend class TauSelectionCut
friend

need to define cut classes to be friends to access protected variables, needed for access of cut thresholds

Definition at line 58 of file TauSelectionTool.h.

◆ TauSelectionCutAbsCharge

friend class TauSelectionCutAbsCharge
friend

Definition at line 61 of file TauSelectionTool.h.

◆ TauSelectionCutAbsEta

friend class TauSelectionCutAbsEta
friend

Definition at line 60 of file TauSelectionTool.h.

◆ TauSelectionCutEleIDWP

friend class TauSelectionCutEleIDWP
friend

Definition at line 67 of file TauSelectionTool.h.

◆ TauSelectionCutGNTauScoreSigTrans

friend class TauSelectionCutGNTauScoreSigTrans
friend

Definition at line 65 of file TauSelectionTool.h.

◆ TauSelectionCutJetIDWP

friend class TauSelectionCutJetIDWP
friend

Definition at line 63 of file TauSelectionTool.h.

◆ TauSelectionCutMuonOLR

friend class TauSelectionCutMuonOLR
friend

Definition at line 68 of file TauSelectionTool.h.

◆ TauSelectionCutNTracks

friend class TauSelectionCutNTracks
friend

Definition at line 62 of file TauSelectionTool.h.

◆ TauSelectionCutPt

friend class TauSelectionCutPt
friend

Definition at line 59 of file TauSelectionTool.h.

◆ TauSelectionCutRNNEleScoreSigTrans

friend class TauSelectionCutRNNEleScoreSigTrans
friend

Definition at line 66 of file TauSelectionTool.h.

◆ TauSelectionCutRNNJetScoreSigTrans

friend class TauSelectionCutRNNJetScoreSigTrans
friend

Definition at line 64 of file TauSelectionTool.h.

Member Data Documentation

◆ m_aAccept

asg::AcceptInfo TauAnalysisTools::TauSelectionTool::m_aAccept
protected

Object used to store selection information.

Definition at line 180 of file TauSelectionTool.h.

◆ m_bCreateControlPlots

Gaudi::Property<bool> TauAnalysisTools::TauSelectionTool::m_bCreateControlPlots {this, "CreateControlPlots", false}
protected

Definition at line 177 of file TauSelectionTool.h.

177{this, "CreateControlPlots", false};

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

Gaudi::Property<bool> TauAnalysisTools::TauSelectionTool::m_bMuonOLR {this, "MuonOLR", false}
private

Definition at line 151 of file TauSelectionTool.h.

151{this, "MuonOLR", false};

◆ m_cMap

std::map<SelectionCuts, std::unique_ptr<TauAnalysisTools::TauSelectionCut> > TauAnalysisTools::TauSelectionTool::m_cMap
private

Definition at line 169 of file TauSelectionTool.h.

◆ m_dAbsEtaMax

Gaudi::Property<float> TauAnalysisTools::TauSelectionTool::m_dAbsEtaMax {this, "AbsEtaMax", NAN}
private

Definition at line 142 of file TauSelectionTool.h.

142{this, "AbsEtaMax", NAN};

◆ m_dAbsEtaMin

Gaudi::Property<float> TauAnalysisTools::TauSelectionTool::m_dAbsEtaMin {this, "AbsEtaMin", NAN}
private

Definition at line 141 of file TauSelectionTool.h.

141{this, "AbsEtaMin", NAN};

◆ m_dEleRNNSigTransMin

Gaudi::Property<float> TauAnalysisTools::TauSelectionTool::m_dEleRNNSigTransMin {this, "EleRNNSigTransMin", NAN}
private

Definition at line 147 of file TauSelectionTool.h.

147{this, "EleRNNSigTransMin", NAN};

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

Gaudi::Property<float> TauAnalysisTools::TauSelectionTool::m_dGNTauSigTransMin {this, "GNTauSigTransMin", NAN}
private

Definition at line 145 of file TauSelectionTool.h.

145{this, "GNTauSigTransMin", NAN};

◆ m_dJetRNNSigTransMin

Gaudi::Property<float> TauAnalysisTools::TauSelectionTool::m_dJetRNNSigTransMin {this, "JetRNNSigTransMin", NAN}
private

Definition at line 144 of file TauSelectionTool.h.

144{this, "JetRNNSigTransMin", NAN};

◆ m_dPtMin

Gaudi::Property<float> TauAnalysisTools::TauSelectionTool::m_dPtMin {this, "PtMin", NAN}
private

Definition at line 140 of file TauSelectionTool.h.

140{this, "PtMin", NAN};

◆ m_eVetoDecorKey

SG::ReadDecorHandleKey<xAOD::TauJetContainer> TauAnalysisTools::TauSelectionTool::m_eVetoDecorKey {this, "eVetoDecorName", "", "Name of eVeto decoration"}
private

Definition at line 166 of file TauSelectionTool.h.

166{this, "eVetoDecorName", "", "Name of eVeto decoration"};

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

TFile* TauAnalysisTools::TauSelectionTool::m_fOutFile
protected

Definition at line 158 of file TauSelectionTool.h.

◆ m_GNTauDecorKey

SG::ReadDecorHandleKey<xAOD::TauJetContainer> TauAnalysisTools::TauSelectionTool::m_GNTauDecorKey {this, "GNTauDecorName", "", "Name of GnTauID decoration"}
private

Definition at line 167 of file TauSelectionTool.h.

167{this, "GNTauDecorName", "", "Name of GnTauID decoration"};

◆ m_hCutFlow

std::shared_ptr<TH1F> TauAnalysisTools::TauSelectionTool::m_hCutFlow
protected

Definition at line 159 of file TauSelectionTool.h.

◆ m_iAbsCharge

Gaudi::Property<float> TauAnalysisTools::TauSelectionTool::m_iAbsCharge {this, "AbsCharge", NAN}
private

Definition at line 143 of file TauSelectionTool.h.

143{this, "AbsCharge", NAN};

◆ m_iEleIDVersion

Gaudi::Property<int> TauAnalysisTools::TauSelectionTool::m_iEleIDVersion {this, "EleIDVersion", 1}
private

Definition at line 150 of file TauSelectionTool.h.

150{this, "EleIDVersion", 1};

◆ m_iEleIDWP

Gaudi::Property<int> TauAnalysisTools::TauSelectionTool::m_iEleIDWP {this, "EleIDWP", 0}
private

Definition at line 149 of file TauSelectionTool.h.

149{this, "EleIDWP", 0};

◆ m_iJetIDWP

Gaudi::Property<int> TauAnalysisTools::TauSelectionTool::m_iJetIDWP {this, "JetIDWP", 1}
private

Definition at line 148 of file TauSelectionTool.h.

148{this, "JetIDWP", 1}; // this corresponds to 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_iNTrack

Gaudi::Property<float> TauAnalysisTools::TauSelectionTool::m_iNTrack {this, "NTrack", NAN}
private

Definition at line 146 of file TauSelectionTool.h.

146{this, "NTrack", NAN};

◆ m_iSelectionCuts

Gaudi::Property<int> TauAnalysisTools::TauSelectionTool::m_iSelectionCuts {this, "SelectionCuts", NoCut}
private

Definition at line 139 of file TauSelectionTool.h.

139{this, "SelectionCuts", NoCut};

◆ m_muonContainerKey

SG::ReadHandleKey<xAOD::MuonContainer> TauAnalysisTools::TauSelectionTool::m_muonContainerKey {this, "MuonContainerName", "Muons", "Muon container name"}
private

Definition at line 164 of file TauSelectionTool.h.

164{this, "MuonContainerName", "Muons", "Muon container name"};

◆ m_outputMetaStore

MetaStore_t asg::AsgMetadataTool::m_outputMetaStore
privateinherited

Object accessing the output metadata store.

Definition at line 121 of file AsgMetadataTool.h.

◆ m_sConfigPath

Gaudi::Property<std::string> TauAnalysisTools::TauSelectionTool::m_sConfigPath {this, "ConfigPath", "TauAnalysisTools/"+std::string(sSharedFilesVersion)+"/Selection/recommended_selection_r22.conf"}
private

Definition at line 163 of file TauSelectionTool.h.

163{this, "ConfigPath", "TauAnalysisTools/"+std::string(sSharedFilesVersion)+"/Selection/recommended_selection_r22.conf"};
static const char *const sSharedFilesVersion
Version of the calibration files.

◆ m_sEleIDWP

std::string TauAnalysisTools::TauSelectionTool::m_sEleIDWP
private

Definition at line 136 of file TauSelectionTool.h.

◆ m_sJetIDWP

std::string TauAnalysisTools::TauSelectionTool::m_sJetIDWP
private

Definition at line 131 of file TauSelectionTool.h.

◆ m_tauContainerKey

SG::ReadHandleKey<xAOD::TauJetContainer> TauAnalysisTools::TauSelectionTool::m_tauContainerKey {this, "TauContainerName", "TauJets", "Tau container name"}
private

Definition at line 165 of file TauSelectionTool.h.

165{this, "TauContainerName", "TauJets", "Tau container name"};

◆ m_useGNTau

bool TauAnalysisTools::TauSelectionTool::m_useGNTau =false
private

Definition at line 132 of file TauSelectionTool.h.

◆ m_useIncidents

bool asg::AsgMetadataTool::m_useIncidents
privateinherited

Definition at line 128 of file AsgMetadataTool.h.

◆ m_vAbsCharges

std::vector<int> TauAnalysisTools::TauSelectionTool::m_vAbsCharges
private

Definition at line 123 of file TauSelectionTool.h.

◆ m_vAbsEtaRegion

std::vector<float> TauAnalysisTools::TauSelectionTool::m_vAbsEtaRegion
private

Definition at line 121 of file TauSelectionTool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vecAbsCharges

Gaudi::Property<std::vector<int> > TauAnalysisTools::TauSelectionTool::m_vecAbsCharges {this, "AbsCharges", {}}
private

Definition at line 154 of file TauSelectionTool.h.

154{this, "AbsCharges", {}};

◆ m_vecAbsEtaRegion

Gaudi::Property<std::vector<float> > TauAnalysisTools::TauSelectionTool::m_vecAbsEtaRegion {this, "AbsEtaRegion",{}}
private

Definition at line 153 of file TauSelectionTool.h.

153{this, "AbsEtaRegion",{}};

◆ m_vecNTracks

Gaudi::Property<std::vector<unsigned> > TauAnalysisTools::TauSelectionTool::m_vecNTracks {this, "NTracks", {}}
private

Definition at line 155 of file TauSelectionTool.h.

155{this, "NTracks", {}};

◆ m_vEleRNNSigTransRegion

std::vector<float> TauAnalysisTools::TauSelectionTool::m_vEleRNNSigTransRegion
private

Definition at line 134 of file TauSelectionTool.h.

◆ m_vGNTauSigTransRegion

std::vector<float> TauAnalysisTools::TauSelectionTool::m_vGNTauSigTransRegion
private

Definition at line 129 of file TauSelectionTool.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_vJetRNNSigTransRegion

std::vector<float> TauAnalysisTools::TauSelectionTool::m_vJetRNNSigTransRegion
private

Definition at line 127 of file TauSelectionTool.h.

◆ m_vNTracks

std::vector<unsigned> TauAnalysisTools::TauSelectionTool::m_vNTracks
private

Definition at line 125 of file TauSelectionTool.h.

◆ m_vPtRegion

std::vector<float> TauAnalysisTools::TauSelectionTool::m_vPtRegion
private

Definition at line 119 of file TauSelectionTool.h.


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