ATLAS Offline Software
L1TopoByteStreamxAODCnv.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 
28 
30 
31 namespace LVL1BS {
32 
34  : Converter(storageType(), classID(), svcloc),
35  AthMessaging(svcloc != 0 ? msgSvc() : 0, "L1TopoByteStreamxAODCnv"),
36  m_name("L1TopoByteStreamxAODCnv") {}
37 
38 // CLID
39 
42 }
43 
46 }
47 
48 // Init method gets all necessary services etc.
49 
51  ATH_MSG_DEBUG("Initializing");
52 
54  return StatusCode::SUCCESS;
55 }
56 
57 // createObj should create the RDO from bytestream.
58 
60  DataObject*& pObj) {
61  ATH_MSG_DEBUG("createObj() called");
62  // -------------------------------------------------------------------------
63  ByteStreamAddress* pBS_Addr = dynamic_cast<ByteStreamAddress*>(pAddr);
64  CHECK(pBS_Addr != nullptr);
65  // -------------------------------------------------------------------------
66  const std::string nm = *(pBS_Addr->par());
67  const std::string nmAux = nm + "Aux.";
68  ATH_MSG_DEBUG("Creating xAOD::L1TopoRawDataContainer interface objects '"
69  << nm << "'");
70 
71  xAOD::L1TopoRawDataContainer* const topoCollection =
73 
74  // Create link with AUX container
76  ATH_MSG_DEBUG("Creating store with data link to '" << nmAux);
77 
78  for (size_t i = 0; i < link->size(); ++i) {
79  topoCollection->push_back(new xAOD::L1TopoRawData());
80  }
81  // ==========================================================================
82  topoCollection->setStore(link);
83  pObj = SG::asStorable(topoCollection);
85  "Number of xAOD::L1TopoRawData created: " << topoCollection->size());
86 
87  return StatusCode::SUCCESS;
88 }
89 
90 // createRep should create the bytestream from RDOs.
91 
93  IOpaqueAddress*& /*pAddr*/) {
94  return StatusCode::FAILURE;
95 }
96 
97 } // end namespace
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::L1TopoByteStreamxAODCnv::createRep
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create ByteStream from TriggerTowers.
Definition: L1TopoByteStreamxAODCnv.cxx:92
IByteStreamEventAccess.h
L1TopoRawDataAuxContainer.h
L1TopoRawDataContainer.h
xAOD::AuxContainerBase::size
virtual size_t size() const override
Get the size of the container.
Definition: AuxContainerBase.cxx:410
LVL1BS::L1TopoByteStreamxAODCnv::L1TopoByteStreamxAODCnv
L1TopoByteStreamxAODCnv(ISvcLocator *svcloc)
Definition: L1TopoByteStreamxAODCnv.cxx:33
ClassID_traits::ID
static const CLID & ID()
the CLID of T
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:50
LVL1BS::L1TopoByteStreamxAODCnv::initialize
virtual StatusCode initialize()
Definition: L1TopoByteStreamxAODCnv.cxx:50
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...
LVL1BS::L1TopoByteStreamxAODCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create TriggerTowers from ByteStream.
Definition: L1TopoByteStreamxAODCnv.cxx:59
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
xAOD::L1TopoRawData_v1
Description of L1TopoRawData_v1.
Definition: L1TopoRawData_v1.h:28
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
LVL1BS::L1TopoByteStreamxAODCnv::classID
static const CLID & classID()
Definition: L1TopoByteStreamxAODCnv.cxx:40
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.
L1TopoByteStreamxAODCnv.h
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
xAOD::L1TopoRawDataContainer
L1TopoRawDataContainer_v1 L1TopoRawDataContainer
Define the latest version of the L1TopoRawData container.
Definition: L1TopoRawDataContainer.h:14
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
LVL1BS
Definition: ZdcByteStreamReadV1V2Tool.h:47
LVL1BS::L1TopoByteStreamxAODCnv::storageType
static long storageType()
Definition: L1TopoByteStreamxAODCnv.cxx:44
StoreGateSvc.h
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
IROBDataProviderSvc.h