ATLAS Offline Software
CmxJetHitsByteStreamxAODCnv.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 
11 
13 #include "ByteStreamData/ROBData.h"
14 
16 #include "GaudiKernel/DataObject.h"
17 #include "GaudiKernel/IOpaqueAddress.h"
18 #include "GaudiKernel/IRegistry.h"
19 #include "GaudiKernel/ISvcLocator.h"
20 #include "GaudiKernel/StatusCode.h"
21 
24 #include "StoreGate/StoreGateSvc.h"
25 
29 
31 
32 namespace LVL1BS {
33 
35  Converter(storageType(), classID(), svcloc),
36  AthMessaging(svcloc != 0 ? msgSvc() : 0, "CmxJetHitsByteStreamxAODCnv"),
37  m_name("CmxJetHitsByteStreamxAODCnv")
38 {
39 
40 }
41 
42 // CLID
43 
46 }
47 
49 {
51 }
52 
53 // Init method gets all necessary services etc.
54 
55 
57  ATH_MSG_DEBUG("Initializing " << m_name);
58 
60  //CHECK(m_readTool.retrieve());
61  return StatusCode::SUCCESS;
62 }
63 
64 // createObj should create the RDO from bytestream.
65 
67  DataObject*& pObj) {
68  ATH_MSG_DEBUG("createObj() called");
69  // -------------------------------------------------------------------------
70  ByteStreamAddress *pBS_Addr = dynamic_cast<ByteStreamAddress *>(pAddr);
71  CHECK(pBS_Addr != nullptr);
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 
98  IOpaqueAddress*& /*pAddr*/) {
99  return StatusCode::FAILURE;
100 }
101 
102 } // end namespace
xAOD::CMXJetHits_v1
Description of CMXJetHits_v1.
Definition: CMXJetHits_v1.h:30
CMXJetHits.h
CmxJetHitsByteStreamxAODCnv.h
LVL1BS::CmxJetHitsByteStreamxAODCnv::initialize
virtual StatusCode initialize()
Definition: CmxJetHitsByteStreamxAODCnv.cxx:56
LVL1BS::CmxJetHitsByteStreamxAODCnv::classID
static const CLID & classID()
Definition: CmxJetHitsByteStreamxAODCnv.cxx:44
StorableConversions.h
convert to and from a SG storable
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
SG::asStorable
DataObject * asStorable(T *pObject)
Definition: StorableConversions.h:158
LVL1BS::CmxJetHitsByteStreamxAODCnv::storageType
static long storageType()
Definition: CmxJetHitsByteStreamxAODCnv.cxx:48
IByteStreamEventAccess.h
LVL1BS::CmxJetHitsByteStreamxAODCnv::createRep
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create ByteStream from TriggerTowers.
Definition: CmxJetHitsByteStreamxAODCnv.cxx:97
CMXJetHitsContainer.h
xAOD::CMXJetHitsContainer
CMXJetHitsContainer_v1 CMXJetHitsContainer
Define the latest version of the CMXJetHits class.
Definition: CMXJetHitsContainer.h:18
xAOD::AuxContainerBase::size
virtual size_t size() const override
Get the size of the container.
Definition: AuxContainerBase.cxx:410
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:92
LVL1BS::CmxJetHitsByteStreamxAODCnv::m_name
std::string m_name
Converter name.
Definition: CmxJetHitsByteStreamxAODCnv.h:53
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
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition: ByteStreamAddress.h:28
LVL1BS::CmxJetHitsByteStreamxAODCnv::CmxJetHitsByteStreamxAODCnv
CmxJetHitsByteStreamxAODCnv(ISvcLocator *svcloc)
Definition: CmxJetHitsByteStreamxAODCnv.cxx:34
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
LVL1BS::CmxJetHitsByteStreamxAODCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create TriggerTowers from ByteStream.
Definition: CmxJetHitsByteStreamxAODCnv.cxx:66
ByteStreamAddress.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
ByteStreamAddress::storageType
static constexpr long storageType()
Definition: ByteStreamAddress.h:51
Converter
Definition: Converter.h:27
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
CMXJetHitsAuxContainer.h
LVL1BS
Definition: ZdcByteStreamReadV1V2Tool.h:47
StoreGateSvc.h
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
IROBDataProviderSvc.h