ATLAS Offline Software
Loading...
Searching...
No Matches
CmxJetHitsByteStreamxAODCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include <vector>
6#include <stdint.h>
7
10
13
15#include "GaudiKernel/DataObject.h"
16#include "GaudiKernel/IOpaqueAddress.h"
17#include "GaudiKernel/IRegistry.h"
18#include "GaudiKernel/ISvcLocator.h"
19#include "GaudiKernel/StatusCode.h"
20
24
28
30
31namespace LVL1BS {
32
34 Converter(storageType(), classID(), svcloc),
35 AthMessaging(svcloc != 0 ? msgSvc() : 0, "CmxJetHitsByteStreamxAODCnv"),
36 m_name("CmxJetHitsByteStreamxAODCnv")
37{
38
39}
40
41// CLID
42
46
51
52// Init method gets all necessary services etc.
53
54
56 ATH_MSG_DEBUG("Initializing " << m_name);
57
58 CHECK(Converter::initialize());
59 //CHECK(m_readTool.retrieve());
60 return StatusCode::SUCCESS;
61}
62
63// createObj should create the RDO from bytestream.
64
65StatusCode CmxJetHitsByteStreamxAODCnv::createObj(IOpaqueAddress* pAddr,
66 DataObject*& pObj) {
67 ATH_MSG_DEBUG("createObj() called");
68 // -------------------------------------------------------------------------
69 ByteStreamAddress *pBS_Addr = dynamic_cast<ByteStreamAddress *>(pAddr);
70 if (not pBS_Addr) return StatusCode::FAILURE;
71
72 // -------------------------------------------------------------------------
73 const std::string nm = *(pBS_Addr->par());
74 const std::string nmAux = nm + "Aux.";
75 ATH_MSG_DEBUG("Creating xAOD::CmxJetHits interface objects '" << nm << "'");
76
77 xAOD::CMXJetHitsContainer* const cmxJetContainer =
79
80 // Create link with AUX container
82 ATH_MSG_DEBUG("Creating store with data link to '" << nmAux);
83
84 for(size_t i=0; i < link->size(); ++i){
85 cmxJetContainer->push_back(new xAOD::CMXJetHits());
86 }
87 // ==========================================================================
88 cmxJetContainer->setStore(link);
89 pObj = SG::asStorable(cmxJetContainer);
90 ATH_MSG_DEBUG("Number of CMXJetHits created: " << cmxJetContainer->size());
91
92 return StatusCode::SUCCESS;
93}
94
95// createRep should create the bytestream from RDOs.
96
97StatusCode CmxJetHitsByteStreamxAODCnv::createRep(DataObject* /*pObj*/,
98 IOpaqueAddress*& /*pAddr*/) {
99 return StatusCode::FAILURE;
100}
101
102} // end namespace
#define ATH_MSG_DEBUG(x)
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
uint32_t CLID
The Class ID type.
Defines the ROB data entity. The ROB data is an abstract entity that is used to decouple the raw even...
convert to and from a SG storable
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
static constexpr long storageType()
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create ByteStream from TriggerTowers.
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create TriggerTowers from ByteStream.
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
CMXJetHitsContainer_v1 CMXJetHitsContainer
Define the latest version of the CMXJetHits class.
CMXJetHits_v1 CMXJetHits
Define the latest version of the CMXJetHits class.