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

ByteStream converter for the MuCTPI_RIO object. More...

#include <RecMuCTPIByteStreamCnv.h>

Inheritance diagram for RecMuCTPIByteStreamCnv:
Collaboration diagram for RecMuCTPIByteStreamCnv:

Public Member Functions

 RecMuCTPIByteStreamCnv (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 MuCTPI_RIO object from a MuCTPI 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< RecMuCTPIByteStreamTool > m_tool
 Tool doing the actual conversion.
MuCTPISrcIdMap m_srcIdMap
 Object storing the various IDs of the MuCTPI fragment.
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
 Service used when reading the BS data.

Detailed Description

ByteStream converter for the MuCTPI_RIO object.

   This is a quite standard BS converter for the output sent from the
   Muon to Central Trigger Processor Interface to the DAQ. It uses an
   external tool (RecMuCTPIByteStreamTool) to do the actual work of
   the conversion, this converter is "only" supposed to communicate
   with the framework.
See also
RecMuCTPIByteStreamTool
Author
Tadashi Maeno
Attila Krasznahorkay

Definition at line 36 of file RecMuCTPIByteStreamCnv.h.

Constructor & Destructor Documentation

◆ RecMuCTPIByteStreamCnv()

RecMuCTPIByteStreamCnv::RecMuCTPIByteStreamCnv ( 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 23 of file RecMuCTPIByteStreamCnv.cxx.

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

Member Function Documentation

◆ classID()

CLID RecMuCTPIByteStreamCnv::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 34 of file RecMuCTPIByteStreamCnv.cxx.

◆ createObj()

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

Function creating the MuCTPI_RIO object from a MuCTPI ROB fragment.

This function creates the MuCTPI_RIO object from the BS data.

It requests the ROB fragment with the ROB Id of the MuCTPI and gives this fragment to the RecMuCTPIByteStreamTool for conversion.

Definition at line 77 of file RecMuCTPIByteStreamCnv.cxx.

77 {
78
79 MsgStream log( msgSvc(), "RecMuCTPIByteStreamCnv" );
80 log << MSG::DEBUG << "executing createObj()" << endmsg;
81
82 ByteStreamAddress* pBS_Addr{};
83 ATH_CHECK( (pBS_Addr = dynamic_cast<ByteStreamAddress*>(pAddr)) != nullptr );
84
85 const EventContext& ctx = pBS_Addr->getEventContext();
86
87 log << MSG::DEBUG << " Creating Objects " << *( pBS_Addr->par() ) << endmsg;
88
89 // get SourceID
90 const uint32_t robId = m_srcIdMap.getRobID( m_srcIdMap.getRodID() );
91
92 std::vector< uint32_t > vID;
93 vID.push_back( robId );
94
95 // get ROB fragment
97 m_robDataProvider->getROBData(ctx, vID, robFrags );
98
99 // size check
100 if ( robFrags.size() == 0 ) {
101 // This is a hack - in early data the rob id of the MuCTPI was
102 // wrong, i.e. 0x76000b
103 uint32_t newRobId = robId;
104 newRobId |= 0x00000b;
105 vID[0] = ( newRobId );
106 m_robDataProvider->getROBData(ctx, vID, robFrags );
107 // size check
108 if ( robFrags.size() != 1 ) {
109 log << MSG::WARNING << " Number of ROB fragments for source ROB ID " << MSG::hex << newRobId << " (ROD ID "
110 << m_srcIdMap.getRodID() << MSG::dec << ") is " << robFrags.size() << endmsg;
111 MuCTPI_RIO * result = new MuCTPI_RIO;
112 pObj = SG::asStorable( result ) ;
113 return StatusCode::SUCCESS;
114 }
115 }
116
117 IROBDataProviderSvc::VROBFRAG::const_iterator it = robFrags.begin();
118 MuCTPI_RIO* result{};
119 // Convert to Object
120 auto sc = m_tool->convert( ROBData( *it ).getROBFragment(), result ) ;
121 if (sc.isFailure()){
122 log << MSG::ERROR<<"RecMuCTPIByteStreamCnv::createObj failed."<<endmsg;
123 delete result; //object new'ed in convert
124 return sc;
125 }
126 pObj = SG::asStorable( result ) ;
127
128 return StatusCode::SUCCESS;
129}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
static Double_t sc
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
MuCTPISrcIdMap m_srcIdMap
Object storing the various IDs of the MuCTPI fragment.
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
setEventNumber uint32_t

◆ initialize()

StatusCode RecMuCTPIByteStreamCnv::initialize ( )
overridevirtual

Function connecting to all the needed services/tools.

Init method gets all necessary services etc.

Definition at line 47 of file RecMuCTPIByteStreamCnv.cxx.

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

◆ repSvcType()

virtual long RecMuCTPIByteStreamCnv::repSvcType ( ) const
inlineoverridevirtual

Function needed by the framework.

Definition at line 48 of file RecMuCTPIByteStreamCnv.h.

48{ return i_repSvcType(); }

◆ storageType()

long RecMuCTPIByteStreamCnv::storageType ( )
static

Function needed by the framework.

Definition at line 40 of file RecMuCTPIByteStreamCnv.cxx.

40 {
42}
static constexpr long storageType()

Member Data Documentation

◆ m_robDataProvider

ServiceHandle< IROBDataProviderSvc > RecMuCTPIByteStreamCnv::m_robDataProvider
private

Service used when reading the BS data.

Definition at line 62 of file RecMuCTPIByteStreamCnv.h.

◆ m_srcIdMap

MuCTPISrcIdMap RecMuCTPIByteStreamCnv::m_srcIdMap
private

Object storing the various IDs of the MuCTPI fragment.

Definition at line 59 of file RecMuCTPIByteStreamCnv.h.

◆ m_tool

ToolHandle< RecMuCTPIByteStreamTool > RecMuCTPIByteStreamCnv::m_tool
private

Tool doing the actual conversion.

Definition at line 56 of file RecMuCTPIByteStreamCnv.h.


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