ATLAS Offline Software
Loading...
Searching...
No Matches
ITkPixelRawContBytestreamCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5/*
6* Author: Ondra Kovanda, ondrej.kovanda at cern.ch
7* Date: 03/2025
8* Description: The BS converter for ITk pixels
9*/
10
17
19 AthConstConverter(ByteStreamAddress::storageType(), 1328667962, svcloc, "ITkPixelRawContByteStreamCnv"),
20 m_ByteStreamEventAccess("ByteStreamCnvSvc", "ITkPixelRawContByteStreamCnv"),
21 m_cnvTool("ITkPixelCnvTool")
22{}
23
25
26 ATH_CHECK(AthConstConverter::initialize());
27
29
30 ATH_CHECK(m_cnvTool.retrieve());
31
32 ATH_MSG_INFO("ITkPixelRawContByteStreamCnv initialized!!!");
33
34 return StatusCode::SUCCESS;
35}
36
42
43StatusCode ITkPixelRawContByteStreamCnv::createRepConst(DataObject* pObj, IOpaqueAddress*& pAddr) const{
44
45 ITkPixelRDO_Container* cont = 0;
46
47 //retrieve & cast the container from SG
48 ATH_CHECK(SG::fromStorable(pObj, cont));
49
50 //create BS address
51 std::string name = pObj->registry()->name();
52 std::unique_ptr<ByteStreamAddress> addr(new ByteStreamAddress(classID(), name, ""));
53 pAddr = addr.release();
54
55 //Segfault without this line. No clue why.
56 pAddr->addRef();
57 ATH_MSG_DEBUG("BS address object created for " << classID() << " name '" << name << "'");
58
59 //Run all the conversion steps scheduled in the ITkPixelCnvTool
60 ATH_CHECK(m_cnvTool->convertToByteStream(cont));
61
62 return StatusCode::SUCCESS;
63}
64
69
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
uint32_t CLID
The Class ID type.
InDetRawDataContainer< InDetRawDataCollection< ITkPixelRDORawData > > ITkPixelRDO_Container
convert to and from a SG storable
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.
static constexpr long storageType()
ServiceHandle< IByteStreamEventAccess > m_ByteStreamEventAccess
virtual StatusCode initialize() override
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
This function is called for the RDO -> BS conversion and orchestrates the necessary steps,...
ToolHandle< ITkPixelCnvTool > m_cnvTool
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)