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= dynamic_cast<ByteStreamAddress*>(pAddr); //Cast from OpaqueAddress to ByteStreamAddress
45 if (!pRE_Addr)
46 {ATH_MSG_ERROR("dynamic_cast of OpaqueAdress to ByteStreamAddress failed!");
47 return StatusCode::FAILURE;
48 }
49
50 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFrags;
51 m_rdpSvc->getROBData(Gaudi::Hive::currentContext(), LArByteStream::s_allROBIDs_LATOME, robFrags );
52 const std::string& key = *(pAddr->par()); // Get key used in the StoreGateSvc::retrieve function
53 // get gain and pass to convert function.
54 std::unique_ptr<LArLATOMEHeaderContainer> header_coll=std::make_unique<LArLATOMEHeaderContainer>();
55
56 // Convert the RawEvent to LArDigitContainer
57 ATH_MSG_VERBOSE("Converting LATOME_HEADER (from ByteStream). key=" << key);
58
59
60 //Supercell readout
61 StatusCode sc=m_scTool->convert(robFrags,nullptr,nullptr, nullptr, nullptr, nullptr, header_coll.get());
62 if (sc!=StatusCode::SUCCESS) {
63 ATH_MSG_WARNING("Conversion tool returned an error. LAr SC containers might be empty.");
64 }
65 pObj = SG::asStorable(std::move(header_coll));
66
67 return StatusCode::SUCCESS;
68
69}
70
71 StatusCode
72LArLATOMEHeaderContByteStreamCnv::createRepConst(DataObject* , IOpaqueAddress*& ) const
73{
74 return StatusCode::SUCCESS;
75}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#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.
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)