ATLAS Offline Software
Loading...
Searching...
No Matches
ALFA_RawDataProvider_charge.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_charge
9// (c) ATLAS ALFA Detector software
11
13
15// constructor
17ALFA_RawDataProvider_charge::ALFA_RawDataProvider_charge(const std::string& name, ISvcLocator* pSvcLocator):
18 AthAlgorithm (name, pSvcLocator),
19 m_robDataProvider("ROBDataProviderSvc",name),
20 m_rawDataTool_charge("ALFA_RawDataProviderTool_charge"),
23{
24 declareProperty("ALFA_RawDataCollectionKey_charge", m_ALFA_RawDataCollectionKey_charge = "ALFA_RawData_charge");
25 declareProperty ("ProviderTool_charge", m_rawDataTool_charge);
26}
27
29// destructor
33
35// initialize() -
38
39 msg(MSG::DEBUG) << "ALFA_RawDataProvider_charge::initialize" << endmsg;
40
41 // Get ROBDataProviderSvc
42 if (m_robDataProvider.retrieve().isFailure()) {
43 msg(MSG::FATAL) << "Failed to retrieve service " << m_robDataProvider << endmsg;
44 return StatusCode::FAILURE;
45 } else
46 msg(MSG::DEBUG) << "Retrieved service " << m_robDataProvider << endmsg;
47
48 // Get ALFARawDataProviderTool
49 if (m_rawDataTool_charge.retrieve().isFailure()) {
50 msg(MSG::FATAL) << "Failed to retrieve service " << m_rawDataTool_charge << endmsg;
51 return StatusCode::FAILURE;
52 } else
53 msg(MSG::DEBUG) << "Retrieved service " << m_rawDataTool_charge << endmsg;
54
55 return StatusCode::SUCCESS;
56}
57
58
59
60
61
63// execute() -
66
67msg(MSG::DEBUG) << "ALFA_RawDataProvider_charge::EXECUTE" << endmsg;
68
69
71 msg(MSG::DEBUG) << " Created ALFA RDO Container_charge" << endmsg;
72
73 StatusCode sc;
74
76
77 if (sc.isFailure()) {
78 msg(MSG::FATAL) << "Unable to record ALFA RDO Container_charge" << endmsg;
79 return StatusCode::FAILURE;
80 } else if (sc.isSuccess()){
81 msg(MSG::DEBUG) << "ALFA RDO Container_charge recorded" << endmsg;
82 }
83
84
85
86 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> listOfRobf;
87 std::vector<unsigned int> ROBIDs;
88 ROBIDs.push_back(0x00840000);
89 ROBIDs.push_back(0x00840001);
90
91 m_robDataProvider->getROBData(Gaudi::Hive::currentContext(), ROBIDs, listOfRobf);
92
93
94 msg(MSG::DEBUG) << " ROB ID " << std::hex <<ROBIDs <<MSG::dec<< endmsg;
95
96 msg(MSG::DEBUG) << " Number of ROB fragments is " << listOfRobf.size() << endmsg;
97
98 // ask ALFA_RawDataProviderTool to decode it and to fill the container
99
100 if (m_rawDataTool_charge->convert_charge(listOfRobf,container).isFailure()){
101 msg(MSG::ERROR) << "BS conversion into RDOs failed" << endmsg;
102} else
103 msg(MSG::DEBUG) << " Number of collections in container is " << container->size() << endmsg;
104
105
106 // check retrieve from StoreGate ///////////////////////////////////////////////////////////
107
109 if (sc.isSuccess())
110 {
111 msg(MSG::DEBUG) << "ALFA RDO Container retrieved" << endmsg;
112 } // end check
113
114 return StatusCode::SUCCESS;
115}
116
#define endmsg
static Double_t sc
This container provides acces to the PMF RDOs.
ALFA_RawDataProvider_charge(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
ToolHandle< ALFA_RawDataProviderTool_charge > m_rawDataTool_charge
Tool that does the actual work.
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Service for reading bytestream.
virtual StatusCode initialize()
Initialize.
virtual StatusCode execute()
Execute.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
MsgStream & msg() const