ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCnv
LArByteStream
src
LArFebHeaderContByteStreamCnv.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
#include "
LArByteStream/LArFebHeaderContByteStreamCnv.h
"
6
#include "
LArByteStream/LArRawDataContByteStreamTool.h
"
7
8
#include "
CaloIdentifier/CaloGain.h
"
9
10
#include "
ByteStreamCnvSvcBase/IByteStreamCnvSvc.h
"
11
#include "
ByteStreamCnvSvcBase/ByteStreamCnvSvcBase.h
"
12
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
13
#include "
ByteStreamCnvSvcBase/IROBDataProviderSvc.h
"
14
#include "
ByteStreamData/RawEvent.h
"
15
16
#include "
LArRawEvent/LArFebHeaderContainer.h
"
17
18
#include "
AthenaKernel/CLASS_DEF.h
"
19
20
//STL-Stuff
21
#include <map>
22
#include <iostream>
23
24
25
LArFebHeaderContByteStreamCnv::LArFebHeaderContByteStreamCnv
(ISvcLocator* svcloc) :
26
AthConstConverter
(
storageType
(),
classID
(),svcloc,
"LArFebHeaderContByteStreamCnv"
),
27
m_tool
(
"LArRawDataContByteStreamTool"
),
28
m_rdpSvc
(
"ROBDataProviderSvc"
,
name
())
29
{}
30
31
CLID
LArFebHeaderContByteStreamCnv::classID
(){
32
return
ClassID_traits<LArFebHeaderContainer>::ID
() ;
33
}
34
35
36
StatusCode
37
LArFebHeaderContByteStreamCnv::initialize
()
38
{
39
ATH_CHECK
( AthConstConverter::initialize() );
40
41
if
(
m_rdpSvc
.retrieve().isFailure()) {
42
ATH_MSG_WARNING
(
" Can't get ByteStreamInputSvc interface Reading of ByteStream Data not possible. "
);
43
}
44
45
ATH_CHECK
(
m_tool
.retrieve() );
46
47
return
StatusCode::SUCCESS;
48
}
49
50
51
StatusCode
LArFebHeaderContByteStreamCnv::createObjConst
(IOpaqueAddress* pAddr, DataObject*& pObj)
const
52
{
//Convert Digits from ByteStream to StoreGate
53
ATH_MSG_VERBOSE
(
"Executing CreateObj method for LArFebHeaderContainer "
);
54
55
if
(!
m_rdpSvc
) {
56
ATH_MSG_ERROR
(
" ROBDataProviderSvc not loaded. Can't read ByteStream."
);
57
return
StatusCode::FAILURE;
58
}
59
60
ByteStreamAddress
* pRE_Addr{};
61
ATH_CHECK
( (pRE_Addr =
dynamic_cast<
ByteStreamAddress
*
>
(pAddr)) !=
nullptr
);
62
63
const
EventContext& ctx = pRE_Addr->
getEventContext
();
64
const
RawEvent
*
re
=
m_rdpSvc
->getEvent(ctx);
65
if
(!
re
) {
66
ATH_MSG_ERROR
(
"Could not get raw event from ByteStreamInputSvc"
);
67
return
StatusCode::FAILURE;
68
}
69
70
// Convert the RawEvent to LArFebHeaderContainer
71
ATH_MSG_DEBUG
(
"Converting LArFebHeaders (from ByteStream)."
);
72
LArFebHeaderContainer
*febHeaderContainer=
new
LArFebHeaderContainer
;
73
StatusCode
sc
=
m_tool
->convert(
re
,febHeaderContainer,(
CaloGain::CaloGain
)0);
74
if
(
sc
!=StatusCode::SUCCESS) {
75
ATH_MSG_WARNING
(
"Conversion tool returned an error. LArFebHeaderContainer might be empty."
);
76
}
77
78
pObj =
SG::asStorable
(febHeaderContainer) ;
79
80
return
StatusCode::SUCCESS;
81
}
82
83
StatusCode
LArFebHeaderContByteStreamCnv::createRepConst
(DataObject*
/*pObj*/
, IOpaqueAddress*&
/*pAddr*/
)
const
84
{
// convert LArFebHeaders from StoreGate into ByteStream
85
ATH_MSG_ERROR
(
"CreateRep method of LArFebHeaderContainer not implemented!"
);
86
return
StatusCode::SUCCESS;
87
}
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_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
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
CaloGain.h
CLASS_DEF.h
macros to associate a CLID to a type
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
IByteStreamCnvSvc.h
IROBDataProviderSvc.h
LArFebHeaderContByteStreamCnv.h
LArFebHeaderContainer.h
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
LArRawDataContByteStreamTool.h
Helper tool for conversion of raw data classes to/from LArByteStream.
RawEvent.h
RawEvent
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Definition
RawEvent.h:37
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
LArFebHeaderContByteStreamCnv::LArFebHeaderContByteStreamCnv
LArFebHeaderContByteStreamCnv(ISvcLocator *svcloc)
Definition
LArFebHeaderContByteStreamCnv.cxx:25
LArFebHeaderContByteStreamCnv::m_rdpSvc
ServiceHandle< IROBDataProviderSvc > m_rdpSvc
Definition
LArFebHeaderContByteStreamCnv.h:52
LArFebHeaderContByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Convert the transient object to the requested representation.
Definition
LArFebHeaderContByteStreamCnv.cxx:83
LArFebHeaderContByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition
LArFebHeaderContByteStreamCnv.cxx:37
LArFebHeaderContByteStreamCnv::storageType
static long storageType()
Definition
LArFebHeaderContByteStreamCnv.h:47
LArFebHeaderContByteStreamCnv::m_tool
ToolHandle< BYTESTREAMTOOL > m_tool
Definition
LArFebHeaderContByteStreamCnv.h:51
LArFebHeaderContByteStreamCnv::classID
static CLID classID()
Definition
LArFebHeaderContByteStreamCnv.cxx:31
LArFebHeaderContByteStreamCnv::createObjConst
virtual StatusCode createObjConst(IOpaqueAddress *pAddr, DataObject *&pObj) const override
Create the transient representation of an object.
Definition
LArFebHeaderContByteStreamCnv.cxx:51
LArFebHeaderContainer
Container class for LArFebHeader.
Definition
LArFebHeaderContainer.h:20
CaloGain::CaloGain
CaloGain
Definition
CaloGain.h:11
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