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

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
virtual const ::TrigConf::L1Menul1Menu (const ::EventContext &ctx) const =0
 Returns the JSON configured L1 ptree.
virtual const ::TrigConf::L1PrescalesSetl1PrescalesSet (const ::EventContext &ctx) const =0
 Returns the JSON configured L1 prescales ptree.
virtual const ::TrigConf::L1BunchGroupSetl1BunchGroupSet (const ::EventContext &ctx) const =0
 Returns the JSON configured bunchgroup ptree.
virtual const ::TrigConf::HLTMenuhltMenu (const ::EventContext &ctx) const =0
 Returns the JSON configured HLTMenu ptree.
virtual const ::TrigConf::HLTMonitoringhltMonitoring (const ::EventContext &ctx) const =0
 Returns the JSON configured HLTMonitoring ptree.
virtual const ::TrigConf::HLTPrescalesSethltPrescalesSet (const ::EventContext &ctx) const =0
 Returns the JSON configured HLT prescales ptree.
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=Gaudi::Hive::currentContext()) const override
 Returns the JSON configured HLTMenu ptree.
virtual const HLTMonitoringhltMonitoring (const EventContext &ctx=Gaudi::Hive::currentContext()) const override
 Returns the JSON configured HLTMonitoring ptree.
virtual const L1Menul1Menu (const EventContext &ctx=Gaudi::Hive::currentContext()) const override
 Returns the JSON configured L1 ptree.
virtual const HLTPrescalesSethltPrescalesSet (const EventContext &ctx=Gaudi::Hive::currentContext()) const override
 Returns the JSON configured HLT prescales ptree.
virtual const L1PrescalesSetl1PrescalesSet (const EventContext &ctx=Gaudi::Hive::currentContext()) const override
 Returns the JSON configured L1 prescales ptree.
virtual const L1BunchGroupSetl1BunchGroupSet (const EventContext &ctx=Gaudi::Hive::currentContext()) 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 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/TEvent.
virtual StatusCode endInputFile ()
 Function called when the currently open input file got completely processed.
virtual StatusCode metaDataStop ()
 Function called when the tool should write out its metadata.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

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
Revision
631651
Date
2014-11-27 19:33:16 +0100 (Thu, 27 Nov 2014)

Definition at line 54 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 51 of file xAODConfigTool.cxx.

52 : asg::AsgMetadataTool( name ),
53 m_tmc( nullptr ),
54 m_hltJson( nullptr), m_hltmonitoringJson(nullptr), m_l1Json( nullptr ),
55 m_hltpsJson( nullptr ), m_l1psJson( nullptr ), m_bgJson( nullptr ),
56 m_menu( nullptr ),
57 m_currentHltJson( nullptr ), m_currentHltmonitoringJson( nullptr ), m_currentL1Json( nullptr ),
58 m_currentHltpsJson( nullptr ), m_currentL1psJson( nullptr ), m_currentBgJson( nullptr ),
61 m_impl (std::make_unique<Impl>()) {
62
63 declareProperty( "EventObjectName", m_eventName = "TrigConfKeys" );
64 declareProperty( "BGKeysObjectName", m_bgkeysName = "BunchConfKey" );
65 declareProperty( "MetaObjectName", m_metaName_run2 = "TriggerMenu" );
66
67 declareProperty( "JSONMetaObjectNameHLT", m_metaNameJSON_hlt = "TriggerMenuJson_HLT" );
68 declareProperty( "JSONMetaObjectNameHLTMonitoring", m_metaNameJSON_hltmonitoring = "TriggerMenuJson_HLTMonitoring" );
69 declareProperty( "JSONMetaObjectNameL1", m_metaNameJSON_l1 = "TriggerMenuJson_L1" );
70 declareProperty( "JSONMetaObjectNameHLTPS", m_metaNameJSON_hltps = "TriggerMenuJson_HLTPS" );
71 declareProperty( "JSONMetaObjectNameL1PS", m_metaNameJSON_l1ps = "TriggerMenuJson_L1PS" );
72 declareProperty( "JSONMetaObjectNameBunchgroup", m_metaNameJSON_bg = "TriggerMenuJson_BG" );
73 }
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 420 of file xAODConfigTool.cxx.

420 {
421
422 // It may be that the input file opening event is missed in standalone
423 // mode at the very beginning of the application. (Depending on the
424 // creation order of the objects.) So make sure that we have the
425 // configuration objects at hand...
428 }
429
430 // Read the current event's trigger keys:
431 const xAOD::TrigConfKeys* keys = nullptr;
432 ATH_CHECK( evtStore()->retrieve( keys, m_eventName ) );
433
434 const xAOD::BunchConfKey* bgKey = nullptr; // The BG key is currently optional, only files written from late 2021 will contain this
437 }
438
439 // Prefer Run 3 data if available
441 return beginEvent_Run3(keys, bgKey);
443 return beginEvent_Run2(keys);
444 }
445
446 ATH_MSG_ERROR( "Both m_menuJSONContainerAvailable and m_triggerMenuContainerAvailable are false");
447 return StatusCode::FAILURE;
448
449 }
#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:114
retrieve(aClass, aKey=None)
Definition PyKernel.py:110
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 451 of file xAODConfigTool.cxx.

451 {
452 // Check if we have the correct menu already:
453 if( m_menu && xAODKeysMatch( keys, m_menu ) ) {
454 return StatusCode::SUCCESS;
455 }
456
457 // If not, let's look for the correct configuration:
460 for( ; menu_itr != menu_end; ++menu_itr ) {
461 // Check if this is the menu we're looking for:
462 if( ! xAODKeysMatch( keys, *menu_itr ) ) continue;
463 // Remember it's pointer:
464 m_menu = *menu_itr;
465 // Cache the menu's configuration:
467 m_impl->m_chainList,
468 m_impl->m_sequenceList,
469 m_impl->m_bgSet, msg() ) );
470 // We're done:
471 return StatusCode::SUCCESS;
472 }
473
474 // Apparently we didn't find the correct menu!
475 ATH_MSG_ERROR( "Couldn't find configuration for current event (SMK:"
476 << keys->smk() << ", L1PSK:" << keys->l1psk()
477 << ", HLTPSK:" << keys->hltpsk() << ")" );
478 return StatusCode::FAILURE;
479 }
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 481 of file xAODConfigTool.cxx.

481 {
482 if (keys==nullptr) {
483 ATH_MSG_ERROR("nullptr TrigConfKeys");
484 return StatusCode::FAILURE;
485 }
486
487 // Check if we have the correct menu already:
488 bool validConfig = true;
489 if (m_currentHltJson->key() != keys->smk()) {
490 validConfig = false;
491 }
492 // m_currentHltminitoringJson is checked by the m_currentHltJson check
493 if (m_currentL1Json->key() != keys->smk()) {
494 validConfig = false;
495 }
496 if (m_currentHltpsJson->key() != keys->hltpsk()) {
497 validConfig = false;
498 }
499 if (m_currentL1psJson->key() != keys->l1psk()) {
500 validConfig = false;
501 }
502 if (m_bgJson && m_currentBgJson && bgKey && m_currentBgJson->key() != static_cast<unsigned int>(bgKey->id())) {
503 validConfig = false;
504 }
505
506 if (validConfig) {
507 return StatusCode::SUCCESS;
508 }
509
510 // If not, load correct JSON menus from their respective containers, matching against the event's keys ...
511 ATH_CHECK( loadJsonByKey("HLT Menu", m_hltJson, keys->smk(), m_currentHltJson) );
514 }
515 ATH_CHECK( loadJsonByKey("L1 Menu", m_l1Json, keys->smk(), m_currentL1Json) );
516 ATH_CHECK( loadJsonByKey("HLT Prescales", m_hltpsJson, keys->hltpsk(), m_currentHltpsJson) );
517 ATH_CHECK( loadJsonByKey("L1 Prescales", m_l1psJson, keys->l1psk(), m_currentL1psJson) );
518 if (m_bgJson && bgKey) {
519 ATH_CHECK( loadJsonByKey("Bunchgroups", m_bgJson, bgKey->id(), m_currentBgJson) );
520 }
521
522 // ... and from these serialised JSON strings, populate the ptree data structures...
523 ATH_CHECK( loadPtrees() );
524
525 // ... and set the keys of the objects in the objects (not part of the JSON pyaload) ...
526 m_impl->m_currentHlt.setSMK( m_currentHltJson->key() );
528 m_impl->m_currentHltmonitoring.setSMK( m_currentHltmonitoringJson->key() );
529 }
530 m_impl->m_currentL1.setSMK( m_currentL1Json->key() );
531 m_impl->m_currentHltps.setPSK( m_currentHltpsJson->key() );
532 m_impl->m_currentL1ps.setPSK( m_currentL1psJson->key() );
533 if (m_bgJson && bgKey) {
534 m_impl->m_currentBg.setBGSK( m_currentBgJson->key() );
535 }
536
537 // R3 interfaces now active
538
539 // ... and finally populate the legacy interface from the ptree data
540 ATH_CHECK( prepareTriggerMenu( m_impl->m_currentHlt,
541 m_impl->m_currentL1,
542 m_impl->m_currentHltps,
543 m_impl->m_currentL1ps,
544 m_impl->m_currentBg,
545 m_impl->m_ctpConfig,
546 m_impl->m_chainList,
547 m_impl->m_sequenceList,
548 m_impl->m_bgSet, msg() ) ); // R2 interfaces now active
549
550 return StatusCode::SUCCESS;
551 }
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 273 of file xAODConfigTool.cxx.

273 {
274
275 // Tell the user what's happening:
276 ATH_MSG_DEBUG( "Loading the trigger menu from a new input file" );
277
278 // Try to read the R2 metadata object:
279 m_tmc = nullptr;
282 or inputMetaStore()->retrieve( m_tmc, m_metaName_run2 ).isFailure() )
283 {
285 }
286
287 // Try to read the R3 metadata object:
288 m_hltJson = nullptr;
289 m_hltmonitoringJson = nullptr;
290 m_l1Json = nullptr;
291 m_hltpsJson = nullptr;
292 m_l1psJson = nullptr;
293 m_bgJson = nullptr;
297 {
299 }
302 {
303 // m_menuJSONContainerAvailable = false;
304 // Currently planning on only storing these data in MC. Hence this has to be an optional input.
305 }
307 or inputMetaStore()->retrieve( m_l1Json, m_metaNameJSON_l1 ).isFailure() )
308 {
310 }
313 {
315 }
318 {
320 }
322 or inputMetaStore()->retrieve( m_bgJson, m_metaNameJSON_bg ).isFailure() ) {
323 // m_menuJSONContainerAvailable = false;
324 // This was not written up to the end of 2021, we have to make it optional for at least a while
325 }
326
327
329 ATH_MSG_WARNING( "No trigger configurations are available on "
330 "the input" );
331 return StatusCode::SUCCESS;
332 }
333
334 // Prefer run three format, if available
336
337 // A little sanity check:
338 if( m_hltJson->size() == 0 ) {
339 // This can happen when we encounter empty input files. In which
340 // case we should not bail, but continue, and only bail if by the
341 // start of an event, we still don't see any configurations.
342 ATH_MSG_WARNING( "No trigger configurations are available on "
343 "the input" );
344 return StatusCode::SUCCESS;
345 }
346
347 // Load the first elements by default
348 ATH_CHECK( m_hltJson->size() > 0 );
349 //ATH_CHECK( m_hltmonitoringJson->size() > 0 ); // Optional - re-enable this check in the future when all used AODs contains this
350 ATH_CHECK( m_l1Json->size() > 0 );
351 ATH_CHECK( m_hltpsJson->size() > 0 );
352 ATH_CHECK( m_l1psJson->size() > 0 );
353 if (m_bgJson) { // Considered optional for now
354 ATH_CHECK( m_bgJson->size() > 0 );
355 }
356
357 m_currentHltJson = m_hltJson->at( 0 );
358 if (m_hltmonitoringJson && m_hltmonitoringJson->size()) { // Optional
360 }
361 m_currentL1Json = m_l1Json->at( 0 );
363 m_currentL1psJson = m_l1psJson->at( 0 );
364 if (m_bgJson) { // Considered optional for now
365 m_currentBgJson = m_bgJson->at( 0 );
366 }
367
369
370 // Loading the payload doesn't additionally let the object know about its own key. We can load this in now too.
371 m_impl->m_currentHlt.setSMK( m_currentHltJson->key() );
372 if (m_currentHltmonitoringJson) { // Optional
373 m_impl->m_currentHltmonitoring.setSMK( m_currentHltmonitoringJson->key() );
374 }
375 m_impl->m_currentL1.setSMK( m_currentL1Json->key() );
376 m_impl->m_currentHltps.setPSK( m_currentHltpsJson->key() );
377 m_impl->m_currentL1ps.setPSK( m_currentL1psJson->key() );
378 if (m_bgJson) { // Optional (for now)
379 m_impl->m_currentBg.setBGSK( m_currentBgJson->key() );
380 }
381
382 ATH_CHECK( prepareTriggerMenu( m_impl->m_currentHlt,
383 m_impl->m_currentL1,
384 m_impl->m_currentHltps,
385 m_impl->m_currentL1ps,
386 m_impl->m_currentBg,
387 m_impl->m_ctpConfig,
388 m_impl->m_chainList,
389 m_impl->m_sequenceList,
390 m_impl->m_bgSet, msg() ) );
391
392 return StatusCode::SUCCESS;
393
395
396 // A little sanity check:
397 if( m_tmc->size() == 0 ) {
398 // This can happen when we encounter empty input files. In which
399 // case we should not bail, but continue, and only bail if by the
400 // start of an event, we still don't see any configurations.
401 ATH_MSG_WARNING( "No trigger configurations are available on "
402 "the input" );
403 return StatusCode::SUCCESS;
404 }
405
406 m_menu = m_tmc->at( 0 );
407 // Cache the menu's configuration:
409 m_impl->m_chainList,
410 m_impl->m_sequenceList,
411 m_impl->m_bgSet, msg() ) );
412
413 return StatusCode::SUCCESS;
414 }
415
416 ATH_MSG_ERROR( "Both m_menuJSONContainerAvailable and m_triggerMenuContainerAvailable are false");
417 return StatusCode::FAILURE; // Should never get here as checked that one or the other is true above
418 }
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(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 125 of file xAODConfigTool.cxx.

125 {
126 // Check if the object is well prepared:
127 if( m_impl->m_bgSet.bunchGroups().size() == 0 ) {
128 ATH_MSG_FATAL( "Trigger menu not loaded" );
129 throw std::runtime_error( "Tool not initialised correctly" );
130 }
131
132 // Return the pointer:
133 return &m_impl->m_bgSet;
134 }
#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 155 of file xAODConfigTool.cxx.

156 {
158 return m_impl->m_currentBg.bgsk();
159 else {
160 ATH_MSG_DEBUG("There's no way to access the bunch group set key from a legacy AOD!");
161 return std::numeric_limits<uint32_t>::max();
162 }
163 }

◆ chains()

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

Get the HLT chains.

Implements TrigConf::IIHLTConfigSvc.

Definition at line 165 of file xAODConfigTool.cxx.

165 {
166 // Check if the object is well prepared:
167 if( m_impl->m_chainList.size() == 0 ) {
168 ATH_MSG_FATAL( "Trigger menu not loaded" );
169 throw std::runtime_error( "Tool not initialised correctly" );
170 }
171
172 // Return the object:
173 return m_impl->m_chainList;
174 }

◆ ctpConfig()

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

Get the LVL1 trigger menu.

Implements TrigConf::IILVL1ConfigSvc.

Definition at line 114 of file xAODConfigTool.cxx.

114 {
115 // Check if the object is well prepared:
116 if( m_impl->m_ctpConfig.menu().size() == 0 ) {
117 ATH_MSG_FATAL( "Trigger menu not loaded" );
118 throw std::runtime_error( "Tool not initialised correctly" );
119 }
120
121 // Return the pointer:
122 return &m_impl->m_ctpConfig;
123 }

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

◆ getKey()

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

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

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

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

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

Definition at line 119 of file AsgTool.cxx.

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

◆ getName()

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

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

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

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

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

Definition at line 106 of file AsgTool.cxx.

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

◆ getProperty()

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

Get one of the tool's properties.

◆ handle()

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

Function receiving incidents from IncidentSvc/TEvent.

Reimplemented in Trig::TrigDecisionTool.

Definition at line 135 of file AsgMetadataTool.cxx.

135 {
136
137 // Tell the user what's happening:
138 ATH_MSG_VERBOSE( "Callback received with incident: " << inc.type() );
139
140 // Call the appropriate member function:
141 if( inc.type() == IncidentType::BeginInputFile ) {
143 if( beginInputFile().isFailure() ) {
144 ATH_MSG_FATAL( "Failed to call beginInputFile()" );
145 throw std::runtime_error( "Couldn't call beginInputFile()" );
146 }
147 } else if( inc.type() == IncidentType::EndInputFile ) {
148 if( endInputFile().isFailure() ) {
149 ATH_MSG_FATAL( "Failed to call endInputFile()" );
150 throw std::runtime_error( "Couldn't call endInputFile()" );
151 }
152 } else if( inc.type() == IncidentType::BeginEvent ) {
153 // If the tool didn't catch the begin input file incident for the
154 // first input file of the job, then call the appropriate function
155 // now.
156 if( ! m_beginInputFileCalled ) {
158 if( beginInputFile().isFailure() ) {
159 ATH_MSG_FATAL( "Failed to call beginInputFile()" );
160 throw std::runtime_error( "Couldn't call beginInputFile()" );
161 }
162 }
163 if( beginEvent().isFailure() ) {
164 ATH_MSG_FATAL( "Failed to call beginEvent()" );
165 throw std::runtime_error( "Couldn't call beginEvent()" );
166 }
167
168 #ifdef XAOD_STANDALONE
169 } else if( inc.type() == IncidentType::MetaDataStop ) {
170 if( metaDataStop().isFailure() ) {
171 ATH_MSG_FATAL( "Failed to call metaDataStop()" );
172 throw std::runtime_error( "Couldn't call metaDataStop()" );
173 }
174
175 #endif // XAOD_STANDALONE
176 } else {
177 ATH_MSG_WARNING( "Unknown incident type received in AsgMetaDataTool: " << inc.type() );
178 }
179
180 return;
181 }
#define ATH_MSG_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() [1/2]

virtual const ::TrigConf::HLTMenu & TrigConf::IIHLTConfigSvc::hltMenu ( const ::EventContext & ctx) const
pure virtualinherited

Returns the JSON configured HLTMenu ptree.

◆ hltMenu() [2/2]

const HLTMenu & TrigConf::xAODConfigTool::hltMenu ( const EventContext & ctx = Gaudi::Hive::currentContext()) const
overridevirtual

Returns the JSON configured HLTMenu ptree.

Definition at line 225 of file xAODConfigTool.cxx.

225 {
227 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
228 throw std::runtime_error( "Tool not initialised correctly" );
229 }
230 return m_impl->m_currentHlt;
231 }

◆ hltMonitoring() [1/2]

virtual const ::TrigConf::HLTMonitoring & TrigConf::IIHLTConfigSvc::hltMonitoring ( const ::EventContext & ctx) const
pure virtualinherited

Returns the JSON configured HLTMonitoring ptree.

◆ hltMonitoring() [2/2]

const HLTMonitoring & TrigConf::xAODConfigTool::hltMonitoring ( const EventContext & ctx = Gaudi::Hive::currentContext()) const
overridevirtual

Returns the JSON configured HLTMonitoring ptree.

Definition at line 233 of file xAODConfigTool.cxx.

233 {
235 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
236 throw std::runtime_error( "Tool not initialised correctly" );
237 }
238 return m_impl->m_currentHltmonitoring;
239 }

◆ hltPrescaleKey()

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

Get the HLT prescale key.

Implements TrigConf::IIHLTConfigSvc.

Definition at line 206 of file xAODConfigTool.cxx.

206 {
208
209 return m_currentHltpsJson->key();
210
211 } else {
212
213 // Check if the object is well prepared:
214 if( ! m_menu ) {
215 ATH_MSG_FATAL( "Trigger menu not loaded" );
216 throw std::runtime_error( "Tool not initialised correctly" );
217 }
218
219 // Return the key from the metadata object:
220 return m_menu->hltpsk();
221
222 }
223 }

◆ hltPrescalesSet() [1/2]

virtual const ::TrigConf::HLTPrescalesSet & TrigConf::IIHLTConfigSvc::hltPrescalesSet ( const ::EventContext & ctx) const
pure virtualinherited

Returns the JSON configured HLT prescales ptree.

◆ hltPrescalesSet() [2/2]

const HLTPrescalesSet & TrigConf::xAODConfigTool::hltPrescalesSet ( const EventContext & ctx = Gaudi::Hive::currentContext()) const
overridevirtual

Returns the JSON configured HLT prescales ptree.

Definition at line 249 of file xAODConfigTool.cxx.

249 {
251 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
252 throw std::runtime_error( "Tool not initialised correctly" );
253 }
254 return m_impl->m_currentHltps;
255 }

◆ initialize()

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

Function initialising the tool.

Reimplemented from asg::AsgTool.

Definition at line 78 of file xAODConfigTool.cxx.

78 {
79
80 // Greet the user:
81 ATH_MSG_INFO( "Initialising..." );
82 ATH_MSG_DEBUG( "EventObjectName = " << m_eventName );
83 ATH_MSG_DEBUG( "-- Run 2 AOD Configuration Settings");
84 ATH_MSG_DEBUG( "MetaObjectName = " << m_metaName_run2 );
85 ATH_MSG_DEBUG( "-- Run 3 AOD Configuration Settings");
86 ATH_MSG_DEBUG( "JSONMetaObjectNameHLT = " << m_metaNameJSON_hlt );
87 ATH_MSG_DEBUG( "JSONMetaObjectNameHLTMonitoring = " << m_metaNameJSON_hltmonitoring );
88 ATH_MSG_DEBUG( "JSONMetaObjectNameL1 = " << m_metaNameJSON_l1 );
89 ATH_MSG_DEBUG( "JSONMetaObjectNameHLTPS = " << m_metaNameJSON_hltps );
90 ATH_MSG_DEBUG( "JSONMetaObjectNameL1PS = " << m_metaNameJSON_l1ps );
91 ATH_MSG_DEBUG( "JSONMetaObjectNameBunchgroup = " << m_metaNameJSON_bg );
92
93 // Reset the pointers:
94 m_tmc = nullptr;
95 m_menu = nullptr;
96 //
97 m_hltJson = nullptr;
98 m_hltmonitoringJson = nullptr;
99 m_l1Json = nullptr;
100 m_hltpsJson = nullptr;
101 m_l1psJson = nullptr;
102 m_bgJson = nullptr;
103 m_currentHltJson = nullptr;
105 m_currentL1Json = nullptr;
106 m_currentHltpsJson = nullptr;
107 m_currentL1psJson = nullptr;
108 m_currentBgJson = nullptr;
109
110 // Return gracefully:
111 return StatusCode::SUCCESS;
112 }
#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() [1/2]

virtual const ::TrigConf::L1BunchGroupSet & TrigConf::IILVL1ConfigSvc::l1BunchGroupSet ( const ::EventContext & ctx) const
pure virtualinherited

Returns the JSON configured bunchgroup ptree.

◆ l1BunchGroupSet() [2/2]

const L1BunchGroupSet & TrigConf::xAODConfigTool::l1BunchGroupSet ( const EventContext & ctx = Gaudi::Hive::currentContext()) const
overridevirtual

Returns the JSON configured bunchgroup ptree.

Definition at line 265 of file xAODConfigTool.cxx.

265 {
267 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
268 throw std::runtime_error( "Tool not initialised correctly" );
269 }
270 return m_impl->m_currentBg;
271 }

◆ l1Menu() [1/2]

virtual const ::TrigConf::L1Menu & TrigConf::IILVL1ConfigSvc::l1Menu ( const ::EventContext & ctx) const
pure virtualinherited

Returns the JSON configured L1 ptree.

◆ l1Menu() [2/2]

const L1Menu & TrigConf::xAODConfigTool::l1Menu ( const EventContext & ctx = Gaudi::Hive::currentContext()) const
overridevirtual

Returns the JSON configured L1 ptree.

Definition at line 241 of file xAODConfigTool.cxx.

241 {
243 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
244 throw std::runtime_error( "Tool not initialised correctly" );
245 }
246 return m_impl->m_currentL1;
247 }

◆ l1PrescalesSet() [1/2]

virtual const ::TrigConf::L1PrescalesSet & TrigConf::IILVL1ConfigSvc::l1PrescalesSet ( const ::EventContext & ctx) const
pure virtualinherited

Returns the JSON configured L1 prescales ptree.

◆ l1PrescalesSet() [2/2]

const L1PrescalesSet & TrigConf::xAODConfigTool::l1PrescalesSet ( const EventContext & ctx = Gaudi::Hive::currentContext()) const
overridevirtual

Returns the JSON configured L1 prescales ptree.

Definition at line 257 of file xAODConfigTool.cxx.

257 {
259 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
260 throw std::runtime_error( "Tool not initialised correctly" );
261 }
262 return m_impl->m_currentL1ps;
263 }

◆ 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 553 of file xAODConfigTool.cxx.

557 {
558 xAOD::TriggerMenuJsonContainer::const_iterator menu_itr = metaContainer->begin();
559 xAOD::TriggerMenuJsonContainer::const_iterator menu_end = metaContainer->end();
560 for( ; menu_itr != menu_end; ++menu_itr ) {
561 // Check if this is the menu we're looking for:
562 if( keyToCheck != (*menu_itr)->key() ) continue;
563 ptrToSet = *menu_itr;
564 return StatusCode::SUCCESS;
565 }
566
567 ATH_MSG_FATAL("Couldn't find configuration for current event"
568 << ", Requested key=" << keyToCheck
569 << ", Requested menu=" << humanName);
570 return StatusCode::FAILURE;
571 }
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 587 of file xAODConfigTool.cxx.

590 {
591 std::stringstream rawData;
592 rawData << menu->payload();
593 dataStructure.clear();
594 try {
595 boost::property_tree::ptree pt;
596 boost::property_tree::read_json(rawData, pt);
597 dataStructure.setData(std::move(pt));
598 } catch (const boost::property_tree::json_parser_error& e) {
599 ATH_MSG_FATAL("Unable to decode a JSON trigger menu metadata payload for " << humanName << " with key " << menu->key());
600 ATH_MSG_FATAL(e.what());
601 return StatusCode::FAILURE;
602 }
603 return StatusCode::SUCCESS;
604 }

◆ loadPtrees()

StatusCode TrigConf::xAODConfigTool::loadPtrees ( )
private

Load all m_currentXXXJson serialised JSON data into ptrees inside m_impl.

Definition at line 573 of file xAODConfigTool.cxx.

573 {
574 ATH_CHECK( loadPtree("HLT Menu", m_currentHltJson, m_impl->m_currentHlt) );
576 ATH_CHECK( loadPtree("HLT Monitoring", m_currentHltmonitoringJson, m_impl->m_currentHltmonitoring) );
577 }
578 ATH_CHECK( loadPtree("L1 Menu", m_currentL1Json, m_impl->m_currentL1) );
579 ATH_CHECK( loadPtree("HLT Prescales", m_currentHltpsJson, m_impl->m_currentHltps) );
580 ATH_CHECK( loadPtree("L1 Prescales", m_currentL1psJson, m_impl->m_currentL1ps) );
581 if (m_bgJson) {
582 ATH_CHECK( loadPtree("Bunchgroups", m_currentBgJson, m_impl->m_currentBg) );
583 }
584 return StatusCode::SUCCESS;
585 }
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 136 of file xAODConfigTool.cxx.

136 {
138
139 return m_currentL1psJson->key();
140
141 } else {
142
143 // Check if the object is well prepared:
144 if( ! m_menu ) {
145 ATH_MSG_FATAL( "Trigger menu not loaded" );
146 throw std::runtime_error( "Tool not initialised correctly" );
147 }
148
149 // Return the key from the metadata object:
150 return m_menu->l1psk();
151
152 }
153 }

◆ masterKey()

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

Get the Super Master Key.

Implements TrigConf::IIHLTConfigSvc.

Definition at line 187 of file xAODConfigTool.cxx.

187 {
189
190 return m_currentHltJson->key();
191
192 } else {
193
194 // Check if the object is well prepared:
195 if( ! m_menu ) {
196 ATH_MSG_FATAL( "Trigger menu not loaded" );
197 throw std::runtime_error( "Tool not initialised correctly" );
198 }
199
200 // Return the key from the metadata object:
201 return m_menu->smk();
202
203 }
204 }

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

◆ 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 176 of file xAODConfigTool.cxx.

176 {
177 // Check if the object is well prepared:
178 if( m_impl->m_sequenceList.size() == 0 ) {
179 ATH_MSG_FATAL( "Trigger menu not loaded" );
180 throw std::runtime_error( "Tool not initialised correctly" );
181 }
182
183 // Return the object:
184 return m_impl->m_sequenceList;
185 }

◆ 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 82 of file xAODConfigTool.h.

82 {
83 return 0;
84 }

◆ 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 198 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 179 of file xAODConfigTool.h.

◆ m_currentBgJson

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

Definition at line 208 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 203 of file xAODConfigTool.h.

◆ m_currentHltmonitoringJson

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

Definition at line 204 of file xAODConfigTool.h.

◆ m_currentHltpsJson

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

Definition at line 206 of file xAODConfigTool.h.

◆ m_currentL1Json

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

Definition at line 205 of file xAODConfigTool.h.

◆ m_currentL1psJson

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

Definition at line 207 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 177 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 193 of file xAODConfigTool.h.

◆ m_hltmonitoringJson

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

Definition at line 194 of file xAODConfigTool.h.

◆ m_hltpsJson

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

Definition at line 196 of file xAODConfigTool.h.

◆ m_impl

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

Definition at line 222 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 195 of file xAODConfigTool.h.

◆ m_l1psJson

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

Definition at line 197 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 201 of file xAODConfigTool.h.

◆ m_menuJSONContainerAvailable

bool TrigConf::xAODConfigTool::m_menuJSONContainerAvailable
private

Is decoded R3 format data available?

Definition at line 213 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 181 of file xAODConfigTool.h.

◆ m_metaNameJSON_bg

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

Definition at line 188 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 183 of file xAODConfigTool.h.

◆ m_metaNameJSON_hltmonitoring

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

Definition at line 184 of file xAODConfigTool.h.

◆ m_metaNameJSON_hltps

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

Definition at line 186 of file xAODConfigTool.h.

◆ m_metaNameJSON_l1

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

Definition at line 185 of file xAODConfigTool.h.

◆ m_metaNameJSON_l1ps

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

Definition at line 187 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 191 of file xAODConfigTool.h.

◆ m_triggerMenuContainerAvailable

bool TrigConf::xAODConfigTool::m_triggerMenuContainerAvailable
private

Is decoded R2 format data available?

Definition at line 211 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: