ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
ALFA
ALFA_EventCnv
ALFA_RawDataByteStreamCnv
src
ALFA_RawDataProvider.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// ALFA_RawDataProvider.cxx
7
// Implementation file for class ALFA_RawDataProvider
9
// (c) ATLAS ALFA Detector software
11
12
#include "
ALFA_RawDataByteStreamCnv/ALFA_RawDataProvider.h
"
13
15
// constructor
17
ALFA_RawDataProvider::ALFA_RawDataProvider
(
const
std::string& name, ISvcLocator* pSvcLocator):
18
AthAlgorithm
(name, pSvcLocator),
19
m_robDataProvider
(
"ROBDataProviderSvc"
,name),
20
m_rawDataTool
(
"ALFA_RawDataProviderTool"
),
21
m_ALFA_RawDataCollectionKey
(),
22
m_collection
()
23
{
24
declareProperty
(
"ALFA_RawDataCollectionKey"
,
m_ALFA_RawDataCollectionKey
=
"ALFA_RawData"
);
25
declareProperty
(
"ProviderTool"
,
m_rawDataTool
);
26
}
27
29
// destructor
31
ALFA_RawDataProvider::~ALFA_RawDataProvider
(){}
32
34
// initialize() -
36
StatusCode
ALFA_RawDataProvider::initialize
()
37
{
38
39
msg
(MSG::DEBUG) <<
"ALFA_RawDataProvider::initialize"
<<
endmsg
;
40
41
// Get ROBDataProviderSvc
42
if
(
m_robDataProvider
.retrieve().isFailure())
43
{
44
msg
(MSG::FATAL) <<
"Failed to retrieve service "
<<
m_robDataProvider
<<
endmsg
;
45
return
StatusCode::FAILURE;
46
}
else
47
msg
(MSG::DEBUG) <<
"Retrieved service "
<<
m_robDataProvider
<<
endmsg
;
48
49
// Get ALFARawDataProviderTool
50
if
(
m_rawDataTool
.retrieve().isFailure())
51
{
52
msg
(MSG::FATAL) <<
"Failed to retrieve service "
<<
m_rawDataTool
<<
endmsg
;
53
return
StatusCode::FAILURE;
54
}
else
55
msg
(MSG::DEBUG) <<
"Retrieved service "
<<
m_rawDataTool
<<
endmsg
;
56
57
return
StatusCode::SUCCESS;
58
}
59
60
61
62
63
65
// execute() -
67
StatusCode
ALFA_RawDataProvider::execute
(
const
EventContext& ctx)
68
{
69
70
msg
(MSG::DEBUG) <<
"ALFA_RawDataProvider::EXECUTE"
<<
endmsg
;
71
72
73
ALFA_RawDataContainer
*container =
new
ALFA_RawDataContainer
();
74
msg
(MSG::DEBUG) <<
" Created ALFA RDO Container"
<<
endmsg
;
75
76
StatusCode
sc
;
77
78
sc
=
evtStore
()->record(container,
m_ALFA_RawDataCollectionKey
);
79
80
if
(
sc
.isFailure())
81
{
82
msg
(MSG::FATAL) <<
"Unable to record ALFA RDO Container"
<<
endmsg
;
83
return
StatusCode::FAILURE;
84
}
else
if
(
sc
.isSuccess()){
85
msg
(MSG::DEBUG) <<
"ALFA RDO Container recorded"
<<
endmsg
;
86
}
87
88
89
90
std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> listOfRobf;
91
std::vector<unsigned int> ROBIDs;
92
ROBIDs.push_back(0x00840000);
93
ROBIDs.push_back(0x00840001);
94
95
m_robDataProvider
->getROBData(ctx, ROBIDs, listOfRobf);
96
97
98
msg
(MSG::DEBUG) <<
" ROB ID "
<< std::hex <<ROBIDs <<MSG::dec<<
endmsg
;
99
100
msg
(MSG::DEBUG) <<
" Number of ROB fragments is "
<< listOfRobf.size() <<
endmsg
;
101
102
// ask ALFA_RawDataProviderTool to decode it and to fill the container
103
104
if
(
m_rawDataTool
->convert(listOfRobf,container).isFailure())
105
{
106
msg
(MSG::ERROR) <<
"BS conversion into RDOs failed"
<<
endmsg
;
107
return
StatusCode::RECOVERABLE;
108
}
else
109
msg
(MSG::DEBUG) <<
" Number of collections in container is "
<< container->size() <<
endmsg
;
110
111
112
// check retrieve from StoreGate ///////////////////////////////////////////////////////////
113
114
sc
=
evtStore
()->retrieve(container,
m_ALFA_RawDataCollectionKey
);
115
if
(
sc
.isSuccess())
116
{
117
msg
(MSG::DEBUG) <<
"ALFA RDO Container retrieved"
<<
endmsg
;
118
}
// end check
119
120
return
StatusCode::SUCCESS;
121
}
122
ALFA_RawDataProvider.h
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
ALFA_RawDataContainer
This container provides acces to the PMF RDOs.
Definition
ALFA_RawDataContainer.h:21
ALFA_RawDataProvider::m_ALFA_RawDataCollectionKey
std::string m_ALFA_RawDataCollectionKey
Definition
ALFA_RawDataProvider.h:62
ALFA_RawDataProvider::initialize
virtual StatusCode initialize()
Initialize.
Definition
ALFA_RawDataProvider.cxx:36
ALFA_RawDataProvider::m_collection
std::string m_collection
Definition
ALFA_RawDataProvider.h:64
ALFA_RawDataProvider::~ALFA_RawDataProvider
~ALFA_RawDataProvider()
Destructor.
Definition
ALFA_RawDataProvider.cxx:31
ALFA_RawDataProvider::ALFA_RawDataProvider
ALFA_RawDataProvider(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
ALFA_RawDataProvider.cxx:17
ALFA_RawDataProvider::m_rawDataTool
ToolHandle< ALFA_RawDataProviderTool > m_rawDataTool
Tool that does the actual work.
Definition
ALFA_RawDataProvider.h:61
ALFA_RawDataProvider::m_robDataProvider
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Service for reading bytestream.
Definition
ALFA_RawDataProvider.h:58
ALFA_RawDataProvider::execute
virtual StatusCode execute(const EventContext &ctx)
Execute.
Definition
ALFA_RawDataProvider.cxx:67
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCommonAlgorithm< Gaudi::Algorithm >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
AthCommonAlgorithm< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition
AthCommonMsg.h:24
Generated on
for ATLAS Offline Software by
1.17.0