ATLAS Offline Software
Loading...
Searching...
No Matches
CmxJetTobByteStreamxAODCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 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, "CmxJetTobByteStreamxAODCnv"),
36 m_name("CmxJetTobByteStreamxAODCnv")
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 CmxJetTobByteStreamxAODCnv::createObj(IOpaqueAddress* pAddr,
66 DataObject*& pObj) {
67 ATH_MSG_DEBUG("createObj() called");
68 // -------------------------------------------------------------------------
69 ByteStreamAddress *pBS_Addr = dynamic_cast<ByteStreamAddress *>(pAddr);
70 CHECK(pBS_Addr != nullptr);
71 // -------------------------------------------------------------------------
72 const std::string nm = *(pBS_Addr->par());
73 const std::string nmAux = nm + "Aux.";
74 ATH_MSG_DEBUG("Creating xAOD::CmxJetTob interface objects '" << nm << "'");
75
76 xAOD::CMXJetTobContainer* const cmxJetContainer =
78
79 // Create link with AUX container
81 ATH_MSG_DEBUG("Creating store with data link to '" << nmAux);
82
83 for(size_t i=0; i < link->size(); ++i){
84 cmxJetContainer->push_back(new xAOD::CMXJetTob());
85 }
86 // ==========================================================================
87 cmxJetContainer->setStore(link);
88 pObj = SG::asStorable(cmxJetContainer);
89 ATH_MSG_DEBUG("Number of CmxJetTob created: " << cmxJetContainer->size());
90
91 return StatusCode::SUCCESS;
92}
93
94// createRep should create the bytestream from RDOs.
95
96StatusCode CmxJetTobByteStreamxAODCnv::createRep(DataObject* /*pObj*/,
97 IOpaqueAddress*& /*pAddr*/) {
98 return StatusCode::FAILURE;
99}
100
101} // 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 createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create TriggerTowers from ByteStream.
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create ByteStream from TriggerTowers.
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
CMXJetTobContainer_v1 CMXJetTobContainer
Define the latest version of the CMXJetTob class.
CMXJetTob_v1 CMXJetTob
Define the latest version of the CMXJetTob class.