ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileSvc
TileByteStream
src
TileMuRcvContByteStreamCnv.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
// Gaudi includes
6
#include "GaudiKernel/MsgStream.h"
7
#include "GaudiKernel/StatusCode.h"
8
#include "GaudiKernel/DataObject.h"
9
#include "GaudiKernel/IRegistry.h"
10
#include "GaudiKernel/IToolSvc.h"
11
12
// Athena includes
13
#include "
AthenaKernel/errorcheck.h
"
14
15
#include "
ByteStreamCnvSvcBase/IByteStreamCnvSvc.h
"
16
#include "
ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.h
"
17
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
18
#include "
ByteStreamCnvSvcBase/IROBDataProviderSvc.h
"
19
#include "
ByteStreamData/RawEvent.h
"
20
21
#include "
StoreGate/StoreClearedIncident.h
"
22
#include "
AthenaKernel/CLASS_DEF.h
"
23
24
// Tile includes
25
#include "
TileByteStream/TileMuRcvContByteStreamCnv.h
"
26
#include "
TileByteStream/TileMuRcvContByteStreamTool.h
"
27
#include "
TileByteStream/TileROD_Decoder.h
"
28
29
30
#include <string>
31
32
33
TileMuRcvContByteStreamCnv::TileMuRcvContByteStreamCnv
(ISvcLocator* svcloc)
34
:
AthConstConverter
(
storageType
(),
classID
(),svcloc,
"TileMuRcvContByteStreamCnv"
)
35
,
m_tool
(
"TileMuRcvContByteStreamTool"
)
36
,
m_byteStreamCnvSvc
(
"ByteStreamCnvSvc"
,
name
())
37
,
m_storeGate
(
"StoreGateSvc"
,
name
())
38
,
m_robSvc
(
"ROBDataProviderSvc"
,
name
())
39
,
m_decoder
(
"TileROD_Decoder"
)
40
{
41
}
42
43
CLID
TileMuRcvContByteStreamCnv::classID
(){
44
return
ClassID_traits<TileMuonReceiverContainer>::ID
();
45
}
46
47
long
TileMuRcvContByteStreamCnv::storageType
() {
48
return
ByteStreamAddress::storageType
();
49
}
50
51
StatusCode
TileMuRcvContByteStreamCnv::initialize
()
52
{
53
ATH_CHECK
(Converter::initialize());
54
55
ATH_MSG_DEBUG
(
" initialize "
);
56
57
// Get ByteStreamCnvSvc
58
ATH_CHECK
(
m_byteStreamCnvSvc
.retrieve() );
59
60
// retrieve Tool
61
ATH_CHECK
(
m_decoder
.retrieve() );
62
63
ATH_CHECK
(
m_tool
.retrieve() );
64
65
ATH_CHECK
(
m_robSvc
.retrieve() );
66
67
ATH_CHECK
(
m_storeGate
.retrieve() );
68
69
return
StatusCode::SUCCESS ;
70
}
71
72
73
StatusCode
TileMuRcvContByteStreamCnv::createObjConst
(IOpaqueAddress* pAddr, DataObject*& pObj)
const
74
{
75
76
ATH_MSG_DEBUG
(
" Executing createObj method"
);
77
78
ByteStreamAddress
* pRE_Addr{};
79
ATH_CHECK
( (pRE_Addr =
dynamic_cast<
ByteStreamAddress
*
>
(pAddr)) !=
nullptr
);
80
81
const
EventContext& ctx = pRE_Addr->
getEventContext
();
82
const
RawEvent
*
re
=
m_robSvc
->getEvent(ctx);
83
if
(!
re
) {
84
ATH_MSG_ERROR
(
"Could not get raw event from ByteStreamInputSvc"
);
85
return
StatusCode::FAILURE;
86
}
87
88
auto
cont = std::make_unique<TileMuonReceiverContainer>();
89
90
StatusCode
sc
=
m_decoder
->convertTMDBDecision(
re
,cont.get());
91
if
(
sc
!=StatusCode::SUCCESS) {
92
ATH_MSG_WARNING
(
"Conversion tool returned an error. TileMuonReceiverContainer might be empty."
);
93
}
94
95
pObj =
SG::asStorable
( std::move(cont) );
96
97
return
StatusCode::SUCCESS;
98
}
99
100
StatusCode
TileMuRcvContByteStreamCnv::createRepConst
(DataObject* pObj, IOpaqueAddress*& pAddr)
const
101
{
102
ATH_MSG_DEBUG
(
" Executing createRep method"
);
103
104
// get Full Event Assembler
105
FullEventAssembler<TileHid2RESrcID>
* fea = 0;
106
std::string key(
"Tile"
);
107
108
ATH_CHECK
(
m_byteStreamCnvSvc
->getFullEventAssembler(fea, key) );
109
110
// create TileMuonReceiverContainer
111
//
112
TileMuonReceiverContainer
* muRcvCont(0);
113
SG::fromStorable
(pObj, muRcvCont);
114
if
(!muRcvCont){
115
ATH_MSG_ERROR
(
" Can not cast to TileMuonReceiverContainer "
);
116
return
StatusCode::FAILURE;
117
}
118
119
std::string
name
= pObj->registry()->name();
120
ByteStreamAddress
* addr =
new
ByteStreamAddress
(
classID
(),
name
,
""
);
121
122
pAddr = addr;
123
124
// call TileMuRcvContByteStreamTool
125
ATH_CHECK
(
m_tool
->convert(muRcvCont,fea) );
126
127
return
StatusCode::SUCCESS;
128
}
129
130
StatusCode
TileMuRcvContByteStreamCnv::finalize
()
131
{
132
return
Converter::finalize();
133
}
re
const std::regex re(r_e)
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ByteStreamAddress.h
ByteStreamCnvSvcBase.h
CLASS_DEF.h
macros to associate a CLID to a type
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
IByteStreamCnvSvc.h
IROBDataProviderSvc.h
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
RawEvent.h
RawEvent
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Definition
RawEvent.h:37
StoreClearedIncident.h
Incident sent after a store is cleared.
TileMuonReceiverContainer
TileContainer< TileMuonReceiverObj > TileMuonReceiverContainer
Definition
TileContainer.h:71
TileMuRcvContByteStreamCnv.h
TileMuRcvContByteStreamTool.h
TileROD_Decoder.h
AthConstConverter::AthConstConverter
AthConstConverter(long storage_type, const CLID &class_type, ISvcLocator *svc, const std::string &name)
Definition
AthConstConverter.h:35
AthConstConverter::name
const std::string & name() const
Definition
AthConstConverter.h:67
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
FullEventAssembler
Template class for assembling a full atlas raw event from subfragments.
Definition
FullEventAssembler.h:38
TileMuRcvContByteStreamCnv::m_tool
ToolHandle< BYTESTREAMTOOL > m_tool
Pointer to TileMuRcvContByteStreamTool.
Definition
TileMuRcvContByteStreamCnv.h:54
TileMuRcvContByteStreamCnv::m_decoder
ToolHandle< TileROD_Decoder > m_decoder
Pointer to TileROD_Decoder.
Definition
TileMuRcvContByteStreamCnv.h:65
TileMuRcvContByteStreamCnv::m_byteStreamCnvSvc
ServiceHandle< IByteStreamCnvSvc > m_byteStreamCnvSvc
Definition
TileMuRcvContByteStreamCnv.h:56
TileMuRcvContByteStreamCnv::finalize
virtual StatusCode finalize() override
Definition
TileMuRcvContByteStreamCnv.cxx:130
TileMuRcvContByteStreamCnv::TileMuRcvContByteStreamCnv
TileMuRcvContByteStreamCnv(ISvcLocator *svcloc)
Definition
TileMuRcvContByteStreamCnv.cxx:33
TileMuRcvContByteStreamCnv::m_storeGate
ServiceHandle< StoreGateSvc > m_storeGate
Pointer to StoreGateSvc.
Definition
TileMuRcvContByteStreamCnv.h:59
TileMuRcvContByteStreamCnv::classID
static CLID classID()
Definition
TileMuRcvContByteStreamCnv.cxx:43
TileMuRcvContByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition
TileMuRcvContByteStreamCnv.cxx:51
TileMuRcvContByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Convert the transient object to the requested representation.
Definition
TileMuRcvContByteStreamCnv.cxx:100
TileMuRcvContByteStreamCnv::m_robSvc
ServiceHandle< IROBDataProviderSvc > m_robSvc
Pointer to IROBDataProviderSvc.
Definition
TileMuRcvContByteStreamCnv.h:62
TileMuRcvContByteStreamCnv::storageType
static long storageType()
Definition
TileMuRcvContByteStreamCnv.cxx:47
TileMuRcvContByteStreamCnv::createObjConst
virtual StatusCode createObjConst(IOpaqueAddress *pAddr, DataObject *&pObj) const override
Create the transient representation of an object.
Definition
TileMuRcvContByteStreamCnv.cxx:73
SG::fromStorable
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
Definition
StorableConversions.h:169
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