ATLAS Offline Software
Loading...
Searching...
No Matches
L1TopoByteStreamAuxCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5// ============================================================================
6// Includes
7// ============================================================================
8// STD
9// ============================================================================
10#include <vector>
11#include <cstdint>
12#include <memory>
13#include <algorithm>
14// ============================================================================
15// Athena
16// ============================================================================
19
22
24#include "GaudiKernel/DataObject.h"
25#include "GaudiKernel/IOpaqueAddress.h"
26#include "GaudiKernel/IRegistry.h"
27#include "GaudiKernel/ISvcLocator.h"
28#include "GaudiKernel/StatusCode.h"
29
33
34// ============================================================================
35// TrigT1
36// ============================================================================
38// ============================================================================
39// xAOD
40// ============================================================================
44// ============================================================================
45// Local
46// ============================================================================
49// ============================================================================
50
51namespace LVL1BS {
53 : Converter(storageType(), classID(), svcloc),
54 AthMessaging(svcloc != 0 ? msgSvc() : 0, "L1TopoByteStreamAuxCnv"),
55 m_name("L1TopoByteStreamAuxCnv"),
56 m_readTool("L1TopoByteStreamTool/L1TopoByteStreamTool") {}
57
61
65
66// Init method gets all necessary services etc.
67
69 ATH_MSG_DEBUG("Initializing " << m_name);
70
71 CHECK(Converter::initialize());
72 CHECK(m_readTool.retrieve());
73
74 return StatusCode::SUCCESS;
75}
76
77// createObj should create the RDO from bytestream.
78StatusCode L1TopoByteStreamAuxCnv::createObj(IOpaqueAddress* pAddr,
79 DataObject*& pObj) {
80 ATH_MSG_DEBUG("createObj() called");
81 // -------------------------------------------------------------------------
82 ByteStreamAddress* pBS_Addr = dynamic_cast<ByteStreamAddress*>(pAddr);
83 CHECK(pBS_Addr != nullptr);
84 // -------------------------------------------------------------------------
85 //coverity[FORWARD_NULL:FALSE]
86 const std::string nm = *(pBS_Addr->par());
87 ATH_MSG_DEBUG("Creating Objects " << nm);
88
90 xAOD::L1TopoRawDataContainer topoContainer;
91 topoContainer.setStore(aux);
92 // -------------------------------------------------------------------------
93 L1TopoRDOCollection topoRDOCollection;
94 StatusCode sc = m_readTool->convert(nm, &topoRDOCollection);
95 if (sc.isFailure()) {
96 ATH_MSG_ERROR("Failed to create objects");
97 delete aux;
98 return sc;
99 }
100
101 for (auto topoRDO : topoRDOCollection) {
103 topoContainer.push_back(item);
104 item->initialize(topoRDO->getDataWords(), topoRDO->getStatusWords(),
105 topoRDO->getError(), topoRDO->getSourceID());
106 }
107
108 // -------------------------------------------------------------------------
109 // ATH_MSG_VERBOSE(ToString(cpmCollection));
110 ATH_MSG_DEBUG("Number of readed Topo: " << aux->size());
111 // -------------------------------------------------------------------------
112 pObj = SG::asStorable(aux);
113 return StatusCode::SUCCESS;
114}
115
116// createRep should create the bytestream from RDOs.
117StatusCode L1TopoByteStreamAuxCnv::createRep(DataObject* /*pObj*/,
118 IOpaqueAddress*& /*pAddr*/) {
119 return StatusCode::FAILURE;
120}
121
122} // end namespace
#define ATH_MSG_ERROR(x)
#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.
static Double_t sc
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.
Container of L1TopoRDOs (standard Athena boilerplate)
std::string m_name
Converter name.
ToolHandle< L1TopoByteStreamTool > m_readTool
Do the main job - retrieve xAOD Topo from robs.
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create TriggerTowers from ByteStream.
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create ByteStream from TriggerTowers.
virtual void initialize(const std::vector< uint32_t > &dataWords, const std::vector< uint32_t > &statusWords, const uint32_t errorWord, const uint32_t sourceID)
initialize
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
L1TopoRawDataAuxContainer_v1 L1TopoRawDataAuxContainer
Define the latest version of the L1TopoRawData auxiliary container.
L1TopoRawData_v1 L1TopoRawData
Define the latest version of the L1TopoRawData class.
L1TopoRawDataContainer_v1 L1TopoRawDataContainer
Define the latest version of the L1TopoRawData container.