ATLAS Offline Software
Loading...
Searching...
No Matches
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"
17
19// destructor
23
25// 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() -
53StatusCode 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
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
bool msgLvl(const MSG::Level lvl) const
virtual ~BCM_RawDataProvider()
Destructor.
virtual StatusCode execute(const EventContext &ctx) const override
Execute.
ToolHandle< BCM_RawDataProviderTool > m_rawDataTool
SG::WriteHandleKey< BCM_RDO_Container > m_RDO_Key
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
virtual StatusCode initialize() override
Initialize.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())