5#ifndef TRIGSTEERINGEVENT_HLTResultMT_H
6#define TRIGSTEERINGEVENT_HLTResultMT_H
15#include "GaudiKernel/StatusCode.h"
18#include "eformat/Status.h"
19#include "eformat/StreamTag.h"
22#include <boost/dynamic_bitset.hpp>
24#include <unordered_map>
41 HLTResultMT(std::vector<eformat::helper::StreamTag> streamTags = {},
42 boost::dynamic_bitset<uint32_t> hltPassRawBits = boost::dynamic_bitset<uint32_t>(),
43 boost::dynamic_bitset<uint32_t> hltPrescaledBits = boost::dynamic_bitset<uint32_t>(),
44 std::unordered_map<uint16_t, std::vector<uint32_t> >
data = {});
56 const std::vector<eformat::helper::StreamTag>&
getStreamTags()
const;
66 StatusCode
setStreamTags(
const std::vector<eformat::helper::StreamTag>& streamTags);
73 StatusCode
addStreamTag(
const eformat::helper::StreamTag& streamTag);
94 void setHltBits(
const boost::dynamic_bitset<uint32_t>& passRawBitset,
95 const boost::dynamic_bitset<uint32_t>& prescaledBitset);
104 const std::unordered_map<uint16_t, std::vector<uint32_t> >&
getSerialisedData()
const;
130 const std::vector<uint32_t>&
getStatus()
const;
133 const std::vector<HLT::OnlineErrorCode>
getErrorCodes()
const;
136 void setStatus(std::vector<uint32_t> status);
144 const eformat::helper::Status& firstStatusWord = {
145 eformat::GenericStatus::DATA_CORRUPTION,
146 eformat::FullEventStatus::PSC_PROBLEM
150 const std::vector<uint32_t>&
getRobStatus(uint16_t moduleId)
const;
198 std::unordered_map<uint16_t, std::vector<uint32_t> >
m_data;
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
std::ostream & operator<<(std::ostream &str, const HLT::HLTResultMT &hltResult)
operator<< overload for printing to std::ostream
char data[hepevt_bytes_allocation_ATLAS]
A container class for data required to build online output from HLT.
std::set< uint16_t > m_truncatedModuleIds
List of module IDs with truncation.
std::vector< uint32_t > m_hltBitWords
Vector storing m_hltBits converted to 4-byte words.
StatusCode addSerialisedDataWithCheck(const uint16_t moduleId, std::vector< uint32_t > data)
Add serialised data for a given moduleId.
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.
RODMinorVersion getVersion() const
ROD minor version getter.
const std::set< uint16_t > & getTruncatedModuleIds() const
Getter for the truncation information.
void updateHltBitWords()
Update m_hltBitWords with the contents of m_hltPassRawBits and m_hltPrescaledBits.
const boost::dynamic_bitset< uint32_t > & getHltPassRawBits() const
Const-getter for HLT pass raw bits.
void addErrorCode(const HLT::OnlineErrorCode &errorCode, const eformat::helper::Status &firstStatusWord={ eformat::GenericStatus::DATA_CORRUPTION, eformat::FullEventStatus::PSC_PROBLEM })
Append an error code.
void addTruncatedModuleId(const uint16_t moduleId, bool severeTruncation=true)
Add module ID to the list of truncated results.
boost::dynamic_bitset< uint32_t > m_hltPassRawBits
HLT bits (flagging which chains passed)
const std::vector< eformat::helper::StreamTag > & getStreamTags() const
Const-getter for stream tags.
bool m_severeTruncation
Should the event be sent to the debug stream due to severe truncation?
boost::dynamic_bitset< uint32_t > m_hltPrescaledBits
void addSerialisedData(const uint16_t moduleId, const std::vector< uint32_t > &data)
Append serialised data (copy of input) for a given moduleId, doesn't remove existing data.
bool severeTruncation() const
Truncation in at least one collection that is not allowed to be truncated.
std::pair< uint8_t, uint8_t > RODMinorVersion
Type to store decoded ROD minor version (16-bit version split into two 8-bit numbers)
bool isAccepted() const
If there is at least one stream tag set, it means the event is accepted.
std::unordered_map< uint16_t, std::vector< uint32_t > > m_data
Serialised result (ROBFragment payload) for each moduleId (0 for full result, >0 for data scouting)
const std::unordered_map< uint16_t, std::vector< uint32_t > > & getSerialisedData() const
Serialised data getter.
const boost::dynamic_bitset< uint32_t > & getHltPrescaledBits() const
Const-getter for HLT prescaled bits.
const std::vector< uint32_t > & getStatus() const
Full event status reference getter (1 bit-mask status word + error code words)
StatusCode setStreamTags(const std::vector< eformat::helper::StreamTag > &streamTags)
Replace the stored list of stream tags with the given one.
const std::vector< uint32_t > & getRobStatus(uint16_t moduleId) const
Status words for ROB with given moduleId.
void setVersion(RODMinorVersion version)
ROD minor version setter.
void setHltPrescaledBits(const boost::dynamic_bitset< uint32_t > &bitset)
Replace HLT prescaled bits with the given bitset.
void setHltPassRawBits(const boost::dynamic_bitset< uint32_t > &bitset)
Replace HLT pass raw bits with the given bitset.
std::unordered_map< uint16_t, std::vector< uint32_t > > m_robStatus
ROBFragment status words for each moduleId.
std::vector< eformat::helper::StreamTag > & getStreamTagsNonConst()
Non-const-getter for stream tags needed by the result maker to remove disabled ROBs/SubDets.
StatusCode addStreamTag(const eformat::helper::StreamTag &streamTag)
Append one stream tag to the stored list.
HLTResultMT(std::vector< eformat::helper::StreamTag > streamTags={}, boost::dynamic_bitset< uint32_t > hltPassRawBits=boost::dynamic_bitset< uint32_t >(), boost::dynamic_bitset< uint32_t > hltPrescaledBits=boost::dynamic_bitset< uint32_t >(), std::unordered_map< uint16_t, std::vector< uint32_t > > data={})
Standard constructor.
const std::vector< HLT::OnlineErrorCode > getErrorCodes() const
Error codes getter (by value) - strips off the first bit-mask status word.
std::vector< eformat::helper::StreamTag > m_streamTags
Stream tags of the event.
std::vector< uint32_t > m_status
FullEvent status words (first word is eformat::helper::Status, next words are optional error codes)
void setSerialisedData(std::unordered_map< uint16_t, std::vector< uint32_t > > data)
Replaces serialised data with a copy of the given data.
void setStatus(std::vector< uint32_t > status)
Replace the full status words with the given data.
RODMinorVersion m_version
Stores the ROD minor version of the HLT ROBFragments.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...