ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoByteStream
src
L1TopoByteStreamxAODCnv.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
#include <vector>
6
#include <stdint.h>
7
8
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
9
#include "
ByteStreamCnvSvcBase/IROBDataProviderSvc.h
"
10
11
#include "
ByteStreamData/RawEvent.h
"
12
#include "
ByteStreamData/ROBData.h
"
13
14
#include "
AthenaKernel/errorcheck.h
"
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
21
#include "
AthenaKernel/ClassID_traits.h
"
22
#include "
AthenaKernel/StorableConversions.h
"
23
#include "
StoreGate/StoreGateSvc.h
"
24
25
#include "
xAODTrigL1Calo/L1TopoRawDataContainer.h
"
26
#include "
xAODTrigL1Calo/L1TopoRawDataAuxContainer.h
"
27
28
#include "
L1TopoByteStreamxAODCnv.h
"
29
30
namespace
LVL1BS
{
31
32
L1TopoByteStreamxAODCnv::L1TopoByteStreamxAODCnv
(ISvcLocator* svcloc)
33
:
Converter
(
storageType
(),
classID
(), svcloc),
34
AthMessaging
(svcloc != 0 ? msgSvc() : 0,
"L1TopoByteStreamxAODCnv"
),
35
m_name
(
"L1TopoByteStreamxAODCnv"
) {}
36
37
// CLID
38
39
CLID
L1TopoByteStreamxAODCnv::classID
() {
40
return
ClassID_traits<xAOD::L1TopoRawDataContainer>::ID
();
41
}
42
43
long
L1TopoByteStreamxAODCnv::storageType
() {
44
return
ByteStreamAddress::storageType
();
45
}
46
47
// Init method gets all necessary services etc.
48
49
StatusCode
L1TopoByteStreamxAODCnv::initialize
() {
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
58
StatusCode
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
//coverity[FORWARD_NULL:FALSE]
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 =
72
new
xAOD::L1TopoRawDataContainer
;
73
74
// Create link with AUX container
75
DataLink<xAOD::L1TopoRawDataAuxContainer>
link(nmAux);
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);
84
ATH_MSG_DEBUG
(
85
"Number of xAOD::L1TopoRawData created: "
<< topoCollection->
size
());
86
87
return
StatusCode::SUCCESS;
88
}
89
90
// createRep should create the bytestream from RDOs.
91
92
StatusCode
L1TopoByteStreamxAODCnv::createRep
(DataObject*
/*pObj*/
,
93
IOpaqueAddress*&
/*pAddr*/
) {
94
return
StatusCode::FAILURE;
95
}
96
97
}
// end namespace
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
L1TopoByteStreamxAODCnv.h
L1TopoRawDataAuxContainer.h
L1TopoRawDataContainer.h
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::storageType
static constexpr long storageType()
Definition
ByteStreamAddress.h:51
Converter::Converter
Converter()
Definition
Converter.h:29
DataLink
Object reference supporting deferred reading from StoreGate.
Definition
AthLinks/DataLink.h:93
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
LVL1BS::L1TopoByteStreamxAODCnv::m_name
std::string m_name
Converter name.
Definition
L1TopoByteStreamxAODCnv.h:55
LVL1BS::L1TopoByteStreamxAODCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create TriggerTowers from ByteStream.
Definition
L1TopoByteStreamxAODCnv.cxx:58
LVL1BS::L1TopoByteStreamxAODCnv::createRep
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create ByteStream from TriggerTowers.
Definition
L1TopoByteStreamxAODCnv.cxx:92
LVL1BS::L1TopoByteStreamxAODCnv::initialize
virtual StatusCode initialize()
Definition
L1TopoByteStreamxAODCnv.cxx:49
LVL1BS::L1TopoByteStreamxAODCnv::classID
static CLID classID()
Definition
L1TopoByteStreamxAODCnv.cxx:39
LVL1BS::L1TopoByteStreamxAODCnv::L1TopoByteStreamxAODCnv
L1TopoByteStreamxAODCnv(ISvcLocator *svcloc)
Definition
L1TopoByteStreamxAODCnv.cxx:32
LVL1BS::L1TopoByteStreamxAODCnv::storageType
static long storageType()
Definition
L1TopoByteStreamxAODCnv.cxx:43
LVL1BS
Definition
ZdcModifySlices.h:10
SG::asStorable
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Definition
DataObjectSharedPtr.h:31
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