ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
AFP
AFP_ByteStream2RawCnv
src
AFP_RawDataProvider.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 includes
6
7
// AFP_ByteStream2RawCnv includes
8
#include "
AFP_ByteStream2RawCnv/AFP_RawDataProvider.h
"
9
10
#include "
AFP_RawEv/AFP_RawContainer.h
"
11
12
13
AFP_RawDataProvider::AFP_RawDataProvider
(
const
std::string &name,
14
ISvcLocator *pSvcLocator)
15
:
AthReentrantAlgorithm
(name, pSvcLocator),
16
m_robDataProvider
(
"ROBDataProviderSvc"
, name)
17
{
18
}
19
20
AFP_RawDataProvider::~AFP_RawDataProvider
() {}
21
22
StatusCode
AFP_RawDataProvider::initialize
() {
23
ATH_MSG_DEBUG
(
"AFP_RawDataProvider::initialize"
);
24
25
if
(
m_robDataProvider
.retrieve().isFailure()) {
26
ATH_MSG_WARNING
(
"Failed to retrieve service "
<<
m_robDataProvider
);
27
return
StatusCode::SUCCESS;
28
}
else
29
ATH_MSG_DEBUG
(
"Retrieved service "
<<
m_robDataProvider
);
30
31
if
(
m_rawDataTool
.retrieve().isFailure()) {
32
ATH_MSG_WARNING
(
"Failed to retrieve service "
<<
m_rawDataTool
);
33
return
StatusCode::SUCCESS;
34
}
else
{
35
ATH_MSG_DEBUG
(
"Retrieved service "
<<
m_rawDataTool
);
36
}
37
38
ATH_CHECK
(
m_AFP_RawContainerKey
.initialize());
39
40
return
StatusCode::SUCCESS;
41
}
42
43
StatusCode
AFP_RawDataProvider::execute
(
const
EventContext &ctx)
const
{
44
ATH_MSG_DEBUG
(
"AFP_RawDataProvider::EXECUTE"
);
45
auto
container = std::make_unique<AFP_RawContainer>();
46
ATH_MSG_DEBUG
(
"Created AFP RDO Container"
);
47
48
std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *> listOfRobf;
49
50
m_robDataProvider
->getROBData(ctx,
m_robIDs
, listOfRobf);
51
ATH_MSG_DEBUG
(
" ROB ID "
<< std::hex <<
m_robIDs
<<std::dec);
52
ATH_MSG_DEBUG
(
" Number of ROB fragments is "
<< listOfRobf.size());
53
54
if
(
m_rawDataTool
->convert(listOfRobf, container.get()).isFailure()) {
55
ATH_MSG_ERROR
(
"Bytestream conversion into raw failed"
);
56
return
StatusCode::FAILURE;
57
}
else
{
58
ATH_MSG_DEBUG
(
" Number of time-of-flight collections in container is "
59
<< container->collectionsToF().size());
60
ATH_MSG_DEBUG
(
" Number of silicon collections in container is "
61
<< container->collectionsSi().size());
62
}
63
64
SG::WriteHandle<AFP_RawContainer>
writeHandle{
m_AFP_RawContainerKey
, ctx};
65
StatusCode recordSC = writeHandle.
record
(std::move(container));
66
if
(recordSC.isFailure()) {
67
ATH_MSG_WARNING
(
"Unable to record AFP RDO Container"
);
68
return
StatusCode::SUCCESS;
69
}
else
{
70
ATH_MSG_DEBUG
(
"AFP RDO Container recorded"
);
71
}
72
73
return
StatusCode::SUCCESS;
74
}
AFP_RawContainer.h
AFP_RawDataProvider.h
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
AFP_RawDataProvider::~AFP_RawDataProvider
virtual ~AFP_RawDataProvider()
Does nothing.
Definition
AFP_RawDataProvider.cxx:20
AFP_RawDataProvider::m_robIDs
const std::vector< unsigned int > m_robIDs
vector of robIDs from which data should be processed
Definition
AFP_RawDataProvider.h:51
AFP_RawDataProvider::initialize
virtual StatusCode initialize()
Initialise tool and service.
Definition
AFP_RawDataProvider.cxx:22
AFP_RawDataProvider::m_AFP_RawContainerKey
SG::WriteHandleKey< AFP_RawContainer > m_AFP_RawContainerKey
name used to store AFP_RawContainer in StoreGate
Definition
AFP_RawDataProvider.h:47
AFP_RawDataProvider::execute
virtual StatusCode execute(const EventContext &ctx) const
Creates raw objects from bytestream.
Definition
AFP_RawDataProvider.cxx:43
AFP_RawDataProvider::AFP_RawDataProvider
AFP_RawDataProvider(const std::string &name, ISvcLocator *pSvcLocator)
Definition
AFP_RawDataProvider.cxx:13
AFP_RawDataProvider::m_robDataProvider
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Definition
AFP_RawDataProvider.h:43
AFP_RawDataProvider::m_rawDataTool
ToolHandle< AFP_RawDataProviderTool > m_rawDataTool
Definition
AFP_RawDataProvider.h:44
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Generated on
for ATLAS Offline Software by
1.17.0