ATLAS Offline Software
Loading...
Searching...
No Matches
LUCID_DigitRawDataCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include "GaudiKernel/ThreadLocalContext.h"
11 ISvcLocator* pSvcLocator)
12 : AthReentrantAlgorithm(name, pSvcLocator)
13{
14}
15
17
18StatusCode
20{
21 ATH_CHECK(m_digitContainerKey.initialize());
23 return StatusCode::SUCCESS;
24}
25
26StatusCode
27LUCID_DigitRawDataCnv::execute(const EventContext& ctx) const
28{
29
31
32 if (!digitContainer.isValid()) {
33 ATH_MSG_WARNING("BAD DATA!!! Input data does not include "
35 return StatusCode::SUCCESS;
36 }
38 for (const LUCID_Digit* digit : *digitContainer) {
39 m_rodEncoder.addDigit(digit,cache);
40 }
41
42 std::vector<uint32_t> data_block;
43 m_rodEncoder.encode(data_block, cache,msg());
44 data_block.push_back(0); // add status word
45
46 auto container = std::make_unique<LUCID_RawDataContainer>();
47 container->push_back(new LUCID_RawData(data_block));
49 .record(std::move(container)));
50
51 return StatusCode::SUCCESS;
52}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
An algorithm that can be simultaneously executed in multiple threads.
StatusCode execute(const EventContext &ctx) const override
SG::WriteHandleKey< LUCID_RawDataContainer > m_lucid_RawDataContainerKey
SG::ReadHandleKey< LUCID_DigitContainer > m_digitContainerKey
StatusCode initialize() override
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
MsgStream & msg
Definition testRead.cxx:32