ATLAS Offline Software
Loading...
Searching...
No Matches
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// Gaudi include(s):
9#ifndef XAOD_STANDALONE
10# include "GaudiKernel/IIncidentSvc.h"
11# include "GaudiKernel/ServiceHandle.h"
12#endif // not XAOD_STANDALONE
13
14// Trigger include(s):
17
18// Local include(s):
22
23// Boost includes
24#define BOOST_BIND_GLOBAL_PLACEHOLDERS // Needed to silence Boost pragma message
25#include <boost/property_tree/ptree.hpp>
26#include <boost/property_tree/json_parser.hpp>
27
28namespace TrigConf {
29
56
59 m_tmc( nullptr ),
60 m_hltJson( nullptr), m_hltmonitoringJson(nullptr), m_l1Json( nullptr ),
61 m_hltpsJson( nullptr ), m_l1psJson( nullptr ), m_bgJson( nullptr ),
62 m_menu( nullptr ),
63 m_currentHltJson( nullptr ), m_currentHltmonitoringJson( nullptr ), m_currentL1Json( nullptr ),
64 m_currentHltpsJson( nullptr ), m_currentL1psJson( nullptr ), m_currentBgJson( nullptr ),
67 m_impl (std::make_unique<Impl>()) {
68
69 declareProperty( "EventObjectName", m_eventName = "TrigConfKeys" );
70 declareProperty( "BGKeysObjectName", m_bgkeysName = "BunchConfKey" );
71 declareProperty( "MetaObjectName", m_metaName_run2 = "TriggerMenu" );
72
73 declareProperty( "JSONMetaObjectNameHLT", m_metaNameJSON_hlt = "TriggerMenuJson_HLT" );
74 declareProperty( "JSONMetaObjectNameHLTMonitoring", m_metaNameJSON_hltmonitoring = "TriggerMenuJson_HLTMonitoring" );
75 declareProperty( "JSONMetaObjectNameL1", m_metaNameJSON_l1 = "TriggerMenuJson_L1" );
76 declareProperty( "JSONMetaObjectNameHLTPS", m_metaNameJSON_hltps = "TriggerMenuJson_HLTPS" );
77 declareProperty( "JSONMetaObjectNameL1PS", m_metaNameJSON_l1ps = "TriggerMenuJson_L1PS" );
78 declareProperty( "JSONMetaObjectNameBunchgroup", m_metaNameJSON_bg = "TriggerMenuJson_BG" );
79 }
80
81 // Defined here rather than in the header because it requires the knowledge of Impl defined above
83
85
86 // Greet the user:
87 ATH_MSG_INFO( "Initialising..." );
88 ATH_MSG_DEBUG( "EventObjectName = " << m_eventName );
89 ATH_MSG_DEBUG( "-- Run 2 AOD Configuration Settings");
90 ATH_MSG_DEBUG( "MetaObjectName = " << m_metaName_run2 );
91 ATH_MSG_DEBUG( "-- Run 3 AOD Configuration Settings");
92 ATH_MSG_DEBUG( "JSONMetaObjectNameHLT = " << m_metaNameJSON_hlt );
93 ATH_MSG_DEBUG( "JSONMetaObjectNameHLTMonitoring = " << m_metaNameJSON_hltmonitoring );
94 ATH_MSG_DEBUG( "JSONMetaObjectNameL1 = " << m_metaNameJSON_l1 );
95 ATH_MSG_DEBUG( "JSONMetaObjectNameHLTPS = " << m_metaNameJSON_hltps );
96 ATH_MSG_DEBUG( "JSONMetaObjectNameL1PS = " << m_metaNameJSON_l1ps );
97 ATH_MSG_DEBUG( "JSONMetaObjectNameBunchgroup = " << m_metaNameJSON_bg );
98
99 // Reset the pointers:
100 m_tmc = nullptr;
101 m_menu = nullptr;
102 //
103 m_hltJson = nullptr;
104 m_hltmonitoringJson = nullptr;
105 m_l1Json = nullptr;
106 m_hltpsJson = nullptr;
107 m_l1psJson = nullptr;
108 m_bgJson = nullptr;
109 m_currentHltJson = nullptr;
111 m_currentL1Json = nullptr;
112 m_currentHltpsJson = nullptr;
113 m_currentL1psJson = nullptr;
114 m_currentBgJson = nullptr;
115
116#ifndef XAOD_STANDALONE
117 // AsgMetadataTool only subscribes to BeginEvent in Athena, so input-file
118 // incidents never reach this tool. Priority 0: after MetaDataSvc has loaded
119 // the new file's metadata, before TrigDecisionTool's -1.
120 ServiceHandle< IIncidentSvc > incSvc( "IncidentSvc", name() );
121 ATH_CHECK( incSvc.retrieve() );
122 incSvc->addListener( this, IncidentType::BeginInputFile, 0, true );
123 incSvc->addListener( this, IncidentType::EndInputFile, 0, true );
124#endif // not XAOD_STANDALONE
125
126 // Return gracefully:
127 return StatusCode::SUCCESS;
128 }
129
131 // Check if the object is well prepared:
132 if( m_impl->m_ctpConfig.menu().size() == 0 ) {
133 ATH_MSG_FATAL( "Trigger menu not loaded" );
134 throw std::runtime_error( "Tool not initialised correctly" );
135 }
136
137 // Return the pointer:
138 return &m_impl->m_ctpConfig;
139 }
140
142 // Check if the object is well prepared:
143 if( m_impl->m_bgSet.bunchGroups().size() == 0 ) {
144 ATH_MSG_FATAL( "Trigger menu not loaded" );
145 throw std::runtime_error( "Tool not initialised correctly" );
146 }
147
148 // Return the pointer:
149 return &m_impl->m_bgSet;
150 }
151
154
155 if( ! m_currentL1psJson ) {
156 ATH_MSG_FATAL( "Trigger configuration not loaded for the current event" );
157 throw std::runtime_error( "Tool not initialised correctly" );
158 }
159 return m_currentL1psJson->key();
160
161 } else {
162
163 // Check if the object is well prepared:
164 if( ! m_menu ) {
165 ATH_MSG_FATAL( "Trigger menu not loaded" );
166 throw std::runtime_error( "Tool not initialised correctly" );
167 }
168
169 // Return the key from the metadata object:
170 return m_menu->l1psk();
171
172 }
173 }
174
176 {
178 return m_impl->m_currentBg.bgsk();
179 else {
180 ATH_MSG_DEBUG("There's no way to access the bunch group set key from a legacy AOD!");
181 return std::numeric_limits<uint32_t>::max();
182 }
183 }
184
186 // Check if the object is well prepared:
187 if( m_impl->m_chainList.size() == 0 ) {
188 ATH_MSG_FATAL( "Trigger menu not loaded" );
189 throw std::runtime_error( "Tool not initialised correctly" );
190 }
191
192 // Return the object:
193 return m_impl->m_chainList;
194 }
195
197 // Check if the object is well prepared:
198 if( m_impl->m_sequenceList.size() == 0 ) {
199 ATH_MSG_FATAL( "Trigger menu not loaded" );
200 throw std::runtime_error( "Tool not initialised correctly" );
201 }
202
203 // Return the object:
204 return m_impl->m_sequenceList;
205 }
206
207 uint32_t xAODConfigTool::masterKey() const {
209
210 if( ! m_currentHltJson ) {
211 ATH_MSG_FATAL( "Trigger configuration not loaded for the current event" );
212 throw std::runtime_error( "Tool not initialised correctly" );
213 }
214 return m_currentHltJson->key();
215
216 } else {
217
218 // Check if the object is well prepared:
219 if( ! m_menu ) {
220 ATH_MSG_FATAL( "Trigger menu not loaded" );
221 throw std::runtime_error( "Tool not initialised correctly" );
222 }
223
224 // Return the key from the metadata object:
225 return m_menu->smk();
226
227 }
228 }
229
232
233 if( ! m_currentHltpsJson ) {
234 ATH_MSG_FATAL( "Trigger configuration not loaded for the current event" );
235 throw std::runtime_error( "Tool not initialised correctly" );
236 }
237 return m_currentHltpsJson->key();
238
239 } else {
240
241 // Check if the object is well prepared:
242 if( ! m_menu ) {
243 ATH_MSG_FATAL( "Trigger menu not loaded" );
244 throw std::runtime_error( "Tool not initialised correctly" );
245 }
246
247 // Return the key from the metadata object:
248 return m_menu->hltpsk();
249
250 }
251 }
252
253 const HLTMenu& xAODConfigTool::hltMenu(const EventContext&) const {
255 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
256 throw std::runtime_error( "Tool not initialised correctly" );
257 }
258 return m_impl->m_currentHlt;
259 }
260
261 const HLTMonitoring& xAODConfigTool::hltMonitoring(const EventContext&) const {
263 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
264 throw std::runtime_error( "Tool not initialised correctly" );
265 }
266 return m_impl->m_currentHltmonitoring;
267 }
268
269 const L1Menu& xAODConfigTool::l1Menu(const EventContext&) const {
271 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
272 throw std::runtime_error( "Tool not initialised correctly" );
273 }
274 return m_impl->m_currentL1;
275 }
276
277 const HLTPrescalesSet& xAODConfigTool::hltPrescalesSet(const EventContext&) const {
279 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
280 throw std::runtime_error( "Tool not initialised correctly" );
281 }
282 return m_impl->m_currentHltps;
283 }
284
285 const L1PrescalesSet& xAODConfigTool::l1PrescalesSet(const EventContext&) const {
287 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
288 throw std::runtime_error( "Tool not initialised correctly" );
289 }
290 return m_impl->m_currentL1ps;
291 }
292
293 const L1BunchGroupSet& xAODConfigTool::l1BunchGroupSet(const EventContext&) const {
295 ATH_MSG_FATAL( "Run 3 format Trigger menu not loaded" );
296 throw std::runtime_error( "Tool not initialised correctly" );
297 }
298 return m_impl->m_currentBg;
299 }
300
302
303 // Tell the user what's happening:
304 ATH_MSG_DEBUG( "Loading the trigger menu from a new input file" );
305
306 // Try to read the R2 metadata object:
307 m_tmc = nullptr;
310 or inputMetaStore()->retrieve( m_tmc, m_metaName_run2 ).isFailure() )
311 {
313 }
314
315 // Try to read the R3 metadata object:
316 m_hltJson = nullptr;
317 m_hltmonitoringJson = nullptr;
318 m_l1Json = nullptr;
319 m_hltpsJson = nullptr;
320 m_l1psJson = nullptr;
321 m_bgJson = nullptr;
324 or inputMetaStore()->retrieve( m_hltJson, m_metaNameJSON_hlt ).isFailure() )
325 {
327 }
330 {
331 // m_menuJSONContainerAvailable = false;
332 // Currently planning on only storing these data in MC. Hence this has to be an optional input.
333 }
335 or inputMetaStore()->retrieve( m_l1Json, m_metaNameJSON_l1 ).isFailure() )
336 {
338 }
340 or inputMetaStore()->retrieve( m_hltpsJson, m_metaNameJSON_hltps ).isFailure() )
341 {
343 }
345 or inputMetaStore()->retrieve( m_l1psJson, m_metaNameJSON_l1ps ).isFailure() )
346 {
348 }
350 or inputMetaStore()->retrieve( m_bgJson, m_metaNameJSON_bg ).isFailure() ) {
351 // m_menuJSONContainerAvailable = false;
352 // This was not written up to the end of 2021, we have to make it optional for at least a while
353 }
354
355
357 ATH_MSG_WARNING( "No trigger configurations are available on "
358 "the input" );
359 return StatusCode::SUCCESS;
360 }
361
362 // Prefer run three format, if available
364
365 // A little sanity check:
366 if( m_hltJson->size() == 0 ) {
367 // This can happen when we encounter empty input files. In which
368 // case we should not bail, but continue, and only bail if by the
369 // start of an event, we still don't see any configurations.
370 ATH_MSG_WARNING( "No trigger configurations are available on "
371 "the input" );
372 return StatusCode::SUCCESS;
373 }
374
375 // Load the first elements by default
376 ATH_CHECK( m_hltJson->size() > 0 );
377 //ATH_CHECK( m_hltmonitoringJson->size() > 0 ); // Optional - re-enable this check in the future when all used AODs contains this
378 ATH_CHECK( m_l1Json->size() > 0 );
379 ATH_CHECK( m_hltpsJson->size() > 0 );
380 ATH_CHECK( m_l1psJson->size() > 0 );
381 if (m_bgJson) { // Considered optional for now
382 ATH_CHECK( m_bgJson->size() > 0 );
383 }
384
385 m_currentHltJson = m_hltJson->at( 0 );
386 if (m_hltmonitoringJson && m_hltmonitoringJson->size()) { // Optional
388 }
389 m_currentL1Json = m_l1Json->at( 0 );
391 m_currentL1psJson = m_l1psJson->at( 0 );
392 if (m_bgJson) { // Considered optional for now
393 m_currentBgJson = m_bgJson->at( 0 );
394 }
395
397
398 // Loading the payload doesn't additionally let the object know about its own key. We can load this in now too.
399 m_impl->m_currentHlt.setSMK( m_currentHltJson->key() );
400 if (m_currentHltmonitoringJson) { // Optional
401 m_impl->m_currentHltmonitoring.setSMK( m_currentHltmonitoringJson->key() );
402 }
403 m_impl->m_currentL1.setSMK( m_currentL1Json->key() );
404 m_impl->m_currentHltps.setPSK( m_currentHltpsJson->key() );
405 m_impl->m_currentL1ps.setPSK( m_currentL1psJson->key() );
406 if (m_bgJson) { // Optional (for now)
407 m_impl->m_currentBg.setBGSK( m_currentBgJson->key() );
408 }
409
410 ATH_CHECK( prepareTriggerMenu( m_impl->m_currentHlt,
411 m_impl->m_currentL1,
412 m_impl->m_currentHltps,
413 m_impl->m_currentL1ps,
414 m_impl->m_currentBg,
415 m_impl->m_ctpConfig,
416 m_impl->m_chainList,
417 m_impl->m_sequenceList,
418 m_impl->m_bgSet, msg() ) );
419
420 return StatusCode::SUCCESS;
421
423
424 // A little sanity check:
425 if( m_tmc->size() == 0 ) {
426 // This can happen when we encounter empty input files. In which
427 // case we should not bail, but continue, and only bail if by the
428 // start of an event, we still don't see any configurations.
429 ATH_MSG_WARNING( "No trigger configurations are available on "
430 "the input" );
431 return StatusCode::SUCCESS;
432 }
433
434 m_menu = m_tmc->at( 0 );
435 // Cache the menu's configuration:
437 m_impl->m_chainList,
438 m_impl->m_sequenceList,
439 m_impl->m_bgSet, msg() ) );
440
441 return StatusCode::SUCCESS;
442 }
443
444 ATH_MSG_ERROR( "Both m_menuJSONContainerAvailable and m_triggerMenuContainerAvailable are false");
445 return StatusCode::FAILURE; // Should never get here as checked that one or the other is true above
446 }
447
449#ifndef XAOD_STANDALONE
450 ATH_MSG_DEBUG( "Input file closed, invalidating the cached trigger configuration" );
451 m_tmc = nullptr;
452 m_menu = nullptr;
453 m_hltJson = nullptr;
454 m_hltmonitoringJson = nullptr;
455 m_l1Json = nullptr;
456 m_hltpsJson = nullptr;
457 m_l1psJson = nullptr;
458 m_bgJson = nullptr;
459 m_currentHltJson = nullptr;
461 m_currentL1Json = nullptr;
462 m_currentHltpsJson = nullptr;
463 m_currentL1psJson = nullptr;
464 m_currentBgJson = nullptr;
465#endif // not XAOD_STANDALONE
466 return StatusCode::SUCCESS;
467 }
468
470
471 // It may be that the input file opening event is missed in standalone
472 // mode at the very beginning of the application. (Depending on the
473 // creation order of the objects.) So make sure that we have the
474 // configuration objects at hand...
477 }
478
479 // Read the current event's trigger keys:
480 const xAOD::TrigConfKeys* keys = nullptr;
481 ATH_CHECK( evtStore()->retrieve( keys, m_eventName ) );
482
483 const xAOD::BunchConfKey* bgKey = nullptr; // The BG key is currently optional, only files written from late 2021 will contain this
485 ATH_CHECK(evtStore()->retrieve(bgKey, m_bgkeysName));
486 }
487
488 // Prefer Run 3 data if available
490 return beginEvent_Run3(keys, bgKey);
492 return beginEvent_Run2(keys);
493 }
494
495 ATH_MSG_ERROR( "Both m_menuJSONContainerAvailable and m_triggerMenuContainerAvailable are false");
496 return StatusCode::FAILURE;
497
498 }
499
501 // Check if we have the correct menu already:
502 if( m_menu && xAODKeysMatch( keys, m_menu ) ) {
503 return StatusCode::SUCCESS;
504 }
505
506 if( !m_tmc ) {
507 ATH_MSG_ERROR( "Trigger menu metadata not loaded for the current input file" );
508 return StatusCode::FAILURE;
509 }
510
511 // If not, let's look for the correct configuration:
514 for( ; menu_itr != menu_end; ++menu_itr ) {
515 // Check if this is the menu we're looking for:
516 if( ! xAODKeysMatch( keys, *menu_itr ) ) continue;
517 // Remember it's pointer:
518 m_menu = *menu_itr;
519 // Cache the menu's configuration:
521 m_impl->m_chainList,
522 m_impl->m_sequenceList,
523 m_impl->m_bgSet, msg() ) );
524 // We're done:
525 return StatusCode::SUCCESS;
526 }
527
528 // Apparently we didn't find the correct menu!
529 ATH_MSG_ERROR( "Couldn't find configuration for current event (SMK:"
530 << keys->smk() << ", L1PSK:" << keys->l1psk()
531 << ", HLTPSK:" << keys->hltpsk() << ")" );
532 return StatusCode::FAILURE;
533 }
534
536 if (keys==nullptr) {
537 ATH_MSG_ERROR("nullptr TrigConfKeys");
538 return StatusCode::FAILURE;
539 }
540
541 // Cached pointers are null right after initialize() or endInputFile(): not valid.
542 bool validConfig = true;
544 validConfig = false;
545 } else {
546 if (m_currentHltJson->key() != keys->smk()) {
547 validConfig = false;
548 }
549 // m_currentHltminitoringJson is checked by the m_currentHltJson check
550 if (m_currentL1Json->key() != keys->smk()) {
551 validConfig = false;
552 }
553 if (m_currentHltpsJson->key() != keys->hltpsk()) {
554 validConfig = false;
555 }
556 if (m_currentL1psJson->key() != keys->l1psk()) {
557 validConfig = false;
558 }
559 if (m_bgJson && m_currentBgJson && bgKey && m_currentBgJson->key() != static_cast<unsigned int>(bgKey->id())) {
560 validConfig = false;
561 }
562 }
563
564 if (validConfig) {
565 return StatusCode::SUCCESS;
566 }
567
568 // Re-retrieved in beginInputFile(); still missing here means this file's metadata never loaded.
569 if( !m_hltJson || !m_l1Json || !m_hltpsJson || !m_l1psJson ) {
570 ATH_MSG_ERROR( "Trigger menu metadata not loaded for the current input file" );
571 return StatusCode::FAILURE;
572 }
573
574 // If not, load correct JSON menus from their respective containers, matching against the event's keys ...
575 ATH_CHECK( loadJsonByKey("HLT Menu", m_hltJson, keys->smk(), m_currentHltJson) );
577 ATH_CHECK( loadJsonByKey("HLT Monitoring", m_hltmonitoringJson, keys->smk(), m_currentHltmonitoringJson) );
578 }
579 ATH_CHECK( loadJsonByKey("L1 Menu", m_l1Json, keys->smk(), m_currentL1Json) );
580 ATH_CHECK( loadJsonByKey("HLT Prescales", m_hltpsJson, keys->hltpsk(), m_currentHltpsJson) );
581 ATH_CHECK( loadJsonByKey("L1 Prescales", m_l1psJson, keys->l1psk(), m_currentL1psJson) );
582 if (m_bgJson && bgKey) {
583 ATH_CHECK( loadJsonByKey("Bunchgroups", m_bgJson, bgKey->id(), m_currentBgJson) );
584 }
585
586 // ... and from these serialised JSON strings, populate the ptree data structures...
587 ATH_CHECK( loadPtrees() );
588
589 // ... and set the keys of the objects in the objects (not part of the JSON pyaload) ...
590 m_impl->m_currentHlt.setSMK( m_currentHltJson->key() );
592 m_impl->m_currentHltmonitoring.setSMK( m_currentHltmonitoringJson->key() );
593 }
594 m_impl->m_currentL1.setSMK( m_currentL1Json->key() );
595 m_impl->m_currentHltps.setPSK( m_currentHltpsJson->key() );
596 m_impl->m_currentL1ps.setPSK( m_currentL1psJson->key() );
597 if (m_bgJson && bgKey) {
598 m_impl->m_currentBg.setBGSK( m_currentBgJson->key() );
599 }
600
601 // R3 interfaces now active
602
603 // ... and finally populate the legacy interface from the ptree data
604 ATH_CHECK( prepareTriggerMenu( m_impl->m_currentHlt,
605 m_impl->m_currentL1,
606 m_impl->m_currentHltps,
607 m_impl->m_currentL1ps,
608 m_impl->m_currentBg,
609 m_impl->m_ctpConfig,
610 m_impl->m_chainList,
611 m_impl->m_sequenceList,
612 m_impl->m_bgSet, msg() ) ); // R2 interfaces now active
613
614 return StatusCode::SUCCESS;
615 }
616
617 StatusCode xAODConfigTool::loadJsonByKey(const std::string& humanName,
618 const xAOD::TriggerMenuJsonContainer* metaContainer,
619 const uint32_t keyToCheck,
620 const xAOD::TriggerMenuJson*& ptrToSet)
621 {
622 xAOD::TriggerMenuJsonContainer::const_iterator menu_itr = metaContainer->begin();
623 xAOD::TriggerMenuJsonContainer::const_iterator menu_end = metaContainer->end();
624 for( ; menu_itr != menu_end; ++menu_itr ) {
625 // Check if this is the menu we're looking for:
626 if( keyToCheck != (*menu_itr)->key() ) continue;
627 ptrToSet = *menu_itr;
628 return StatusCode::SUCCESS;
629 }
630
631 ATH_MSG_FATAL("Couldn't find configuration for current event"
632 << ", Requested key=" << keyToCheck
633 << ", Requested menu=" << humanName);
634 return StatusCode::FAILURE;
635 }
636
638 ATH_CHECK( loadPtree("HLT Menu", m_currentHltJson, m_impl->m_currentHlt) );
640 ATH_CHECK( loadPtree("HLT Monitoring", m_currentHltmonitoringJson, m_impl->m_currentHltmonitoring) );
641 }
642 ATH_CHECK( loadPtree("L1 Menu", m_currentL1Json, m_impl->m_currentL1) );
643 ATH_CHECK( loadPtree("HLT Prescales", m_currentHltpsJson, m_impl->m_currentHltps) );
644 ATH_CHECK( loadPtree("L1 Prescales", m_currentL1psJson, m_impl->m_currentL1ps) );
645 if (m_bgJson) {
646 ATH_CHECK( loadPtree("Bunchgroups", m_currentBgJson, m_impl->m_currentBg) );
647 }
648 return StatusCode::SUCCESS;
649 }
650
651 StatusCode xAODConfigTool::loadPtree(const std::string& humanName,
653 DataStructure& dataStructure)
654 {
655 std::stringstream rawData;
656 rawData << menu->payload();
657 dataStructure.clear();
658 try {
659 boost::property_tree::ptree pt;
660 boost::property_tree::read_json(rawData, pt);
661 dataStructure.setData(std::move(pt));
662 } catch (const boost::property_tree::json_parser_error& e) {
663 ATH_MSG_FATAL("Unable to decode a JSON trigger menu metadata payload for " << humanName << " with key " << menu->key());
664 ATH_MSG_FATAL(e.what());
665 return StatusCode::FAILURE;
666 }
667 return StatusCode::SUCCESS;
668 }
669
670} // namespace TrigConf
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Base class for Trigger configuration data and wrapper around underlying representation.
void setData(const ptree &data)
Setting the configuration data.
virtual void clear()
Clearing the configuration data.
list of all HLT chains in a trigger menu
HLT menu configuration.
Definition HLTMenu.h:21
HLT monitoring configuration.
HLT menu configuration.
list of HLT sequences
L1 board configuration.
L1 menu configuration.
Definition L1Menu.h:29
L1 menu configuration.
StatusCode beginEvent_Run2(const xAOD::TrigConfKeys *keys)
Internal call to check / load from a file with Run2 metadata.
const xAOD::TriggerMenuJson * m_currentHltmonitoringJson
virtual const BunchGroupSet * bunchGroupSet() const override
Get the LVL1 bunch group set.
std::string m_metaNameJSON_hlt
Key for the trigger configuration metadata objects (Run 3).
const xAOD::TriggerMenuContainer * m_tmc
The configuration object of the current input file (for Run2 AOD).
bool m_triggerMenuContainerAvailable
Is decoded R2 format data available?
StatusCode loadJsonByKey(const std::string &humanName, const xAOD::TriggerMenuJsonContainer *metaContainer, const uint32_t keyToCheck, const xAOD::TriggerMenuJson *&ptrToSet)
Locates a Run3 TriggerMenuJson object inside a container by key. Loads it into the m_currentXXXJson p...
StatusCode loadPtree(const std::string &humanName, const xAOD::TriggerMenuJson *menu, DataStructure &dataStructure)
Load single m_currentXXXJson serialised JSON data into ptree.
virtual uint32_t lvl1PrescaleKey() const override
Get the LVL1 prescale key.
virtual uint32_t masterKey() const override
Get the Super Master Key.
const xAOD::TriggerMenuJson * m_currentL1Json
virtual const L1BunchGroupSet & l1BunchGroupSet(const EventContext &ctx) const override
Returns the JSON configured bunchgroup ptree.
virtual const HLTSequenceList & sequences() const override
Get the HLT sequences.
bool m_menuJSONContainerAvailable
Is decoded R3 format data available?
const xAOD::TriggerMenuJson * m_currentHltpsJson
const xAOD::TriggerMenuJson * m_currentL1psJson
virtual ~xAODConfigTool() override
Out-of-line dtor so that we don't need to define Impl in the header.
const xAOD::TriggerMenuJson * m_currentHltJson
The active configuration for the current event (For Run3 AOD).
virtual uint32_t bunchGroupSetKey() const override
Get the LVL1 bunch group set key.
virtual const L1Menu & l1Menu(const EventContext &ctx) const override
Returns the JSON configured L1 ptree.
StatusCode loadPtrees()
Load all m_currentXXXJson serialised JSON data into ptrees inside m_impl.
std::string m_metaName_run2
Key for the trigger configuration metadata object (Run 2).
virtual const CTPConfig * ctpConfig() const override
Get the LVL1 trigger menu.
virtual const L1PrescalesSet & l1PrescalesSet(const EventContext &ctx) const override
Returns the JSON configured L1 prescales ptree.
const xAOD::TriggerMenu * m_menu
The active configuration for the current event (For Run2 AOD).
const xAOD::TriggerMenuJsonContainer * m_l1Json
std::string m_bgkeysName
Key for the event-level bunchgroup identification object, in the codebase since R2 but only being use...
const xAOD::TriggerMenuJsonContainer * m_hltmonitoringJson
virtual StatusCode beginInputFile() override
Function called when a new input file is opened.
virtual StatusCode endInputFile() override
Invalidate the cached menu objects when the current input file is closed.
virtual const HLTMonitoring & hltMonitoring(const EventContext &ctx) const override
Returns the JSON configured HLTMonitoring ptree.
virtual StatusCode initialize() override
Function initialising the tool.
virtual const HLTPrescalesSet & hltPrescalesSet(const EventContext &ctx) const override
Returns the JSON configured HLT prescales ptree.
virtual const HLTMenu & hltMenu(const EventContext &ctx) const override
Returns the JSON configured HLTMenu ptree.
const xAOD::TriggerMenuJsonContainer * m_bgJson
virtual uint32_t hltPrescaleKey() const override
Get the HLT prescale key.
std::string m_eventName
Key for the event-level configuration identifier object.
virtual StatusCode beginEvent() override
Function called when a new event is loaded.
std::unique_ptr< Impl > m_impl
virtual const HLTChainList & chains() const override
Get the HLT chains.
xAODConfigTool(const std::string &name="TrigConf::xAODConfigTool")
Create a proper constructor for Athena.
const xAOD::TriggerMenuJsonContainer * m_hltpsJson
const xAOD::TriggerMenuJsonContainer * m_hltJson
The configuration object of the current input file (for Run3 AOD).
const xAOD::TriggerMenuJson * m_currentBgJson
StatusCode beginEvent_Run3(const xAOD::TrigConfKeys *keys, const xAOD::BunchConfKey *bgKey)
Internal call to check / load from a file with Run3 metadata.
const xAOD::TriggerMenuJsonContainer * m_l1psJson
std::string m_metaNameJSON_hltmonitoring
AsgMetadataTool(const std::string &name)
Normal ASG tool constructor with a name.
MetaStorePtr_t inputMetaStore() const
Accessor for the input metadata store.
make the sidebar many part of the config
Definition hcg.cxx:554
uint32_t id() const
Get the 32-bit identifier of the bunch configuration.
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:116
Forward iterator to traverse the main components of the trigger configuration.
StatusCode prepareTriggerMenu(const xAOD::TriggerMenu *menu, CTPConfig &ctpConfig, HLTChainList &chainList, HLTSequenceList &sequenceList, BunchGroupSet &bgSet, MsgStream &msg)
In order to avoid duplicating code between how the dual-use and the Athena-only code translates the x...
bool xAODKeysMatch(const xAOD::TrigConfKeys *keys, const xAOD::TriggerMenu *menu)
Since this is used in a couple of places, it seemed to make sense to put this simple code into a cent...
STL namespace.
TriggerMenuJson_v1 TriggerMenuJson
Define the latest version of the trigger menu JSON class.
BunchConfKey_v1 BunchConfKey
Declare the current version of the bunch configuration key type.
TriggerMenuJsonContainer_v1 TriggerMenuJsonContainer
TrigConfKeys_v1 TrigConfKeys
Declare the current version of the trigger configuration keys type.
HLTMenu m_currentHlt
The JSON decoded Run3 HLT menu.
CTPConfig m_ctpConfig
Note: The run 3 JSON derives objects below are used to additionally populate these objects for interf...
HLTMonitoring m_currentHltmonitoring
The JSON decoded Run3 HLT monitoring.
HLTChainList m_chainList
The "translated" HLT configuration object.
L1Menu m_currentL1
The JSON decoded Run3 L1 menu.
HLTSequenceList m_sequenceList
The "translated" HLT configuration object.
L1BunchGroupSet m_currentBg
The JSON decoded current Bunchgroup configuration.
L1PrescalesSet m_currentL1ps
The JSON decoded current L1 prescales set.
HLTPrescalesSet m_currentHltps
The JSON decoded current HLT prescales set.
BunchGroupSet m_bgSet
The "translated" bunch group set object.
MsgStream & msg
Definition testRead.cxx:32