ATLAS Offline Software
Loading...
Searching...
No Matches
TrigConf::xAODConfigTool Class Reference

Trigger configuration metadata tool for xAOD analysis. More...

#include <xAODConfigTool.h>

Inheritance diagram for TrigConf::xAODConfigTool:
Collaboration diagram for TrigConf::xAODConfigTool:

Classes

struct  Impl

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

 xAODConfigTool (const std::string &name="TrigConf::xAODConfigTool")
 Create a proper constructor for Athena.
virtual ~xAODConfigTool () override
 Out-of-line dtor so that we don't need to define Impl in the header.
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
Function(s) implementing the asg::IAsgTool interface
virtual StatusCode initialize () override
 Function initialising the tool.
Implementation of the IILVL1ConfigSvc interface
virtual const CTPConfigctpConfig () const override
 Get the LVL1 trigger menu.
virtual const ThresholdConfigthresholdConfig () const override
 Get the LVL1 threshold configuruation (not available from xAOD).
virtual const BunchGroupSetbunchGroupSet () const override
 Get the LVL1 bunch group set.
virtual uint32_t lvl1PrescaleKey () const override
 Get the LVL1 prescale key.
virtual uint32_t bunchGroupSetKey () const override
 Get the LVL1 bunch group set key.
Implementation of the IIHLTConfigSvc interface
virtual const HLTChainListchains () const override
 Get the HLT chains.
virtual const HLTSequenceListsequences () const override
 Get the HLT sequences.
virtual uint32_t masterKey () const override
 Get the Super Master Key.
virtual uint32_t hltPrescaleKey () const override
 Get the HLT prescale key.
Impliment the JSON config interface.
virtual const HLTMenuhltMenu (const EventContext &ctx) const override
 Returns the JSON configured HLTMenu ptree.
virtual const HLTMonitoringhltMonitoring (const EventContext &ctx) const override
 Returns the JSON configured HLTMonitoring ptree.
virtual const L1Menul1Menu (const EventContext &ctx) const override
 Returns the JSON configured L1 ptree.
virtual const HLTPrescalesSethltPrescalesSet (const EventContext &ctx) const override
 Returns the JSON configured HLT prescales ptree.
virtual const L1PrescalesSetl1PrescalesSet (const EventContext &ctx) const override
 Returns the JSON configured L1 prescales ptree.
virtual const L1BunchGroupSetl1BunchGroupSet (const EventContext &ctx) const override
 Returns the JSON configured bunchgroup ptree.
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 function(s) from AsgMetadataTool
virtual StatusCode beginInputFile () override
 Function called when a new input file is opened.
virtual StatusCode endInputFile () override
 Invalidate the cached menu objects when the current input file is closed.
virtual StatusCode beginEvent () override
 Function called when a new event is loaded.
StatusCode beginEvent_Run2 (const xAOD::TrigConfKeys *keys)
 Internal call to check / load from a file with Run2 metadata.
StatusCode beginEvent_Run3 (const xAOD::TrigConfKeys *keys, const xAOD::BunchConfKey *bgKey)
 Internal call to check / load from a file with Run3 metadata.
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 metaDataStop ()
 Function called when the tool should write out its metadata.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>
Run 3 helper functions
StatusCode loadJsonByKey (const std::string &humanName, const xAOD::TriggerMenuJsonContainer *metaContainer, const uint32_t keyToCheck, const xAOD::TriggerMenuJson *&ptrToSet)
 Locates a Run3 TriggerMenuJson object inside a container by key. Loads it into the m_currentXXXJson ptr.
StatusCode loadPtrees ()
 Load all m_currentXXXJson serialised JSON data into ptrees inside m_impl.
StatusCode loadPtree (const std::string &humanName, const xAOD::TriggerMenuJson *menu, DataStructure &dataStructure)
 Load single m_currentXXXJson serialised JSON data into ptree.

Private Attributes

std::string m_eventName
 Key for the event-level configuration identifier object.
std::string m_bgkeysName
 Key for the event-level bunchgroup identification object, in the codebase since R2 but only being used since R3.
std::string m_metaName_run2
 Key for the trigger configuration metadata object (Run 2).
std::string m_metaNameJSON_hlt
 Key for the trigger configuration metadata objects (Run 3).
std::string m_metaNameJSON_hltmonitoring
std::string m_metaNameJSON_l1
std::string m_metaNameJSON_hltps
std::string m_metaNameJSON_l1ps
std::string m_metaNameJSON_bg
const xAOD::TriggerMenuContainerm_tmc
 The configuration object of the current input file (for Run2 AOD).
const xAOD::TriggerMenuJsonContainerm_hltJson
 The configuration object of the current input file (for Run3 AOD).
const xAOD::TriggerMenuJsonContainerm_hltmonitoringJson
const xAOD::TriggerMenuJsonContainerm_l1Json
const xAOD::TriggerMenuJsonContainerm_hltpsJson
const xAOD::TriggerMenuJsonContainerm_l1psJson
const xAOD::TriggerMenuJsonContainerm_bgJson
const xAOD::TriggerMenum_menu
 The active configuration for the current event (For Run2 AOD).
const xAOD::TriggerMenuJsonm_currentHltJson
 The active configuration for the current event (For Run3 AOD).
const xAOD::TriggerMenuJsonm_currentHltmonitoringJson
const xAOD::TriggerMenuJsonm_currentL1Json
const xAOD::TriggerMenuJsonm_currentHltpsJson
const xAOD::TriggerMenuJsonm_currentL1psJson
const xAOD::TriggerMenuJsonm_currentBgJson
bool m_triggerMenuContainerAvailable
 Is decoded R2 format data available?
bool m_menuJSONContainerAvailable
 Is decoded R3 format data available?
std::unique_ptr< Implm_impl
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

Trigger configuration metadata tool for xAOD analysis.

This tool is meant to be used when analysing xAOD files both in Athena and in ROOT, to get access to the trigger configuration information of the processed events.

Author
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h

Definition at line 50 of file xAODConfigTool.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

◆ xAODConfigTool()

TrigConf::xAODConfigTool::xAODConfigTool ( const std::string & name = "TrigConf::xAODConfigTool")

Create a proper constructor for Athena.

Constructor for standalone usage

Definition at line 57 of file xAODConfigTool.cxx.

58 : asg::AsgMetadataTool( name ),
59 m_tmc( nullptr ),
60 m_hltJson( nullptr), m_hltmonitoringJson(nullptr), m_l1Json( nullptr ),
61 m_hltpsJson( nullptr ), m_l1psJson( nullptr ), m_bgJson( nullptr ),
62 m_menu( nullptr ),
63 m_currentHltJson( nullptr ), m_currentHltmonitoringJson( nullptr ), m_currentL1Json( nullptr ),
64 m_currentHltpsJson( nullptr ), m_currentL1psJson( nullptr ), m_currentBgJson( nullptr ),
67 m_impl (std::make_unique<Impl>()) {
68
69 declareProperty( "EventObjectName", m_eventName = "TrigConfKeys" );
70 declareProperty( "BGKeysObjectName", m_bgkeysName = "BunchConfKey" );
71 declareProperty( "MetaObjectName", m_metaName_run2 = "TriggerMenu" );
72
73 declareProperty( "JSONMetaObjectNameHLT", m_metaNameJSON_hlt = "TriggerMenuJson_HLT" );
74 declareProperty( "JSONMetaObjectNameHLTMonitoring", m_metaNameJSON_hltmonitoring = "TriggerMenuJson_HLTMonitoring" );
75 declareProperty( "JSONMetaObjectNameL1", m_metaNameJSON_l1 = "TriggerMenuJson_L1" );
76 declareProperty( "JSONMetaObjectNameHLTPS", m_metaNameJSON_hltps = "TriggerMenuJson_HLTPS" );
77 declareProperty( "JSONMetaObjectNameL1PS", m_metaNameJSON_l1ps = "TriggerMenuJson_L1PS" );
78 declareProperty( "JSONMetaObjectNameBunchgroup", m_metaNameJSON_bg = "TriggerMenuJson_BG" );
79 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const xAOD::TriggerMenuJson * m_currentHltmonitoringJson
std::string m_metaNameJSON_hlt
Key for the trigger configuration metadata objects (Run 3).
const xAOD::TriggerMenuContainer * m_tmc
The configuration object of the current input file (for Run2 AOD).
bool m_triggerMenuContainerAvailable
Is decoded R2 format data available?
const xAOD::TriggerMenuJson * m_currentL1Json
bool m_menuJSONContainerAvailable
Is decoded R3 format data available?
const xAOD::TriggerMenuJson * m_currentHltpsJson
const xAOD::TriggerMenuJson * m_currentL1psJson
const xAOD::TriggerMenuJson * m_currentHltJson
The active configuration for the current event (For Run3 AOD).
std::string m_metaName_run2
Key for the trigger configuration metadata object (Run 2).
const xAOD::TriggerMenu * m_menu
The active configuration for the current event (For Run2 AOD).
const xAOD::TriggerMenuJsonContainer * m_l1Json
std::string m_bgkeysName
Key for the event-level bunchgroup identification object, in the codebase since R2 but only being use...
const xAOD::TriggerMenuJsonContainer * m_hltmonitoringJson
const xAOD::TriggerMenuJsonContainer * m_bgJson
std::string m_eventName
Key for the event-level configuration identifier object.
std::unique_ptr< Impl > m_impl
const xAOD::TriggerMenuJsonContainer * m_hltpsJson
const xAOD::TriggerMenuJsonContainer * m_hltJson
The configuration object of the current input file (for Run3 AOD).
const xAOD::TriggerMenuJson * m_currentBgJson
const xAOD::TriggerMenuJsonContainer * m_l1psJson
std::string m_metaNameJSON_hltmonitoring

◆ ~xAODConfigTool()

TrigConf::xAODConfigTool::~xAODConfigTool ( )
overridevirtualdefault

Out-of-line dtor so that we don't need to define Impl in the header.

Member Function Documentation

◆ beginEvent()

StatusCode TrigConf::xAODConfigTool::beginEvent ( )
overrideprotectedvirtual

Function called when a new event is loaded.

Reimplemented from asg::AsgMetadataTool.

Definition at line 469 of file xAODConfigTool.cxx.

469 {
470
471 // It may be that the input file opening event is missed in standalone
472 // mode at the very beginning of the application. (Depending on the
473 // creation order of the objects.) So make sure that we have the
474 // configuration objects at hand...
477 }
478
479 // Read the current event's trigger keys:
480 const xAOD::TrigConfKeys* keys = nullptr;
481 ATH_CHECK( evtStore()->retrieve( keys, m_eventName ) );
482
483 const xAOD::BunchConfKey* bgKey = nullptr; // The BG key is currently optional, only files written from late 2021 will contain this
485 ATH_CHECK(evtStore()->retrieve(bgKey, m_bgkeysName));
486 }
487
488 // Prefer Run 3 data if available
490 return beginEvent_Run3(keys, bgKey);
492 return beginEvent_Run2(keys);
493 }
494
495 ATH_MSG_ERROR( "Both m_menuJSONContainerAvailable and m_triggerMenuContainerAvailable are false");
496 return StatusCode::FAILURE;
497
498 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x,...)
ServiceHandle< StoreGateSvc > & evtStore()
StatusCode beginEvent_Run2(const xAOD::TrigConfKeys *keys)
Internal call to check / load from a file with Run2 metadata.
virtual StatusCode beginInputFile() override
Function called when a new input file is opened.
StatusCode beginEvent_Run3(const xAOD::TrigConfKeys *keys, const xAOD::BunchConfKey *bgKey)
Internal call to check / load from a file with Run3 metadata.
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:116
BunchConfKey_v1 BunchConfKey
Declare the current version of the bunch configuration key type.
TrigConfKeys_v1 TrigConfKeys
Declare the current version of the trigger configuration keys type.

◆ beginEvent_Run2()

StatusCode TrigConf::xAODConfigTool::beginEvent_Run2 ( const xAOD::TrigConfKeys * keys)
protected

Internal call to check / load from a file with Run2 metadata.

Definition at line 500 of file xAODConfigTool.cxx.

500 {
501 // Check if we have the correct menu already:
502 if( m_menu && xAODKeysMatch( keys, m_menu ) ) {
503 return StatusCode::SUCCESS;
504 }
505
506 if( !m_tmc ) {
507 ATH_MSG_ERROR( "Trigger menu metadata not loaded for the current input file" );
508 return StatusCode::FAILURE;
509 }
510
511 // If not, let's look for the correct configuration:
514 for( ; menu_itr != menu_end; ++menu_itr ) {
515 // Check if this is the menu we're looking for:
516 if( ! xAODKeysMatch( keys, *menu_itr ) ) continue;
517 // Remember it's pointer:
518 m_menu = *menu_itr;
519 // Cache the menu's configuration:
521 m_impl->m_chainList,
522 m_impl->m_sequenceList,
523 m_impl->m_bgSet, msg() ) );
524 // We're done:
525 return StatusCode::SUCCESS;
526 }
527
528 // Apparently we didn't find the correct menu!
529 ATH_MSG_ERROR( "Couldn't find configuration for current event (SMK:"
530 << keys->smk() << ", L1PSK:" << keys->l1psk()
531 << ", HLTPSK:" << keys->hltpsk() << ")" );
532 return StatusCode::FAILURE;
533 }
MsgStream & msg() const
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
StatusCode prepareTriggerMenu(const xAOD::TriggerMenu *menu, CTPConfig &ctpConfig, HLTChainList &chainList, HLTSequenceList &sequenceList, BunchGroupSet &bgSet, MsgStream &msg)
In order to avoid duplicating code between how the dual-use and the Athena-only code translates the x...
bool xAODKeysMatch(const xAOD::TrigConfKeys *keys, const xAOD::TriggerMenu *menu)
Since this is used in a couple of places, it seemed to make sense to put this simple code into a cent...

◆ beginEvent_Run3()

StatusCode TrigConf::xAODConfigTool::beginEvent_Run3 ( const xAOD::TrigConfKeys * keys,
const xAOD::BunchConfKey * bgKey )
protected

Internal call to check / load from a file with Run3 metadata.

Definition at line 535 of file xAODConfigTool.cxx.

535 {
536 if (keys==nullptr) {
537 ATH_MSG_ERROR("nullptr TrigConfKeys");
538 return StatusCode::FAILURE;
539 }
540
541 // Cached pointers are null right after initialize() or endInputFile(): not valid.
542 bool validConfig = true;
544 validConfig = false;
545 } else {
546 if (m_currentHltJson->key() != keys->smk()) {
547 validConfig = false;
548 }
549 // m_currentHltminitoringJson is checked by the m_currentHltJson check
550 if (m_currentL1Json->key() != keys->smk()) {
551 validConfig = false;
552 }
553 if (m_currentHltpsJson->key() != keys->hltpsk()) {
554 validConfig = false;
555 }
556 if (m_currentL1psJson->key() != keys->l1psk()) {
557 validConfig = false;
558 }
559 if (m_bgJson && m_currentBgJson && bgKey && m_currentBgJson->key() != static_cast<unsigned int>(bgKey->id())) {
560 validConfig = false;
561 }
562 }
563
564 if (validConfig) {
565 return StatusCode::SUCCESS;
566 }
567
568 // Re-retrieved in beginInputFile(); still missing here means this file's metadata never loaded.
569 if( !m_hltJson || !m_l1Json || !m_hltpsJson || !m_l1psJson ) {
570 ATH_MSG_ERROR( "Trigger menu metadata not loaded for the current input file" );
571 return StatusCode::FAILURE;
572 }
573
574 // If not, load correct JSON menus from their respective containers, matching against the event's keys ...
575 ATH_CHECK( loadJsonByKey("HLT Menu", m_hltJson, keys->smk(), m_currentHltJson) );
578 }
579 ATH_CHECK( loadJsonByKey("L1 Menu", m_l1Json, keys->smk(), m_currentL1Json) );
580 ATH_CHECK( loadJsonByKey("HLT Prescales", m_hltpsJson, keys->hltpsk(), m_currentHltpsJson) );
581 ATH_CHECK( loadJsonByKey("L1 Prescales", m_l1psJson, keys->l1psk(), m_currentL1psJson) );
582 if (m_bgJson && bgKey) {
583 ATH_CHECK( loadJsonByKey("Bunchgroups", m_bgJson, bgKey->id(), m_currentBgJson) );
584 }
585
586 // ... and from these serialised JSON strings, populate the ptree data structures...
587 ATH_CHECK( loadPtrees() );
588
589 // ... and set the keys of the objects in the objects (not part of the JSON pyaload) ...
590 m_impl->m_currentHlt.setSMK( m_currentHltJson->key() );
592 m_impl->m_currentHltmonitoring.setSMK( m_currentHltmonitoringJson->key() );
593 }
594 m_impl->m_currentL1.setSMK( m_currentL1Json->key() );
595 m_impl->m_currentHltps.setPSK( m_currentHltpsJson->key() );
596 m_impl->m_currentL1ps.setPSK( m_currentL1psJson->key() );
597 if (m_bgJson && bgKey) {
598 m_impl->m_currentBg.setBGSK( m_currentBgJson->key() );
599 }
600
601 // R3 interfaces now active
602
603 // ... and finally populate the legacy interface from the ptree data
604 ATH_CHECK( prepareTriggerMenu( m_impl->m_currentHlt,
605 m_impl->m_currentL1,
606 m_impl->m_currentHltps,
607 m_impl->m_currentL1ps,
608 m_impl->m_currentBg,
609 m_impl->m_ctpConfig,
610 m_impl->m_chainList,
611 m_impl->m_sequenceList,
612 m_impl->m_bgSet, msg() ) ); // R2 interfaces now active
613
614 return StatusCode::SUCCESS;
615 }
StatusCode loadJsonByKey(const std::string &humanName, const xAOD::TriggerMenuJsonContainer *metaContainer, const uint32_t keyToCheck, const xAOD::TriggerMenuJson *&ptrToSet)
Locates a Run3 TriggerMenuJson object inside a container by key. Loads it into the m_currentXXXJson p...
StatusCode loadPtrees()
Load all m_currentXXXJson serialised JSON data into ptrees inside m_impl.
uint32_t id() const
Get the 32-bit identifier of the bunch configuration.

◆ beginInputFile()

StatusCode TrigConf::xAODConfigTool::beginInputFile ( )
overrideprotectedvirtual

Function called when a new input file is opened.

Reimplemented from asg::AsgMetadataTool.

Definition at line 301 of file xAODConfigTool.cxx.

301 {
302
303 // Tell the user what's happening:
304 ATH_MSG_DEBUG( "Loading the trigger menu from a new input file" );
305
306 // Try to read the R2 metadata object:
307 m_tmc = nullptr;
310 or inputMetaStore()->retrieve( m_tmc, m_metaName_run2 ).isFailure() )
311 {
313 }
314
315 // Try to read the R3 metadata object:
316 m_hltJson = nullptr;
317 m_hltmonitoringJson = nullptr;
318 m_l1Json = nullptr;
319 m_hltpsJson = nullptr;
320 m_l1psJson = nullptr;
321 m_bgJson = nullptr;
324 or inputMetaStore()->retrieve( m_hltJson, m_metaNameJSON_hlt ).isFailure() )
325 {
327 }
330 {
331 // m_menuJSONContainerAvailable = false;
332 // Currently planning on only storing these data in MC. Hence this has to be an optional input.
333 }
335 or inputMetaStore()->retrieve( m_l1Json, m_metaNameJSON_l1 ).isFailure() )
336 {
338 }
340 or inputMetaStore()->retrieve( m_hltpsJson, m_metaNameJSON_hltps ).isFailure() )
341 {
343 }
345 or inputMetaStore()->retrieve( m_l1psJson, m_metaNameJSON_l1ps ).isFailure() )
346 {
348 }
350 or inputMetaStore()->retrieve( m_bgJson, m_metaNameJSON_bg ).isFailure() ) {
351 // m_menuJSONContainerAvailable = false;
352 // This was not written up to the end of 2021, we have to make it optional for at least a while
353 }
354
355
357 ATH_MSG_WARNING( "No trigger configurations are available on "
358 "the input" );
359 return StatusCode::SUCCESS;
360 }
361
362 // Prefer run three format, if available
364
365 // A little sanity check:
366 if( m_hltJson->size() == 0 ) {
367 // This can happen when we encounter empty input files. In which
368 // case we should not bail, but continue, and only bail if by the
369 // start of an event, we still don't see any configurations.
370 ATH_MSG_WARNING( "No trigger configurations are available on "
371 "the input" );
372 return StatusCode::SUCCESS;
373 }
374
375 // Load the first elements by default
376 ATH_CHECK( m_hltJson->size() > 0 );
377 //ATH_CHECK( m_hltmonitoringJson->size() > 0 ); // Optional - re-enable this check in the future when all used AODs contains this
378 ATH_CHECK( m_l1Json->size() > 0 );
379 ATH_CHECK( m_hltpsJson->size() > 0 );
380 ATH_CHECK( m_l1psJson->size() > 0 );
381 if (m_bgJson) { // Considered optional for now
382 ATH_CHECK( m_bgJson->size() > 0 );
383 }
384
385 m_currentHltJson = m_hltJson->at( 0 );
386 if (m_hltmonitoringJson && m_hltmonitoringJson->size()) { // Optional
388 }
389 m_currentL1Json = m_l1Json->at( 0 );
391 m_currentL1psJson = m_l1psJson->at( 0 );
392 if (m_bgJson) { // Considered optional for now
393 m_currentBgJson = m_bgJson->at( 0 );
394 }
395
397
398 // Loading the payload doesn't additionally let the object know about its own key. We can load this in now too.
399 m_impl->m_currentHlt.setSMK( m_currentHltJson->key() );
400 if (m_currentHltmonitoringJson) { // Optional
401 m_impl->m_currentHltmonitoring.setSMK( m_currentHltmonitoringJson->key() );
402 }
403 m_impl->m_currentL1.setSMK( m_currentL1Json->key() );
404 m_impl->m_currentHltps.setPSK( m_currentHltpsJson->key() );
405 m_impl->m_currentL1ps.setPSK( m_currentL1psJson->key() );
406 if (m_bgJson) { // Optional (for now)
407 m_impl->m_currentBg.setBGSK( m_currentBgJson->key() );
408 }
409
410 ATH_CHECK( prepareTriggerMenu( m_impl->m_currentHlt,
411 m_impl->m_currentL1,
412 m_impl->m_currentHltps,
413 m_impl->m_currentL1ps,
414 m_impl->m_currentBg,
415 m_impl->m_ctpConfig,
416 m_impl->m_chainList,
417 m_impl->m_sequenceList,
418 m_impl->m_bgSet, msg() ) );
419
420 return StatusCode::SUCCESS;
421
423
424 // A little sanity check:
425 if( m_tmc->size() == 0 ) {
426 // This can happen when we encounter empty input files. In which
427 // case we should not bail, but continue, and only bail if by the
428 // start of an event, we still don't see any configurations.
429 ATH_MSG_WARNING( "No trigger configurations are available on "
430 "the input" );
431 return StatusCode::SUCCESS;
432 }
433
434 m_menu = m_tmc->at( 0 );
435 // Cache the menu's configuration:
437 m_impl->m_chainList,
438 m_impl->m_sequenceList,
439 m_impl->m_bgSet, msg() ) );
440
441 return StatusCode::SUCCESS;
442 }
443
444 ATH_MSG_ERROR( "Both m_menuJSONContainerAvailable and m_triggerMenuContainerAvailable are false");
445 return StatusCode::FAILURE; // Should never get here as checked that one or the other is true above
446 }
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
MetaStorePtr_t inputMetaStore() const
Accessor for the input metadata store.

◆ bunchGroupSet()

const BunchGroupSet * TrigConf::xAODConfigTool::bunchGroupSet ( ) const
overridevirtual

Get the LVL1 bunch group set.

Implements TrigConf::IILVL1ConfigSvc.

Definition at line 141 of file xAODConfigTool.cxx.

141 {
142 // Check if the object is well prepared:
143 if( m_impl->m_bgSet.bunchGroups().size() == 0 ) {
144 ATH_MSG_FATAL( "Trigger menu not loaded" );
145 throw std::runtime_error( "Tool not initialised correctly" );
146 }
147
148 // Return the pointer:
149 return &m_impl->m_bgSet;
150 }
#define ATH_MSG_FATAL(x,...)

◆ bunchGroupSetKey()

uint32_t TrigConf::xAODConfigTool::bunchGroupSetKey ( ) const
overridevirtual

Get the LVL1 bunch group set key.

Implements TrigConf::IILVL1ConfigSvc.

Definition at line 175 of file xAODConfigTool.cxx.

176 {
178 return m_impl->m_currentBg.bgsk();
179 else {
180 ATH_MSG_DEBUG("There's no way to access the bunch group set key from a legacy AOD!");
181 return std::numeric_limits<uint32_t>::max();
182 }
183 }

◆ chains()

const HLTChainList & TrigConf::xAODConfigTool::chains ( ) const
overridevirtual

Get the HLT chains.

Implements TrigConf::IIHLTConfigSvc.

Definition at line 185 of file xAODConfigTool.cxx.

185 {
186 // Check if the object is well prepared:
187 if( m_impl->m_chainList.size() == 0 ) {
188 ATH_MSG_FATAL( "Trigger menu not loaded" );
189 throw std::runtime_error( "Tool not initialised correctly" );
190 }
191
192 // Return the object:
193 return m_impl->m_chainList;
194 }

◆ ctpConfig()

const CTPConfig * TrigConf::xAODConfigTool::ctpConfig ( ) const
overridevirtual

Get the LVL1 trigger menu.

Implements TrigConf::IILVL1ConfigSvc.

Definition at line 130 of file xAODConfigTool.cxx.

130 {
131 // Check if the object is well prepared:
132 if( m_impl->m_ctpConfig.menu().size() == 0 ) {
133 ATH_MSG_FATAL( "Trigger menu not loaded" );
134 throw std::runtime_error( "Tool not initialised correctly" );
135 }
136
137 // Return the pointer:
138 return &m_impl->m_ctpConfig;
139 }

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

◆ 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 TrigConf::xAODConfigTool::endInputFile ( )
overrideprotectedvirtual

Invalidate the cached menu objects when the current input file is closed.

Reimplemented from asg::AsgMetadataTool.

Definition at line 448 of file xAODConfigTool.cxx.

448 {
449#ifndef XAOD_STANDALONE
450 ATH_MSG_DEBUG( "Input file closed, invalidating the cached trigger configuration" );
451 m_tmc = nullptr;
452 m_menu = nullptr;
453 m_hltJson = nullptr;
454 m_hltmonitoringJson = nullptr;
455 m_l1Json = nullptr;
456 m_hltpsJson = nullptr;
457 m_l1psJson = nullptr;
458 m_bgJson = nullptr;
459 m_currentHltJson = nullptr;
461 m_currentL1Json = nullptr;
462 m_currentHltpsJson = nullptr;
463 m_currentL1psJson = nullptr;
464 m_currentBgJson = nullptr;
465#endif // not XAOD_STANDALONE
466 return StatusCode::SUCCESS;
467 }

◆ 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

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

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

◆ hltMenu()

const HLTMenu & TrigConf::xAODConfigTool::hltMenu ( const EventContext & ctx) const
overridevirtual

Returns the JSON configured HLTMenu ptree.

Implements TrigConf::IIHLTConfigSvc.

Definition at line 253 of file xAODConfigTool.cxx.

253 {
255 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
256 throw std::runtime_error( "Tool not initialised correctly" );
257 }
258 return m_impl->m_currentHlt;
259 }

◆ hltMonitoring()

const HLTMonitoring & TrigConf::xAODConfigTool::hltMonitoring ( const EventContext & ctx) const
overridevirtual

Returns the JSON configured HLTMonitoring ptree.

Implements TrigConf::IIHLTConfigSvc.

Definition at line 261 of file xAODConfigTool.cxx.

261 {
263 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
264 throw std::runtime_error( "Tool not initialised correctly" );
265 }
266 return m_impl->m_currentHltmonitoring;
267 }

◆ hltPrescaleKey()

uint32_t TrigConf::xAODConfigTool::hltPrescaleKey ( ) const
overridevirtual

Get the HLT prescale key.

Implements TrigConf::IIHLTConfigSvc.

Definition at line 230 of file xAODConfigTool.cxx.

230 {
232
233 if( ! m_currentHltpsJson ) {
234 ATH_MSG_FATAL( "Trigger configuration not loaded for the current event" );
235 throw std::runtime_error( "Tool not initialised correctly" );
236 }
237 return m_currentHltpsJson->key();
238
239 } else {
240
241 // Check if the object is well prepared:
242 if( ! m_menu ) {
243 ATH_MSG_FATAL( "Trigger menu not loaded" );
244 throw std::runtime_error( "Tool not initialised correctly" );
245 }
246
247 // Return the key from the metadata object:
248 return m_menu->hltpsk();
249
250 }
251 }

◆ hltPrescalesSet()

const HLTPrescalesSet & TrigConf::xAODConfigTool::hltPrescalesSet ( const EventContext & ctx) const
overridevirtual

Returns the JSON configured HLT prescales ptree.

Implements TrigConf::IIHLTConfigSvc.

Definition at line 277 of file xAODConfigTool.cxx.

277 {
279 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
280 throw std::runtime_error( "Tool not initialised correctly" );
281 }
282 return m_impl->m_currentHltps;
283 }

◆ initialize()

StatusCode TrigConf::xAODConfigTool::initialize ( void )
overridevirtual

Function initialising the tool.

Reimplemented from asg::AsgTool.

Definition at line 84 of file xAODConfigTool.cxx.

84 {
85
86 // Greet the user:
87 ATH_MSG_INFO( "Initialising..." );
88 ATH_MSG_DEBUG( "EventObjectName = " << m_eventName );
89 ATH_MSG_DEBUG( "-- Run 2 AOD Configuration Settings");
90 ATH_MSG_DEBUG( "MetaObjectName = " << m_metaName_run2 );
91 ATH_MSG_DEBUG( "-- Run 3 AOD Configuration Settings");
92 ATH_MSG_DEBUG( "JSONMetaObjectNameHLT = " << m_metaNameJSON_hlt );
93 ATH_MSG_DEBUG( "JSONMetaObjectNameHLTMonitoring = " << m_metaNameJSON_hltmonitoring );
94 ATH_MSG_DEBUG( "JSONMetaObjectNameL1 = " << m_metaNameJSON_l1 );
95 ATH_MSG_DEBUG( "JSONMetaObjectNameHLTPS = " << m_metaNameJSON_hltps );
96 ATH_MSG_DEBUG( "JSONMetaObjectNameL1PS = " << m_metaNameJSON_l1ps );
97 ATH_MSG_DEBUG( "JSONMetaObjectNameBunchgroup = " << m_metaNameJSON_bg );
98
99 // Reset the pointers:
100 m_tmc = nullptr;
101 m_menu = nullptr;
102 //
103 m_hltJson = nullptr;
104 m_hltmonitoringJson = nullptr;
105 m_l1Json = nullptr;
106 m_hltpsJson = nullptr;
107 m_l1psJson = nullptr;
108 m_bgJson = nullptr;
109 m_currentHltJson = nullptr;
111 m_currentL1Json = nullptr;
112 m_currentHltpsJson = nullptr;
113 m_currentL1psJson = nullptr;
114 m_currentBgJson = nullptr;
115
116#ifndef XAOD_STANDALONE
117 // AsgMetadataTool only subscribes to BeginEvent in Athena, so input-file
118 // incidents never reach this tool. Priority 0: after MetaDataSvc has loaded
119 // the new file's metadata, before TrigDecisionTool's -1.
120 ServiceHandle< IIncidentSvc > incSvc( "IncidentSvc", name() );
121 ATH_CHECK( incSvc.retrieve() );
122 incSvc->addListener( this, IncidentType::BeginInputFile, 0, true );
123 incSvc->addListener( this, IncidentType::EndInputFile, 0, true );
124#endif // not XAOD_STANDALONE
125
126 // Return gracefully:
127 return StatusCode::SUCCESS;
128 }
#define ATH_MSG_INFO(x,...)

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

◆ l1BunchGroupSet()

const L1BunchGroupSet & TrigConf::xAODConfigTool::l1BunchGroupSet ( const EventContext & ctx) const
overridevirtual

Returns the JSON configured bunchgroup ptree.

Implements TrigConf::IILVL1ConfigSvc.

Definition at line 293 of file xAODConfigTool.cxx.

293 {
295 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
296 throw std::runtime_error( "Tool not initialised correctly" );
297 }
298 return m_impl->m_currentBg;
299 }

◆ l1Menu()

const L1Menu & TrigConf::xAODConfigTool::l1Menu ( const EventContext & ctx) const
overridevirtual

Returns the JSON configured L1 ptree.

Implements TrigConf::IILVL1ConfigSvc.

Definition at line 269 of file xAODConfigTool.cxx.

269 {
271 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
272 throw std::runtime_error( "Tool not initialised correctly" );
273 }
274 return m_impl->m_currentL1;
275 }

◆ l1PrescalesSet()

const L1PrescalesSet & TrigConf::xAODConfigTool::l1PrescalesSet ( const EventContext & ctx) const
overridevirtual

Returns the JSON configured L1 prescales ptree.

Implements TrigConf::IILVL1ConfigSvc.

Definition at line 285 of file xAODConfigTool.cxx.

285 {
287 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
288 throw std::runtime_error( "Tool not initialised correctly" );
289 }
290 return m_impl->m_currentL1ps;
291 }

◆ loadJsonByKey()

StatusCode TrigConf::xAODConfigTool::loadJsonByKey ( const std::string & humanName,
const xAOD::TriggerMenuJsonContainer * metaContainer,
const uint32_t keyToCheck,
const xAOD::TriggerMenuJson *& ptrToSet )
private

Locates a Run3 TriggerMenuJson object inside a container by key. Loads it into the m_currentXXXJson ptr.

Definition at line 617 of file xAODConfigTool.cxx.

621 {
622 xAOD::TriggerMenuJsonContainer::const_iterator menu_itr = metaContainer->begin();
623 xAOD::TriggerMenuJsonContainer::const_iterator menu_end = metaContainer->end();
624 for( ; menu_itr != menu_end; ++menu_itr ) {
625 // Check if this is the menu we're looking for:
626 if( keyToCheck != (*menu_itr)->key() ) continue;
627 ptrToSet = *menu_itr;
628 return StatusCode::SUCCESS;
629 }
630
631 ATH_MSG_FATAL("Couldn't find configuration for current event"
632 << ", Requested key=" << keyToCheck
633 << ", Requested menu=" << humanName);
634 return StatusCode::FAILURE;
635 }
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.

◆ loadPtree()

StatusCode TrigConf::xAODConfigTool::loadPtree ( const std::string & humanName,
const xAOD::TriggerMenuJson * menu,
DataStructure & dataStructure )
private

Load single m_currentXXXJson serialised JSON data into ptree.

Definition at line 651 of file xAODConfigTool.cxx.

654 {
655 std::stringstream rawData;
656 rawData << menu->payload();
657 dataStructure.clear();
658 try {
659 boost::property_tree::ptree pt;
660 boost::property_tree::read_json(rawData, pt);
661 dataStructure.setData(std::move(pt));
662 } catch (const boost::property_tree::json_parser_error& e) {
663 ATH_MSG_FATAL("Unable to decode a JSON trigger menu metadata payload for " << humanName << " with key " << menu->key());
664 ATH_MSG_FATAL(e.what());
665 return StatusCode::FAILURE;
666 }
667 return StatusCode::SUCCESS;
668 }

◆ loadPtrees()

StatusCode TrigConf::xAODConfigTool::loadPtrees ( )
private

Load all m_currentXXXJson serialised JSON data into ptrees inside m_impl.

Definition at line 637 of file xAODConfigTool.cxx.

637 {
638 ATH_CHECK( loadPtree("HLT Menu", m_currentHltJson, m_impl->m_currentHlt) );
640 ATH_CHECK( loadPtree("HLT Monitoring", m_currentHltmonitoringJson, m_impl->m_currentHltmonitoring) );
641 }
642 ATH_CHECK( loadPtree("L1 Menu", m_currentL1Json, m_impl->m_currentL1) );
643 ATH_CHECK( loadPtree("HLT Prescales", m_currentHltpsJson, m_impl->m_currentHltps) );
644 ATH_CHECK( loadPtree("L1 Prescales", m_currentL1psJson, m_impl->m_currentL1ps) );
645 if (m_bgJson) {
646 ATH_CHECK( loadPtree("Bunchgroups", m_currentBgJson, m_impl->m_currentBg) );
647 }
648 return StatusCode::SUCCESS;
649 }
StatusCode loadPtree(const std::string &humanName, const xAOD::TriggerMenuJson *menu, DataStructure &dataStructure)
Load single m_currentXXXJson serialised JSON data into ptree.

◆ lvl1PrescaleKey()

uint32_t TrigConf::xAODConfigTool::lvl1PrescaleKey ( ) const
overridevirtual

Get the LVL1 prescale key.

Implements TrigConf::IILVL1ConfigSvc.

Definition at line 152 of file xAODConfigTool.cxx.

152 {
154
155 if( ! m_currentL1psJson ) {
156 ATH_MSG_FATAL( "Trigger configuration not loaded for the current event" );
157 throw std::runtime_error( "Tool not initialised correctly" );
158 }
159 return m_currentL1psJson->key();
160
161 } else {
162
163 // Check if the object is well prepared:
164 if( ! m_menu ) {
165 ATH_MSG_FATAL( "Trigger menu not loaded" );
166 throw std::runtime_error( "Tool not initialised correctly" );
167 }
168
169 // Return the key from the metadata object:
170 return m_menu->l1psk();
171
172 }
173 }

◆ masterKey()

uint32_t TrigConf::xAODConfigTool::masterKey ( ) const
overridevirtual

Get the Super Master Key.

Implements TrigConf::IIHLTConfigSvc.

Definition at line 207 of file xAODConfigTool.cxx.

207 {
209
210 if( ! m_currentHltJson ) {
211 ATH_MSG_FATAL( "Trigger configuration not loaded for the current event" );
212 throw std::runtime_error( "Tool not initialised correctly" );
213 }
214 return m_currentHltJson->key();
215
216 } else {
217
218 // Check if the object is well prepared:
219 if( ! m_menu ) {
220 ATH_MSG_FATAL( "Trigger menu not loaded" );
221 throw std::runtime_error( "Tool not initialised correctly" );
222 }
223
224 // Return the key from the metadata object:
225 return m_menu->smk();
226
227 }
228 }

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

void asg::AsgTool::print ( ) const
virtualinherited

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

◆ sequences()

const HLTSequenceList & TrigConf::xAODConfigTool::sequences ( ) const
overridevirtual

Get the HLT sequences.

Implements TrigConf::IIHLTConfigSvc.

Definition at line 196 of file xAODConfigTool.cxx.

196 {
197 // Check if the object is well prepared:
198 if( m_impl->m_sequenceList.size() == 0 ) {
199 ATH_MSG_FATAL( "Trigger menu not loaded" );
200 throw std::runtime_error( "Tool not initialised correctly" );
201 }
202
203 // Return the object:
204 return m_impl->m_sequenceList;
205 }

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

◆ thresholdConfig()

virtual const ThresholdConfig * TrigConf::xAODConfigTool::thresholdConfig ( ) const
inlineoverridevirtual

Get the LVL1 threshold configuruation (not available from xAOD).

Implements TrigConf::IILVL1ConfigSvc.

Definition at line 78 of file xAODConfigTool.h.

78 {
79 return 0;
80 }

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

const xAOD::TriggerMenuJsonContainer* TrigConf::xAODConfigTool::m_bgJson
private

Definition at line 197 of file xAODConfigTool.h.

◆ m_bgkeysName

std::string TrigConf::xAODConfigTool::m_bgkeysName
private

Key for the event-level bunchgroup identification object, in the codebase since R2 but only being used since R3.

Definition at line 178 of file xAODConfigTool.h.

◆ m_currentBgJson

const xAOD::TriggerMenuJson* TrigConf::xAODConfigTool::m_currentBgJson
private

Definition at line 207 of file xAODConfigTool.h.

◆ m_currentHltJson

const xAOD::TriggerMenuJson* TrigConf::xAODConfigTool::m_currentHltJson
private

The active configuration for the current event (For Run3 AOD).

Definition at line 202 of file xAODConfigTool.h.

◆ m_currentHltmonitoringJson

const xAOD::TriggerMenuJson* TrigConf::xAODConfigTool::m_currentHltmonitoringJson
private

Definition at line 203 of file xAODConfigTool.h.

◆ m_currentHltpsJson

const xAOD::TriggerMenuJson* TrigConf::xAODConfigTool::m_currentHltpsJson
private

Definition at line 205 of file xAODConfigTool.h.

◆ m_currentL1Json

const xAOD::TriggerMenuJson* TrigConf::xAODConfigTool::m_currentL1Json
private

Definition at line 204 of file xAODConfigTool.h.

◆ m_currentL1psJson

const xAOD::TriggerMenuJson* TrigConf::xAODConfigTool::m_currentL1psJson
private

Definition at line 206 of file xAODConfigTool.h.

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

std::string TrigConf::xAODConfigTool::m_eventName
private

Key for the event-level configuration identifier object.

Definition at line 176 of file xAODConfigTool.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_hltJson

const xAOD::TriggerMenuJsonContainer* TrigConf::xAODConfigTool::m_hltJson
private

The configuration object of the current input file (for Run3 AOD).

Definition at line 192 of file xAODConfigTool.h.

◆ m_hltmonitoringJson

const xAOD::TriggerMenuJsonContainer* TrigConf::xAODConfigTool::m_hltmonitoringJson
private

Definition at line 193 of file xAODConfigTool.h.

◆ m_hltpsJson

const xAOD::TriggerMenuJsonContainer* TrigConf::xAODConfigTool::m_hltpsJson
private

Definition at line 195 of file xAODConfigTool.h.

◆ m_impl

std::unique_ptr<Impl> TrigConf::xAODConfigTool::m_impl
private

Definition at line 221 of file xAODConfigTool.h.

◆ m_inputMetaStore

MetaStore_t asg::AsgMetadataTool::m_inputMetaStore
privateinherited

Object accessing the input metadata store.

Definition at line 119 of file AsgMetadataTool.h.

◆ m_l1Json

const xAOD::TriggerMenuJsonContainer* TrigConf::xAODConfigTool::m_l1Json
private

Definition at line 194 of file xAODConfigTool.h.

◆ m_l1psJson

const xAOD::TriggerMenuJsonContainer* TrigConf::xAODConfigTool::m_l1psJson
private

Definition at line 196 of file xAODConfigTool.h.

◆ m_menu

const xAOD::TriggerMenu* TrigConf::xAODConfigTool::m_menu
private

The active configuration for the current event (For Run2 AOD).

Definition at line 200 of file xAODConfigTool.h.

◆ m_menuJSONContainerAvailable

bool TrigConf::xAODConfigTool::m_menuJSONContainerAvailable
private

Is decoded R3 format data available?

Definition at line 212 of file xAODConfigTool.h.

◆ m_metaName_run2

std::string TrigConf::xAODConfigTool::m_metaName_run2
private

Key for the trigger configuration metadata object (Run 2).

Definition at line 180 of file xAODConfigTool.h.

◆ m_metaNameJSON_bg

std::string TrigConf::xAODConfigTool::m_metaNameJSON_bg
private

Definition at line 187 of file xAODConfigTool.h.

◆ m_metaNameJSON_hlt

std::string TrigConf::xAODConfigTool::m_metaNameJSON_hlt
private

Key for the trigger configuration metadata objects (Run 3).

Definition at line 182 of file xAODConfigTool.h.

◆ m_metaNameJSON_hltmonitoring

std::string TrigConf::xAODConfigTool::m_metaNameJSON_hltmonitoring
private

Definition at line 183 of file xAODConfigTool.h.

◆ m_metaNameJSON_hltps

std::string TrigConf::xAODConfigTool::m_metaNameJSON_hltps
private

Definition at line 185 of file xAODConfigTool.h.

◆ m_metaNameJSON_l1

std::string TrigConf::xAODConfigTool::m_metaNameJSON_l1
private

Definition at line 184 of file xAODConfigTool.h.

◆ m_metaNameJSON_l1ps

std::string TrigConf::xAODConfigTool::m_metaNameJSON_l1ps
private

Definition at line 186 of file xAODConfigTool.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_tmc

const xAOD::TriggerMenuContainer* TrigConf::xAODConfigTool::m_tmc
private

The configuration object of the current input file (for Run2 AOD).

Definition at line 190 of file xAODConfigTool.h.

◆ m_triggerMenuContainerAvailable

bool TrigConf::xAODConfigTool::m_triggerMenuContainerAvailable
private

Is decoded R2 format data available?

Definition at line 210 of file xAODConfigTool.h.

◆ 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_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: