ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
AFP
AFP_ByteStream2RawCnv
src
AFP_RawDataProviderTool.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
// AFP_ByteStream2RawCnv includes
6
#include "
AFP_ByteStream2RawCnv/AFP_RawDataProviderTool.h
"
7
8
static
const
InterfaceID
9
IID_IAFP_RawCollByteStreamTool
(
"AFP_RawDataProviderTool"
, 1, 0);
10
const
InterfaceID &
AFP_RawDataProviderTool::interfaceID
() {
11
return
IID_IAFP_RawCollByteStreamTool
;
12
}
13
14
AFP_RawDataProviderTool::AFP_RawDataProviderTool
(
const
std::string &
type
,
15
const
std::string &name,
16
const
IInterface *parent)
17
:
AthAlgTool
(
type
, name, parent)
18
{
19
declareInterface<AFP_RawDataProviderTool>(
this
);
20
}
21
22
AFP_RawDataProviderTool::~AFP_RawDataProviderTool
() {}
23
24
StatusCode
AFP_RawDataProviderTool::initialize
() {
25
ATH_MSG_INFO
(
"Initializing "
<< name() <<
"..."
);
26
27
StatusCode
sc
= AthAlgTool::initialize();
28
ATH_MSG_DEBUG
(
"INITIALIZE AFP_RawDataProviderTool"
);
29
if
(
sc
.isFailure()) {
30
ATH_MSG_WARNING
(
" Failed to init baseclass"
);
31
return
StatusCode::SUCCESS;
32
}
33
34
if
(
m_decoder
.retrieve().isFailure()) {
35
ATH_MSG_WARNING
(
"FAILED TO RETRIEVE TOOL "
<<
m_decoder
);
36
return
StatusCode::SUCCESS;
37
}
else
{
38
ATH_MSG_DEBUG
(
"Retrieved decoder tool "
<<
m_decoder
);
39
}
40
return
StatusCode::SUCCESS;
41
}
42
43
StatusCode
44
AFP_RawDataProviderTool::convert
(std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *> &vecRobs,
45
AFP_RawContainer
*rawContainer)
const
46
{
47
std::set<uint32_t> robIdSet;
48
49
if
(!rawContainer) {
50
ATH_MSG_WARNING
(
"NULL pointer passed in rawContainer."
);
51
return
StatusCode::SUCCESS;
52
}
53
54
if
(vecRobs.empty()) {
55
ATH_MSG_DEBUG
(
"vecRobs.size() == 0"
);
56
return
StatusCode::SUCCESS;
57
}
58
59
// Loop over robs and fill rawContainer
60
for
(
const
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment
* rob : vecRobs) {
61
const
uint32_t robId = rob->rod_source_id();
62
63
if
(robIdSet.insert(robId).second) {
64
StatusCode
sc
=
m_decoder
->fillCollection(rob, rawContainer);
65
if
(
sc
.isFailure()) {
66
ATH_MSG_ERROR
(
"Failed filling collection"
);
67
return
StatusCode::FAILURE;
68
}
69
}
70
71
}
// end for loop
72
73
return
StatusCode::SUCCESS;
74
}
75
76
StatusCode
AFP_RawDataProviderTool::finalize
() {
77
StatusCode
sc
= AthAlgTool::finalize();
78
ATH_MSG_DEBUG
(
"FINALIZE AFP_RawDataProviderTool"
);
79
if
(
sc
.isFailure()) {
80
ATH_MSG_WARNING
(
"FINALIZE failed"
);
81
return
StatusCode::SUCCESS;
82
}
83
84
return
StatusCode::SUCCESS;
85
}
IID_IAFP_RawCollByteStreamTool
static const InterfaceID IID_IAFP_RawCollByteStreamTool("AFP_RawDataProviderTool", 1, 0)
AFP_RawDataProviderTool.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
AFP_RawContainer
Definition
AFP_RawContainer.h:14
AFP_RawDataProviderTool::convert
StatusCode convert(std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vecRobs, AFP_RawContainer *rawContainer) const
Fill rawContainer with collections created from provided vecRobs.
Definition
AFP_RawDataProviderTool.cxx:44
AFP_RawDataProviderTool::initialize
virtual StatusCode initialize()
Definition
AFP_RawDataProviderTool.cxx:24
AFP_RawDataProviderTool::~AFP_RawDataProviderTool
virtual ~AFP_RawDataProviderTool()
Does nothing.
Definition
AFP_RawDataProviderTool.cxx:22
AFP_RawDataProviderTool::finalize
virtual StatusCode finalize()
Definition
AFP_RawDataProviderTool.cxx:76
AFP_RawDataProviderTool::interfaceID
static const InterfaceID & interfaceID()
Definition
AFP_RawDataProviderTool.cxx:10
AFP_RawDataProviderTool::m_decoder
ToolHandle< AFP_ByteStream2RawCnv > m_decoder
Definition
AFP_RawDataProviderTool.h:39
AFP_RawDataProviderTool::AFP_RawDataProviderTool
AFP_RawDataProviderTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
AFP_RawDataProviderTool.cxx:14
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment
eformat::ROBFragment< PointerType > ROBFragment
Definition
RawEvent.h:27
type
Generated on
for ATLAS Offline Software by
1.17.0