Skip to content
Snippets Groups Projects
Commit 9c14c246 authored by Rafal Bielski's avatar Rafal Bielski :wave:
Browse files

move back HLTResultMT to TrigSteeringEvent

also moving it back to the HLT namespace
parent 097df635
No related branches found
No related tags found
No related merge requests found
Showing
with 125 additions and 121 deletions
......@@ -37,7 +37,6 @@
class CondAttrListCollection;
class EventContext;
class EventInfo;
class HLTResultMT;
class HLTResultMTMaker;
class IAlgExecStateSvc;
class IAlgorithm;
......@@ -53,6 +52,9 @@ class TrigCOOLUpdateHelper;
namespace coral {
class AttributeList;
}
namespace HLT {
class HLTResultMT;
}
/** @class HltEventLoopMgr
* @brief AthenaMT event loop manager for running HLT online
......@@ -231,7 +233,7 @@ private:
/// StoreGate key for reading EventInfo
SG::ReadHandleKey<EventInfo> m_eventInfoRHKey;
/// StoreGate key for reading the HLT result
SG::ReadHandleKey<HLTResultMT> m_hltResultRHKey;
SG::ReadHandleKey<HLT::HLTResultMT> m_hltResultRHKey;
// ------------------------- Other private members ---------------------------
/// typedef used for detector mask fields
......
......@@ -6,9 +6,9 @@
#include "TrigServices/HltEventLoopMgr.h"
#include "TrigCOOLUpdateHelper.h"
#include "TrigKernel/HltExceptions.h"
#include "TrigSORFromPtreeHelper.h"
#include "TrigOutputHandling/HLTResultMT.h"
#include "TrigOutputHandling/HLTResultMTMaker.h"
#include "TrigSORFromPtreeHelper.h"
#include "TrigSteeringEvent/HLTResultMT.h"
// Athena includes
#include "AthenaKernel/EventContextClid.h"
......@@ -1118,13 +1118,13 @@ StatusCode HltEventLoopMgr::failedEvent(hltonl::PSCErrorCode errorCode, const Ev
m_hltResultMaker->makeResult(eventContext).ignore();
}
std::unique_ptr<HLTResultMT> hltResultPtr;
std::unique_ptr<HLT::HLTResultMT> hltResultPtr;
if (!hltResultRH.isValid())
hltResultPtr = std::make_unique<HLTResultMT>();
hltResultPtr = std::make_unique<HLT::HLTResultMT>();
else
hltResultPtr = std::make_unique<HLTResultMT>(*hltResultRH);
hltResultPtr = std::make_unique<HLT::HLTResultMT>(*hltResultRH);
SG::WriteHandleKey<HLTResultMT> hltResultWHK(m_hltResultRHKey.key()+"_FailedEvent");
SG::WriteHandleKey<HLT::HLTResultMT> hltResultWHK(m_hltResultRHKey.key()+"_FailedEvent");
hltResultWHK.initialize();
auto hltResultWH = SG::makeHandle(hltResultWHK,eventContext);
if (hltResultWH.record(std::move(hltResultPtr)).isFailure()) {
......
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGSTEERINGEVENT_HLTResultMT_H
#define TRIGSTEERINGEVENT_HLTResultMT_H
#include "AthenaKernel/CLASS_DEF.h"
#include "eformat/StreamTag.h"
#include <vector>
#include <unordered_map>
namespace HLT {
/** @class HLTResultMT
* @brief A container class for data required to build online output from HLT.
*
* It is not intended to modify the stored data, but may perform extra checks and debug printouts in the
* getter/setter methods.
**/
class HLTResultMT {
public:
/// Standard constructor
HLTResultMT(std::vector<eformat::helper::StreamTag> streamTags = {},
std::vector<uint32_t> hltBits = {},
std::unordered_map<uint16_t, std::vector<uint32_t> > data = {},
std::vector<uint32_t> status = {});
/// Copy constructor
HLTResultMT(const HLTResultMT& other);
/// Standard destructor
virtual ~HLTResultMT();
/// Stream tags getter
const std::vector<eformat::helper::StreamTag>& getStreamTags() const;
/// Stream tags setter
void setStreamTags(const std::vector<eformat::helper::StreamTag>& streamTags);
/// Append a stream tag
void addStreamTag(const eformat::helper::StreamTag& streamTag);
/// HLT bits getter
const std::vector<uint32_t>& getHltBits() const;
/// HLT bits setter
void setHltBits(const std::vector<uint32_t>& bits);
/// Append a word with HLT bits
void addHltBitsWord(const uint32_t& word);
/// Serialised data getter
const std::unordered_map<uint16_t, std::vector<uint32_t> >& getSerialisedData() const;
/// Serialised data getter for a given module ID
const std::vector<uint32_t>& getSerialisedData(uint16_t moduleId) const;
/// Serialised data setter
void setSerialisedData(const std::unordered_map<uint16_t, std::vector<uint32_t> >& data);
/// Append serialised data for a given module ID
void addSerialisedData(const uint16_t moduleId, const std::vector<uint32_t>& data);
/// Status words getter
const std::vector<uint32_t>& getStatus() const;
/// Status words setter
void setStatus(const std::vector<uint32_t>& status);
/// Append a status word
void addStatusWord(const uint32_t& word);
private:
/// Stream tags of the event
std::vector<eformat::helper::StreamTag> m_streamTags;
/// Serialised HLT bits (flagging which chains passed)
std::vector<uint32_t> m_hltBits;
/// Serialised result (ROBFragment payload) for each module ID (0 for full result, >0 for data scouting)
std::unordered_map<uint16_t, std::vector<uint32_t> > m_data;
/// Event status words (used to indicate processing errors)
std::vector<uint32_t> m_status;
};
} // namespace HLT
CLASS_DEF(HLT::HLTResultMT, 172156324, 1)
#endif // TRIGSTEERINGEVENT_HLTResultMT_H
......@@ -2,16 +2,16 @@
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
#include "TrigOutputHandling/HLTResultMT.h"
#include "TrigSteeringEvent/HLTResultMT.h"
#include <algorithm>
// =============================================================================
// Standard constructor
// =============================================================================
HLTResultMT::HLTResultMT(std::vector<eformat::helper::StreamTag> streamTags,
std::vector<uint32_t> hltBits,
std::unordered_map<uint16_t, std::vector<uint32_t> > data,
std::vector<uint32_t> status)
HLT::HLTResultMT::HLTResultMT(std::vector<eformat::helper::StreamTag> streamTags,
std::vector<uint32_t> hltBits,
std::unordered_map<uint16_t, std::vector<uint32_t> > data,
std::vector<uint32_t> status)
: m_streamTags(streamTags),
m_hltBits(hltBits),
m_data(data),
......@@ -20,7 +20,7 @@ HLTResultMT::HLTResultMT(std::vector<eformat::helper::StreamTag> streamTags,
// =============================================================================
// Copy constructor
// =============================================================================
HLTResultMT::HLTResultMT(const HLTResultMT& other)
HLT::HLTResultMT::HLTResultMT(const HLT::HLTResultMT& other)
: m_streamTags(other.m_streamTags),
m_hltBits(other.m_hltBits),
m_data(other.m_data),
......@@ -29,23 +29,23 @@ HLTResultMT::HLTResultMT(const HLTResultMT& other)
// =============================================================================
// Standard destructor
// =============================================================================
HLTResultMT::~HLTResultMT() {}
HLT::HLTResultMT::~HLTResultMT() {}
// =============================================================================
// Getter/setter methods for stream tags
// =============================================================================
const std::vector<eformat::helper::StreamTag>& HLTResultMT::getStreamTags() const {
const std::vector<eformat::helper::StreamTag>& HLT::HLTResultMT::getStreamTags() const {
return m_streamTags;
}
// -----------------------------------------------------------------------------
void HLTResultMT::setStreamTags(const std::vector<eformat::helper::StreamTag>& streamTags) {
void HLT::HLTResultMT::setStreamTags(const std::vector<eformat::helper::StreamTag>& streamTags) {
// copy assignment
m_streamTags = streamTags;
}
// -----------------------------------------------------------------------------
void HLTResultMT::addStreamTag(const eformat::helper::StreamTag& streamTag) {
void HLT::HLTResultMT::addStreamTag(const eformat::helper::StreamTag& streamTag) {
// Check if a stream tag with the same type and name is already in the result
auto compareTypeName = [&streamTag](const eformat::helper::StreamTag& existingStreamTag) {
return streamTag.type == existingStreamTag.type && streamTag.name == existingStreamTag.name;
......@@ -69,18 +69,18 @@ void HLTResultMT::addStreamTag(const eformat::helper::StreamTag& streamTag) {
// =============================================================================
// Getter/setter methods for trigger bits
// =============================================================================
const std::vector<uint32_t>& HLTResultMT::getHltBits() const {
const std::vector<uint32_t>& HLT::HLTResultMT::getHltBits() const {
return m_hltBits;
}
// -----------------------------------------------------------------------------
void HLTResultMT::setHltBits(const std::vector<uint32_t>& bits) {
void HLT::HLTResultMT::setHltBits(const std::vector<uint32_t>& bits) {
// copy assignment
m_hltBits = bits;
}
// -----------------------------------------------------------------------------
void HLTResultMT::addHltBitsWord(const uint32_t& word) {
void HLT::HLTResultMT::addHltBitsWord(const uint32_t& word) {
m_hltBits.push_back(word);
}
......@@ -88,24 +88,24 @@ void HLTResultMT::addHltBitsWord(const uint32_t& word) {
// Getter/setter methods for serialised data
// =============================================================================
/// Serialised data getter
const std::unordered_map<uint16_t, std::vector<uint32_t> >& HLTResultMT::getSerialisedData() const {
const std::unordered_map<uint16_t, std::vector<uint32_t> >& HLT::HLTResultMT::getSerialisedData() const {
return m_data;
}
// -----------------------------------------------------------------------------
const std::vector<uint32_t>& HLTResultMT::getSerialisedData(uint16_t moduleId) const {
const std::vector<uint32_t>& HLT::HLTResultMT::getSerialisedData(uint16_t moduleId) const {
// this can throw std::out_of_range - implement messaging (std::cerr or ATH_MSG_ERR) to avoid exception
return m_data.at(moduleId);
}
// -----------------------------------------------------------------------------
void HLTResultMT::setSerialisedData(const std::unordered_map<uint16_t, std::vector<uint32_t> >& data) {
void HLT::HLTResultMT::setSerialisedData(const std::unordered_map<uint16_t, std::vector<uint32_t> >& data) {
// copy assignment (WARNING, data may be large!)
m_data = data;
}
// -----------------------------------------------------------------------------
void HLTResultMT::addSerialisedData(const uint16_t moduleId, const std::vector<uint32_t>& data) {
void HLT::HLTResultMT::addSerialisedData(const uint16_t moduleId, const std::vector<uint32_t>& data) {
if (m_data.find(moduleId)!=m_data.cend()) {
// implement error printout and handling here !!! use either std::cerr or ATH_MSG_ERR
}
......@@ -117,17 +117,17 @@ void HLTResultMT::addSerialisedData(const uint16_t moduleId, const std::vector<u
// =============================================================================
// Getter/setter methods for status words
// =============================================================================
const std::vector<uint32_t>& HLTResultMT::getStatus() const {
const std::vector<uint32_t>& HLT::HLTResultMT::getStatus() const {
return m_status;
}
// -----------------------------------------------------------------------------
void HLTResultMT::setStatus(const std::vector<uint32_t>& status) {
void HLT::HLTResultMT::setStatus(const std::vector<uint32_t>& status) {
// copy assignment
m_status = status;
}
// -----------------------------------------------------------------------------
void HLTResultMT::addStatusWord(const uint32_t& word) {
void HLT::HLTResultMT::addStatusWord(const uint32_t& word) {
m_status.push_back(word);
}
......@@ -14,8 +14,7 @@ atlas_depends_on_subdirs( PUBLIC
Event/ByteStreamCnvSvcBase
Event/ByteStreamData
GaudiKernel
Trigger/TrigEvent/TrigSteeringEvent
Trigger/TrigSteer/TrigOutputHandling )
Trigger/TrigEvent/TrigSteeringEvent )
# External dependencies:
find_package( tdaq-common COMPONENTS eformat_write )
......@@ -25,10 +24,10 @@ atlas_add_library( TrigHLTResultByteStreamLib
src/*.cxx
PUBLIC_HEADERS TrigHLTResultByteStream
INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} AthenaBaseComps SGTools ByteStreamData GaudiKernel TrigSteeringEvent TrigOutputHandlingLib StoreGateLib SGtests ByteStreamCnvSvcBaseLib ByteStreamData_test )
LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} AthenaBaseComps SGTools ByteStreamData GaudiKernel TrigSteeringEvent StoreGateLib SGtests ByteStreamCnvSvcBaseLib ByteStreamData_test )
atlas_add_component( TrigHLTResultByteStream
src/components/*.cxx
INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS}
LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} AthenaBaseComps SGTools StoreGateLib SGtests ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test GaudiKernel TrigSteeringEvent TrigOutputHandlingLib TrigHLTResultByteStreamLib )
LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} AthenaBaseComps SGTools StoreGateLib SGtests ByteStreamCnvSvcBaseLib ByteStreamData ByteStreamData_test GaudiKernel TrigSteeringEvent TrigHLTResultByteStreamLib )
......@@ -4,7 +4,7 @@
// Trigger includes
#include "TrigHLTResultByteStream/HLTResultMTByteStreamCnv.h"
#include "TrigOutputHandling/HLTResultMT.h"
#include "TrigSteeringEvent/HLTResultMT.h"
// Athena includes
#include "AthenaBaseComps/AthCheckMacros.h"
......@@ -74,7 +74,7 @@ StatusCode HLT::HLTResultMTByteStreamCnv::createRep(DataObject* pObj, IOpaqueAdd
ATH_MSG_VERBOSE("start of " << __FUNCTION__);
// Cast the DataObject to HLTResultMT
HLTResultMT* hltResult = nullptr;
HLT::HLTResultMT* hltResult = nullptr;
bool castSuccessful = SG::fromStorable(pObj, hltResult);
if (!castSuccessful || !hltResult) {
ATH_MSG_ERROR("Failed to convert DataObject to HLTResultMT");
......@@ -155,6 +155,6 @@ StatusCode HLT::HLTResultMTByteStreamCnv::createRep(DataObject* pObj, IOpaqueAdd
// CLID
// =============================================================================
const CLID& HLT::HLTResultMTByteStreamCnv::classID() {
return ClassID_traits<HLTResultMT>::ID();
return ClassID_traits<HLT::HLTResultMT>::ID();
}
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGOUTPUTHANDLING_HLTRESULTMT_H
#define TRIGOUTPUTHANDLING_HLTRESULTMT_H
#include "AthenaKernel/CLASS_DEF.h"
#include "eformat/StreamTag.h"
#include <vector>
#include <unordered_map>
/** @class HLTResultMT
* @brief A container class for data required to build online output from HLT.
*
* It is not intended to modify the stored data, but may perform extra checks and debug printouts in the
* getter/setter methods.
**/
class HLTResultMT {
public:
/// Standard constructor
HLTResultMT(std::vector<eformat::helper::StreamTag> streamTags = {},
std::vector<uint32_t> hltBits = {},
std::unordered_map<uint16_t, std::vector<uint32_t> > data = {},
std::vector<uint32_t> status = {});
/// Copy constructor
HLTResultMT(const HLTResultMT& other);
/// Standard destructor
virtual ~HLTResultMT();
/// Stream tags getter
const std::vector<eformat::helper::StreamTag>& getStreamTags() const;
/// Stream tags setter
void setStreamTags(const std::vector<eformat::helper::StreamTag>& streamTags);
/// Append a stream tag
void addStreamTag(const eformat::helper::StreamTag& streamTag);
/// HLT bits getter
const std::vector<uint32_t>& getHltBits() const;
/// HLT bits setter
void setHltBits(const std::vector<uint32_t>& bits);
/// Append a word with HLT bits
void addHltBitsWord(const uint32_t& word);
/// Serialised data getter
const std::unordered_map<uint16_t, std::vector<uint32_t> >& getSerialisedData() const;
/// Serialised data getter for a given module ID
const std::vector<uint32_t>& getSerialisedData(uint16_t moduleId) const;
/// Serialised data setter
void setSerialisedData(const std::unordered_map<uint16_t, std::vector<uint32_t> >& data);
/// Append serialised data for a given module ID
void addSerialisedData(const uint16_t moduleId, const std::vector<uint32_t>& data);
/// Status words getter
const std::vector<uint32_t>& getStatus() const;
/// Status words setter
void setStatus(const std::vector<uint32_t>& status);
/// Append a status word
void addStatusWord(const uint32_t& word);
private:
/// Stream tags of the event
std::vector<eformat::helper::StreamTag> m_streamTags;
/// Serialised HLT bits (flagging which chains passed)
std::vector<uint32_t> m_hltBits;
/// Serialised result (ROBFragment payload) for each module ID (0 for full result, >0 for data scouting)
std::unordered_map<uint16_t, std::vector<uint32_t> > m_data;
/// Event status words (used to indicate processing errors)
std::vector<uint32_t> m_status;
};
CLASS_DEF(HLTResultMT, 69657051, 1)
#endif // TRIGOUTPUTHANDLING_HLTRESULTMT_H
......@@ -5,7 +5,7 @@
#ifndef TRIGOUTPUTHANDLING_HLTRESULTMTMAKER_H
#define TRIGOUTPUTHANDLING_HLTRESULTMTMAKER_H
#include "TrigOutputHandling/HLTResultMT.h"
#include "TrigSteeringEvent/HLTResultMT.h"
#include "TrigOutputHandling/HLTResultMTMakerTool.h"
#include "AthenaBaseComps/AthAlgTool.h"
......@@ -34,8 +34,8 @@ public:
private:
/// StoreGate key for the HLTResultMT
SG::WriteHandleKey<HLTResultMT> m_hltResultWHKey {this, "HLTResultWHKey", "HLTResultMT",
"Key of the output HLTResultMT object"};
SG::WriteHandleKey<HLT::HLTResultMT> m_hltResultWHKey {this, "HLTResultWHKey", "HLTResultMT",
"Key of the output HLTResultMT object"};
/// Tools filling the HLTResultMT object
ToolHandleArray<HLTResultMTMakerTool> m_makerTools {this, "MakerTools", {},
"Set of tools that fill content of the HLTResultMT"};
......
......@@ -5,7 +5,7 @@
#define TRIGOUTPUTHANDLING_HLTRESULTMTMAKERTOOL_H
#include "GaudiKernel/IAlgTool.h"
#include "TrigOutputHandling/HLTResultMT.h"
#include "TrigSteeringEvent/HLTResultMT.h"
/**
* @class HLTResultMTMakerTool
* @brief
......@@ -14,7 +14,7 @@ class HLTResultMTMakerTool : virtual public IAlgTool {
public:
DeclareInterfaceID(HLTResultMTMakerTool, 1, 0);
virtual StatusCode fill( HLTResultMT& resultToFill ) const = 0;
virtual StatusCode fill( HLT::HLTResultMT& resultToFill ) const = 0;
virtual ~HLTResultMTMakerTool() override {}
};
......
......@@ -19,7 +19,7 @@ public:
TriggerBitsMakerTool(const std::string& type, const std::string& name, const IInterface* parent);
virtual ~TriggerBitsMakerTool() override;
virtual StatusCode fill( HLTResultMT& resultToFill ) const override;
virtual StatusCode fill( HLT::HLTResultMT& resultToFill ) const override;
StatusCode fill( std::vector<uint32_t>& place ) const;
virtual StatusCode initialize() override;
......
......@@ -40,7 +40,7 @@ StatusCode HLTResultMTMaker::makeResult(const EventContext& eventContext) const
// Create and record the HLTResultMT object
auto hltResult = SG::makeHandle(m_hltResultWHKey,eventContext);
ATH_CHECK( hltResult.record(std::make_unique<HLTResultMT>()) );
ATH_CHECK( hltResult.record(std::make_unique<HLT::HLTResultMT>()) );
ATH_MSG_DEBUG("Recorded HLTResultMT with key " << m_hltResultWHKey.key());
// Fill the object using the result maker tools
......
......@@ -28,7 +28,7 @@ StatusCode StreamTagMakerTool::finalize() {
}
StatusCode StreamTagMakerTool::fill( HLTResultMT& resultToFill ) const {
StatusCode StreamTagMakerTool::fill( HLT::HLTResultMT& resultToFill ) const {
// obtain chain decisions,
auto chainsHandle = SG::makeHandle( m_finalChainDecisions );
......
......@@ -21,7 +21,7 @@ public:
StreamTagMakerTool(const std::string& type, const std::string& name, const IInterface* parent);
virtual ~StreamTagMakerTool() override;
virtual StatusCode fill( HLTResultMT& resultToFill ) const override;
virtual StatusCode fill( HLT::HLTResultMT& resultToFill ) const override;
virtual StatusCode initialize() override;
virtual StatusCode finalize() override;
......
......@@ -23,7 +23,7 @@ StatusCode TriggerBitsMakerTool::initialize() {
}
StatusCode TriggerBitsMakerTool::fill( HLTResultMT& resultToFill ) const {
StatusCode TriggerBitsMakerTool::fill( HLT::HLTResultMT& resultToFill ) const {
std::vector<uint32_t> bits;
ATH_CHECK( fill( bits ) );
resultToFill.setHltBits( bits );
......
......@@ -82,7 +82,7 @@ StatusCode TriggerEDMSerialiserTool::fillPayload( void* data, size_t sz, std::ve
}
StatusCode TriggerEDMSerialiserTool::fill( HLTResultMT& resultToFill ) const {
StatusCode TriggerEDMSerialiserTool::fill( HLT::HLTResultMT& resultToFill ) const {
for ( const Address& address: m_toSerialize ) {
......
......@@ -32,7 +32,7 @@ class TriggerEDMSerialiserTool: public extends<AthAlgTool, HLTResultMTMakerTool>
const IInterface* parent );
virtual ~TriggerEDMSerialiserTool();
virtual StatusCode fill( HLTResultMT& resultToFill ) const override;
virtual StatusCode fill( HLT::HLTResultMT& resultToFill ) const override;
virtual StatusCode initialize() override;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment