ATLAS Offline Software
JemTobRoiByteStreamxAODCnv.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, "JemTobRoiByteStreamxAODCnv"),
37  m_name("JemTobRoiByteStreamxAODCnv")
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::JEMTobRoI interface objects '" << nm << "'");
76 
77  xAOD::JEMTobRoIContainer* const container =
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  container->push_back(new xAOD::JEMTobRoI());
86  }
87  // ==========================================================================
88  container->setStore(link);
89  pObj = SG::asStorable(container);
90  ATH_MSG_DEBUG("Number of JEMTobRoI created: " << container->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
JemTobRoiByteStreamxAODCnv.h
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
JEMTobRoIContainer.h
IByteStreamEventAccess.h
LVL1BS::JemTobRoiByteStreamxAODCnv::m_name
std::string m_name
Converter name.
Definition: JemTobRoiByteStreamxAODCnv.h:53
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
JEMTobRoIAuxContainer.h
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
lumiFormat.i
int i
Definition: lumiFormat.py:92
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
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: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.
LVL1BS::JemTobRoiByteStreamxAODCnv::storageType
static long storageType()
Definition: JemTobRoiByteStreamxAODCnv.cxx:48
LVL1BS::JemTobRoiByteStreamxAODCnv::initialize
virtual StatusCode initialize()
Definition: JemTobRoiByteStreamxAODCnv.cxx:56
LVL1BS::JemTobRoiByteStreamxAODCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create TriggerTowers from ByteStream.
Definition: JemTobRoiByteStreamxAODCnv.cxx:66
xAOD::JEMTobRoI_v1
Description of JEMTobRoI_v1.
Definition: JEMTobRoI_v1.h:25
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
LVL1BS
Definition: ZdcByteStreamReadV1V2Tool.h:47
LVL1BS::JemTobRoiByteStreamxAODCnv::classID
static const CLID & classID()
Definition: JemTobRoiByteStreamxAODCnv.cxx:44
LVL1BS::JemTobRoiByteStreamxAODCnv::JemTobRoiByteStreamxAODCnv
JemTobRoiByteStreamxAODCnv(ISvcLocator *svcloc)
Definition: JemTobRoiByteStreamxAODCnv.cxx:34
StoreGateSvc.h
LVL1BS::JemTobRoiByteStreamxAODCnv::createRep
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create ByteStream from TriggerTowers.
Definition: JemTobRoiByteStreamxAODCnv.cxx:97
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
JEMTobRoI.h
IROBDataProviderSvc.h
xAOD::JEMTobRoIContainer
JEMTobRoIContainer_v1 JEMTobRoIContainer
Define the latest version of the JEMTobRoI class.
Definition: JEMTobRoIContainer.h:18