ATLAS Offline Software
Loading...
Searching...
No Matches
HLT::HLTResultByteStreamTool Class Reference

#include <HLTResultByteStreamTool.h>

Inheritance diagram for HLT::HLTResultByteStreamTool:
Collaboration diagram for HLT::HLTResultByteStreamTool:

Public Member Functions

 HLTResultByteStreamTool (const std::string &type, const std::string &name, const IInterface *parent)
 std Gaudi tool constructor
StatusCode convert (IROBDataProviderSvc &dataProvider, HLTResult *&result, std::string objName)
 convert ROBData to HLTResult this function should be called from createObj
StatusCode convert (HLTResult *result, RawEventWrite *re, std::string objName)
 convert HLTResult to ByteStream this function should be called from createRep
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()
 std Gaudi interface

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< std::map< std::string, uint32_t > > m_robIDMap
FullEventAssembler< HLTSrcIdMapm_fea
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 43 of file HLTResultByteStreamTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ HLTResultByteStreamTool()

HLT::HLTResultByteStreamTool::HLTResultByteStreamTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

std Gaudi tool constructor

Definition at line 13 of file HLTResultByteStreamTool.cxx.

16 : AthAlgTool(type,name,parent)
17{
18 declareInterface<HLT::HLTResultByteStreamTool>( this );
19}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ convert() [1/2]

StatusCode HLT::HLTResultByteStreamTool::convert ( HLTResult * result,
RawEventWrite * re,
std::string objName )

convert HLTResult to ByteStream this function should be called from createRep

Conversion from RDO to eformat::ROBFragment.

this is called from the createRep method.

Definition at line 26 of file HLTResultByteStreamTool.cxx.

28{
29 // find the ROB ID for the given HLTResult name
30 const auto itr = m_robIDMap.find(objName);
31 if ( itr==m_robIDMap.end() ) {
32 ATH_MSG_ERROR("No ROB ID configured for " << objName);
33 return StatusCode::FAILURE;
34 }
35 eformat::helper::SourceIdentifier rob(itr->second);
36
37 // configure the EventAssembler and serialize into bytestream
38 m_fea.clear();
39 m_fea.idMap().setDetId(rob.subdetector_id());
40
41 std::vector<uint32_t>* rod = m_fea.getRodData( rob.code() );
42 if (!rod) return StatusCode::FAILURE;
43
44 result->serialize( *rod );
45 m_fea.fill(re, msg());
46
47 ATH_MSG_DEBUG("Serialized HLT Result " << objName << " (" << rod->size()
48 << " words) to location " << rob.human());
49
50 return StatusCode::SUCCESS;
51}
const boost::regex re(r_e)
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
MsgStream & msg() const
Gaudi::Property< std::map< std::string, uint32_t > > m_robIDMap
FullEventAssembler< HLTSrcIdMap > m_fea

◆ convert() [2/2]

StatusCode HLT::HLTResultByteStreamTool::convert ( IROBDataProviderSvc & dataProvider,
HLT::HLTResult *& result,
std::string objName )

convert ROBData to HLTResult this function should be called from createObj

Conversion from eformat::ROBFragment to RDO.

this is called from the createObj method.

Definition at line 58 of file HLTResultByteStreamTool.cxx.

60{
61 // find the ROB ID for the given HLTResult name
62 const auto itr = m_robIDMap.find(objName);
63 if ( itr==m_robIDMap.end() ) {
64 ATH_MSG_ERROR("No ROB ID configured for " << objName);
65 return StatusCode::FAILURE;
66 }
67 eformat::helper::SourceIdentifier rob(itr->second);
68
69 // request the ROB and deserialize into HLTResult
71 dataProvider.getROBData(Gaudi::Hive::currentContext(), {rob.code()}, robFrags);
72
73 // unsigned int vector where to store HLT payload
74 std::vector<uint32_t> hltContent;
75 for (const IROBDataProviderSvc::ROBF* rob : robFrags ) {
76
78 rob->rod_data(rodData);
79
80 const uint32_t nData = rob->rod_ndata();
81 hltContent.reserve(nData);
82 for (size_t i = 0; i < nData; i++) hltContent.push_back(rodData[i]);
83 }
84
85 result->deserialize(hltContent);
86 ATH_MSG_DEBUG("Deserialized HLT Result " << objName << " (" << hltContent.size() << " words)");
87
88 return StatusCode::SUCCESS;
89}
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment ROBF
virtual void getROBData(const EventContext &context, const std::vector< uint32_t > &robIds, VROBFRAG &robFragments, const std::string_view callerName="UNKNOWN")=0
Retrieve ROBFragments for given ROB ids from cache.
std::vector< const ROBF * > VROBFRAG
const DataType * PointerType
Definition RawEvent.h:25
setEventNumber uint32_t

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & HLT::HLTResultByteStreamTool::interfaceID ( )
inlinestatic

std Gaudi interface

Definition at line 76 of file HLTResultByteStreamTool.h.

77{
78 static const InterfaceID IID("HLTResultByteStreamTool", 1, 0);
79 return IID;
80}

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_fea

FullEventAssembler<HLTSrcIdMap> HLT::HLTResultByteStreamTool::m_fea
private

Definition at line 72 of file HLTResultByteStreamTool.h.

◆ m_robIDMap

Gaudi::Property<std::map<std::string, uint32_t> > HLT::HLTResultByteStreamTool::m_robIDMap
private
Initial value:
{
this, "HLTResultRobIdMap", {
{"HLTResult_L2", eformat::helper::SourceIdentifier(eformat::TDAQ_LVL2, 0).code()},
{"HLTResult_EF", eformat::helper::SourceIdentifier(eformat::TDAQ_EVENT_FILTER, 0).code()},
{"HLTResult_HLT", eformat::helper::SourceIdentifier(eformat::TDAQ_HLT, 0).code()}
}, "Map of HLTResult names to ROB IDs"}

Definition at line 65 of file HLTResultByteStreamTool.h.

65 {
66 this, "HLTResultRobIdMap", {
67 {"HLTResult_L2", eformat::helper::SourceIdentifier(eformat::TDAQ_LVL2, 0).code()},
68 {"HLTResult_EF", eformat::helper::SourceIdentifier(eformat::TDAQ_EVENT_FILTER, 0).code()},
69 {"HLTResult_HLT", eformat::helper::SourceIdentifier(eformat::TDAQ_HLT, 0).code()}
70 }, "Map of HLTResult names to ROB IDs"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: