ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
BCM_RawDataByteStreamCnv
src
BCM_RawDataProvider.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// BCM_RawDataProvider.cxx
7
// Implementation file for class BCM_RawDataProvider
9
// Version 00-00-01 12/05/2008 Daniel Dobos
10
// Version 00-00-02 19/05/2008 Daniel Dobos
11
// Version 00-00-11 09/02/2009 Daniel Dobos
13
14
#include "
BCM_RawDataProvider.h
"
15
#include "
BCM_RawDataProviderTool.h
"
16
#include "
InDetBCM_RawData/BCM_RDO_Container.h
"
17
19
// destructor
21
BCM_RawDataProvider::~BCM_RawDataProvider
(){
22
}
23
25
// initialize() -
27
StatusCode
BCM_RawDataProvider::initialize
() {
28
29
if
(
msgLvl
(MSG::INFO))
msg
(MSG::INFO) <<
"BCM_RawDataProvider::initialize"
<<
endmsg
;
30
31
// Get ROBDataProviderSvc
32
if
(
m_robDataProvider
.retrieve().isFailure()) {
33
if
(
msgLvl
(MSG::FATAL))
msg
(MSG::FATAL) <<
"Failed to retrieve service "
<<
m_robDataProvider
<<
endmsg
;
34
return
StatusCode::FAILURE;
35
}
else
36
if
(
msgLvl
(MSG::INFO))
msg
(MSG::INFO) <<
"Retrieved service "
<<
m_robDataProvider
<<
endmsg
;
37
38
// Get BCMRawDataProviderTool
39
if
(
m_rawDataTool
.retrieve().isFailure()) {
40
if
(
msgLvl
(MSG::FATAL))
msg
(MSG::FATAL) <<
"Failed to retrieve tool "
<<
m_rawDataTool
<<
endmsg
;
41
return
StatusCode::FAILURE;
42
}
else
43
if
(
msgLvl
(MSG::INFO))
msg
(MSG::INFO) <<
"Retrieved tool "
<<
m_rawDataTool
<<
endmsg
;
44
45
ATH_CHECK
(
m_RDO_Key
.initialize() );
46
47
return
StatusCode::SUCCESS;
48
}
49
51
// execute() -
53
StatusCode
BCM_RawDataProvider::execute
(
const
EventContext& ctx)
const
{
54
55
if
(
msgLvl
(MSG::DEBUG))
msg
(MSG::DEBUG) <<
"Create BCM RDO Container"
<<
endmsg
;
56
auto
container = std::make_unique<BCM_RDO_Container>();
57
58
// ask ROBDataProviderSvc for the vector of ROBFragment for all BCM ROBIDs
59
// std::vector<const ROBFragment*> listOfRobf_all;
60
std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> listOfRobf;
61
62
// std::vector<unsigned int> ROBIDs_all;
63
std::vector<unsigned int> ROBIDs;
64
// changed 0x0081000A -> 0x0081004A and 0x0081000C -> 0x0081004C
65
/*
66
// Run-1 IDs
67
ROBIDs_all.push_back(0x0081000A);
68
ROBIDs_all.push_back(0x0081000C);
69
70
//Run-2 IDs
71
ROBIDs_all.push_back(0x0081004A);
72
ROBIDs_all.push_back(0x0081004C);
73
*/
74
//Run-1 ID
75
ROBIDs.push_back(0x0081000A);
76
ROBIDs.push_back(0x0081000C);
77
//Run-2 IDs
78
ROBIDs.push_back(0x0081004A);
79
ROBIDs.push_back(0x0081004C);
80
81
//m_robDataProvider->getROBData(ROBIDs_all, listOfRobf_all);
82
83
m_robDataProvider
->getROBData(ctx,ROBIDs, listOfRobf);
84
85
// For Run-1 if 4 fragment present select only the PRO BCM
86
/*
87
if( listOfRobf_all.size() == 4 ) {
88
ROBIDs.push_back(0x0081000A);
89
ROBIDs.push_back(0x0081000C);
90
}
91
*/
92
93
if
(
msgLvl
(MSG::DEBUG))
msg
(MSG::DEBUG) <<
"Number of ROB fragments is "
<< listOfRobf.size() <<
endmsg
;
94
95
// ask BCM_RawDataProviderTool to decode it and to fill the container
96
if
(
m_rawDataTool
->convert(listOfRobf,container.get()).isFailure())
97
if
(
msgLvl
(MSG::ERROR))
msg
(MSG::ERROR) <<
"BS conversion into RDOs failed"
<<
endmsg
;
98
99
if
(
msgLvl
(MSG::DEBUG))
msg
(MSG::DEBUG) <<
"Number of collections in container is "
<< container->size() <<
endmsg
;
100
101
ATH_CHECK
(
SG::makeHandle
(
m_RDO_Key
,ctx).record (std::move (container)) );
102
103
return
StatusCode::SUCCESS;
104
}
105
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
BCM_RDO_Container.h
BCM_RawDataProviderTool.h
BCM_RawDataProvider.h
AthCommonAlgorithm< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition
AthCommonMsg.h:30
AthCommonAlgorithm< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition
AthCommonMsg.h:24
BCM_RawDataProvider::~BCM_RawDataProvider
virtual ~BCM_RawDataProvider()
Destructor.
Definition
BCM_RawDataProvider.cxx:21
BCM_RawDataProvider::execute
virtual StatusCode execute(const EventContext &ctx) const override
Execute.
Definition
BCM_RawDataProvider.cxx:53
BCM_RawDataProvider::m_rawDataTool
ToolHandle< BCM_RawDataProviderTool > m_rawDataTool
Definition
BCM_RawDataProvider.h:44
BCM_RawDataProvider::m_RDO_Key
SG::WriteHandleKey< BCM_RDO_Container > m_RDO_Key
Definition
BCM_RawDataProvider.h:45
BCM_RawDataProvider::m_robDataProvider
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Definition
BCM_RawDataProvider.h:43
BCM_RawDataProvider::initialize
virtual StatusCode initialize() override
Initialize.
Definition
BCM_RawDataProvider.cxx:27
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:269
Generated on
for ATLAS Offline Software by
1.17.0