ATLAS Offline Software
Loading...
Searching...
No Matches
LUCID_ByteStreamRawDataCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5
8
10
11LUCID_ByteStreamRawDataCnv::LUCID_ByteStreamRawDataCnv(const std::string& name, ISvcLocator* pSvcLocator):
12 AthReentrantAlgorithm (name , pSvcLocator),
13 m_robDataProvider("ROBDataProviderSvc", name) {
14}
15
17
19
20 ATH_MSG_INFO("LUCID_ByteStreamRawDataCnv::initialize");
21
22 StatusCode sc = m_robDataProvider.retrieve();
23
24 if (sc.isFailure()) ATH_MSG_WARNING(" Could not retrieve ROBDataProviderSvc ");
25 else ATH_MSG_DEBUG (" Retrieved service ROBDataProviderSvc ");
26
28
29 return StatusCode::SUCCESS;
30}
31
32StatusCode LUCID_ByteStreamRawDataCnv::execute(const EventContext& ctx) const{
33
34 ATH_MSG_DEBUG(" LUCID_ByteStreamRawDataCnv::execute ");
35
36 std::vector<const ROBFragment*> listOfRobf;
37 std::vector<unsigned int> ROBIDs;
38
39 ROBIDs.push_back(m_rodDecoder.getSourceID());
40
41 m_robDataProvider->getROBData(ctx, ROBIDs, listOfRobf);
42
43 auto container = std::make_unique<LUCID_RawDataContainer>();
44
45 StatusCode sc = fillContainer(listOfRobf, *container);
46
47 if (sc.isFailure()) ATH_MSG_WARNING(" fillContainer failed ");
48 else ATH_MSG_DEBUG (" fillContainer success ");
49
51
52 return StatusCode::SUCCESS;
53}
54
55StatusCode
56LUCID_ByteStreamRawDataCnv::fillContainer(const std::vector<const ROBFragment*>& listOfRobf,
58
59 ATH_MSG_DEBUG(" LUCID_ByteStreamRawDataCnv::fillContainer ");
60
61 int nLucidFragments = listOfRobf.size();
62
63 ATH_MSG_DEBUG(" Number of LUCID ROB fragments: " << nLucidFragments);
64
65 if (!nLucidFragments) return StatusCode::SUCCESS;
66
67 for (const ROBFragment* frag : listOfRobf) {
68
69 uint32_t robid = frag->rod_source_id();
70
71 ATH_MSG_DEBUG(" ROB Fragment with ID: " << std::hex << robid << std::dec);
72
73 std::vector<uint32_t> data_block;
74
75 StatusCode sc = m_rodDecoder.decode(frag, data_block, msg());
76
77 if (sc.isFailure()) ATH_MSG_WARNING(" Conversion from ByteStream to RawData failed ");
78 else {
79
80 ATH_MSG_DEBUG(" Number of data_block elements: " << data_block.size());
81
82 LUCID_RawData* lrd = new LUCID_RawData(data_block);
83
84 ATH_MSG_DEBUG(lrd->str());
85
86 lrd->decodeLumatMapping();
87
88 container.push_back(lrd);
89 }
90 }
91
92 for (const LUCID_RawData* data : container)
93 ATH_MSG_DEBUG(data->str());
94
95 return StatusCode::SUCCESS;
96}
97
99
100 ATH_MSG_INFO(" LUCID_ByteStreamRawDataCnv::finalize ");
101
102 return StatusCode::SUCCESS;
103}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
static Double_t sc
Handle class for recording to StoreGate.
An algorithm that can be simultaneously executed in multiple threads.
virtual StatusCode execute(const EventContext &ctx) const override
StatusCode fillContainer(const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &, LUCID_RawDataContainer &container) const
SG::WriteHandleKey< LUCID_RawDataContainer > m_lucid_RawDataContainerKey
virtual StatusCode finalize() override
virtual StatusCode initialize() override
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
void decodeLumatMapping(void)
std::string str() const
eformat::ROBFragment< PointerType > ROBFragment
Definition RawEvent.h:27
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
MsgStream & msg
Definition testRead.cxx:32