Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
13 #include "ITkPixelRDO_Container.h"
17 
19  AthConstConverter(ByteStreamAddress::storageType(), 1328667962, svcloc, "ITkPixelRawContByteStreamCnv"),
20  m_ByteStreamEventAccess("ByteStreamCnvSvc", "ITkPixelRawContByteStreamCnv"),
21  m_cnvTool("ITkPixelCnvTool")
22 {}
23 
25 
27 
29 
30  ATH_CHECK(m_cnvTool.retrieve());
31 
32  ATH_MSG_INFO("ITkPixelRawContByteStreamCnv initialized!!!");
33 
34  return StatusCode::SUCCESS;
35 }
36 
43 StatusCode 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 
66 
68 }
69 
71 
73 }
AthCheckMacros.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::fromStorable
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
Definition: StorableConversions.h:169
StorableConversions.h
convert to and from a SG storable
initialize
void initialize()
Definition: run_EoverP.cxx:894
InDetRawDataContainer
Definition: InDetRawDataContainer.h:27
AthConstConverter
Gaudi converter base class with const interfaces.
Definition: AthConstConverter.h:33
ITkPixelRawContByteStreamCnv::storageType
static long storageType()
Definition: ITkPixelRawContBytestreamCnv.cxx:70
ITkPixelRDO_Container.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition: ByteStreamAddress.h:28
ITkPixelRawContByteStreamCnv::classID
static const CLID & classID()
Definition: ITkPixelRawContBytestreamCnv.cxx:65
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ByteStreamAddress.h
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
ITkPixelRawContByteStreamCnv::m_cnvTool
ToolHandle< ITkPixelCnvTool > m_cnvTool
Definition: ITkPixelRawContBytestreamCnv.h:40
ByteStreamAddress::storageType
static constexpr long storageType()
Definition: ByteStreamAddress.h:51
ITkPixelRawContByteStreamCnv::createRepConst
virtual StatusCode createRepConst(DataObject *pObj, IOpaqueAddress *&pAddr) const override
This function is called for the RDO -> BS conversion and orchestrates the necessary steps,...
Definition: ITkPixelRawContBytestreamCnv.cxx:43
AthConstConverter::name
const std::string & name() const
Definition: AthConstConverter.h:67
ITkPixelRawContBytestreamCnv.h
ITkPixelRawContByteStreamCnv::ITkPixelRawContByteStreamCnv
ITkPixelRawContByteStreamCnv(ISvcLocator *svcloc)
Definition: ITkPixelRawContBytestreamCnv.cxx:18
ByteStreamCnvSvcBase.h
ITkPixelRawContByteStreamCnv::initialize
virtual StatusCode initialize() override
Definition: ITkPixelRawContBytestreamCnv.cxx:24
ClassID_traits::ID
static CLID ID()
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:44
ITkPixelRawContByteStreamCnv::m_ByteStreamEventAccess
ServiceHandle< IByteStreamEventAccess > m_ByteStreamEventAccess
Definition: ITkPixelRawContBytestreamCnv.h:38