7#ifndef TRIGCONFXAOD_XAODCONFIGSVC_H
8#define TRIGCONFXAOD_XAODCONFIGSVC_H
13#include "GaudiKernel/IIncidentListener.h"
14#include "GaudiKernel/ServiceHandle.h"
41#include <shared_mutex>
75 class xAODConfigSvc :
public extends<AthService, ITrigConfigSvc, IIncidentListener> {
84 virtual StatusCode
finalize()
override;
118 virtual uint32_t
masterKey()
const override;
139 virtual const HLTMenu&
hltMenu(
const EventContext& ctx = Gaudi::Hive::currentContext())
const override;
145 virtual const L1Menu&
l1Menu(
const EventContext& ctx = Gaudi::Hive::currentContext())
const override;
159 virtual void handle(
const Incident& inc )
override;
190 StatusCode
loadPtree(
const std::string& humanName,
192 const uint32_t keyToCheck,
195 const bool optional =
false);
198 "Key for the event-level configuration identifier object"};
201 "Key for the event-level bunchgroup configuration identifier object. Only written from late 2021, optional input."};
205 Gaudi::Property<std::string>
m_metaName{
this,
"MetaObjectName",
"TriggerMenu",
206 "Key for the trigger configuration metadata object"};
211 Gaudi::Property< std::string >
m_metaNameJSON_hlt {
this,
"JSONMetaObjectNameHLT",
"TriggerMenuJson_HLT",
212 "StoreGate key for the xAOD::TriggerMenuJson HLT configuration object"};
215 "StoreGate key for the xAOD::TriggerMenuJson HLT monitoring configuration object"};
217 Gaudi::Property< std::string >
m_metaNameJSON_l1 {
this,
"JSONMetaObjectNameL1",
"TriggerMenuJson_L1",
218 "StoreGate key for the xAOD::TriggerMenuJson L1 configuration object"};
221 "StoreGate key for the xAOD::TriggerMenuJson HLT prescales configuration object"};
223 Gaudi::Property< std::string >
m_metaNameJSON_l1ps {
this,
"JSONMetaObjectNameL1PS",
"TriggerMenuJson_L1PS",
224 "StoreGate key for the xAOD::TriggerMenuJson L1 prescales configuration object"};
226 Gaudi::Property< std::string >
m_metaNameJSON_bg {
this,
"JSONMetaObjectNameBunchgroup",
"TriggerMenuJson_BG",
227 "StoreGate key for the xAOD::TriggerMenuJson BunchGroup configuration object"};
234 "HLT Menu Key, for when UseInFileMetadata=False. From the DetectorStore."};
237 "L1 Menu Key, for when UseInFileMetadata=False. From the DetectorStore"};
240 "HLT prescales set condition handle, for when UseInFileMetadata=False"};
243 "L1 prescales set condition handle, for when UseInFileMetadata=False"};
248 Gaudi::Property<bool>
m_useInFileMetadata{
this,
"UseInFileMetadata",
true,
"Flag for reading all configuration from the input POOL file(s). "
249 "This mode should be used everywhere except for: RAWtoALL from bytestream. "
250 "If set to false, only the R3 configuration is supported."};
252 Gaudi::Property<bool>
m_stopOnFailure{
this,
"StopOnFailure",
true,
"Flag for stopping the job in case of a failure"};
259 std::unique_ptr<xAOD::TriggerMenuAuxContainer>
m_tmcAux;
260 std::unique_ptr<xAOD::TriggerMenuContainer>
m_tmc;
270 std::unique_ptr<xAOD::TriggerMenuJsonContainer>
m_hltJson;
274 std::unique_ptr<xAOD::TriggerMenuJsonContainer>
m_l1Json;
280 std::unique_ptr<xAOD::TriggerMenuJsonContainer>
m_bgJson;
Maintain a set of objects, one per slot.
Property holding a SG store/key/clid from which a ReadHandle is made.
Maintain a set of objects, one per slot.
Base class for Trigger configuration data and wrapper around underlying representation.
list of all HLT chains in a trigger menu
HLT monitoring configuration.
SG::ReadCondHandleKey< TrigConf::HLTPrescalesSet > m_HLTPrescaleSetKey
xAODConfigSvc(const std::string &name, ISvcLocator *svcLoc)
Standard service constructor.
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapper > m_currentHltpsJson
virtual uint32_t lvl1PrescaleKey() const override
Get the LVL1 prescale key.
Gaudi::Property< std::string > m_metaNameJSON_l1ps
bool m_menuJSONContainerAvailable
Is decoded R3 format data available?
virtual const L1PrescalesSet & l1PrescalesSet(const EventContext &ctx=Gaudi::Hive::currentContext()) const override
Returns the JSON configured L1 prescales ptree.
Gaudi::Property< std::string > m_metaNameJSON_hlt
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapper > m_currentBgJson
bool m_triggerMenuContainerAvailable
Is decoded R2 format data available?
Gaudi::Property< std::string > m_metaName
virtual StatusCode finalize() override
Function finalising the service.
SG::SlotSpecificObj< HLTMenu > m_currentHlt
std::string configurationSource() const override
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_hltpsJson
virtual const HLTSequenceList & sequences() const override
Get the HLT sequences.
StatusCode prepareEventRun3Athena(const EventContext &context)
Do per-event updating of R3 JSON-based metadata, reading the data direct from the Conditions and Dete...
virtual void handle(const Incident &inc) override
Function handling the incoming incidents.
SG::SlotSpecificObj< HLTChainList > m_chainList
The "translated" HLT configuration object.
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_hltmonitoringJson
Gaudi::Property< std::string > m_metaNameJSON_l1
virtual const Muctpi * muctpiConfig() const override
Get the MuCTPI's online configuration.
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapper > m_currentHltmonitoringJson
SG::SlotSpecificObj< L1PrescalesSet > m_currentL1ps
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapper > m_currentHltJson
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_l1psJson
SG::ReadHandleKey< xAOD::BunchConfKey > m_eventBGKey
SG::SlotSpecificObj< CTPConfig > m_ctpConfig
std::unique_ptr< xAOD::TriggerMenuContainer > m_tmc
SG::ReadHandleKey< HLTMenu > m_hltMenuKey
SG::SlotSpecificObj< BunchGroupSet > m_bgSet
The "translated" bunch group set object.
StatusCode prepareEvent()
Function setting up the service for a new event.
SG::ReadHandleKey< L1Menu > m_l1MenuKey
Gaudi::Property< bool > m_stopOnFailure
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_hltJsonAux
virtual uint32_t bunchGroupSetKey() const override
Get the LVL1 bunch group set key.
virtual const HLTMonitoring & hltMonitoring(const EventContext &ctx=Gaudi::Hive::currentContext()) const override
Returns the JSON configured HLTMonitoring ptree.
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_l1psJsonAux
SG::SlotSpecificObj< HLTSequenceList > m_sequenceList
The "translated" HLT configuration object.
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_l1Json
Gaudi::Property< bool > m_useInFileMetadata
StatusCode prepareEventxAODTriggerMenuJson(const xAOD::TrigConfKeys *keys, const xAOD::BunchConfKey *bgKey, const EventContext &context)
Do per-event decoding for R3 in-file serialised xAOD::TriggerMenuJson metadata.
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_bgJsonAux
virtual const CTPConfig * ctpConfig() const override
Get the LVL1 trigger menu.
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSet > m_L1BunchGroupSetKey
virtual const L1Menu & l1Menu(const EventContext &ctx=Gaudi::Hive::currentContext()) const override
Returns the JSON configured L1 ptree.
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_hltJson
SG::SlotSpecificObj< MenuPtrWrapper > m_menu
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapper > m_currentL1Json
SG::SlotSpecificObj< L1BunchGroupSet > m_currentBg
SG::ReadHandleKey< xAOD::TrigConfKeys > m_eventKey
virtual const BunchGroupSet * bunchGroupSet() const override
Get the LVL1 bunch group set.
Gaudi::Property< std::string > m_metaNameJSON_hltmonitoring
virtual const HLTChainList & chains() const override
Get the HLT chains.
virtual const ThresholdConfig * thresholdConfig() const override
Get the LVL1 threshold configuruation (not available from xAOD)
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_hltmonitoringJsonAux
SG::SlotSpecificObj< HLTMonitoring > m_currentHltmonitoring
std::shared_mutex m_sharedMutex
The mutex used to to restrict access to m_tmc when it is being written to.
std::unique_ptr< xAOD::TriggerMenuAuxContainer > m_tmcAux
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_hltpsJsonAux
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapper > m_currentL1psJson
StatusCode prepareEventxAODTriggerMenu(const xAOD::TrigConfKeys *keys, const EventContext &context)
Do per-event decoding for R2 in-file serialised xAOD::TriggerMenu metadata.
StatusCode readMetadata()
Function reading in a new metadata object from the input.
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_bgJson
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_l1JsonAux
virtual uint32_t hltPrescaleKey() const override
Get the HLT prescale key.
virtual StatusCode initialize() override
Function initialising the service.
Gaudi::Property< std::string > m_metaNameJSON_hltps
SG::SlotSpecificObj< HLTPrescalesSet > m_currentHltps
SG::SlotSpecificObj< L1Menu > m_currentL1
StatusCode loadPtree(const std::string &humanName, const xAOD::TriggerMenuJsonContainer *metaContainer, const uint32_t keyToCheck, TriggerMenuJsonPtrWrapper &cacheOfLoadedMenuPtr, DataStructure &dataStructure, const bool optional=false)
Helper function to find a JSON in a given TriggerMenuJsonContainer using a given key,...
virtual const HLTMenu & hltMenu(const EventContext &ctx=Gaudi::Hive::currentContext()) const override
Returns the JSON configured HLTMenu ptree.
Gaudi::Property< std::string > m_metaNameJSON_bg
virtual const HLTPrescalesSet & hltPrescalesSet(const EventContext &ctx=Gaudi::Hive::currentContext()) const override
Returns the JSON configured HLT prescales ptree.
virtual const L1BunchGroupSet & l1BunchGroupSet(const EventContext &ctx=Gaudi::Hive::currentContext()) const override
Returns the JSON configured bunchgroup ptree.
bool m_isInFailure
Internal state of the service.
ServiceHandle< StoreGateSvc > m_metaStore
Connection to the metadata store.
SG::ReadCondHandleKey< TrigConf::L1PrescalesSet > m_L1PrescaleSetKey
virtual uint32_t masterKey() const override
Get the Super Master Key.
void copyMetadataToPersonalStore(const xAOD::TriggerMenuJsonContainer *input, xAOD::TriggerMenuJsonContainer *existing)
Helper function for copying into the service's private data store.
Forward iterator to traverse the main components of the trigger configuration.
TriggerMenuJson_v1 TriggerMenuJson
Define the latest version of the trigger menu JSON class.
TriggerMenu_v1 TriggerMenu
Define the latest version of the trigger menu class.
BunchConfKey_v1 BunchConfKey
Declare the current version of the bunch configuration key type.
TriggerMenuJsonContainer_v1 TriggerMenuJsonContainer
TrigConfKeys_v1 TrigConfKeys
Declare the current version of the trigger configuration keys type.