7#include "GaudiKernel/IAlgExecStateSvc.h"
12 base_class(
type, name, parent){}
19 return StatusCode::SUCCESS;
30 ATH_MSG_DEBUG(
"Chain " << ch.name() <<
" will flip " << ch.counter() <<
" bit" );
39 struct { std::string chain; uint32_t bit; } conf { chainAndBit.first, chainAndBit.second };
40 ATH_MSG_DEBUG(
"Extra Chain " << conf.chain <<
" will flip " << conf.bit <<
" bit" );
46 return StatusCode::SUCCESS;
52 ATH_MSG_ERROR(
"Inconsistent hashes found for chain:" << chain <<
", from Python:" << hash
54 return StatusCode::FAILURE;
56 return StatusCode::SUCCESS;
60 const auto checkIt = std::find_if(
62 [&](
const std::pair<TrigCompositeUtils::DecisionID, uint32_t>& m) { return m.second == bit; }
66 <<
" and " << chain <<
" are both configured with ChainCounter:" << bit);
67 return StatusCode::FAILURE;
70 ATH_MSG_ERROR(
"Trying to register an empty string as a Chain." );
71 return StatusCode::FAILURE;
73 return StatusCode::SUCCESS;
77 boost::dynamic_bitset<uint32_t>& prescaled,
78 const EventContext& ctx)
const
86 if (!chainsHandle.isValid()) {
87 SmartIF<IAlgExecStateSvc> aess = svcLoc()->service<IAlgExecStateSvc>(
"AlgExecStateSvc",
false);
88 if (aess.isValid() && aess->eventStatus(ctx) != EventStatus::Success) {
90 return StatusCode::SUCCESS;
93 return StatusCode::FAILURE;
99 const Decision* HLTPassRaw =
nullptr;
100 const Decision* HLTPrescaled =
nullptr;
106 for (
const Decision* decisionObject : *chainsHandle) {
109 HLTPassRaw = decisionObject;
111 HLTPrescaled = decisionObject;
113 if (HLTPassRaw !=
nullptr && HLTPrescaled !=
nullptr) {
132 return StatusCode::SUCCESS;
139 boost::dynamic_bitset<uint32_t> passRaw;
140 boost::dynamic_bitset<uint32_t> prescaled;
146 if ( msgLvl( MSG::DEBUG ) ) {
147 const boost::dynamic_bitset<uint32_t>& passRawBits = resultToFill.
getHltPassRawBits();
148 std::vector<uint32_t> bitsTemp(passRawBits.num_blocks());
149 boost::to_block_range(passRawBits, bitsTemp.begin());
150 ATH_MSG_VERBOSE(
"HLT result now has " << bitsTemp.size() <<
" words with HLT pass raw bits:");
151 for (
const auto& w : bitsTemp)
ATH_MSG_VERBOSE(
"0x" << MSG::hex << w << MSG::dec);
154 boost::to_block_range(prescaleBits, bitsTemp.begin());
155 ATH_MSG_VERBOSE(
"HLT result now has " << bitsTemp.size() <<
" words with HLT prescale bits:");
156 for (
const auto& w : bitsTemp)
ATH_MSG_VERBOSE(
"0x" << MSG::hex << w << MSG::dec);
159 ATH_MSG_DEBUG(
"HLT result now has " << words.size() <<
" words with the final trigger bits:");
160 for (
const uint32_t w : words)
ATH_MSG_DEBUG(
"0x" << MSG::hex << w << MSG::dec);
163 return StatusCode::SUCCESS;
168 boost::dynamic_bitset<uint32_t>& resultToFill)
const
172 return StatusCode::SUCCESS;
175 auto mappingIter =
m_mapping.find( chain );
179 return StatusCode::FAILURE;
181 const int chainBitPosition = mappingIter->second;
183 if (resultToFill.test(chainBitPosition)) {
186 resultToFill.set(chainBitPosition);
187 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
xAOD::TrigComposite Decision
std::set< DecisionID > DecisionIDContainer
void decisionIDs(const Decision *d, DecisionIDContainer &id)
Extracts DecisionIDs stored in the Decision object.
A container class for data required to build online output from HLT.
void setHltBits(const boost::dynamic_bitset< uint32_t > &passRawBitset, const boost::dynamic_bitset< uint32_t > &prescaledBitset)
Replace both HLT pass raw and prescaled bits with the given bitsets.
const std::vector< uint32_t > & getHltBitsAsWords() const
Const-getter for HLT bits as uint32_t array. Ordering: PassRaw, Prescaled.
const boost::dynamic_bitset< uint32_t > & getHltPassRawBits() const
Const-getter for HLT pass raw bits.
const boost::dynamic_bitset< uint32_t > & getHltPrescaledBits() const
Const-getter for HLT prescaled bits.
TrigCompositeUtils::DecisionID numeric() const
numeric ID
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
const std::string & summaryPrescaledNodeName()
const std::string & summaryPassNodeName()
bool isLegId(const HLT::Identifier &legIdentifier)
Recognise whether the chain ID is a leg ID.