ATLAS Offline Software
LArCalorimeter
LArCnv
LArByteStream
src
LArFebHeaderContByteStreamCnv.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 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 "
ByteStreamCnvSvc/ByteStreamCnvSvc.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
const
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
ByteStreamAddress
*pRE_Addr;
60
pRE_Addr =
dynamic_cast<
ByteStreamAddress
*
>
(pAddr);
//Cast from OpaqueAddress to ByteStreamAddress
61
if
(!pRE_Addr) {
62
ATH_MSG_ERROR
(
"dynamic_cast of OpaqueAdress to ByteStreamAddress failed!"
);
63
return
StatusCode::FAILURE;
64
}
65
66
const
RawEvent
*
re
=
m_rdpSvc
->getEvent();
67
if
(!
re
) {
68
ATH_MSG_ERROR
(
"Could not get raw event from ByteStreamInputSvc"
);
69
return
StatusCode::FAILURE;
70
}
71
72
// Convert the RawEvent to LArFebHeaderContainer
73
ATH_MSG_DEBUG
(
"Converting LArFebHeaders (from ByteStream)."
);
74
LArFebHeaderContainer
*febHeaderContainer=
new
LArFebHeaderContainer
;
75
StatusCode
sc
=
m_tool
->convert(
re
,febHeaderContainer,(
CaloGain::CaloGain
)0);
76
if
(
sc
!=StatusCode::SUCCESS) {
77
ATH_MSG_WARNING
(
"Conversion tool returned an error. LArFebHeaderContainer might be empty."
);
78
}
79
80
pObj =
SG::asStorable
(febHeaderContainer) ;
81
82
return
StatusCode::SUCCESS;
83
}
84
85
StatusCode
LArFebHeaderContByteStreamCnv::createRepConst
(DataObject*
/*pObj*/
, IOpaqueAddress*&
/*pAddr*/
)
const
86
{
// convert LArFebHeaders from StoreGate into ByteStream
87
ATH_MSG_ERROR
(
"CreateRep method of LArFebHeaderContainer not implemented!"
);
88
return
StatusCode::SUCCESS;
89
}
initialize
void initialize()
Definition:
run_EoverP.cxx:894
RawEvent
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Definition:
RawEvent.h:37
LArRawDataContByteStreamTool.h
Helper tool for conversion of raw data classes to/from LArByteStream.
SG::asStorable
DataObject * asStorable(T *pObject)
Definition:
StorableConversions.h:158
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition:
AthMsgStreamMacros.h:28
AthConstConverter
Gaudi converter base class with const interfaces.
Definition:
AthConstConverter.h:33
LArFebHeaderContByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Convert the transient object to the requested representation.
Definition:
LArFebHeaderContByteStreamCnv.cxx:85
LArFebHeaderContByteStreamCnv.h
AthenaPoolTestRead.sc
sc
Definition:
AthenaPoolTestRead.py:27
LArFebHeaderContByteStreamCnv::classID
static const CLID & classID()
Definition:
LArFebHeaderContByteStreamCnv.cxx:31
ClassID_traits::ID
static const CLID & ID()
the CLID of T
Definition:
Control/AthenaKernel/AthenaKernel/ClassID_traits.h:50
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition:
AthMsgStreamMacros.h:33
LArFebHeaderContByteStreamCnv::m_tool
ToolHandle< BYTESTREAMTOOL > m_tool
Definition:
LArFebHeaderContByteStreamCnv.h:52
RawEvent.h
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
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition:
ByteStreamAddress.h:28
ATH_CHECK
#define ATH_CHECK
Definition:
AthCheckMacros.h:40
ByteStreamAddress.h
ByteStreamCnvSvc.h
CLID
uint32_t CLID
The Class ID type.
Definition:
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
LArFebHeaderContainer.h
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:195
CaloGain::CaloGain
CaloGain
Definition:
CaloGain.h:11
LArFebHeaderContByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition:
LArFebHeaderContByteStreamCnv.cxx:37
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition:
AthMsgStreamMacros.h:32
re
const boost::regex re(r_e)
LArFebHeaderContainer
Container class for LArFebHeader.
Definition:
LArFebHeaderContainer.h:20
ByteStreamCnvSvcBase.h
LArFebHeaderContByteStreamCnv::m_rdpSvc
ServiceHandle< IROBDataProviderSvc > m_rdpSvc
Definition:
LArFebHeaderContByteStreamCnv.h:53
LArFebHeaderContByteStreamCnv::LArFebHeaderContByteStreamCnv
LArFebHeaderContByteStreamCnv(ISvcLocator *svcloc)
Definition:
LArFebHeaderContByteStreamCnv.cxx:25
CaloGain.h
CLASS_DEF.h
macros to associate a CLID to a type
IROBDataProviderSvc.h
LArFebHeaderContByteStreamCnv::createObjConst
virtual StatusCode createObjConst(IOpaqueAddress *pAddr, DataObject *&pObj) const override
Create the transient representation of an object.
Definition:
LArFebHeaderContByteStreamCnv.cxx:51
Generated on Thu Jul 4 2024 21:20:17 for ATLAS Offline Software by
1.8.18