ATLAS Offline Software
Loading...
Searching...
No Matches
RecCTPByteStreamTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Trigger include(s):
7
8// Local include(s):
10
12static const InterfaceID IID_IRecCTPByteStreamTool( "RecCTPByteStreamTool", 1, 0 );
13
18const InterfaceID & RecCTPByteStreamTool::interfaceID() {
20}
21
26RecCTPByteStreamTool::RecCTPByteStreamTool( const std::string& type, const std::string& name,
27 const IInterface* parent )
28 : AthAlgTool( type, name, parent ) {
29
30 declareInterface< RecCTPByteStreamTool >( this );
31}
32
37StatusCode RecCTPByteStreamTool::convert( const ROBF* rob, CTP_RIO*& result ) {
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)
static const InterfaceID IID_IRecCTPByteStreamTool("RecCTPByteStreamTool", 1, 0)
Unique interface ID of the tool that identifies it to the framweork.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment ROBF
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.
CTPSrcIdMap m_srcIdMap
Object storing the various IDs of the CTP fragment.
const DataType * PointerType
Definition RawEvent.h:25