ATLAS Offline Software
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):
6 #include "TrigT1Result/CTP_RIO.h"
7 
8 // Local include(s):
9 #include "RecCTPByteStreamTool.h"
10 
12 static const InterfaceID IID_IRecCTPByteStreamTool( "RecCTPByteStreamTool", 1, 0 );
13 
18 const InterfaceID & RecCTPByteStreamTool::interfaceID() {
19  return IID_IRecCTPByteStreamTool;
20 }
21 
26 RecCTPByteStreamTool::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 
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 }
CTP_RIO
Definition: CTP_RIO.h:22
RecCTPByteStreamTool::convert
StatusCode convert(const ROBF *rob, CTP_RIO *&result)
Convert ROBFragment to CTP_RIO.
Definition: RecCTPByteStreamTool.cxx:37
RecCTPByteStreamTool::interfaceID
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
Definition: RecCTPByteStreamTool.cxx:18
get_generator_info.result
result
Definition: get_generator_info.py:21
RecCTPByteStreamTool::m_srcIdMap
CTPSrcIdMap m_srcIdMap
Object storing the various IDs of the CTP fragment.
Definition: RecCTPByteStreamTool.h:50
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
OFFLINE_FRAGMENTS_NAMESPACE::PointerType
const DataType * PointerType
Definition: RawEvent.h:25
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
eformat::ROBFragment
Definition: L1CaloBsDecoderUtil.h:12
lumiFormat.i
int i
Definition: lumiFormat.py:92
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
RecCTPByteStreamTool.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
CTP_RIO.h
CTPSrcIdMap::getRodID
uint32_t getRodID() const
get a ROD Source ID
Definition: CTPSrcIdMap.cxx:13
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
RecCTPByteStreamTool::RecCTPByteStreamTool
RecCTPByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
Definition: RecCTPByteStreamTool.cxx:26
AthAlgTool
Definition: AthAlgTool.h:26