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

ByteStream converter for the CTP_RIO object. More...

#include <RecCTPByteStreamCnv.h>

Inheritance diagram for RecCTPByteStreamCnv:
Collaboration diagram for RecCTPByteStreamCnv:

Public Member Functions

 RecCTPByteStreamCnv (ISvcLocator *svcloc)
 Standard constructor.
virtual StatusCode initialize () override
 Function connecting to all the needed services/tools.
virtual StatusCode createObj (IOpaqueAddress *pAddr, DataObject *&pObj) override
 Function creating the CTP_RIO object from a CTP ROB fragment.
virtual long repSvcType () const override
 Function needed by the framework.

Static Public Member Functions

static long storageType ()
 Function needed by the framework.
static CLID classID ()
 Function needed by the framework.

Private Attributes

ToolHandle< RecCTPByteStreamTool > m_tool
 Tool doing the actual conversion.
CTPSrcIdMap m_srcIdMap
 Object storing the various IDs of the CTP fragment.
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
 Service used when reading the BS data.

Detailed Description

ByteStream converter for the CTP_RIO object.

   This is a quite standard BS converter for the output sent from the
   Central Trigger Processor to the DAQ. It uses an external tool
   (RecCTPByteStreamTool) to do the actual work of the conversion, this
   converter is "only" supposed to communicate with the framework.
See also
RecCTPByteStreamTool
Author
David Berge
Date
Date
2009-02-23 21:23:03

Definition at line 35 of file RecCTPByteStreamCnv.h.

Constructor & Destructor Documentation

◆ RecCTPByteStreamCnv()

RecCTPByteStreamCnv::RecCTPByteStreamCnv ( ISvcLocator * svcloc)

Standard constructor.

The constructor sets up all the ToolHandle and ServiceHandle objects and initialises the base class in the correct way.

Definition at line 24 of file RecCTPByteStreamCnv.cxx.

25 : Converter( storageType(), classID(), svcloc ),
26 m_tool( "RecCTPByteStreamTool" ),
27 m_robDataProvider( "ROBDataProviderSvc", "RecCTPByteStreamCnv" ) {
28
29}
static CLID classID()
Function needed by the framework.
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Service used when reading the BS data.
ToolHandle< RecCTPByteStreamTool > m_tool
Tool doing the actual conversion.
static long storageType()
Function needed by the framework.

Member Function Documentation

◆ classID()

CLID RecCTPByteStreamCnv::classID ( )
static

Function needed by the framework.

Function telling the framework the Class ID of the object that this converter is for (CTP_RIO).

Definition at line 35 of file RecCTPByteStreamCnv.cxx.

35 {
36
38
39}

◆ createObj()

StatusCode RecCTPByteStreamCnv::createObj ( IOpaqueAddress * pAddr,
DataObject *& pObj )
overridevirtual

Function creating the CTP_RIO object from a CTP ROB fragment.

This function creates the CTP_RIO object from the BS data.

It requests the ROB fragment with the ROB Id of the CTP and gives this fragment to the RecCTPByteStreamTool for conversion.

Definition at line 78 of file RecCTPByteStreamCnv.cxx.

78 {
79
80 MsgStream log( msgSvc(), "RecCTPByteStreamCnv" );
81 log << MSG::DEBUG << "RecCTPByteStreamCnv::createObj() called" << endmsg;
82
83 ByteStreamAddress* pBS_Addr{};
84 ATH_CHECK( (pBS_Addr = dynamic_cast<ByteStreamAddress*>(pAddr)) != nullptr );
85
86 const EventContext& ctx = pBS_Addr->getEventContext();
87
88 log << MSG::DEBUG << " Creating Objects: " << *( pBS_Addr->par() ) << endmsg;
89
90 //
91 // Get SourceID:
92 //
93 const uint32_t robId = m_srcIdMap.getRobID( m_srcIdMap.getRodID() );
94
95 log << MSG::DEBUG << "expected ROB sub-detector ID: " << std::hex
96 << robId << std::dec << endmsg;
97
98 std::vector< uint32_t > vID;
99 vID.push_back( robId );
100
101 // get ROB fragment
103 m_robDataProvider->getROBData(ctx, vID, robFrags );
104
105 // size check
106 if ( robFrags.size() != 1 ) {
107 log << MSG::WARNING << " Number of ROB fragments for source ID 0x" << MSG::hex << robId
108 << " is " << robFrags.size() << endmsg;
109
110 CTP_RIO* result = new CTP_RIO;
111 pObj = SG::asStorable( result ) ;
112 return StatusCode::SUCCESS;
113 }
114
115 IROBDataProviderSvc::VROBFRAG::const_iterator it = robFrags.begin();
116 CTP_RIO * result = 0;
117
118 ATH_CHECK( m_tool->convert( ROBData( *it ).getROBFragment(), result ) );
119 pObj = SG::asStorable( result );
120
121 return StatusCode::SUCCESS;
122}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
ROBData_T< OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment, OFFLINE_FRAGMENTS_NAMESPACE::PointerType > ROBData
Definition ROBData.h:225
const EventContext & getEventContext() const
std::vector< const ROBF * > VROBFRAG
const ROBFragment * getROBFragment() const
Return the ROBFragment.
Definition ROBData.h:184
CTPSrcIdMap m_srcIdMap
Object storing the various IDs of the CTP fragment.
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
setEventNumber uint32_t

◆ initialize()

StatusCode RecCTPByteStreamCnv::initialize ( )
overridevirtual

Function connecting to all the needed services/tools.

Init method gets all necessary services etc.

Definition at line 48 of file RecCTPByteStreamCnv.cxx.

48 {
49
50 //
51 // Initialise the base class:
52 //
53 ATH_CHECK( Converter::initialize() );
54
55 MsgStream log( msgSvc(), "RecCTPByteStreamCnv" );
56 log << MSG::DEBUG << "RecCTPByteStreamCnv in initialize()" << endmsg;
57
58 //
59 // Get RecCTPByteStreamTool:
60 //
61 ATH_CHECK( m_tool.retrieve() );
62 log << MSG::DEBUG << "Connected to RecCTPByteStreamTool" << endmsg;
63
64 //
65 // Get ROBDataProvider:
66 //
67 ATH_CHECK( m_robDataProvider.retrieve() );
68 log << MSG::DEBUG << "Connected to ROBDataProviderSvc" << endmsg;
69
70 return StatusCode::SUCCESS;
71}

◆ repSvcType()

virtual long RecCTPByteStreamCnv::repSvcType ( ) const
inlineoverridevirtual

Function needed by the framework.

Definition at line 47 of file RecCTPByteStreamCnv.h.

47{ return i_repSvcType(); }

◆ storageType()

long RecCTPByteStreamCnv::storageType ( )
static

Function needed by the framework.

Definition at line 41 of file RecCTPByteStreamCnv.cxx.

41 {
43}
static constexpr long storageType()

Member Data Documentation

◆ m_robDataProvider

ServiceHandle< IROBDataProviderSvc > RecCTPByteStreamCnv::m_robDataProvider
private

Service used when reading the BS data.

Definition at line 61 of file RecCTPByteStreamCnv.h.

◆ m_srcIdMap

CTPSrcIdMap RecCTPByteStreamCnv::m_srcIdMap
private

Object storing the various IDs of the CTP fragment.

Definition at line 58 of file RecCTPByteStreamCnv.h.

◆ m_tool

ToolHandle< RecCTPByteStreamTool > RecCTPByteStreamCnv::m_tool
private

Tool doing the actual conversion.

Definition at line 55 of file RecCTPByteStreamCnv.h.


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