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 
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 
27 
29 
30 namespace LVL1BS {
31 
33  : Converter(storageType(), classID(), svcloc),
34  AthMessaging(svcloc != 0 ? msgSvc() : 0, "L1TopoByteStreamxAODCnv"),
35  m_name("L1TopoByteStreamxAODCnv") {}
36 
37 // CLID
38 
41 }
42 
45 }
46 
47 // Init method gets all necessary services etc.
48 
50  ATH_MSG_DEBUG("Initializing");
51 
53  return StatusCode::SUCCESS;
54 }
55 
56 // createObj should create the RDO from bytestream.
57 
59  DataObject*& pObj) {
60  ATH_MSG_DEBUG("createObj() called");
61  // -------------------------------------------------------------------------
62  ByteStreamAddress* pBS_Addr = dynamic_cast<ByteStreamAddress*>(pAddr);
63  CHECK(pBS_Addr != nullptr);
64  // -------------------------------------------------------------------------
65  const std::string nm = *(pBS_Addr->par());
66  const std::string nmAux = nm + "Aux.";
67  ATH_MSG_DEBUG("Creating xAOD::L1TopoRawDataContainer interface objects '"
68  << nm << "'");
69 
70  xAOD::L1TopoRawDataContainer* const topoCollection =
72 
73  // Create link with AUX container
75  ATH_MSG_DEBUG("Creating store with data link to '" << nmAux);
76 
77  for (size_t i = 0; i < link->size(); ++i) {
78  topoCollection->push_back(new xAOD::L1TopoRawData());
79  }
80  // ==========================================================================
81  topoCollection->setStore(link);
82  pObj = SG::asStorable(topoCollection);
84  "Number of xAOD::L1TopoRawData created: " << topoCollection->size());
85 
86  return StatusCode::SUCCESS;
87 }
88 
89 // createRep should create the bytestream from RDOs.
90 
92  IOpaqueAddress*& /*pAddr*/) {
93  return StatusCode::FAILURE;
94 }
95 
96 } // 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
LVL1BS::L1TopoByteStreamxAODCnv::createRep
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create ByteStream from TriggerTowers.
Definition: L1TopoByteStreamxAODCnv.cxx:91
L1TopoRawDataAuxContainer.h
L1TopoRawDataContainer.h
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
LVL1BS::L1TopoByteStreamxAODCnv::L1TopoByteStreamxAODCnv
L1TopoByteStreamxAODCnv(ISvcLocator *svcloc)
Definition: L1TopoByteStreamxAODCnv.cxx:32
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:49
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...
LVL1BS::L1TopoByteStreamxAODCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create TriggerTowers from ByteStream.
Definition: L1TopoByteStreamxAODCnv.cxx:58
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:794
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:39
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: ZdcModifySlices.h:10
LVL1BS::L1TopoByteStreamxAODCnv::storageType
static long storageType()
Definition: L1TopoByteStreamxAODCnv.cxx:43
StoreGateSvc.h
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
IROBDataProviderSvc.h