ATLAS Offline Software
Loading...
Searching...
No Matches
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
13
15// constructor
17ALFA_RawDataProvider::ALFA_RawDataProvider(const std::string& name, ISvcLocator* pSvcLocator):
18 AthAlgorithm (name, pSvcLocator),
19 m_robDataProvider("ROBDataProviderSvc",name),
20 m_rawDataTool("ALFA_RawDataProviderTool"),
23{
24 declareProperty("ALFA_RawDataCollectionKey", m_ALFA_RawDataCollectionKey = "ALFA_RawData");
25 declareProperty ("ProviderTool", m_rawDataTool);
26}
27
29// destructor
32
34// 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() -
68{
69
70 msg(MSG::DEBUG) << "ALFA_RawDataProvider::EXECUTE" << endmsg;
71
72
74 msg(MSG::DEBUG) << " Created ALFA RDO Container" << endmsg;
75
76 StatusCode sc;
77
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(Gaudi::Hive::currentContext(), 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
115 if (sc.isSuccess())
116 {
117 msg(MSG::DEBUG) << "ALFA RDO Container retrieved" << endmsg;
118 } // end check
119
120 return StatusCode::SUCCESS;
121}
122
#define endmsg
static Double_t sc
This container provides acces to the PMF RDOs.
std::string m_ALFA_RawDataCollectionKey
virtual StatusCode initialize()
Initialize.
ALFA_RawDataProvider(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
virtual StatusCode execute()
Execute.
ToolHandle< ALFA_RawDataProviderTool > m_rawDataTool
Tool that does the actual work.
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Service for reading bytestream.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
MsgStream & msg() const