ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TrigConf::xAODConfigSvc Class Reference

Trigger configuration service used when reading an xAOD file. More...

#include <xAODConfigSvc.h>

Inheritance diagram for TrigConf::xAODConfigSvc:
Collaboration diagram for TrigConf::xAODConfigSvc:

Public Member Functions

 xAODConfigSvc (const std::string &name, ISvcLocator *svcLoc)
 Standard service constructor. More...
 
virtual StatusCode initialize () override
 Function initialising the service. More...
 
virtual StatusCode finalize () override
 Function finalising the service. More...
 
virtual void handle (const Incident &inc) override
 Function handling the incoming incidents. More...
 
std::string configurationSource () const override
 
Implementation of the IILVL1ConfigSvc interface
virtual const CTPConfigctpConfig () const override
 Get the LVL1 trigger menu. More...
 
virtual const ThresholdConfigthresholdConfig () const override
 Get the LVL1 threshold configuruation (not available from xAOD) More...
 
virtual const BunchGroupSetbunchGroupSet () const override
 Get the LVL1 bunch group set. More...
 
virtual uint32_t lvl1PrescaleKey () const override
 Get the LVL1 prescale key. More...
 
virtual uint32_t bunchGroupSetKey () const override
 Get the LVL1 bunch group set key. More...
 
Implementation of the IIHLTConfigSvc interface
virtual const HLTChainListchains () const override
 Get the HLT chains. More...
 
virtual const HLTSequenceListsequences () const override
 Get the HLT sequences. More...
 
virtual uint32_t masterKey () const override
 Get the Super Master Key. More...
 
virtual uint32_t hltPrescaleKey () const override
 Get the HLT prescale key. More...
 
Dummy implementation of the ILVL1ConfigSvc interface
virtual const MuctpimuctpiConfig () const override
 Get the MuCTPI's online configuration. More...
 
Impliment the JSON config interface.
virtual const HLTMenuhltMenu (const EventContext &ctx=Gaudi::Hive::currentContext()) const override
 Returns the JSON configured HLTMenu ptree. More...
 
virtual const HLTMonitoringhltMonitoring (const EventContext &ctx=Gaudi::Hive::currentContext()) const override
 Returns the JSON configured HLTMonitoring ptree. More...
 
virtual const L1Menul1Menu (const EventContext &ctx=Gaudi::Hive::currentContext()) const override
 Returns the JSON configured L1 ptree. More...
 
virtual const HLTPrescalesSethltPrescalesSet (const EventContext &ctx=Gaudi::Hive::currentContext()) const override
 Returns the JSON configured HLT prescales ptree. More...
 
virtual const L1PrescalesSetl1PrescalesSet (const EventContext &ctx=Gaudi::Hive::currentContext()) const override
 Returns the JSON configured L1 prescales ptree. More...
 
virtual const L1BunchGroupSetl1BunchGroupSet (const EventContext &ctx=Gaudi::Hive::currentContext()) const override
 Returns the JSON configured bunchgroup ptree. More...
 

Private Member Functions

StatusCode readMetadata ()
 Function reading in a new metadata object from the input. More...
 
StatusCode prepareEvent ()
 Function setting up the service for a new event. More...
 
void copyMetadataToPersonalStore (const xAOD::TriggerMenuJsonContainer *input, xAOD::TriggerMenuJsonContainer *existing)
 Helper function for copying into the service's private data store. More...
 
StatusCode prepareEventRun3Athena (const EventContext &context)
 Do per-event updating of R3 JSON-based metadata, reading the data direct from the Conditions and Detector stores (UseInFileMetadata=False case). More...
 
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. More...
 
StatusCode prepareEventxAODTriggerMenu (const xAOD::TrigConfKeys *keys, const EventContext &context)
 Do per-event decoding for R2 in-file serialised xAOD::TriggerMenu metadata. More...
 
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, extract its ptree data. More...
 

Private Attributes

SG::ReadHandleKey< xAOD::TrigConfKeysm_eventKey
 
SG::ReadHandleKey< xAOD::BunchConfKeym_eventBGKey
 
Gaudi::Property< bool > m_useInFileMetadata
 
Gaudi::Property< bool > m_stopOnFailure {this, "StopOnFailure", true, "Flag for stopping the job in case of a failure"}
 
bool m_isInFailure {false}
 Internal state of the service. More...
 
std::shared_mutex m_sharedMutex
 The mutex used to to restrict access to m_tmc when it is being written to. More...
 
ServiceHandle< StoreGateSvcm_metaStore {this, "MetaDataStore", "InputMetaDataStore"}
 Connection to the metadata store. More...
 
bool m_triggerMenuContainerAvailable {false}
 Is decoded R2 format data available? More...
 
bool m_menuJSONContainerAvailable {false}
 Is decoded R3 format data available? More...
 
Names for reading the R2 (and R1) AOD metadata payload
Gaudi::Property< std::string > m_metaName
 
Names for reading the R3 AOD metadata payload
Gaudi::Property< std::string > m_metaNameJSON_hlt
 
Gaudi::Property< std::string > m_metaNameJSON_hltmonitoring
 
Gaudi::Property< std::string > m_metaNameJSON_l1
 
Gaudi::Property< std::string > m_metaNameJSON_hltps
 
Gaudi::Property< std::string > m_metaNameJSON_l1ps
 
Gaudi::Property< std::string > m_metaNameJSON_bg
 
Names for reading the R3 payload directly (RAWtoALL)
SG::ReadHandleKey< HLTMenum_hltMenuKey
 
SG::ReadHandleKey< L1Menum_l1MenuKey
 
SG::ReadCondHandleKey< TrigConf::HLTPrescalesSetm_HLTPrescaleSetKey
 
SG::ReadCondHandleKey< TrigConf::L1PrescalesSetm_L1PrescaleSetKey
 
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSetm_L1BunchGroupSetKey {this, "L1BunchGroup", "L1BunchGroup", "L1 Bunch groups"}
 
The configuration objects copied from all input files. R1 and R2 AOD
std::unique_ptr< xAOD::TriggerMenuAuxContainerm_tmcAux
 
std::unique_ptr< xAOD::TriggerMenuContainerm_tmc
 
SG::SlotSpecificObj< MenuPtrWrapperm_menu
 
The configuration objects copied from all input files. R3 AOD
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainerm_hltJsonAux
 
std::unique_ptr< xAOD::TriggerMenuJsonContainerm_hltJson
 
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainerm_hltmonitoringJsonAux
 
std::unique_ptr< xAOD::TriggerMenuJsonContainerm_hltmonitoringJson
 
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainerm_l1JsonAux
 
std::unique_ptr< xAOD::TriggerMenuJsonContainerm_l1Json
 
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainerm_hltpsJsonAux
 
std::unique_ptr< xAOD::TriggerMenuJsonContainerm_hltpsJson
 
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainerm_l1psJsonAux
 
std::unique_ptr< xAOD::TriggerMenuJsonContainerm_l1psJson
 
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainerm_bgJsonAux
 
std::unique_ptr< xAOD::TriggerMenuJsonContainerm_bgJson
 
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapperm_currentHltJson
 
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapperm_currentHltmonitoringJson
 
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapperm_currentL1Json
 
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapperm_currentHltpsJson
 
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapperm_currentL1psJson
 
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapperm_currentBgJson
 
SG::SlotSpecificObj< HLTMenum_currentHlt
 
SG::SlotSpecificObj< HLTMonitoringm_currentHltmonitoring
 
SG::SlotSpecificObj< L1Menum_currentL1
 
SG::SlotSpecificObj< HLTPrescalesSetm_currentHltps
 
SG::SlotSpecificObj< L1PrescalesSetm_currentL1ps
 
SG::SlotSpecificObj< L1BunchGroupSetm_currentBg
 
The legacy configuration objects which are populated either from a R1, R2 TriggerMenuContainer or the R3 JSONs

The "translated" LVL1 configuration object

SG::SlotSpecificObj< CTPConfigm_ctpConfig
 
SG::SlotSpecificObj< HLTChainListm_chainList
 The "translated" HLT configuration object. More...
 
SG::SlotSpecificObj< HLTSequenceListm_sequenceList
 The "translated" HLT configuration object. More...
 
SG::SlotSpecificObj< BunchGroupSetm_bgSet
 The "translated" bunch group set object. More...
 

Detailed Description

Trigger configuration service used when reading an xAOD file.

   This implementation of the ITrigConfigSvc interface can be
   used when reading an xAOD file in Athena to get the correct
   configuration for the current event.
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 75 of file xAODConfigSvc.h.

Constructor & Destructor Documentation

◆ xAODConfigSvc()

TrigConf::xAODConfigSvc::xAODConfigSvc ( const std::string &  name,
ISvcLocator *  svcLoc 
)

Standard service constructor.

Definition at line 27 of file xAODConfigSvc.cxx.

28  : base_class( name, svcLoc ),
29  m_tmcAux( nullptr ), m_tmc( nullptr ), m_menu(),
31 
32  }

Member Function Documentation

◆ bunchGroupSet()

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

Get the LVL1 bunch group set.

Definition at line 127 of file xAODConfigSvc.cxx.

127  {
128 
129  // Long-term-support interface (including Run 2 AODs)
130  if( m_isInFailure ) {
132  << "Trigger menu not loaded";
133  throw GaudiException( "Service not initialised correctly",
134  "TrigConf::xAODConfigSvc::bunchGroupSet",
135  StatusCode::FAILURE );
136  }
137 
138  // Return the slot-specific pointer:
139  return m_bgSet.get();
140  }

◆ bunchGroupSetKey()

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

Get the LVL1 bunch group set key.

Definition at line 247 of file xAODConfigSvc.cxx.

247  {
248  if (!m_useInFileMetadata) {
249  const bool firstEvent = !m_currentBg.get()->isInitialized();
250  if (firstEvent)
253  if (!l1BGS.isValid())
254  {
255  REPORT_MESSAGE( MSG::WARNING )
256  << "Unable to load " << m_L1BunchGroupSetKey.key() << " from Conditions Store." << endmsg;
258  }
259  else
260  return l1BGS->bgsk();
261  } else if (m_menuJSONContainerAvailable)
262  return m_currentBg.get()->bgsk();
263  else {
265  << "There's no way to access the bunch group set key from a legacy AOD!" << endmsg;
267  }
268  }

◆ chains()

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

Get the HLT chains.

Definition at line 143 of file xAODConfigSvc.cxx.

143  {
144 
145  // Long-term-support interface (including Run 2 AODs)
146  if( m_isInFailure ) {
148  << "Trigger menu not loaded";
149  throw GaudiException( "Service not initialised correctly",
150  "TrigConf::xAODConfigSvc::chains",
151  StatusCode::FAILURE );
152  }
153 
154  // Return the slot-specifc object:
155  return *(m_chainList.get());
156  }

◆ configurationSource()

std::string TrigConf::xAODConfigSvc::configurationSource ( ) const
inlineoverride

Definition at line 161 of file xAODConfigSvc.h.

161  {
162  return "";
163  }

◆ copyMetadataToPersonalStore()

void TrigConf::xAODConfigSvc::copyMetadataToPersonalStore ( const xAOD::TriggerMenuJsonContainer input,
xAOD::TriggerMenuJsonContainer existing 
)
private

Helper function for copying into the service's private data store.

Definition at line 614 of file xAODConfigSvc.cxx.

614  {
615  for ( const xAOD::TriggerMenuJson* inputTriggerMenuJson : *input ) {
616  bool alreadyHave = false;
617  for( const xAOD::TriggerMenuJson* existingTriggerMenuJson : *existing ) {
618  if (inputTriggerMenuJson->key() == existingTriggerMenuJson->key()) {
619  alreadyHave = true;
620  break;
621  }
622  }
623  if (alreadyHave) {
624  continue;
625  }
626  // Copy this menu JSON into the service's internal cache of all menus
627  xAOD::TriggerMenuJson* newTriggerMenuJson = new xAOD::TriggerMenuJson();
628  existing->push_back( newTriggerMenuJson ); // Note: 'newTriggerMenuJson' is now memory managed by 'existing'
629  *newTriggerMenuJson = *inputTriggerMenuJson; // Perform xAOD copy
630  REPORT_MESSAGE( MSG::DEBUG ) << "Imported new configuration: Name = " << newTriggerMenuJson->name() << " Key = " << newTriggerMenuJson->key() << endmsg;
631  }
632  }

◆ ctpConfig()

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

Get the LVL1 trigger menu.

Definition at line 112 of file xAODConfigSvc.cxx.

112  {
113 
114  // Long-term-support interface for (including Run 2 AODs)
115  if( m_isInFailure ) {
117  << "Trigger menu not loaded";
118  throw GaudiException( "Service not initialised correctly",
119  "TrigConf::xAODConfigSvc::ctpConfig",
120  StatusCode::FAILURE );
121  }
122 
123  // Return the slot-specific pointer:
124  return m_ctpConfig.get();
125  }

◆ finalize()

StatusCode TrigConf::xAODConfigSvc::finalize ( )
overridevirtual

Function finalising the service.

Definition at line 106 of file xAODConfigSvc.cxx.

106  {
107 
108  // Return gracefully:
109  return StatusCode::SUCCESS;
110  }

◆ handle()

void TrigConf::xAODConfigSvc::handle ( const Incident &  inc)
overridevirtual

Function handling the incoming incidents.

Definition at line 405 of file xAODConfigSvc.cxx.

405  {
406 
407  // Tell the user what we're doing:
408  REPORT_MESSAGE( MSG::DEBUG ) << "Callback received with incident: "
409  << inc.type() << endmsg;
410 
411  // If it's a file-beginning incident, let's read in the
412  // metadata object:
413  if( inc.type() == IncidentType::BeginInputFile ) {
414  if( readMetadata().isFailure() && m_stopOnFailure ) {
416  << "Couldn't read in the input file's metadata";
417  throw GaudiException( "Couldn't read in the input file's "
418  "metadata",
419  "TrigConf::xAODConfigSvc::handle",
420  StatusCode::FAILURE );
421  return;
422  }
423  }
424  // If it's an event-beginning incident, let's make sure that the
425  // correct menu is cached:
426  else if( inc.type() == IncidentType::BeginEvent ) {
427  if( prepareEvent().isFailure() && m_stopOnFailure ) {
429  << "Couldn't prepare the trigger configuration for the "
430  << "current event";
431  throw GaudiException( "Couldn't prepare the trigger configuration "
432  "for the current event",
433  "TrigConf::xAODConfigSvc::handle",
434  StatusCode::FAILURE );
435  return;
436  }
437  }
438  // We got some strange incident...
439  else {
440  REPORT_MESSAGE( MSG::WARNING ) << "Unknown incident type received: "
441  << inc.type() << endmsg;
442  return;
443  }
444 
445  // Return gracefully:
446  return;
447  }

◆ hltMenu()

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

Returns the JSON configured HLTMenu ptree.

Definition at line 310 of file xAODConfigSvc.cxx.

310  {
311  if (!m_useInFileMetadata) {
312  SG::ReadHandle<HLTMenu> hltMenuHandle(m_hltMenuKey, ctx);
313  if( hltMenuHandle.isValid() ) {
314  return *hltMenuHandle;
315  }
316  }
318  REPORT_MESSAGE( MSG::FATAL ) << "Run 3 hltMenu JSON not loaded." << endmsg;
319  throw GaudiException( "Service not initialised correctly",
320  "TrigConf::xAODConfigSvc::hltMenu",
321  StatusCode::FAILURE );
322  }
323  // Run3: From in-file JSON metadata or JSON from detector store
324  return *(m_currentHlt.get(ctx));
325  }

◆ hltMonitoring()

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

Returns the JSON configured HLTMonitoring ptree.

Definition at line 327 of file xAODConfigSvc.cxx.

327  {
329  REPORT_MESSAGE( MSG::FATAL ) << "Run 3 hltMonitoring JSON not loaded." << endmsg;
330  throw GaudiException( "Service not initialised correctly",
331  "TrigConf::xAODConfigSvc::hltMenu",
332  StatusCode::FAILURE );
333  }
334  // Run3: From in-file JSON metadata
335  return *(m_currentHltmonitoring.get(ctx));
336  }

◆ hltPrescaleKey()

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

Get the HLT prescale key.

Definition at line 270 of file xAODConfigSvc.cxx.

270  {
271  if (!m_useInFileMetadata) {
272 
273  const bool firstEvent = !m_currentHltps.get()->isInitialized();
274  if (firstEvent) {
276  }
277 
279  if( !hltpsRCH.isValid() ) {
280  REPORT_MESSAGE( MSG::WARNING )
281  << "Unable to load " << m_HLTPrescaleSetKey.key() << " from Conditions Store." << endmsg;
283  } else {
284  return hltpsRCH->psk();
285  }
286 
287  } else if (m_menuJSONContainerAvailable) {
288 
289  // Run3: From in-file JSON metadata or JSON from conditions store
290  return m_currentHltps.get()->psk();
291 
292  } else {
293 
294  // Legacy support for R2 AODs
295  if( ! m_menu.get()->m_ptr ) {
297  << "Trigger menu not yet known. Configuration key not returned.";
298  throw GaudiException( "Service not initialised correctly",
299  "TrigConf::xAODConfigSvc::hltPrescaleKey",
300  StatusCode::FAILURE );
301  return 0;
302  }
303 
304  // Return the key from the slot-specific metadata object:
305  return m_menu.get()->m_ptr->hltpsk();
306 
307  }
308  }

◆ hltPrescalesSet()

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

Returns the JSON configured HLT prescales ptree.

Definition at line 355 of file xAODConfigSvc.cxx.

355  {
356  if (!m_useInFileMetadata) {
358  if( hltpsRCH.isValid() ) {
359  return **hltpsRCH;
360  }
361  }
363  REPORT_MESSAGE( MSG::FATAL ) << "Run 3 hltPrescalesSet JSON not loaded." << endmsg;
364  throw GaudiException( "Service not initialised correctly",
365  "TrigConf::xAODConfigSvc::hltPrescalesSet",
366  StatusCode::FAILURE );
367  }
368  // Run3: From in-file JSON metadata or JSON from conditions store
369  return *(m_currentHltps.get(ctx));
370  }

◆ initialize()

StatusCode TrigConf::xAODConfigSvc::initialize ( )
overridevirtual

Function initialising the service.

Definition at line 34 of file xAODConfigSvc.cxx.

34  {
35 
36  // Greet the user:
37  ATH_MSG_INFO( "Initialising" );
38 
39  // Note this is a service, there is NO scheduler propagation of these read handle keys to clients of this service.
40  // We still however use the ReadHandle mechanism to consume the collection, along with validation checks.
41  // Attempting to use this service when no eventKey is available will cause the service to fail.
42  // Attempting to use this service when no eventBGKey is available will return empty bunch group data.
43  CHECK( m_eventKey.initialize() );
44  CHECK( m_eventBGKey.initialize() );
45 
46  CHECK( m_hltMenuKey.initialize() );
47  CHECK( m_l1MenuKey.initialize() );
48 
49  // Set up the callbacks for the service:
50  ServiceHandle< IIncidentSvc > incSvc( "IncidentSvc", name() );
51  CHECK( incSvc.retrieve() );
52  incSvc->addListener( this, IncidentType::BeginEvent, 0,
54 
55  if (m_useInFileMetadata) {
56  // Retrieve the needed service(s):
57  CHECK( m_metaStore.retrieve() );
58 
59  // Set up the callbacks for the service:
60  ServiceHandle< IIncidentSvc > incSvc( "IncidentSvc", name() );
61  incSvc->addListener( this, IncidentType::BeginInputFile, 0,
63 
64  // Internal holder for R2 payloads
65  m_tmcAux = std::make_unique<xAOD::TriggerMenuAuxContainer>();
66  m_tmc = std::make_unique<xAOD::TriggerMenuContainer>();
67  m_tmc->setStore( m_tmcAux.get() );
68 
69  // Internal holders for R3 payloads
70  m_hltJsonAux = std::make_unique<xAOD::TriggerMenuJsonAuxContainer>();
71  m_hltJson = std::make_unique<xAOD::TriggerMenuJsonContainer>();
72  m_hltJson->setStore( m_hltJsonAux.get() );
73 
74  m_hltmonitoringJsonAux = std::make_unique<xAOD::TriggerMenuJsonAuxContainer>();
75  m_hltmonitoringJson = std::make_unique<xAOD::TriggerMenuJsonContainer>();
77 
78  m_l1JsonAux = std::make_unique<xAOD::TriggerMenuJsonAuxContainer>();
79  m_l1Json = std::make_unique<xAOD::TriggerMenuJsonContainer>();
80  m_l1Json->setStore( m_l1JsonAux.get() );
81 
82  m_hltpsJsonAux = std::make_unique<xAOD::TriggerMenuJsonAuxContainer>();
83  m_hltpsJson = std::make_unique<xAOD::TriggerMenuJsonContainer>();
84  m_hltpsJson->setStore( m_hltpsJsonAux.get() );
85 
86  m_l1psJsonAux = std::make_unique<xAOD::TriggerMenuJsonAuxContainer>();
87  m_l1psJson = std::make_unique<xAOD::TriggerMenuJsonContainer>();
88  m_l1psJson->setStore( m_l1psJsonAux.get() );
89 
90  m_bgJsonAux = std::make_unique<xAOD::TriggerMenuJsonAuxContainer>();
91  m_bgJson = std::make_unique<xAOD::TriggerMenuJsonContainer>();
92  m_bgJson->setStore( m_bgJsonAux.get() );
93  }
94 
98 
99  // Reset the internal flag:
100  m_isInFailure = false;
101 
102  // Return gracefully:
103  return StatusCode::SUCCESS;
104  }

◆ l1BunchGroupSet()

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

Returns the JSON configured bunchgroup ptree.

Definition at line 389 of file xAODConfigSvc.cxx.

389  {
390  if (!m_useInFileMetadata) {
392  if( l1BGS.isValid() )
393  return **l1BGS;
394  }
396  REPORT_MESSAGE( MSG::FATAL ) << "Run 3 l1BunchGroupSet JSON not loaded." << endmsg;
397  throw GaudiException( "Service not initialised correctly",
398  "TrigConf::xAODConfigSvc::l1BunchGroupSet",
399  StatusCode::FAILURE );
400  }
401  // Run3: From in-file JSON metadata or JSON from conditions store
402  return *(m_currentBg.get(ctx));
403  }

◆ l1Menu()

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

Returns the JSON configured L1 ptree.

Definition at line 338 of file xAODConfigSvc.cxx.

338  {
339  if (!m_useInFileMetadata) {
340  SG::ReadHandle<L1Menu> l1MenuHandle(m_l1MenuKey, ctx);
341  if( l1MenuHandle.isValid() ) {
342  return *l1MenuHandle;
343  }
344  }
346  REPORT_MESSAGE( MSG::FATAL ) << "Run 3 l1Menu JSON not loaded." << endmsg;
347  throw GaudiException( "Service not initialised correctly",
348  "TrigConf::xAODConfigSvc::l1Menu",
349  StatusCode::FAILURE );
350  }
351  // Run3: From in-file JSON metadata or JSON from detector store
352  return *(m_currentL1.get(ctx));
353  }

◆ l1PrescalesSet()

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

Returns the JSON configured L1 prescales ptree.

Definition at line 372 of file xAODConfigSvc.cxx.

372  {
373  if (!m_useInFileMetadata) {
375  if( l1psRCH.isValid() ) {
376  return **l1psRCH;
377  }
378  }
380  REPORT_MESSAGE( MSG::FATAL ) << "Run 3 l1PrescalesSet JSON not loaded." << endmsg;
381  throw GaudiException( "Service not initialised correctly",
382  "TrigConf::xAODConfigSvc::l1PrescalesSet",
383  StatusCode::FAILURE );
384  }
385  // Run3: From in-file JSON metadata or JSON from conditions store
386  return *(m_currentL1ps.get(ctx));
387  }

◆ loadPtree()

StatusCode TrigConf::xAODConfigSvc::loadPtree ( const std::string &  humanName,
const xAOD::TriggerMenuJsonContainer metaContainer,
const uint32_t  keyToCheck,
TriggerMenuJsonPtrWrapper cacheOfLoadedMenuPtr,
DataStructure dataStructure,
const bool  optional = false 
)
private

Helper function to find a JSON in a given TriggerMenuJsonContainer using a given key, extract its ptree data.

Parameters
humanNameName to print if things go wrong
metaContainerMetadata container of TriggerMenuJson objects from which to load a ptree
keyToCheckThe key of the ptree to load
cacheOfLoadedMenuPtrSlot's cache of the currently loaded TriggerMenuJson
DataStructuredataStructure object to fill with the TriggerMenuJson's payload
optionalSet to true if it is expected in some valid scenarios for the payload to be missing

Definition at line 955 of file xAODConfigSvc.cxx.

960  {
961  xAOD::TriggerMenuJsonContainer::const_iterator menu_itr = metaContainer->begin();
962  xAOD::TriggerMenuJsonContainer::const_iterator menu_end = metaContainer->end();
963  const xAOD::TriggerMenuJson* ptrToLocatedMenu = nullptr;
964  cacheOfLoadedMenuPtr.m_ptr = nullptr;
965  for( ; menu_itr != menu_end; ++menu_itr ) {
966  // Check if this is the menu we're looking for:
967  if( keyToCheck != (*menu_itr)->key() ) continue;
968  // Remember its pointer:
969  ptrToLocatedMenu = *menu_itr;
970  cacheOfLoadedMenuPtr.m_ptr = ptrToLocatedMenu;
971  std::stringstream rawData;
972  rawData << ptrToLocatedMenu->payload();
973  dataStructure.clear();
974  try {
976  boost::property_tree::read_json(rawData, pt);
977  dataStructure.setData(std::move(pt));
978  } catch (const boost::property_tree::json_parser_error& e) {
979  REPORT_MESSAGE( MSG::FATAL ) << "Unable to decode a JSON trigger menu metadata payload for " << humanName << " with key " << keyToCheck << endmsg;
980  REPORT_MESSAGE( MSG::FATAL ) << e.what();
981  return StatusCode::FAILURE;
982  }
983  break;
984  }
985 
986  if (not optional and ptrToLocatedMenu == nullptr) {
988  << "Couldn't find configuration for current event"
989  << ", Requested key=" << keyToCheck
990  << ", Requested menu=" << humanName
991  << endmsg;
992  return StatusCode::FAILURE;
993  }
994  return StatusCode::SUCCESS;
995  }

◆ lvl1PrescaleKey()

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

Get the LVL1 prescale key.

Definition at line 208 of file xAODConfigSvc.cxx.

208  {
209  if (!m_useInFileMetadata) {
210 
211  const bool firstEvent = !m_currentL1ps.get()->isInitialized();
212  if (firstEvent) {
214  }
215 
217  if( !l1psRCH.isValid() ) {
218  REPORT_MESSAGE( MSG::WARNING )
219  << "Unable to load " << m_L1PrescaleSetKey.key() << " from Conditions Store." << endmsg;
221  } else {
222  return l1psRCH->psk();
223  }
224 
225  } else if (m_menuJSONContainerAvailable) {
226 
227  // Run3: From in-file JSON metadata or JSON from conditions store
228  return m_currentL1ps.get()->psk();
229 
230  } else {
231 
232  // Legacy support for R2 AODs
233  if( ! m_menu.get()->m_ptr ) {
234  REPORT_MESSAGE( MSG::ERROR )
235  << "Trigger menu not yet known. Configuration key not returned.";
236  throw GaudiException( "Service not initialised correctly",
237  "TrigConf::xAODConfigSvc::lvl1PrescaleKey",
238  StatusCode::FAILURE );
239  return 0;
240  }
241 
242  // Return the key from the slot-specific metadata object:
243  return m_menu.get()->m_ptr->l1psk();
244  }
245  }

◆ masterKey()

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

Get the Super Master Key.

Definition at line 173 of file xAODConfigSvc.cxx.

173  {
174  if (!m_useInFileMetadata) {
175 
176  SG::ReadHandle<HLTMenu> hltMenuHandle(m_hltMenuKey); // No context - Detector Store
177  if( !hltMenuHandle.isValid() ) {
178  REPORT_MESSAGE( MSG::WARNING )
179  << "Unable to load " << m_hltMenuKey.key() << " from Detector Store." << endmsg;
181  } else {
182  return hltMenuHandle->smk();
183  }
184 
185  } else if (m_menuJSONContainerAvailable) {
186 
187  // Run3: From in-file JSON metadata or JSON from conditions store
188  return m_currentHlt.get()->smk();
189 
190  } else {
191 
192  // Legacy support for R2 AODs
193  if( ! m_menu.get()->m_ptr ) {
195  << "Trigger menu not yet known. Configuration key not returned.";
196  throw GaudiException( "Service not initialised correctly",
197  "TrigConf::xAODConfigSvc::masterKey",
198  StatusCode::FAILURE );
199  return 0;
200  }
201 
202  // Return the key from the slot-specific metadata object:
203  return m_menu.get()->m_ptr->smk();
204 
205  }
206  }

◆ muctpiConfig()

virtual const Muctpi* TrigConf::xAODConfigSvc::muctpiConfig ( ) const
inlineoverridevirtual

Get the MuCTPI's online configuration.

Definition at line 129 of file xAODConfigSvc.h.

129  {
130  return 0;
131  }

◆ prepareEvent()

StatusCode TrigConf::xAODConfigSvc::prepareEvent ( )
private

Function setting up the service for a new event.

Definition at line 634 of file xAODConfigSvc.cxx.

634  {
635 
636  // Can the incident service provide this to us?
637  const EventContext& context = Gaudi::Hive::currentContext();
638 
639  if (!m_useInFileMetadata) { // Run 3 RAWtoALL decoding mode
640  return prepareEventRun3Athena(context);
641  }
642 
643  // Otherwise we're dealing with in-file data
644  // Read the current event's trigger keys:
646  const xAOD::TrigConfKeys* keys = nullptr;
647  if( keysRH.isValid() ) {
648  keys = keysRH.cptr();
649  } else {
650  // Update the internal flag:
651  m_isInFailure = true;
652  // Decide what to do:
653  if( m_stopOnFailure ) {
655  << "Coudln't retrieve xAOD::TrigConfKeys";
656  return StatusCode::FAILURE;
657  } else {
658  REPORT_MESSAGE( MSG::DEBUG ) << "Coudln't retrieve xAOD::TrigConfKeys" << endmsg;
659  return StatusCode::SUCCESS;
660  }
661  }
662 
664  const xAOD::BunchConfKey* bgKey = nullptr;
665  if (bgKeyRH.isValid()) {
666  bgKey = bgKeyRH.cptr();
667  } // Note: This is optional, no errors if it cannot be found
668 
669  if (m_menuJSONContainerAvailable) { // Run 3 AOD decoding mode
670  return prepareEventxAODTriggerMenuJson(keys, bgKey, context);
671  } else if (m_triggerMenuContainerAvailable) { // Run 2 AOD decoding mode
672  return prepareEventxAODTriggerMenu(keys, context);
673  }
674  ATH_MSG_ERROR( "Both m_menuJSONContainerAvailable and m_triggerMenuContainerAvailable are false" );
675  return StatusCode::FAILURE;
676  }

◆ prepareEventRun3Athena()

StatusCode TrigConf::xAODConfigSvc::prepareEventRun3Athena ( const EventContext &  context)
private

Do per-event updating of R3 JSON-based metadata, reading the data direct from the Conditions and Detector stores (UseInFileMetadata=False case).

Definition at line 727 of file xAODConfigSvc.cxx.

727  {
728  HLTMenu& currentHlt = *(m_currentHlt.get(context));
729  L1Menu& currentL1 = *(m_currentL1.get(context));
730  HLTPrescalesSet& currentHltps = *(m_currentHltps.get(context));
731  L1PrescalesSet& currentL1ps = *(m_currentL1ps.get(context));
732  L1BunchGroupSet& currentBg = *(m_currentBg.get(context));
733 
734  // There is only the beginEvent incident when reading the data from the Detector and Conditions stores.
735  // So only one thread may be active at one time on these (slot-specific) objects. Hence we do not need to lock like
736  // we do when we also have to deal with the possibility of concurrent beginFile incidents.
737 
738  bool validConfig = true;
739 
740  // In the beginEvent incident _before_ the first event, we cannot read the prescales (conditions) but we can still
741  // read the menu (detector store).
742  const bool firstEvent = (!currentHlt.isInitialized() and !currentHltps.isInitialized());
743 
744  SG::ReadHandle<HLTMenu> hltMenuHandle(m_hltMenuKey, context);
745  if( !hltMenuHandle.isValid() ) {
746  REPORT_MESSAGE( MSG::WARNING )
747  << "Unable to load " << m_hltMenuKey.key() << " from Detector Store." << endmsg;
748  } else {
749  if (!currentHlt.isInitialized() or currentHlt.smk() != hltMenuHandle->smk()) {
750  validConfig = false;
751  currentHlt.clear();
752  currentHlt.setData( hltMenuHandle->data() );
753  currentHlt.setSMK( hltMenuHandle->smk() );
754  }
755  }
756 
757  SG::ReadHandle<L1Menu> l1MenuHandle(m_l1MenuKey, context);
758  if( !l1MenuHandle.isValid() ) {
759  REPORT_MESSAGE( MSG::WARNING )
760  << "Unable to load " << m_l1MenuKey.key() << " from Detector Store." << endmsg;
761  } else {
762  if (!currentL1.isInitialized() or currentL1.smk() != l1MenuHandle->smk()) {
763  validConfig = false;
764  currentL1.clear();
765  currentL1.setData( l1MenuHandle->data() );
766  currentL1.setSMK( l1MenuHandle->smk() );
767  }
768  }
769 
770  if (firstEvent) {
771 
772  REPORT_MESSAGE( MSG::WARNING )
773  << "L1 and HLT prescales will not be available via the TrigConf::xAODConfigSvc in the first "
774  << "event when running with UseInFileMetadata=False" << endmsg;
775 
776  } else {
777 
779  if( !l1psRCH.isValid() ) {
780  REPORT_MESSAGE( MSG::WARNING )
781  << "Unable to load " << m_L1PrescaleSetKey.key() << " from Conditions Store." << endmsg;
782  } else {
783  if (!currentL1ps.isInitialized() or currentL1ps.psk() != l1psRCH->psk()) {
784  validConfig = false;
785  currentL1ps.clear();
786  currentL1ps.setData( l1psRCH->data() );
787  currentL1ps.setPSK( l1psRCH->psk() );
788  }
789  }
790 
792  if( !hltpsRCH.isValid() ) {
793  REPORT_MESSAGE( MSG::WARNING )
794  << "Unable to load " << m_HLTPrescaleSetKey.key() << " from Conditions Store." << endmsg;
795  } else {
796  if (!currentHltps.isInitialized() or currentHltps.psk() != hltpsRCH->psk()) {
797  validConfig = false;
798  currentHltps.clear();
799  currentHltps.setData( hltpsRCH->data() );
800  currentHltps.setPSK( hltpsRCH->psk() );
801  }
802  }
803 
804  // Bunchgroup data are not accessible via this service in this mode as the conditions alg uses a different
805  // format to the JSON interface used by the trigger.
806 
807  }
808 
809  if (validConfig) {
811  << "Configuration matches the loaded one, nothing to do." << endmsg;
812  return StatusCode::SUCCESS;
813  }
814 
815  CTPConfig& ctpConfig = *(m_ctpConfig.get(context));
816  HLTChainList& chainList = *(m_chainList.get(context));
817  HLTSequenceList& sequenceList = *(m_sequenceList.get(context));
818  BunchGroupSet& bgSet = *(m_bgSet.get(context));
819 
820  // Copy data into legacy long-term-support interfaces
821  CHECK( prepareTriggerMenu( currentHlt,
822  currentL1,
823  currentHltps,
824  currentL1ps,
825  currentBg,
826  ctpConfig,
827  chainList,
828  sequenceList,
829  bgSet,
830  msg() ) );
831 
832  REPORT_MESSAGE( MSG::INFO ) << "Loaded Trigger configuration from Conditions Store and Detector Store:"
833  << " SMK = " << (currentHlt.isInitialized() ? std::to_string(currentHlt.smk()) : std::string("UNKNOWN"))
834  << ", L1PSK = " << (currentL1ps.isInitialized() ? std::to_string(currentL1ps.psk()) : std::string("UNKNOWN"))
835  << ", HLTPSK = " << (currentHltps.isInitialized() ? std::to_string(currentHltps.psk()) : std::string("UNKNOWN"))
836  << ", BGSK = " << (currentBg.isInitialized() ? std::to_string(currentBg.bgsk()) : std::string("UNKNOWN")) << endmsg;
837 
838  REPORT_MESSAGE( MSG::DEBUG ) << "ctpConfig.menu().size() = " << ctpConfig.menu().size()
839  << " chainList.size() = " << chainList.size()
840  << " sequenceList.size() = " << sequenceList.size()
841  << " bgSet.bunchGroups().size() = " << bgSet.bunchGroups().size() << endmsg;
842 
843  return StatusCode::SUCCESS;
844  }

◆ prepareEventxAODTriggerMenu()

StatusCode TrigConf::xAODConfigSvc::prepareEventxAODTriggerMenu ( const xAOD::TrigConfKeys keys,
const EventContext &  context 
)
private

Do per-event decoding for R2 in-file serialised xAOD::TriggerMenu metadata.

Definition at line 679 of file xAODConfigSvc.cxx.

679  {
680  const xAOD::TriggerMenu* loadedMenuInSlot = m_menu.get(context)->m_ptr;
681 
682  // Check if we have the correct menu already:
683  if( loadedMenuInSlot != nullptr && xAODKeysMatch( keys, loadedMenuInSlot ) ) {
685  << "Configuration matches the loaded one, nothing to do." << endmsg;
686  return StatusCode::SUCCESS;
687  }
688 
689  // If not, let's look for the correct configuration:
690  // Open a shared lock. OK for multiple events to search at the same time,
691  // but prevent the extension of m_tmc from a BeginInputFile incident.
692  std::shared_lock lockShared(m_sharedMutex);
693 
696  for( ; menu_itr != menu_end; ++menu_itr ) {
697  // Check if this is the menu we're looking for:
698  if( ! xAODKeysMatch( keys, *menu_itr ) ) continue;
699  // Remember it's pointer:
700  loadedMenuInSlot = *menu_itr;
701  m_menu.get(context)->m_ptr = loadedMenuInSlot;
702  // Cache the menu's configuration.
703  CTPConfig& ctpConfig = *(m_ctpConfig.get(context));
704  HLTChainList& chainList = *(m_chainList.get(context));
705  HLTSequenceList& sequenceList = *(m_sequenceList.get(context));
706  BunchGroupSet& bgSet = *(m_bgSet.get(context));
707  CHECK( prepareTriggerMenu( loadedMenuInSlot, ctpConfig,
708  chainList, sequenceList,
709  bgSet, msg() ) );
710  REPORT_MESSAGE( MSG::DEBUG ) << "ctpConfig.menu().size() = " << ctpConfig.menu().size()
711  << " chainList.size() = " << chainList.size()
712  << " sequenceList.size() = " << sequenceList.size()
713  << " bgSet.bunchGroups().size() = " << bgSet.bunchGroups().size() << endmsg;
714  // We're done:
715  return StatusCode::SUCCESS;
716  }
717 
718  // Apparently we didn't find the correct menu!
720  << "Couldn't find configuration for current event (SMK:"
721  << keys->smk() << ", L1PSK:" << keys->l1psk()
722  << ", HLTPSK:" << keys->hltpsk() << ")";
723  return StatusCode::FAILURE;
724  }

◆ prepareEventxAODTriggerMenuJson()

StatusCode TrigConf::xAODConfigSvc::prepareEventxAODTriggerMenuJson ( const xAOD::TrigConfKeys keys,
const xAOD::BunchConfKey bgKey,
const EventContext &  context 
)
private

Do per-event decoding for R3 in-file serialised xAOD::TriggerMenuJson metadata.

Definition at line 848 of file xAODConfigSvc.cxx.

848  {
849  const xAOD::TriggerMenuJson* loadedHltJson = m_currentHltJson.get(context)->m_ptr;
850  const xAOD::TriggerMenuJson* loadedL1Json = m_currentL1Json.get(context)->m_ptr;
851  const xAOD::TriggerMenuJson* loadedHltpsJson = m_currentHltpsJson.get(context)->m_ptr;
852  const xAOD::TriggerMenuJson* loadedL1psJson = m_currentL1psJson.get(context)->m_ptr;
853  const xAOD::TriggerMenuJson* loadedBgJson = m_currentBgJson.get(context)->m_ptr;
854 
855  bool validConfig = true;
856  if (loadedHltJson == nullptr || loadedHltJson->key() != keys->smk()) {
857  validConfig = false;
858  }
859  // The check on loadedHltJson is good also for loadedHltmonitoringJson
860  if (loadedL1Json == nullptr || loadedL1Json->key() != keys->smk()) {
861  validConfig = false;
862  }
863  if (loadedHltpsJson == nullptr || loadedHltpsJson->key() != keys->hltpsk()) {
864  validConfig = false;
865  }
866  if (loadedL1psJson == nullptr || loadedL1psJson->key() != keys->l1psk()) {
867  validConfig = false;
868  }
869  if (bgKey) {
870  if (loadedBgJson == nullptr || loadedBgJson->key() != static_cast<unsigned int>(bgKey->id())) {
871  validConfig = false;
872  }
873  }
874 
875  if (validConfig) {
877  << "Configuration matches the loaded one, nothing to do." << endmsg;
878  return StatusCode::SUCCESS;
879  }
880 
881  // If not, let's look for the correct configuration:
882  // Open a shared lock. OK for multiple events to search at the same time,
883  // but prevent the extension of m_hltJson et. al. from a BeginInputFile incident.
884  std::shared_lock lockShared(m_sharedMutex);
885 
886  TriggerMenuJsonPtrWrapper& currentHltJson = *(m_currentHltJson.get(context));
887  TriggerMenuJsonPtrWrapper& currentHltmonitoringJson = *(m_currentHltmonitoringJson.get(context));
888  TriggerMenuJsonPtrWrapper& currentL1Json = *(m_currentL1Json.get(context));
889  TriggerMenuJsonPtrWrapper& currentHltpsJson = *(m_currentHltpsJson.get(context));
890  TriggerMenuJsonPtrWrapper& currentL1psJson = *(m_currentL1psJson.get(context));
891  TriggerMenuJsonPtrWrapper& currentBgJson = *(m_currentBgJson.get(context));
892 
893  TrigConf::HLTMenu& currentHlt = *(m_currentHlt.get(context));
894  TrigConf::HLTMonitoring& currentHltmonitoring = *(m_currentHltmonitoring.get(context));
895  TrigConf::L1Menu& currentL1 = *(m_currentL1.get(context));
896  TrigConf::HLTPrescalesSet& currentHltps = *(m_currentHltps.get(context));
897  TrigConf::L1PrescalesSet& currentL1ps = *(m_currentL1ps.get(context));
898  TrigConf::L1BunchGroupSet& currentBg = *(m_currentBg.get(context));
899 
900  ATH_CHECK( loadPtree("HLT Menu", m_hltJson.get(), keys->smk(), currentHltJson, currentHlt) );
901  ATH_CHECK( loadPtree("HLT Monitoring", m_hltmonitoringJson.get(), keys->smk(), currentHltmonitoringJson, currentHltmonitoring, /*optional=*/true) );
902  ATH_CHECK( loadPtree("L1 Menu", m_l1Json.get(), keys->smk(), currentL1Json, currentL1) );
903  ATH_CHECK( loadPtree("HLT Prescales", m_hltpsJson.get(), keys->hltpsk(), currentHltpsJson, currentHltps) );
904  ATH_CHECK( loadPtree("L1 Prescales", m_l1psJson.get(), keys->l1psk(), currentL1psJson, currentL1ps) );
905  if (bgKey) {
906  ATH_CHECK( loadPtree("Bunchgroups", m_bgJson.get(), bgKey->id(), currentBgJson, currentBg) );
907  }
908 
909  // Loading the payload doesn't additionally let the object know about its own key. We can load this in now too.
910  // The current*Json objects were updated by loadPtree to point to the entry with the correct key.
911  // We don't set this in loadPtree as the poperties are on the derived objects, not the base DataStructure.
912  currentHlt.setSMK( currentHltJson.m_ptr->key() );
913  if (currentHltmonitoringJson.m_ptr) {
914  currentHltmonitoring.setSMK( currentHltmonitoringJson.m_ptr->key() );
915  }
916  currentL1.setSMK( currentL1Json.m_ptr->key() );
917  currentHltps.setPSK( currentHltpsJson.m_ptr->key() );
918  currentL1ps.setPSK( currentL1psJson.m_ptr->key() );
919  if (bgKey) {
920  currentBg.setBGSK( currentBgJson.m_ptr->key() );
921  }
922 
923  CTPConfig& ctpConfig = *(m_ctpConfig.get(context));
924  HLTChainList& chainList = *(m_chainList.get(context));
925  HLTSequenceList& sequenceList = *(m_sequenceList.get(context));
926  BunchGroupSet& bgSet = *(m_bgSet.get(context));
927 
928  // Copy data into legacy long-term-support interfaces
929  CHECK( prepareTriggerMenu( currentHlt,
930  currentL1,
931  currentHltps,
932  currentL1ps,
933  currentBg,
934  ctpConfig,
935  chainList,
936  sequenceList,
937  bgSet,
938  msg() ) );
939 
940  REPORT_MESSAGE( MSG::INFO ) << "Loaded xAOD::TriggerMenuJson configuration:"
941  << " SMK = " << keys->smk()
942  << ", L1PSK = " << keys->l1psk()
943  << ", HLTPSK = " << keys->hltpsk()
944  << ", BGSK = " << (bgKey ? std::to_string(bgKey->id()) : std::string("UNKNOWN")) << endmsg;
945 
946  REPORT_MESSAGE( MSG::DEBUG ) << "ctpConfig.menu().size() = " << ctpConfig.menu().size()
947  << " chainList.size() = " << chainList.size()
948  << " sequenceList.size() = " << sequenceList.size()
949  << " bgSet.bunchGroups().size() = " << bgSet.bunchGroups().size() << endmsg;
950 
951  return StatusCode::SUCCESS;
952 
953  }

◆ readMetadata()

StatusCode TrigConf::xAODConfigSvc::readMetadata ( )
private

Function reading in a new metadata object from the input.

Definition at line 449 of file xAODConfigSvc.cxx.

449  {
450 
451  // Only one thread at a time is allowed to process a new file being opened
452  // and this should only happen when it is not being iterated over
453  // as part of the BeginEvent incident.
454  std::unique_lock lockUnique(m_sharedMutex);
455 
458 
459  // Read the R2 metadata object...
460  const xAOD::TriggerMenuContainer* input_tmc = nullptr;
462  or m_metaStore->retrieve( input_tmc, m_metaName ).isFailure() )
463  {
465  }
466 
467  // Read the R3 metadata object...
468  const xAOD::TriggerMenuJsonContainer* input_hlt = nullptr;
469  const xAOD::TriggerMenuJsonContainer* input_hltmonitoring = nullptr;
470  const xAOD::TriggerMenuJsonContainer* input_l1 = nullptr;
471  const xAOD::TriggerMenuJsonContainer* input_hltps = nullptr;
472  const xAOD::TriggerMenuJsonContainer* input_l1ps = nullptr;
473  const xAOD::TriggerMenuJsonContainer* input_bg = nullptr;
475  or m_metaStore->retrieve( input_hlt, m_metaNameJSON_hlt ).isFailure() )
476  {
478  }
480  or m_metaStore->retrieve( input_hltmonitoring, m_metaNameJSON_hltmonitoring ).isFailure() )
481  {
482  // m_menuJSONContainerAvailable = false;
483  // Currently planning on only storing these data in MC. Hence this has to be an optional input.
484  }
486  or m_metaStore->retrieve( input_l1, m_metaNameJSON_l1 ).isFailure() )
487  {
489  }
491  or m_metaStore->retrieve( input_hltps, m_metaNameJSON_hltps ).isFailure() )
492  {
494  }
496  or m_metaStore->retrieve( input_l1ps, m_metaNameJSON_l1ps ).isFailure() )
497  {
499  }
501  or m_metaStore->retrieve( input_bg, m_metaNameJSON_bg ).isFailure() )
502  {
503  // m_menuJSONContainerAvailable = false;
504  // This was not written up to the end of 2021, we have to make it optional for at least a while
505  }
506 
508  // Update the internal flag:
509  m_isInFailure = true;
510  // Decide what to do:
511  if( m_stopOnFailure ) {
512  REPORT_MESSAGE( MSG::FATAL ) << "Couldn't retrieve xAOD::TriggerMenuContainer or xAOD::TriggerMenuJsonContainer(s)" << endmsg;
513  return StatusCode::FAILURE;
514  } else {
515  REPORT_MESSAGE( MSG::WARNING ) << "Couldn't retrieve xAOD::TriggerMenuContainer or xAOD::TriggerMenuJsonContainer(s)" << endmsg;
516  return StatusCode::SUCCESS;
517  }
518  }
519 
520  // From file #2 and onward, check for mixed-messages from the input files.
521  // Note from the check just above, we know that we have at least one type of data available on this input file
522  //
523  // We do this as we currently have just two "available" flags, for the two data formats. Not two per slot
525  m_isInFailure = true;
528  if( m_stopOnFailure ) {
530  << "In this input file we found xAOD::TriggerMenuJsonContainer(s), but no xAOD::TriggerMenuContainer. "
531  << "This is inconsistent with previous input files." << endmsg;
532  return StatusCode::FAILURE;
533  } else {
534  REPORT_MESSAGE( MSG::WARNING )
535  << "In this input file we found xAOD::TriggerMenuJsonContainer(s), but no xAOD::TriggerMenuContainer. "
536  << "This is inconsistent with previous input files." << endmsg;
537  return StatusCode::SUCCESS;
538  }
539  }
541  m_isInFailure = true;
544  if( m_stopOnFailure ) {
546  << "In this input file we found xAOD::TriggerMenuContainer, but no xAOD::TriggerMenuJsonContainer. "
547  << "This is inconsistent with previous input files." << endmsg;
548  return StatusCode::FAILURE;
549  } else {
550  REPORT_MESSAGE( MSG::WARNING )
551  << "In this input file we found xAOD::TriggerMenuContainer, but no xAOD::TriggerMenuJsonContainer. "
552  << "This is inconsistent with previous input files." << endmsg;
553  return StatusCode::SUCCESS;
554  }
555  }
556 
557  // Let the user know what happened:
558  REPORT_MESSAGE( MSG::DEBUG ) << "Loaded trigger configuration metadata container(s)" << endmsg;
559 
560  // If available, give preference to the R3 format
562 
563  copyMetadataToPersonalStore(input_hlt, m_hltJson.get());
564  if (input_hltmonitoring) {
565  copyMetadataToPersonalStore(input_hltmonitoring, m_hltmonitoringJson.get());
566  }
567  copyMetadataToPersonalStore(input_l1, m_l1Json.get());
568  copyMetadataToPersonalStore(input_hltps, m_hltpsJson.get());
569  copyMetadataToPersonalStore(input_l1ps, m_l1psJson.get());
570  if (input_bg) {
571  copyMetadataToPersonalStore(input_bg, m_bgJson.get());
572  }
573 
574  return StatusCode::SUCCESS;
575 
576  } else if (m_triggerMenuContainerAvailable) { // Otherwise load the Run 2 format
577 
578  // A little sanity check:
579  if( ! input_tmc->size() ) {
580  REPORT_MESSAGE( MSG::WARNING ) << "No trigger configurations are available on the input" << endmsg;
581  return StatusCode::SUCCESS;
582  }
583 
584  // Copy in new menus
585  for ( const xAOD::TriggerMenu* inputMenu : *input_tmc ) {
586  bool alreadyHave = false;
587  for( const xAOD::TriggerMenu* existingMenu : *m_tmc ) {
588  if (xAODKeysMatch(inputMenu, existingMenu)) {
589  alreadyHave = true;
590  break;
591  }
592  }
593  if (alreadyHave) {
594  continue;
595  }
596  // Copy this menu into the service's internal cache of all menus
597  xAOD::TriggerMenu* newMenu = new xAOD::TriggerMenu();
598  m_tmc->push_back( newMenu ); // Note: 'newMenu' is now memory managed by m_tmc
599  *newMenu = *inputMenu;
600  REPORT_MESSAGE( MSG::DEBUG ) << "Imported new configuration: SMK = " << newMenu->smk()
601  << ", L1PSK = " << newMenu->l1psk()
602  << ", HLTPSK = " << newMenu->hltpsk() << endmsg;
603  }
604 
605  return StatusCode::SUCCESS;
606 
607  } // m_menuJSONContainerAvailable or m_triggerMenuContainerAvailable
608 
609  //Should never get here (due to check above)
610  ATH_MSG_ERROR( "Both m_menuJSONContainerAvailable and m_triggerMenuContainerAvailable are false" );
611  return StatusCode::FAILURE;
612  }

◆ sequences()

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

Get the HLT sequences.

Definition at line 158 of file xAODConfigSvc.cxx.

158  {
159 
160  // Long-term-support interface (including Run 2 AODs)
161  if( m_isInFailure ) {
163  << "Trigger menu not loaded";
164  throw GaudiException( "Service not initialised correctly",
165  "TrigConf::xAODConfigSvc::chains",
166  StatusCode::FAILURE );
167  }
168 
169  // Return the slot-specific object:
170  return *(m_sequenceList.get());
171  }

◆ thresholdConfig()

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

Get the LVL1 threshold configuruation (not available from xAOD)

Definition at line 93 of file xAODConfigSvc.h.

93  {
94  return 0;
95  }

Member Data Documentation

◆ m_bgJson

std::unique_ptr<xAOD::TriggerMenuJsonContainer> TrigConf::xAODConfigSvc::m_bgJson
private

Definition at line 280 of file xAODConfigSvc.h.

◆ m_bgJsonAux

std::unique_ptr<xAOD::TriggerMenuJsonAuxContainer> TrigConf::xAODConfigSvc::m_bgJsonAux
private

Definition at line 279 of file xAODConfigSvc.h.

◆ m_bgSet

SG::SlotSpecificObj<BunchGroupSet> TrigConf::xAODConfigSvc::m_bgSet
private

The "translated" bunch group set object.

Definition at line 313 of file xAODConfigSvc.h.

◆ m_chainList

SG::SlotSpecificObj<HLTChainList> TrigConf::xAODConfigSvc::m_chainList
private

The "translated" HLT configuration object.

Definition at line 309 of file xAODConfigSvc.h.

◆ m_ctpConfig

SG::SlotSpecificObj<CTPConfig> TrigConf::xAODConfigSvc::m_ctpConfig
private

Definition at line 307 of file xAODConfigSvc.h.

◆ m_currentBg

SG::SlotSpecificObj<L1BunchGroupSet> TrigConf::xAODConfigSvc::m_currentBg
private

Definition at line 296 of file xAODConfigSvc.h.

◆ m_currentBgJson

SG::SlotSpecificObj<TriggerMenuJsonPtrWrapper> TrigConf::xAODConfigSvc::m_currentBgJson
private

Definition at line 288 of file xAODConfigSvc.h.

◆ m_currentHlt

SG::SlotSpecificObj<HLTMenu> TrigConf::xAODConfigSvc::m_currentHlt
private

Definition at line 291 of file xAODConfigSvc.h.

◆ m_currentHltJson

SG::SlotSpecificObj<TriggerMenuJsonPtrWrapper> TrigConf::xAODConfigSvc::m_currentHltJson
private

Definition at line 283 of file xAODConfigSvc.h.

◆ m_currentHltmonitoring

SG::SlotSpecificObj<HLTMonitoring> TrigConf::xAODConfigSvc::m_currentHltmonitoring
private

Definition at line 292 of file xAODConfigSvc.h.

◆ m_currentHltmonitoringJson

SG::SlotSpecificObj<TriggerMenuJsonPtrWrapper> TrigConf::xAODConfigSvc::m_currentHltmonitoringJson
private

Definition at line 284 of file xAODConfigSvc.h.

◆ m_currentHltps

SG::SlotSpecificObj<HLTPrescalesSet> TrigConf::xAODConfigSvc::m_currentHltps
private

Definition at line 294 of file xAODConfigSvc.h.

◆ m_currentHltpsJson

SG::SlotSpecificObj<TriggerMenuJsonPtrWrapper> TrigConf::xAODConfigSvc::m_currentHltpsJson
private

Definition at line 286 of file xAODConfigSvc.h.

◆ m_currentL1

SG::SlotSpecificObj<L1Menu> TrigConf::xAODConfigSvc::m_currentL1
private

Definition at line 293 of file xAODConfigSvc.h.

◆ m_currentL1Json

SG::SlotSpecificObj<TriggerMenuJsonPtrWrapper> TrigConf::xAODConfigSvc::m_currentL1Json
private

Definition at line 285 of file xAODConfigSvc.h.

◆ m_currentL1ps

SG::SlotSpecificObj<L1PrescalesSet> TrigConf::xAODConfigSvc::m_currentL1ps
private

Definition at line 295 of file xAODConfigSvc.h.

◆ m_currentL1psJson

SG::SlotSpecificObj<TriggerMenuJsonPtrWrapper> TrigConf::xAODConfigSvc::m_currentL1psJson
private

Definition at line 287 of file xAODConfigSvc.h.

◆ m_eventBGKey

SG::ReadHandleKey<xAOD::BunchConfKey> TrigConf::xAODConfigSvc::m_eventBGKey
private
Initial value:
{this, "BGKeysObjectName", "BunchConfKey",
"Key for the event-level bunchgroup configuration identifier object. Only written from late 2021, optional input."}

Definition at line 200 of file xAODConfigSvc.h.

◆ m_eventKey

SG::ReadHandleKey<xAOD::TrigConfKeys> TrigConf::xAODConfigSvc::m_eventKey
private
Initial value:
{this, "EventObjectName", "TrigConfKeys",
"Key for the event-level configuration identifier object"}

Definition at line 197 of file xAODConfigSvc.h.

◆ m_hltJson

std::unique_ptr<xAOD::TriggerMenuJsonContainer> TrigConf::xAODConfigSvc::m_hltJson
private

Definition at line 270 of file xAODConfigSvc.h.

◆ m_hltJsonAux

std::unique_ptr<xAOD::TriggerMenuJsonAuxContainer> TrigConf::xAODConfigSvc::m_hltJsonAux
private

Definition at line 269 of file xAODConfigSvc.h.

◆ m_hltMenuKey

SG::ReadHandleKey<HLTMenu> TrigConf::xAODConfigSvc::m_hltMenuKey
private
Initial value:
{this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu",
"HLT Menu Key, for when UseInFileMetadata=False. From the DetectorStore."}

Definition at line 233 of file xAODConfigSvc.h.

◆ m_hltmonitoringJson

std::unique_ptr<xAOD::TriggerMenuJsonContainer> TrigConf::xAODConfigSvc::m_hltmonitoringJson
private

Definition at line 272 of file xAODConfigSvc.h.

◆ m_hltmonitoringJsonAux

std::unique_ptr<xAOD::TriggerMenuJsonAuxContainer> TrigConf::xAODConfigSvc::m_hltmonitoringJsonAux
private

Definition at line 271 of file xAODConfigSvc.h.

◆ m_HLTPrescaleSetKey

SG::ReadCondHandleKey<TrigConf::HLTPrescalesSet> TrigConf::xAODConfigSvc::m_HLTPrescaleSetKey
private
Initial value:
{this, "HLTPrescales", "HLTPrescales",
"HLT prescales set condition handle, for when UseInFileMetadata=False"}

Definition at line 239 of file xAODConfigSvc.h.

◆ m_hltpsJson

std::unique_ptr<xAOD::TriggerMenuJsonContainer> TrigConf::xAODConfigSvc::m_hltpsJson
private

Definition at line 276 of file xAODConfigSvc.h.

◆ m_hltpsJsonAux

std::unique_ptr<xAOD::TriggerMenuJsonAuxContainer> TrigConf::xAODConfigSvc::m_hltpsJsonAux
private

Definition at line 275 of file xAODConfigSvc.h.

◆ m_isInFailure

bool TrigConf::xAODConfigSvc::m_isInFailure {false}
private

Internal state of the service.

Definition at line 254 of file xAODConfigSvc.h.

◆ m_L1BunchGroupSetKey

SG::ReadCondHandleKey<TrigConf::L1BunchGroupSet> TrigConf::xAODConfigSvc::m_L1BunchGroupSetKey {this, "L1BunchGroup", "L1BunchGroup", "L1 Bunch groups"}
private

Definition at line 245 of file xAODConfigSvc.h.

◆ m_l1Json

std::unique_ptr<xAOD::TriggerMenuJsonContainer> TrigConf::xAODConfigSvc::m_l1Json
private

Definition at line 274 of file xAODConfigSvc.h.

◆ m_l1JsonAux

std::unique_ptr<xAOD::TriggerMenuJsonAuxContainer> TrigConf::xAODConfigSvc::m_l1JsonAux
private

Definition at line 273 of file xAODConfigSvc.h.

◆ m_l1MenuKey

SG::ReadHandleKey<L1Menu> TrigConf::xAODConfigSvc::m_l1MenuKey
private
Initial value:
{this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu",
"L1 Menu Key, for when UseInFileMetadata=False. From the DetectorStore"}

Definition at line 236 of file xAODConfigSvc.h.

◆ m_L1PrescaleSetKey

SG::ReadCondHandleKey<TrigConf::L1PrescalesSet> TrigConf::xAODConfigSvc::m_L1PrescaleSetKey
private
Initial value:
{this, "L1Prescales", "L1Prescales",
"L1 prescales set condition handle, for when UseInFileMetadata=False"}

Definition at line 242 of file xAODConfigSvc.h.

◆ m_l1psJson

std::unique_ptr<xAOD::TriggerMenuJsonContainer> TrigConf::xAODConfigSvc::m_l1psJson
private

Definition at line 278 of file xAODConfigSvc.h.

◆ m_l1psJsonAux

std::unique_ptr<xAOD::TriggerMenuJsonAuxContainer> TrigConf::xAODConfigSvc::m_l1psJsonAux
private

Definition at line 277 of file xAODConfigSvc.h.

◆ m_menu

SG::SlotSpecificObj<MenuPtrWrapper> TrigConf::xAODConfigSvc::m_menu
private

Definition at line 263 of file xAODConfigSvc.h.

◆ m_menuJSONContainerAvailable

bool TrigConf::xAODConfigSvc::m_menuJSONContainerAvailable {false}
private

Is decoded R3 format data available?

Definition at line 322 of file xAODConfigSvc.h.

◆ m_metaName

Gaudi::Property<std::string> TrigConf::xAODConfigSvc::m_metaName
private
Initial value:
{this, "MetaObjectName", "TriggerMenu",
"Key for the trigger configuration metadata object"}

Definition at line 205 of file xAODConfigSvc.h.

◆ m_metaNameJSON_bg

Gaudi::Property< std::string > TrigConf::xAODConfigSvc::m_metaNameJSON_bg
private
Initial value:
{this, "JSONMetaObjectNameBunchgroup", "TriggerMenuJson_BG",
"StoreGate key for the xAOD::TriggerMenuJson BunchGroup configuration object"}

Definition at line 226 of file xAODConfigSvc.h.

◆ m_metaNameJSON_hlt

Gaudi::Property< std::string > TrigConf::xAODConfigSvc::m_metaNameJSON_hlt
private
Initial value:
{this, "JSONMetaObjectNameHLT", "TriggerMenuJson_HLT",
"StoreGate key for the xAOD::TriggerMenuJson HLT configuration object"}

Definition at line 211 of file xAODConfigSvc.h.

◆ m_metaNameJSON_hltmonitoring

Gaudi::Property< std::string > TrigConf::xAODConfigSvc::m_metaNameJSON_hltmonitoring
private
Initial value:
{this, "JSONMetaObjectNameHLTMonitoring", "TriggerMenuJson_HLTMonitoring",
"StoreGate key for the xAOD::TriggerMenuJson HLT monitoring configuration object"}

Definition at line 214 of file xAODConfigSvc.h.

◆ m_metaNameJSON_hltps

Gaudi::Property< std::string > TrigConf::xAODConfigSvc::m_metaNameJSON_hltps
private
Initial value:
{this, "JSONMetaObjectNameHLTPS", "TriggerMenuJson_HLTPS",
"StoreGate key for the xAOD::TriggerMenuJson HLT prescales configuration object"}

Definition at line 220 of file xAODConfigSvc.h.

◆ m_metaNameJSON_l1

Gaudi::Property< std::string > TrigConf::xAODConfigSvc::m_metaNameJSON_l1
private
Initial value:
{this, "JSONMetaObjectNameL1", "TriggerMenuJson_L1",
"StoreGate key for the xAOD::TriggerMenuJson L1 configuration object"}

Definition at line 217 of file xAODConfigSvc.h.

◆ m_metaNameJSON_l1ps

Gaudi::Property< std::string > TrigConf::xAODConfigSvc::m_metaNameJSON_l1ps
private
Initial value:
{this, "JSONMetaObjectNameL1PS", "TriggerMenuJson_L1PS",
"StoreGate key for the xAOD::TriggerMenuJson L1 prescales configuration object"}

Definition at line 223 of file xAODConfigSvc.h.

◆ m_metaStore

ServiceHandle< StoreGateSvc > TrigConf::xAODConfigSvc::m_metaStore {this, "MetaDataStore", "InputMetaDataStore"}
private

Connection to the metadata store.

Definition at line 317 of file xAODConfigSvc.h.

◆ m_sequenceList

SG::SlotSpecificObj<HLTSequenceList> TrigConf::xAODConfigSvc::m_sequenceList
private

The "translated" HLT configuration object.

Definition at line 311 of file xAODConfigSvc.h.

◆ m_sharedMutex

std::shared_mutex TrigConf::xAODConfigSvc::m_sharedMutex
private

The mutex used to to restrict access to m_tmc when it is being written to.

Definition at line 300 of file xAODConfigSvc.h.

◆ m_stopOnFailure

Gaudi::Property<bool> TrigConf::xAODConfigSvc::m_stopOnFailure {this, "StopOnFailure", true, "Flag for stopping the job in case of a failure"}
private

Definition at line 252 of file xAODConfigSvc.h.

◆ m_tmc

std::unique_ptr<xAOD::TriggerMenuContainer> TrigConf::xAODConfigSvc::m_tmc
private

Definition at line 260 of file xAODConfigSvc.h.

◆ m_tmcAux

std::unique_ptr<xAOD::TriggerMenuAuxContainer> TrigConf::xAODConfigSvc::m_tmcAux
private

Definition at line 259 of file xAODConfigSvc.h.

◆ m_triggerMenuContainerAvailable

bool TrigConf::xAODConfigSvc::m_triggerMenuContainerAvailable {false}
private

Is decoded R2 format data available?

Definition at line 320 of file xAODConfigSvc.h.

◆ m_useInFileMetadata

Gaudi::Property<bool> TrigConf::xAODConfigSvc::m_useInFileMetadata
private
Initial value:
{this, "UseInFileMetadata", true, "Flag for reading all configuration from the input POOL file(s). "
"This mode should be used everywhere except for: RAWtoALL from bytestream. "
"If set to false, only the R3 configuration is supported."}

Definition at line 248 of file xAODConfigSvc.h.


The documentation for this class was generated from the following files:
TrigConf::L1Menu::setSMK
void setSMK(unsigned int psk)
Definition: L1Menu.cxx:196
TrigConf::HLTPrescalesSet::setPSK
void setPSK(unsigned int psk)
Definition: HLTPrescalesSet.cxx:80
TrigConf::L1BunchGroupSet::setBGSK
void setBGSK(unsigned int bgsk)
Definition: L1BunchGroupSet.h:96
TrigConf::xAODConfigSvc::m_bgJsonAux
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_bgJsonAux
Definition: xAODConfigSvc.h:279
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TrigConf::xAODConfigSvc::m_currentL1
SG::SlotSpecificObj< L1Menu > m_currentL1
Definition: xAODConfigSvc.h:293
TrigConf::xAODConfigSvc::m_L1PrescaleSetKey
SG::ReadCondHandleKey< TrigConf::L1PrescalesSet > m_L1PrescaleSetKey
Definition: xAODConfigSvc.h:242
max
#define max(a, b)
Definition: cfImp.cxx:41
TrigConf::xAODConfigSvc::readMetadata
StatusCode readMetadata()
Function reading in a new metadata object from the input.
Definition: xAODConfigSvc.cxx:449
TrigConf::xAODConfigSvc::copyMetadataToPersonalStore
void copyMetadataToPersonalStore(const xAOD::TriggerMenuJsonContainer *input, xAOD::TriggerMenuJsonContainer *existing)
Helper function for copying into the service's private data store.
Definition: xAODConfigSvc.cxx:614
TrigConf::HLTMonitoring::setSMK
void setSMK(unsigned int psk)
Definition: HLTMonitoring.cxx:99
TrigConf::xAODConfigSvc::m_currentBg
SG::SlotSpecificObj< L1BunchGroupSet > m_currentBg
Definition: xAODConfigSvc.h:296
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TrigConf::xAODConfigSvc::prepareEvent
StatusCode prepareEvent()
Function setting up the service for a new event.
Definition: xAODConfigSvc.cxx:634
TrigConf::HLTMenu
HLT menu configuration.
Definition: HLTMenu.h:21
TrigConf::xAODConfigSvc::ctpConfig
virtual const CTPConfig * ctpConfig() const override
Get the LVL1 trigger menu.
Definition: xAODConfigSvc.cxx:112
xAOD::TriggerMenu_v1::l1psk
uint32_t l1psk() const
Get the LVL1 prescale key of this configuration.
TrigConf::xAODConfigSvc::m_currentL1ps
SG::SlotSpecificObj< L1PrescalesSet > m_currentL1ps
Definition: xAODConfigSvc.h:295
TrigConf::xAODConfigSvc::prepareEventxAODTriggerMenu
StatusCode prepareEventxAODTriggerMenu(const xAOD::TrigConfKeys *keys, const EventContext &context)
Do per-event decoding for R2 in-file serialised xAOD::TriggerMenu metadata.
Definition: xAODConfigSvc.cxx:679
TrigConf::xAODConfigSvc::m_hltJson
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_hltJson
Definition: xAODConfigSvc.h:270
TrigConf::xAODConfigSvc::m_menu
SG::SlotSpecificObj< MenuPtrWrapper > m_menu
Definition: xAODConfigSvc.h:263
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TrigConf::xAODConfigSvc::m_sharedMutex
std::shared_mutex m_sharedMutex
The mutex used to to restrict access to m_tmc when it is being written to.
Definition: xAODConfigSvc.h:300
TrigConf::xAODConfigSvc::m_metaNameJSON_hltps
Gaudi::Property< std::string > m_metaNameJSON_hltps
Definition: xAODConfigSvc.h:220
TrigConf::xAODConfigSvc::m_currentHltps
SG::SlotSpecificObj< HLTPrescalesSet > m_currentHltps
Definition: xAODConfigSvc.h:294
TrigConf::xAODConfigSvc::m_chainList
SG::SlotSpecificObj< HLTChainList > m_chainList
The "translated" HLT configuration object.
Definition: xAODConfigSvc.h:309
TrigConf::xAODConfigSvc::m_useInFileMetadata
Gaudi::Property< bool > m_useInFileMetadata
Definition: xAODConfigSvc.h:248
TrigConf::xAODConfigSvc::m_metaNameJSON_hltmonitoring
Gaudi::Property< std::string > m_metaNameJSON_hltmonitoring
Definition: xAODConfigSvc.h:214
TrigConf::xAODConfigSvc::m_currentL1psJson
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapper > m_currentL1psJson
Definition: xAODConfigSvc.h:287
xAOD::TriggerMenuJson_v1::name
const std::string & name() const
Get the name of this configuration.
TrigConf::xAODConfigSvc::m_currentHltJson
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapper > m_currentHltJson
Definition: xAODConfigSvc.h:283
TrigConf::xAODConfigSvc::m_l1Json
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_l1Json
Definition: xAODConfigSvc.h:274
TrigConf::xAODConfigSvc::m_ctpConfig
SG::SlotSpecificObj< CTPConfig > m_ctpConfig
Definition: xAODConfigSvc.h:307
test_pyathena.pt
pt
Definition: test_pyathena.py:11
TrigConf::prepareTriggerMenu
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...
Definition: prepareTriggerMenu.cxx:47
TrigConf::L1Menu
L1 menu configuration.
Definition: L1Menu.h:28
TrigConf::HLTMenu::setSMK
void setSMK(unsigned int psk)
Definition: HLTMenu.cxx:46
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
TrigConf::xAODConfigSvc::m_bgSet
SG::SlotSpecificObj< BunchGroupSet > m_bgSet
The "translated" bunch group set object.
Definition: xAODConfigSvc.h:313
TrigConf::L1PrescalesSet::setPSK
void setPSK(unsigned int psk)
Definition: L1PrescalesSet.cxx:49
TrigConf::xAODConfigSvc::m_metaNameJSON_l1ps
Gaudi::Property< std::string > m_metaNameJSON_l1ps
Definition: xAODConfigSvc.h:223
TrigConf::xAODKeysMatch
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...
Definition: xAODKeysMatch.cxx:20
TrigConf::xAODConfigSvc::m_eventBGKey
SG::ReadHandleKey< xAOD::BunchConfKey > m_eventBGKey
Definition: xAODConfigSvc.h:200
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TrigConf::xAODConfigSvc::m_tmc
std::unique_ptr< xAOD::TriggerMenuContainer > m_tmc
Definition: xAODConfigSvc.h:260
TrigConf::xAODConfigSvc::m_l1psJson
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_l1psJson
Definition: xAODConfigSvc.h:278
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrigConf::xAODConfigSvc::m_eventKey
SG::ReadHandleKey< xAOD::TrigConfKeys > m_eventKey
Definition: xAODConfigSvc.h:197
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TrigConf::xAODConfigSvc::m_hltMenuKey
SG::ReadHandleKey< HLTMenu > m_hltMenuKey
Definition: xAODConfigSvc.h:233
TrigConf::xAODConfigSvc::m_triggerMenuContainerAvailable
bool m_triggerMenuContainerAvailable
Is decoded R2 format data available?
Definition: xAODConfigSvc.h:320
TrigConf::xAODConfigSvc::m_hltpsJson
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_hltpsJson
Definition: xAODConfigSvc.h:276
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigConf::xAODConfigSvc::m_metaNameJSON_hlt
Gaudi::Property< std::string > m_metaNameJSON_hlt
Definition: xAODConfigSvc.h:211
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
TrigConf::xAODConfigSvc::prepareEventxAODTriggerMenuJson
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.
Definition: xAODConfigSvc.cxx:848
TrigConf::xAODConfigSvc::m_l1psJsonAux
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_l1psJsonAux
Definition: xAODConfigSvc.h:277
TrigConf::xAODConfigSvc::m_hltpsJsonAux
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_hltpsJsonAux
Definition: xAODConfigSvc.h:275
TrigConf::L1BunchGroupSet
L1 board configuration.
Definition: L1BunchGroupSet.h:71
TrigConf::xAODConfigSvc::m_hltmonitoringJsonAux
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_hltmonitoringJsonAux
Definition: xAODConfigSvc.h:271
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
TrigConf::xAODConfigSvc::m_menuJSONContainerAvailable
bool m_menuJSONContainerAvailable
Is decoded R3 format data available?
Definition: xAODConfigSvc.h:322
TrigConf::xAODConfigSvc::m_HLTPrescaleSetKey
SG::ReadCondHandleKey< TrigConf::HLTPrescalesSet > m_HLTPrescaleSetKey
Definition: xAODConfigSvc.h:239
TrigConf::L1PrescalesSet
L1 menu configuration.
Definition: L1PrescalesSet.h:19
TrigConf::xAODConfigSvc::m_metaStore
ServiceHandle< StoreGateSvc > m_metaStore
Connection to the metadata store.
Definition: xAODConfigSvc.h:317
TrigConf::xAODConfigSvc::m_isInFailure
bool m_isInFailure
Internal state of the service.
Definition: xAODConfigSvc.h:254
ptree
boost::property_tree::ptree ptree
Definition: JsonFileLoader.cxx:16
TrigConf::xAODConfigSvc::m_stopOnFailure
Gaudi::Property< bool > m_stopOnFailure
Definition: xAODConfigSvc.h:252
TrigConf::xAODConfigSvc::m_currentBgJson
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapper > m_currentBgJson
Definition: xAODConfigSvc.h:288
xAOD::TrigConfKeys_v1
Class describing the configuration used in a given event.
Definition: TrigConfKeys_v1.h:32
xAOD::TriggerMenu
TriggerMenu_v1 TriggerMenu
Define the latest version of the trigger menu class.
Definition: TriggerMenu.h:16
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
xAOD::TriggerMenuJson_v1::key
uint32_t key() const
Get the key of this configuration.
xAOD::BunchConfKey_v1::id
uint32_t id() const
Get the 32-bit identifier of the bunch configuration.
Definition: BunchConfKey_v1.cxx:17
REPORT_MESSAGE
#define REPORT_MESSAGE(LVL)
Report a message.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:365
xAOD::TriggerMenuJson_v1
Raw JSON data for a given type of menu file.
Definition: TriggerMenuJson_v1.h:26
TrigConf::HLTMonitoring
HLT monitoring configuration.
Definition: HLTMonitoring.h:27
TrigConf::xAODConfigSvc::m_hltJsonAux
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_hltJsonAux
Definition: xAODConfigSvc.h:269
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
TrigConf::xAODConfigSvc::m_L1BunchGroupSetKey
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSet > m_L1BunchGroupSetKey
Definition: xAODConfigSvc.h:245
TrigConf::xAODConfigSvc::m_tmcAux
std::unique_ptr< xAOD::TriggerMenuAuxContainer > m_tmcAux
Definition: xAODConfigSvc.h:259
TrigConf::xAODConfigSvc::m_currentHlt
SG::SlotSpecificObj< HLTMenu > m_currentHlt
Definition: xAODConfigSvc.h:291
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
TrigConf::xAODConfigSvc::m_hltmonitoringJson
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_hltmonitoringJson
Definition: xAODConfigSvc.h:272
TrigConf::xAODConfigSvc::m_metaName
Gaudi::Property< std::string > m_metaName
Definition: xAODConfigSvc.h:205
TrigConf::CTPConfig::menu
const Menu & menu() const
Definition: CTPConfig.h:38
TrigConf::xAODConfigSvc::m_bgJson
std::unique_ptr< xAOD::TriggerMenuJsonContainer > m_bgJson
Definition: xAODConfigSvc.h:280
DEBUG
#define DEBUG
Definition: page_access.h:11
xAOD::TriggerMenuJson
TriggerMenuJson_v1 TriggerMenuJson
Define the latest version of the trigger menu JSON class.
Definition: TriggerMenuJson.h:15
TrigConf::xAODConfigSvc::m_metaNameJSON_l1
Gaudi::Property< std::string > m_metaNameJSON_l1
Definition: xAODConfigSvc.h:217
xAOD::TriggerMenuJson_v1::payload
const std::string & payload() const
Get the JSON payload.
TrigConf::xAODConfigSvc::prepareEventRun3Athena
StatusCode prepareEventRun3Athena(const EventContext &context)
Do per-event updating of R3 JSON-based metadata, reading the data direct from the Conditions and Dete...
Definition: xAODConfigSvc.cxx:727
TrigConf::xAODConfigSvc::m_currentHltpsJson
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapper > m_currentHltpsJson
Definition: xAODConfigSvc.h:286
TrigConf::xAODConfigSvc::m_currentHltmonitoring
SG::SlotSpecificObj< HLTMonitoring > m_currentHltmonitoring
Definition: xAODConfigSvc.h:292
xAOD::TriggerMenu_v1::smk
uint32_t smk() const
Get the Super Master Key of this configuration.
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
TrigConf::xAODConfigSvc::loadPtree
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,...
Definition: xAODConfigSvc.cxx:955
TrigConf::Menu::size
int size() const
Definition: Menu.h:143
TrigConf::HLTPrescalesSet
HLT menu configuration.
Definition: HLTPrescalesSet.h:19
xAOD::TriggerMenu_v1
Class holding one particular trigger configuration.
Definition: TriggerMenu_v1.h:34
TrigConf::xAODConfigSvc::m_l1JsonAux
std::unique_ptr< xAOD::TriggerMenuJsonAuxContainer > m_l1JsonAux
Definition: xAODConfigSvc.h:273
TrigConf::xAODConfigSvc::m_l1MenuKey
SG::ReadHandleKey< L1Menu > m_l1MenuKey
Definition: xAODConfigSvc.h:236
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TrigConf::xAODConfigSvc::m_metaNameJSON_bg
Gaudi::Property< std::string > m_metaNameJSON_bg
Definition: xAODConfigSvc.h:226
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
TrigConf::xAODConfigSvc::m_currentHltmonitoringJson
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapper > m_currentHltmonitoringJson
Definition: xAODConfigSvc.h:284
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
xAOD::TriggerMenu_v1::hltpsk
uint32_t hltpsk() const
Get the HLT prescale key of this configuration.
TrigConf::xAODConfigSvc::m_currentL1Json
SG::SlotSpecificObj< TriggerMenuJsonPtrWrapper > m_currentL1Json
Definition: xAODConfigSvc.h:285
ServiceHandle< IIncidentSvc >
xAOD::BunchConfKey_v1
Class identifying the bunch configuration of a given event.
Definition: BunchConfKey_v1.h:29
TrigConf::xAODConfigSvc::m_sequenceList
SG::SlotSpecificObj< HLTSequenceList > m_sequenceList
The "translated" HLT configuration object.
Definition: xAODConfigSvc.h:311