ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1ResultByteStream
src
RecCTPByteStreamCnv.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
// Gaudi/Athena include(s):
7
#include "GaudiKernel/MsgStream.h"
8
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
9
#include "
ByteStreamData/RawEvent.h
"
10
#include "
ByteStreamData/ROBData.h
"
11
12
#include "
AthenaKernel/StorableConversions.h
"
13
14
// Trigger include(s):
15
#include "
TrigT1Result/CTP_RIO.h
"
16
17
// Local include(s):
18
#include "
RecCTPByteStreamCnv.h
"
19
24
RecCTPByteStreamCnv::RecCTPByteStreamCnv
( ISvcLocator* svcloc )
25
:
Converter
(
storageType
(),
classID
(), svcloc ),
26
m_tool
(
"RecCTPByteStreamTool"
),
27
m_robDataProvider
(
"ROBDataProviderSvc"
,
"RecCTPByteStreamCnv"
) {
28
29
}
30
35
CLID
RecCTPByteStreamCnv::classID
() {
36
37
return
ClassID_traits< CTP_RIO >::ID
();
38
39
}
40
41
long
RecCTPByteStreamCnv::storageType
() {
42
return
ByteStreamAddress::storageType
();
43
}
44
48
StatusCode
RecCTPByteStreamCnv::initialize
() {
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
}
72
78
StatusCode
RecCTPByteStreamCnv::createObj
( IOpaqueAddress* pAddr, DataObject*& pObj ) {
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
102
IROBDataProviderSvc::VROBFRAG
robFrags;
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
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ByteStreamAddress.h
CTP_RIO.h
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
ROBData.h
Defines the ROB data entity. The ROB data is an abstract entity that is used to decouple the raw even...
ROBData
ROBData_T< OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment, OFFLINE_FRAGMENTS_NAMESPACE::PointerType > ROBData
Definition
ROBData.h:225
RawEvent.h
RecCTPByteStreamCnv.h
StorableConversions.h
convert to and from a SG storable
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition
ByteStreamAddress.h:28
ByteStreamAddress::getEventContext
const EventContext & getEventContext() const
Definition
ByteStreamAddress.h:62
ByteStreamAddress::storageType
static constexpr long storageType()
Definition
ByteStreamAddress.h:51
CTP_RIO
Definition
CTP_RIO.h:22
Converter::Converter
Converter()
Definition
Converter.h:29
IROBDataProviderSvc::VROBFRAG
std::vector< const ROBF * > VROBFRAG
Definition
IROBDataProviderSvc.h:25
RecCTPByteStreamCnv::m_srcIdMap
CTPSrcIdMap m_srcIdMap
Object storing the various IDs of the CTP fragment.
Definition
RecCTPByteStreamCnv.h:58
RecCTPByteStreamCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj) override
Function creating the CTP_RIO object from a CTP ROB fragment.
Definition
RecCTPByteStreamCnv.cxx:78
RecCTPByteStreamCnv::initialize
virtual StatusCode initialize() override
Function connecting to all the needed services/tools.
Definition
RecCTPByteStreamCnv.cxx:48
RecCTPByteStreamCnv::classID
static CLID classID()
Function needed by the framework.
Definition
RecCTPByteStreamCnv.cxx:35
RecCTPByteStreamCnv::m_robDataProvider
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Service used when reading the BS data.
Definition
RecCTPByteStreamCnv.h:61
RecCTPByteStreamCnv::m_tool
ToolHandle< RecCTPByteStreamTool > m_tool
Tool doing the actual conversion.
Definition
RecCTPByteStreamCnv.h:55
RecCTPByteStreamCnv::storageType
static long storageType()
Function needed by the framework.
Definition
RecCTPByteStreamCnv.cxx:41
RecCTPByteStreamCnv::RecCTPByteStreamCnv
RecCTPByteStreamCnv(ISvcLocator *svcloc)
Standard constructor.
Definition
RecCTPByteStreamCnv.cxx:24
SG::asStorable
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Definition
DataObjectSharedPtr.h:31
ClassID_traits::ID
static constexpr CLID ID()
Definition
Control/AthenaKernel/AthenaKernel/ClassID_traits.h:44
Generated on
for ATLAS Offline Software by
1.17.0