ATLAS Offline Software
Loading...
Searching...
No Matches
LArLATOMEHeaderContByteStreamCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
8
11#include "GaudiKernel/DataObject.h"
12#include "GaudiKernel/IRegistry.h"
14// For LATOME while no Condition alg exists
15#include "LArLATOMEROBIDs.h"
16
17
19 AthConstConverter(storageType(), classID(),svcloc,"LArLATOMEHeaderContByteStreamCnv"),
20 m_scTool("LArLATOMEDecoder"),
21 m_rdpSvc("ROBDataProviderSvc", name()) {};
22
23
25
29
30
31StatusCode
33 ATH_MSG_DEBUG("initialize ");
34 ATH_CHECK( AthConstConverter::initialize());
35 ATH_CHECK( m_rdpSvc.retrieve());
36 ATH_CHECK( m_scTool.retrieve());
37 return StatusCode::SUCCESS;
38}
39
40StatusCode
41LArLATOMEHeaderContByteStreamCnv::createObjConst(IOpaqueAddress* pAddr, DataObject*& pObj) const {
42 ATH_MSG_VERBOSE("Executing CreateObj method for LArLATOMEHeaderContainer");
43
44 ByteStreamAddress* pRE_Addr{};
45 ATH_CHECK( (pRE_Addr = dynamic_cast<ByteStreamAddress*>(pAddr)) != nullptr );
46
47 const EventContext& ctx = pRE_Addr->getEventContext();
48
49 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFrags;
50 m_rdpSvc->getROBData(ctx, LArByteStream::s_allROBIDs_LATOME, robFrags );
51 const std::string& key = *(pAddr->par()); // Get key used in the StoreGateSvc::retrieve function
52 // get gain and pass to convert function.
53 std::unique_ptr<LArLATOMEHeaderContainer> header_coll=std::make_unique<LArLATOMEHeaderContainer>();
54
55 // Convert the RawEvent to LArDigitContainer
56 ATH_MSG_VERBOSE("Converting LATOME_HEADER (from ByteStream). key=" << key);
57
58
59 //Supercell readout
60 StatusCode sc=m_scTool->convert(robFrags,nullptr,nullptr, nullptr, nullptr, nullptr, header_coll.get());
61 if (sc!=StatusCode::SUCCESS) {
62 ATH_MSG_WARNING("Conversion tool returned an error. LAr SC containers might be empty.");
63 }
64 pObj = SG::asStorable(std::move(header_coll));
65
66 return StatusCode::SUCCESS;
67
68}
69
70 StatusCode
71LArLATOMEHeaderContByteStreamCnv::createRepConst(DataObject* , IOpaqueAddress*& ) const
72{
73 return StatusCode::SUCCESS;
74}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
macros to associate a CLID to a type
uint32_t CLID
The Class ID type.
Byte stream converter of LATOME.
static Double_t sc
AthConstConverter(long storage_type, const CLID &class_type, ISvcLocator *svc, const std::string &name)
const std::string & name() const
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
const EventContext & getEventContext() const
virtual StatusCode createObjConst(IOpaqueAddress *pAddr, DataObject *&pObj) const override
Create the transient representation of an object.
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
Convert the transient object to the requested representation.
ServiceHandle< IROBDataProviderSvc > m_rdpSvc
static const std::vector< uint32_t > s_allROBIDs_LATOME
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)