ATLAS Offline Software
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 
12 #include "ByteStreamData/ROBData.h"
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 
23 #include "StoreGate/StoreGateSvc.h"
24 
28 
30 
31 namespace 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 
45 }
46 
48 {
50 }
51 
52 // Init method gets all necessary services etc.
53 
54 
56  ATH_MSG_DEBUG("Initializing " << m_name);
57 
59  //CHECK(m_readTool.retrieve());
60  return StatusCode::SUCCESS;
61 }
62 
63 // createObj should create the RDO from bytestream.
64 
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 
97  IOpaqueAddress*& /*pAddr*/) {
98  return StatusCode::FAILURE;
99 }
100 
101 } // end namespace
xAOD::CMXJetTobContainer
CMXJetTobContainer_v1 CMXJetTobContainer
Define the latest version of the CMXJetTob class.
Definition: CMXJetTobContainer.h:18
CMXJetTobAuxContainer.h
LVL1BS::CmxJetTobByteStreamxAODCnv::createRep
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create ByteStream from TriggerTowers.
Definition: CmxJetTobByteStreamxAODCnv.cxx:96
StorableConversions.h
convert to and from a SG storable
LVL1BS::CmxJetTobByteStreamxAODCnv::initialize
virtual StatusCode initialize()
Definition: CmxJetTobByteStreamxAODCnv.cxx:55
ROBData.h
Defines the ROB data entity. The ROB data is an abstract entity that is used to discase the raw event...
initialize
void initialize()
Definition: run_EoverP.cxx:894
CmxJetTobByteStreamxAODCnv.h
LVL1BS::CmxJetTobByteStreamxAODCnv::m_name
std::string m_name
Converter name.
Definition: CmxJetTobByteStreamxAODCnv.h:53
xAOD::AuxContainerBase::size
virtual size_t size() const override
Get the size of the container.
Definition: AuxContainerBase.cxx:430
SG::asStorable
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Definition: DataObjectSharedPtr.h:65
ClassID_traits::ID
static const CLID & ID()
the CLID of T
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:50
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
lumiFormat.i
int i
Definition: lumiFormat.py:85
ClassID_traits.h
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
RawEvent.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
LVL1BS::CmxJetTobByteStreamxAODCnv::CmxJetTobByteStreamxAODCnv
CmxJetTobByteStreamxAODCnv(ISvcLocator *svcloc)
Definition: CmxJetTobByteStreamxAODCnv.cxx:33
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition: ByteStreamAddress.h:28
LVL1BS::CmxJetTobByteStreamxAODCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create TriggerTowers from ByteStream.
Definition: CmxJetTobByteStreamxAODCnv.cxx:65
LVL1BS::CmxJetTobByteStreamxAODCnv::storageType
static long storageType()
Definition: CmxJetTobByteStreamxAODCnv.cxx:47
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
ByteStreamAddress.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
xAOD::CMXJetTob_v1
Description of CMXJetTob_v1.
Definition: CMXJetTob_v1.h:27
CMXJetTobContainer.h
ByteStreamAddress::storageType
static constexpr long storageType()
Definition: ByteStreamAddress.h:51
Converter
Definition: Converter.h:27
LVL1BS::CmxJetTobByteStreamxAODCnv::classID
static const CLID & classID()
Definition: CmxJetTobByteStreamxAODCnv.cxx:43
errorcheck.h
Helpers for checking error return status codes and reporting errors.
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
LVL1BS
Definition: ZdcModifySlices.h:10
StoreGateSvc.h
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
IROBDataProviderSvc.h
CMXJetTob.h