ATLAS Offline Software
Loading...
Searching...
No Matches
RecCTPByteStreamTool Class Reference

Tool doing the ByteStream -> CTP_RIO conversion. More...

#include <RecCTPByteStreamTool.h>

Inheritance diagram for RecCTPByteStreamTool:
Collaboration diagram for RecCTPByteStreamTool:

Public Member Functions

 RecCTPByteStreamTool (const std::string &type, const std::string &name, const IInterface *parent)
 Default constructor.
StatusCode convert (const ROBF *rob, CTP_RIO *&result)
 Convert ROBFragment to CTP_RIO.
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 ()
 AlgTool InterfaceID.

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 OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment ROBF
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

CTPSrcIdMap m_srcIdMap
 Object storing the various IDs of the CTP fragment.
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

Tool doing the ByteStream -> CTP_RIO conversion.

   The actual work of translating the information in a CTP ROB fragment
   into a CTP_RIO object is done with this tool.
See also
RecCTPByteStreamCnv
Author
David Berge

Definition at line 32 of file RecCTPByteStreamTool.h.

Member Typedef Documentation

◆ ROBF

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ RecCTPByteStreamTool()

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

Default constructor.

The constructor takes care of correctly constructing the base class and declaring the tool's interface to the framework.

Definition at line 26 of file RecCTPByteStreamTool.cxx.

28 : AthAlgTool( type, name, parent ) {
29
30 declareInterface< RecCTPByteStreamTool >( this );
31}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ convert()

StatusCode RecCTPByteStreamTool::convert ( const ROBF * rob,
CTP_RIO *& result )

Convert ROBFragment to CTP_RIO.

Conversion from eformat::ROBFragment to RIO.

This is called from the RecCTPByteStreamCnv::createObj method.

Definition at line 37 of file RecCTPByteStreamTool.cxx.

37 {
38
39 ATH_MSG_DEBUG("executing convert() from ROBFragment to RIO");
40
41 const uint32_t ctpRodId = m_srcIdMap.getRodID();
42 const uint32_t rodId = rob->rod_source_id();
43
44 ATH_MSG_DEBUG(" expected ROD sub-detector ID: 0x" << std::hex << ctpRodId
45 << " ID found: 0x" << std::hex << rodId << std::dec);
46
47 if( rodId == ctpRodId ) {
48 // create CTP RIO
49 result = new CTP_RIO();
50
51 const uint32_t bcid = rob->rod_bc_id();
52 const uint32_t ndata = rob->rod_ndata();
53 const uint32_t detev_type = rob->rod_detev_type();
54 const uint32_t lvl1_type = rob->rod_lvl1_trigger_type();
55 const uint32_t lvl1_id = rob->rod_lvl1_id();
56 const uint32_t run_no = rob->rod_run_no();
57 const uint32_t nstatus = rob->rod_nstatus();
58
60 rob->rod_status( it_data );
61
62 ATH_MSG_VERBOSE(" Dumping CTP ROD fragment Header data:");
63 ATH_MSG_VERBOSE(" Source ID 0x" << MSG::hex << rodId << MSG::dec);
64 ATH_MSG_VERBOSE(" BCID 0x" << MSG::hex << bcid << MSG::dec
65 << " (dec " << bcid << ")");
66 ATH_MSG_VERBOSE(" Detector event type 0x" << MSG::hex << detev_type
67 << MSG::dec << " (dec " << detev_type << ")");
68 ATH_MSG_VERBOSE(" Level-1 ID 0x" << MSG::hex << lvl1_id << MSG::dec
69 << " (dec " << lvl1_id << ")");
70 ATH_MSG_VERBOSE(" Level-1 type 0x" << MSG::hex << lvl1_type << MSG::dec
71 << " (dec " << lvl1_type << ")");
72 ATH_MSG_VERBOSE(" Run number " << run_no);
73 ATH_MSG_VERBOSE(" Number of data words " << ndata);
74 ATH_MSG_VERBOSE(" Number of status words ");
75 for ( uint32_t i = 0; i < nstatus; ++i , ++it_data) {
76 ATH_MSG_VERBOSE(" Status word # " << i << ": 0x" << MSG::hex << (*it_data) << MSG::dec
77 << " (dec " << (*it_data) << ")");
78 result->statusWords().push_back( static_cast< uint32_t >( *it_data ) );
79 }
80 result->sourceId( rodId );
81 result->runNumber( run_no );
82 result->lvl1Id( lvl1_id );
83 result->bcid( bcid );
84 result->lvl1TriggerType( lvl1_type );
85 result->detectorEventType( detev_type );
86 result->numberDataWords( ndata );
87 result->numberStatusWords( nstatus );
88
89 return StatusCode::SUCCESS;
90 }
91
92 ATH_MSG_ERROR("Wrong ROD ID found in the CTP ROB fragment!");
93 return StatusCode::FAILURE;
94}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
CTPSrcIdMap m_srcIdMap
Object storing the various IDs of the CTP fragment.
const DataType * PointerType
Definition RawEvent.h:25
setEventNumber setTimeStamp bcid
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 & RecCTPByteStreamTool::interfaceID ( )
static

AlgTool InterfaceID.

This function is needed by the framework to know what kind of tool this is.

Definition at line 18 of file RecCTPByteStreamTool.cxx.

18 {
20}
static const InterfaceID IID_IRecCTPByteStreamTool("RecCTPByteStreamTool", 1, 0)
Unique interface ID of the tool that identifies it to the framweork.

◆ 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_srcIdMap

CTPSrcIdMap RecCTPByteStreamTool::m_srcIdMap
private

Object storing the various IDs of the CTP fragment.

Definition at line 50 of file RecCTPByteStreamTool.h.

◆ 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: