ATLAS Offline Software
xAODConfigTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // System include(s):
6 #include <stdexcept>
7 
8 // Trigger include(s):
11 
12 // Local include(s):
16 
17 // Boost includes
18 #define BOOST_BIND_GLOBAL_PLACEHOLDERS // Needed to silence Boost pragma message
19 #include <boost/property_tree/ptree.hpp>
20 #include <boost/property_tree/json_parser.hpp>
21 
22 namespace TrigConf {
23 
25  {
36 
49  };
50 
51  xAODConfigTool::xAODConfigTool( const std::string& name )
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 ),
59  m_triggerMenuContainerAvailable(false),
60  m_menuJSONContainerAvailable(false),
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  }
74 
75  // Defined here rather than in the header because it requires the knowledge of Impl defined above
77 
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;
104  m_currentHltmonitoringJson = 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  }
113 
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  }
124 
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  }
135 
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  }
154 
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!");
162  }
163  }
164 
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  }
175 
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  }
186 
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  }
205 
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  }
224 
225  const HLTMenu& xAODConfigTool::hltMenu(const EventContext&) const {
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  }
232 
233  const HLTMonitoring& xAODConfigTool::hltMonitoring(const EventContext&) const {
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  }
240 
241  const L1Menu& xAODConfigTool::l1Menu(const EventContext&) const {
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  }
248 
249  const HLTPrescalesSet& xAODConfigTool::hltPrescalesSet(const EventContext&) const {
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  }
256 
257  const L1PrescalesSet& xAODConfigTool::l1PrescalesSet(const EventContext&) const {
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  }
264 
265  const L1BunchGroupSet& xAODConfigTool::l1BunchGroupSet(const EventContext&) const {
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  }
272 
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;
281  if( !inputMetaStore()->contains<xAOD::TriggerMenuContainer>(m_metaName_run2)
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;
295  if( !inputMetaStore()->contains<xAOD::TriggerMenuJsonContainer>(m_metaNameJSON_hlt)
296  or inputMetaStore()->retrieve( m_hltJson, m_metaNameJSON_hlt ).isFailure() )
297  {
299  }
300  if( !inputMetaStore()->contains<xAOD::TriggerMenuJsonContainer>(m_metaNameJSON_hltmonitoring)
302  {
303  // m_menuJSONContainerAvailable = false;
304  // Currently planning on only storing these data in MC. Hence this has to be an optional input.
305  }
306  if( !inputMetaStore()->contains<xAOD::TriggerMenuJsonContainer>(m_metaNameJSON_l1)
307  or inputMetaStore()->retrieve( m_l1Json, m_metaNameJSON_l1 ).isFailure() )
308  {
310  }
311  if( !inputMetaStore()->contains<xAOD::TriggerMenuJsonContainer>(m_metaNameJSON_hltps)
313  {
315  }
316  if( !inputMetaStore()->contains<xAOD::TriggerMenuJsonContainer>(m_metaNameJSON_l1ps)
317  or inputMetaStore()->retrieve( m_l1psJson, m_metaNameJSON_l1ps ).isFailure() )
318  {
320  }
321  if( !inputMetaStore()->contains<xAOD::TriggerMenuJsonContainer>(m_metaNameJSON_bg)
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 );
364  if (m_bgJson) { // Considered optional for now
365  m_currentBgJson = m_bgJson->at( 0 );
366  }
367 
368  ATH_CHECK( loadPtrees() );
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 
394  } else if (m_triggerMenuContainerAvailable) {
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:
408  ATH_CHECK( prepareTriggerMenu( m_menu, m_impl->m_ctpConfig,
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  }
419 
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;
433 
434  const xAOD::BunchConfKey* bgKey = nullptr; // The BG key is currently optional, only files written from late 2021 will contain this
435  if (evtStore()->contains<xAOD::BunchConfKey>(m_bgkeysName)) {
437  }
438 
439  // Prefer Run 3 data if available
441  return beginEvent_Run3(keys, bgKey);
442  } else if (m_triggerMenuContainerAvailable) {
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  }
450 
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:
466  ATH_CHECK( prepareTriggerMenu( m_menu, m_impl->m_ctpConfig,
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  }
480 
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  }
552 
553  StatusCode xAODConfigTool::loadJsonByKey(const std::string& humanName,
554  const xAOD::TriggerMenuJsonContainer* metaContainer,
555  const uint32_t keyToCheck,
556  const xAOD::TriggerMenuJson*& ptrToSet)
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  }
572 
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  }
586 
587  StatusCode xAODConfigTool::loadPtree(const std::string& humanName,
589  DataStructure& dataStructure)
590  {
591  std::stringstream rawData;
592  rawData << menu->payload();
593  dataStructure.clear();
594  try {
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  }
605 
606 } // namespace TrigConf
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TrigConf::BunchGroupSet
Definition: BunchGroupSet.h:19
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TrigConf::xAODConfigTool::m_l1psJson
const xAOD::TriggerMenuJsonContainer * m_l1psJson
Definition: xAODConfigTool.h:197
prepareTriggerMenu.h
xAODConfigTool.h
TrigConf::xAODConfigTool::m_hltpsJson
const xAOD::TriggerMenuJsonContainer * m_hltpsJson
Definition: xAODConfigTool.h:196
max
#define max(a, b)
Definition: cfImp.cxx:41
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TrigConf::xAODConfigTool::Impl::m_chainList
HLTChainList m_chainList
The "translated" HLT configuration object.
Definition: xAODConfigTool.cxx:31
TrigConf::HLTMenu
HLT menu configuration.
Definition: HLTMenu.h:21
TrigConf::xAODConfigTool::beginEvent_Run3
StatusCode beginEvent_Run3(const xAOD::TrigConfKeys *keys, const xAOD::BunchConfKey *bgKey)
Internal call to check / load from a file with Run3 metadata.
Definition: xAODConfigTool.cxx:481
xAOD::TriggerMenu_v1::l1psk
uint32_t l1psk() const
Get the LVL1 prescale key of this configuration.
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
TrigConf::xAODConfigTool::bunchGroupSet
virtual const BunchGroupSet * bunchGroupSet() const override
Get the LVL1 bunch group set.
Definition: xAODConfigTool.cxx:125
TrigConf::xAODConfigTool::Impl::m_currentL1
L1Menu m_currentL1
The JSON decoded Run3 L1 menu.
Definition: xAODConfigTool.cxx:42
TrigConf::xAODConfigTool::~xAODConfigTool
virtual ~xAODConfigTool() override
Out-of-line dtor so that we don't need to define Impl in the header.
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TrigConf::xAODConfigTool::m_metaNameJSON_bg
std::string m_metaNameJSON_bg
Definition: xAODConfigTool.h:188
TrigConf::xAODConfigTool::loadPtree
StatusCode loadPtree(const std::string &humanName, const xAOD::TriggerMenuJson *menu, DataStructure &dataStructure)
Load single m_currentXXXJson serialised JSON data into ptree.
Definition: xAODConfigTool.cxx:587
TrigConf::xAODConfigTool::lvl1PrescaleKey
virtual uint32_t lvl1PrescaleKey() const override
Get the LVL1 prescale key.
Definition: xAODConfigTool.cxx:136
asg
Definition: DataHandleTestTool.h:28
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::xAODConfigTool::loadPtrees
StatusCode loadPtrees()
Load all m_currentXXXJson serialised JSON data into ptrees inside m_impl.
Definition: xAODConfigTool.cxx:573
asg::AsgMetadataTool::inputMetaStore
MetaStorePtr_t inputMetaStore() const
Accessor for the input metadata store.
Definition: AsgMetadataTool.cxx:88
TrigConf::L1Menu
L1 menu configuration.
Definition: L1Menu.h:28
TrigConf::xAODConfigTool::m_metaNameJSON_l1ps
std::string m_metaNameJSON_l1ps
Definition: xAODConfigTool.h:187
TrigConf::xAODConfigTool::hltPrescaleKey
virtual uint32_t hltPrescaleKey() const override
Get the HLT prescale key.
Definition: xAODConfigTool.cxx:206
TrigConf::xAODConfigTool::m_metaNameJSON_hlt
std::string m_metaNameJSON_hlt
Key for the trigger configuration metadata objects (Run 3)
Definition: xAODConfigTool.h:183
TrigConf::xAODConfigTool::Impl::m_ctpConfig
CTPConfig m_ctpConfig
Note: The run 3 JSON derives objects below are used to additionally populate these objects for interf...
Definition: xAODConfigTool.cxx:29
TrigConf::xAODConfigTool::m_metaNameJSON_hltmonitoring
std::string m_metaNameJSON_hltmonitoring
Definition: xAODConfigTool.h:184
TrigConf::DataStructure::setData
void setData(const ptree &data)
Setting the configuration data.
Definition: DataStructure.cxx:39
TrigConf::xAODConfigTool::loadJsonByKey
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...
Definition: xAODConfigTool.cxx:553
TrigConf::xAODConfigTool::ctpConfig
virtual const CTPConfig * ctpConfig() const override
Get the LVL1 trigger menu.
Definition: xAODConfigTool.cxx:114
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::xAODConfigTool::beginInputFile
virtual StatusCode beginInputFile() override
Function called when a new input file is opened.
Definition: xAODConfigTool.cxx:273
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
menu
make the sidebar many part of the config
Definition: hcg.cxx:551
TrigConf::xAODConfigTool::xAODConfigTool
xAODConfigTool(const std::string &name="TrigConf::xAODConfigTool")
Create a proper constructor for Athena.
Definition: xAODConfigTool.cxx:51
TrigConf::xAODConfigTool::l1Menu
virtual const L1Menu & l1Menu(const EventContext &ctx=Gaudi::Hive::currentContext()) const override
Returns the JSON configured L1 ptree.
Definition: xAODConfigTool.cxx:241
TrigConf::xAODConfigTool::Impl::m_currentHltmonitoring
HLTMonitoring m_currentHltmonitoring
The JSON decoded Run3 HLT monitoring.
Definition: xAODConfigTool.cxx:40
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::xAODConfigTool::Impl::m_bgSet
BunchGroupSet m_bgSet
The "translated" bunch group set object.
Definition: xAODConfigTool.cxx:35
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TrigConf::xAODConfigTool::m_bgkeysName
std::string m_bgkeysName
Key for the event-level bunchgroup identification object, in the codebase since R2 but only being use...
Definition: xAODConfigTool.h:179
TrigConf::HLTChainList
list of all HLT chains in a trigger menu
Definition: HLTChainList.h:56
TrigConf::xAODConfigTool::m_currentL1Json
const xAOD::TriggerMenuJson * m_currentL1Json
Definition: xAODConfigTool.h:205
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigConf::xAODConfigTool::m_currentHltJson
const xAOD::TriggerMenuJson * m_currentHltJson
The active configuration for the current event (For Run3 AOD)
Definition: xAODConfigTool.h:203
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrigConf::xAODConfigTool::m_bgJson
const xAOD::TriggerMenuJsonContainer * m_bgJson
Definition: xAODConfigTool.h:198
TrigConf::xAODConfigTool::beginEvent
virtual StatusCode beginEvent() override
Function called when a new event is loaded.
Definition: xAODConfigTool.cxx:420
TrigConf::xAODConfigTool::m_currentHltmonitoringJson
const xAOD::TriggerMenuJson * m_currentHltmonitoringJson
Definition: xAODConfigTool.h:204
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigConf::xAODConfigTool::m_tmc
const xAOD::TriggerMenuContainer * m_tmc
The configuration object of the current input file (for Run2 AOD)
Definition: xAODConfigTool.h:191
TrigConf::L1BunchGroupSet
L1 board configuration.
Definition: L1BunchGroupSet.h:71
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
TrigConf::xAODConfigTool::m_metaName_run2
std::string m_metaName_run2
Key for the trigger configuration metadata object (Run 2)
Definition: xAODConfigTool.h:181
TrigConf::xAODConfigTool::hltMenu
virtual const HLTMenu & hltMenu(const EventContext &ctx=Gaudi::Hive::currentContext()) const override
Returns the JSON configured HLTMenu ptree.
Definition: xAODConfigTool.cxx:225
TrigConf::xAODConfigTool::m_hltmonitoringJson
const xAOD::TriggerMenuJsonContainer * m_hltmonitoringJson
Definition: xAODConfigTool.h:194
TrigConf::name
Definition: HLTChainList.h:35
TrigConf::L1PrescalesSet
L1 menu configuration.
Definition: L1PrescalesSet.h:19
BunchGroup.h
TrigConf::xAODConfigTool::m_currentBgJson
const xAOD::TriggerMenuJson * m_currentBgJson
Definition: xAODConfigTool.h:208
ptree
boost::property_tree::ptree ptree
Definition: JsonFileLoader.cxx:16
xAOD::TrigConfKeys_v1
Class describing the configuration used in a given event.
Definition: TrigConfKeys_v1.h:32
TrigConf::xAODConfigTool::l1PrescalesSet
virtual const L1PrescalesSet & l1PrescalesSet(const EventContext &ctx=Gaudi::Hive::currentContext()) const override
Returns the JSON configured L1 prescales ptree.
Definition: xAODConfigTool.cxx:257
TrigConf::xAODConfigTool::m_l1Json
const xAOD::TriggerMenuJsonContainer * m_l1Json
Definition: xAODConfigTool.h:195
TrigConf::DataStructure
Base class for Trigger configuration data and wrapper around underlying representation.
Definition: DataStructure.h:37
TrigConf::xAODConfigTool::sequences
virtual const HLTSequenceList & sequences() const override
Get the HLT sequences.
Definition: xAODConfigTool.cxx:176
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
TrigConf::xAODConfigTool::initialize
virtual StatusCode initialize() override
Function initialising the tool.
Definition: xAODConfigTool.cxx:78
xAODKeysMatch.h
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::xAODConfigTool::Impl
Definition: xAODConfigTool.cxx:25
TrigConf::xAODConfigTool::l1BunchGroupSet
virtual const L1BunchGroupSet & l1BunchGroupSet(const EventContext &ctx=Gaudi::Hive::currentContext()) const override
Returns the JSON configured bunchgroup ptree.
Definition: xAODConfigTool.cxx:265
TrigConf::xAODConfigTool::m_currentHltpsJson
const xAOD::TriggerMenuJson * m_currentHltpsJson
Definition: xAODConfigTool.h:206
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
TrigConf::xAODConfigTool::m_menuJSONContainerAvailable
bool m_menuJSONContainerAvailable
Is decoded R3 format data available?
Definition: xAODConfigTool.h:213
TrigConf::xAODConfigTool::m_currentL1psJson
const xAOD::TriggerMenuJson * m_currentL1psJson
Definition: xAODConfigTool.h:207
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
HLTSequenceList.h
TrigConf::xAODConfigTool::chains
virtual const HLTChainList & chains() const override
Get the HLT chains.
Definition: xAODConfigTool.cxx:165
TrigConf::xAODConfigTool::Impl::m_currentHltps
HLTPrescalesSet m_currentHltps
The JSON decoded current HLT prescales set.
Definition: xAODConfigTool.cxx:44
TrigConf::xAODConfigTool::Impl::m_sequenceList
HLTSequenceList m_sequenceList
The "translated" HLT configuration object.
Definition: xAODConfigTool.cxx:33
TrigConf::xAODConfigTool::m_metaNameJSON_hltps
std::string m_metaNameJSON_hltps
Definition: xAODConfigTool.h:186
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
TrigConf::xAODConfigTool::Impl::m_currentBg
L1BunchGroupSet m_currentBg
The JSON decoded current Bunchgroup configuration.
Definition: xAODConfigTool.cxx:48
TrigConf::DataStructure::clear
virtual void clear()
Clearing the configuration data.
Definition: DataStructure.cxx:65
TrigConf::xAODConfigTool::hltMonitoring
virtual const HLTMonitoring & hltMonitoring(const EventContext &ctx=Gaudi::Hive::currentContext()) const override
Returns the JSON configured HLTMonitoring ptree.
Definition: xAODConfigTool.cxx:233
TrigConf::xAODConfigTool::masterKey
virtual uint32_t masterKey() const override
Get the Super Master Key.
Definition: xAODConfigTool.cxx:187
TrigConf::CTPConfig
Definition: CTPConfig.h:27
TrigConf::xAODConfigTool::hltPrescalesSet
virtual const HLTPrescalesSet & hltPrescalesSet(const EventContext &ctx=Gaudi::Hive::currentContext()) const override
Returns the JSON configured HLT prescales ptree.
Definition: xAODConfigTool.cxx:249
TrigConf::xAODConfigTool::m_menu
const xAOD::TriggerMenu * m_menu
The active configuration for the current event (For Run2 AOD)
Definition: xAODConfigTool.h:201
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::xAODConfigTool::Impl::m_currentHlt
HLTMenu m_currentHlt
The JSON decoded Run3 HLT menu.
Definition: xAODConfigTool.cxx:38
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
TrigConf::xAODConfigTool::m_eventName
std::string m_eventName
Key for the event-level configuration identifier object.
Definition: xAODConfigTool.h:177
TrigConf::xAODConfigTool::m_hltJson
const xAOD::TriggerMenuJsonContainer * m_hltJson
The configuration object of the current input file (for Run3 AOD)
Definition: xAODConfigTool.h:193
TrigConf::xAODConfigTool::m_impl
std::unique_ptr< Impl > m_impl
Definition: xAODConfigTool.h:220
TrigConf::xAODConfigTool::m_triggerMenuContainerAvailable
bool m_triggerMenuContainerAvailable
Is decoded R2 format data available?
Definition: xAODConfigTool.h:211
TrigConf::HLTPrescalesSet
HLT menu configuration.
Definition: HLTPrescalesSet.h:19
TrigConf::xAODConfigTool::Impl::m_currentL1ps
L1PrescalesSet m_currentL1ps
The JSON decoded current L1 prescales set.
Definition: xAODConfigTool.cxx:46
TrigConf::xAODConfigTool::beginEvent_Run2
StatusCode beginEvent_Run2(const xAOD::TrigConfKeys *keys)
Internal call to check / load from a file with Run2 metadata.
Definition: xAODConfigTool.cxx:451
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TrigConf::xAODConfigTool::m_metaNameJSON_l1
std::string m_metaNameJSON_l1
Definition: xAODConfigTool.h:185
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::xAODConfigTool::bunchGroupSetKey
virtual uint32_t bunchGroupSetKey() const override
Get the LVL1 bunch group set key.
Definition: xAODConfigTool.cxx:155
xAOD::BunchConfKey_v1
Class identifying the bunch configuration of a given event.
Definition: BunchConfKey_v1.h:29
TrigConf::HLTSequenceList
list of HLT sequences
Definition: HLTSequenceList.h:40