ATLAS Offline Software
Loading...
Searching...
No Matches
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
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
24
27
29
30namespace LVL1BS {
31
33 : Converter(storageType(), classID(), svcloc),
34 AthMessaging(svcloc != 0 ? msgSvc() : 0, "L1TopoByteStreamxAODCnv"),
35 m_name("L1TopoByteStreamxAODCnv") {}
36
37// CLID
38
42
46
47// Init method gets all necessary services etc.
48
50 ATH_MSG_DEBUG("Initializing");
51
52 CHECK(Converter::initialize());
53 return StatusCode::SUCCESS;
54}
55
56// createObj should create the RDO from bytestream.
57
58StatusCode L1TopoByteStreamxAODCnv::createObj(IOpaqueAddress* pAddr,
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
91StatusCode L1TopoByteStreamxAODCnv::createRep(DataObject* /*pObj*/,
92 IOpaqueAddress*& /*pAddr*/) {
93 return StatusCode::FAILURE;
94}
95
96} // end namespace
#define ATH_MSG_DEBUG(x)
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
uint32_t CLID
The Class ID type.
Defines the ROB data entity. The ROB data is an abstract entity that is used to decouple the raw even...
convert to and from a SG storable
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
static constexpr long storageType()
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create TriggerTowers from ByteStream.
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create ByteStream from TriggerTowers.
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
L1TopoRawData_v1 L1TopoRawData
Define the latest version of the L1TopoRawData class.
L1TopoRawDataContainer_v1 L1TopoRawDataContainer
Define the latest version of the L1TopoRawData container.