ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoByteStream
src
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
// ============================================================================
17
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
18
#include "
ByteStreamCnvSvcBase/IROBDataProviderSvc.h
"
19
20
#include "
ByteStreamData/RawEvent.h
"
21
#include "
ByteStreamData/ROBData.h
"
22
23
#include "
AthenaKernel/errorcheck.h
"
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
30
#include "
AthenaKernel/ClassID_traits.h
"
31
#include "
AthenaKernel/StorableConversions.h
"
32
#include "
StoreGate/StoreGateSvc.h
"
33
34
// ============================================================================
35
// TrigT1
36
// ============================================================================
37
#include "
L1TopoRDO/L1TopoRDOCollection.h
"
38
// ============================================================================
39
// xAOD
40
// ============================================================================
41
#include "
xAODTrigL1Calo/L1TopoRawData.h
"
42
#include "
xAODTrigL1Calo/L1TopoRawDataContainer.h
"
43
#include "
xAODTrigL1Calo/L1TopoRawDataAuxContainer.h
"
44
// ============================================================================
45
// Local
46
// ============================================================================
47
#include "
L1TopoByteStreamAuxCnv.h
"
48
#include "
L1TopoByteStreamTool.h
"
49
// ============================================================================
50
51
namespace
LVL1BS
{
52
L1TopoByteStreamAuxCnv::L1TopoByteStreamAuxCnv
(ISvcLocator* svcloc)
53
:
Converter
(
storageType
(),
classID
(), svcloc),
54
AthMessaging
(svcloc != 0 ? msgSvc() : 0,
"L1TopoByteStreamAuxCnv"
),
55
m_name
(
"L1TopoByteStreamAuxCnv"
),
56
m_readTool
(
"L1TopoByteStreamTool/L1TopoByteStreamTool"
) {}
57
58
CLID
L1TopoByteStreamAuxCnv::classID
() {
59
return
ClassID_traits<xAOD::L1TopoRawDataAuxContainer>::ID
();
60
}
61
62
long
L1TopoByteStreamAuxCnv::storageType
() {
63
return
ByteStreamAddress::storageType
();
64
}
65
66
// Init method gets all necessary services etc.
67
68
StatusCode
L1TopoByteStreamAuxCnv::initialize
() {
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.
78
StatusCode
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
const
EventContext& ctx = pBS_Addr->
getEventContext
();
88
ATH_MSG_DEBUG
(
"Creating Objects "
<< nm);
89
90
auto
aux =
new
xAOD::L1TopoRawDataAuxContainer
;
91
xAOD::L1TopoRawDataContainer
topoContainer;
92
topoContainer.setStore(aux);
93
// -------------------------------------------------------------------------
94
L1TopoRDOCollection
topoRDOCollection;
95
StatusCode
sc
=
m_readTool
->convert(ctx, nm, &topoRDOCollection);
96
if
(
sc
.isFailure()) {
97
ATH_MSG_ERROR
(
"Failed to create objects"
);
98
delete
aux;
99
return
sc
;
100
}
101
102
for
(
auto
topoRDO : topoRDOCollection) {
103
xAOD::L1TopoRawData
* item =
new
xAOD::L1TopoRawData
();
104
topoContainer.
push_back
(item);
105
item->
initialize
(topoRDO->getDataWords(), topoRDO->getStatusWords(),
106
topoRDO->getError(), topoRDO->getSourceID());
107
}
108
109
// -------------------------------------------------------------------------
110
// ATH_MSG_VERBOSE(ToString(cpmCollection));
111
ATH_MSG_DEBUG
(
"Number of readed Topo: "
<< aux->size());
112
// -------------------------------------------------------------------------
113
pObj =
SG::asStorable
(aux);
114
return
StatusCode::SUCCESS;
115
}
116
117
// createRep should create the bytestream from RDOs.
118
StatusCode
L1TopoByteStreamAuxCnv::createRep
(DataObject*
/*pObj*/
,
119
IOpaqueAddress*&
/*pAddr*/
) {
120
return
StatusCode::FAILURE;
121
}
122
123
}
// end namespace
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ByteStreamAddress.h
ClassID_traits.h
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
IROBDataProviderSvc.h
L1TopoByteStreamAuxCnv.h
L1TopoByteStreamTool.h
L1TopoRDOCollection.h
L1TopoRawDataAuxContainer.h
L1TopoRawDataContainer.h
L1TopoRawData.h
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
ROBData.h
Defines the ROB data entity. The ROB data is an abstract entity that is used to decouple the raw even...
RawEvent.h
StorableConversions.h
convert to and from a SG storable
StoreGateSvc.h
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
ByteStreamAddress
IOpaqueAddress for ByteStreamCnvSvc, with ROB ids.
Definition
ByteStreamAddress.h:28
ByteStreamAddress::getEventContext
const EventContext & getEventContext() const
Definition
ByteStreamAddress.h:62
ByteStreamAddress::storageType
static constexpr long storageType()
Definition
ByteStreamAddress.h:51
Converter::Converter
Converter()
Definition
Converter.h:29
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
L1TopoRDOCollection
Container of L1TopoRDOs (standard Athena boilerplate).
Definition
L1TopoRDOCollection.h:13
LVL1BS::L1TopoByteStreamAuxCnv::storageType
static long storageType()
Definition
L1TopoByteStreamAuxCnv.cxx:62
LVL1BS::L1TopoByteStreamAuxCnv::m_name
std::string m_name
Converter name.
Definition
L1TopoByteStreamAuxCnv.h:58
LVL1BS::L1TopoByteStreamAuxCnv::L1TopoByteStreamAuxCnv
L1TopoByteStreamAuxCnv(ISvcLocator *svcloc)
Definition
L1TopoByteStreamAuxCnv.cxx:52
LVL1BS::L1TopoByteStreamAuxCnv::classID
static CLID classID()
Definition
L1TopoByteStreamAuxCnv.cxx:58
LVL1BS::L1TopoByteStreamAuxCnv::initialize
virtual StatusCode initialize()
Definition
L1TopoByteStreamAuxCnv.cxx:68
LVL1BS::L1TopoByteStreamAuxCnv::m_readTool
ToolHandle< L1TopoByteStreamTool > m_readTool
Do the main job - retrieve xAOD Topo from robs.
Definition
L1TopoByteStreamAuxCnv.h:61
LVL1BS::L1TopoByteStreamAuxCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create TriggerTowers from ByteStream.
Definition
L1TopoByteStreamAuxCnv.cxx:78
LVL1BS::L1TopoByteStreamAuxCnv::createRep
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create ByteStream from TriggerTowers.
Definition
L1TopoByteStreamAuxCnv.cxx:118
xAOD::L1TopoRawData_v1::initialize
virtual void initialize(const std::vector< uint32_t > &dataWords, const std::vector< uint32_t > &statusWords, const uint32_t errorWord, const uint32_t sourceID)
initialize
Definition
L1TopoRawData_v1.cxx:24
LVL1BS
Definition
ZdcModifySlices.h:10
SG::asStorable
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Definition
DataObjectSharedPtr.h:31
xAOD::L1TopoRawDataAuxContainer
L1TopoRawDataAuxContainer_v1 L1TopoRawDataAuxContainer
Define the latest version of the L1TopoRawData auxiliary container.
Definition
L1TopoRawDataAuxContainer.h:13
xAOD::L1TopoRawData
L1TopoRawData_v1 L1TopoRawData
Define the latest version of the L1TopoRawData class.
Definition
L1TopoRawData.h:14
xAOD::L1TopoRawDataContainer
L1TopoRawDataContainer_v1 L1TopoRawDataContainer
Define the latest version of the L1TopoRawData container.
Definition
L1TopoRawDataContainer.h:14
ClassID_traits::ID
static constexpr CLID ID()
Definition
Control/AthenaKernel/AthenaKernel/ClassID_traits.h:44
Generated on
for ATLAS Offline Software by
1.17.0