18#define BOOST_BIND_GLOBAL_PLACEHOLDERS
19#include <boost/property_tree/ptree.hpp>
20#include <boost/property_tree/json_parser.hpp>
111 return StatusCode::SUCCESS;
116 if(
m_impl->m_ctpConfig.menu().size() == 0 ) {
118 throw std::runtime_error(
"Tool not initialised correctly" );
122 return &
m_impl->m_ctpConfig;
127 if(
m_impl->m_bgSet.bunchGroups().size() == 0 ) {
129 throw std::runtime_error(
"Tool not initialised correctly" );
146 throw std::runtime_error(
"Tool not initialised correctly" );
158 return m_impl->m_currentBg.bgsk();
160 ATH_MSG_DEBUG(
"There's no way to access the bunch group set key from a legacy AOD!");
161 return std::numeric_limits<uint32_t>::max();
167 if(
m_impl->m_chainList.size() == 0 ) {
169 throw std::runtime_error(
"Tool not initialised correctly" );
173 return m_impl->m_chainList;
178 if(
m_impl->m_sequenceList.size() == 0 ) {
180 throw std::runtime_error(
"Tool not initialised correctly" );
184 return m_impl->m_sequenceList;
197 throw std::runtime_error(
"Tool not initialised correctly" );
216 throw std::runtime_error(
"Tool not initialised correctly" );
228 throw std::runtime_error(
"Tool not initialised correctly" );
230 return m_impl->m_currentHlt;
236 throw std::runtime_error(
"Tool not initialised correctly" );
238 return m_impl->m_currentHltmonitoring;
244 throw std::runtime_error(
"Tool not initialised correctly" );
246 return m_impl->m_currentL1;
252 throw std::runtime_error(
"Tool not initialised correctly" );
254 return m_impl->m_currentHltps;
260 throw std::runtime_error(
"Tool not initialised correctly" );
262 return m_impl->m_currentL1ps;
268 throw std::runtime_error(
"Tool not initialised correctly" );
270 return m_impl->m_currentBg;
276 ATH_MSG_DEBUG(
"Loading the trigger menu from a new input file" );
331 return StatusCode::SUCCESS;
344 return StatusCode::SUCCESS;
392 return StatusCode::SUCCESS;
397 if(
m_tmc->size() == 0 ) {
403 return StatusCode::SUCCESS;
413 return StatusCode::SUCCESS;
416 ATH_MSG_ERROR(
"Both m_menuJSONContainerAvailable and m_triggerMenuContainerAvailable are false");
417 return StatusCode::FAILURE;
446 ATH_MSG_ERROR(
"Both m_menuJSONContainerAvailable and m_triggerMenuContainerAvailable are false");
447 return StatusCode::FAILURE;
454 return StatusCode::SUCCESS;
460 for( ; menu_itr != menu_end; ++menu_itr ) {
471 return StatusCode::SUCCESS;
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;
484 return StatusCode::FAILURE;
488 bool validConfig =
true;
507 return StatusCode::SUCCESS;
550 return StatusCode::SUCCESS;
555 const uint32_t keyToCheck,
560 for( ; menu_itr != menu_end; ++menu_itr ) {
562 if( keyToCheck != (*menu_itr)->key() )
continue;
563 ptrToSet = *menu_itr;
564 return StatusCode::SUCCESS;
567 ATH_MSG_FATAL(
"Couldn't find configuration for current event"
568 <<
", Requested key=" << keyToCheck
569 <<
", Requested menu=" << humanName);
570 return StatusCode::FAILURE;
584 return StatusCode::SUCCESS;
591 std::stringstream rawData;
592 rawData <<
menu->payload();
593 dataStructure.
clear();
595 boost::property_tree::ptree pt;
596 boost::property_tree::read_json(rawData, pt);
597 dataStructure.
setData(std::move(pt));
598 }
catch (
const boost::property_tree::json_parser_error& e) {
599 ATH_MSG_FATAL(
"Unable to decode a JSON trigger menu metadata payload for " << humanName <<
" with key " <<
menu->key());
601 return StatusCode::FAILURE;
603 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
DataModel_detail::const_iterator< DataVector > const_iterator
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 monitoring configuration.
uint32_t id() const
Get the 32-bit identifier of the bunch configuration.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
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...
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.