ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1CaloByteStream
src
xaod
CpmTowerByteStreamxAODCnv.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/CPMTower.h
"
26
#include "
xAODTrigL1Calo/CPMTowerContainer.h
"
27
#include "
xAODTrigL1Calo/CPMTowerAuxContainer.h
"
28
29
#include "
CpmTowerByteStreamxAODCnv.h
"
30
31
namespace
LVL1BS
{
32
33
CpmTowerByteStreamxAODCnv::CpmTowerByteStreamxAODCnv
(ISvcLocator* svcloc) :
34
Converter
(
storageType
(),
classID
(), svcloc),
35
AthMessaging
(svcloc != 0 ? msgSvc() : 0,
"CpmTowerByteStreamxAODCnv"
),
36
m_name
(
"CpmTowerByteStreamxAODCnv"
)
37
{
38
39
}
40
41
// CLID
42
43
CLID
CpmTowerByteStreamxAODCnv::classID
() {
44
return
ClassID_traits<xAOD::CPMTowerContainer>::ID
();
45
}
46
47
long
CpmTowerByteStreamxAODCnv::storageType
()
48
{
49
return
ByteStreamAddress::storageType
();
50
}
51
52
// Init method gets all necessary services etc.
53
54
55
StatusCode
CpmTowerByteStreamxAODCnv::initialize
() {
56
ATH_MSG_DEBUG
(
"Initializing "
<<
m_name
);
57
58
CHECK
(Converter::initialize());
59
return
StatusCode::SUCCESS;
60
}
61
62
// createObj should create the RDO from bytestream.
63
64
StatusCode
CpmTowerByteStreamxAODCnv::createObj
(IOpaqueAddress* pAddr,
65
DataObject*& pObj) {
66
ATH_MSG_DEBUG
(
"createObj() called"
);
67
// -------------------------------------------------------------------------
68
ByteStreamAddress
*pBS_Addr =
dynamic_cast<
ByteStreamAddress
*
>
(pAddr);
69
if
(not pBS_Addr)
return
StatusCode::FAILURE;
70
// -------------------------------------------------------------------------
71
const
std::string nm = *(pBS_Addr->par());
72
const
std::string nmAux = nm +
"Aux."
;
73
ATH_MSG_DEBUG
(
"Creating xAOD::CPMTower interface objects '"
<< nm <<
"'"
);
74
75
xAOD::CPMTowerContainer
*
const
cpmCollection =
76
new
xAOD::CPMTowerContainer
;
77
78
// Create link with AUX container
79
DataLink<xAOD::CPMTowerAuxContainer>
link(nmAux);
80
ATH_MSG_DEBUG
(
"Creating store with data link to '"
<< nmAux);
81
82
for
(
size_t
i=0; i < link->size(); ++i){
83
cpmCollection->
push_back
(
new
xAOD::CPMTower
());
84
}
85
// ==========================================================================
86
cpmCollection->setStore(link);
87
pObj =
SG::asStorable
(cpmCollection);
88
ATH_MSG_DEBUG
(
"Number of CPMTowers created: "
<< cpmCollection->
size
());
89
90
return
StatusCode::SUCCESS;
91
}
92
93
// createRep should create the bytestream from RDOs.
94
95
StatusCode
CpmTowerByteStreamxAODCnv::createRep
(DataObject*
/*pObj*/
,
96
IOpaqueAddress*&
/*pAddr*/
) {
97
return
StatusCode::FAILURE;
98
}
99
100
}
// end namespace
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ByteStreamAddress.h
CPMTowerAuxContainer.h
CPMTowerContainer.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
CpmTowerByteStreamxAODCnv.h
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
CPMTower.h
IROBDataProviderSvc.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::CpmTowerByteStreamxAODCnv::storageType
static long storageType()
Definition
CpmTowerByteStreamxAODCnv.cxx:47
LVL1BS::CpmTowerByteStreamxAODCnv::CpmTowerByteStreamxAODCnv
CpmTowerByteStreamxAODCnv(ISvcLocator *svcloc)
Definition
CpmTowerByteStreamxAODCnv.cxx:33
LVL1BS::CpmTowerByteStreamxAODCnv::createRep
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create ByteStream from TriggerTowers.
Definition
CpmTowerByteStreamxAODCnv.cxx:95
LVL1BS::CpmTowerByteStreamxAODCnv::classID
static CLID classID()
Definition
CpmTowerByteStreamxAODCnv.cxx:43
LVL1BS::CpmTowerByteStreamxAODCnv::initialize
virtual StatusCode initialize()
Definition
CpmTowerByteStreamxAODCnv.cxx:55
LVL1BS::CpmTowerByteStreamxAODCnv::m_name
std::string m_name
Converter name.
Definition
CpmTowerByteStreamxAODCnv.h:53
LVL1BS::CpmTowerByteStreamxAODCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create TriggerTowers from ByteStream.
Definition
CpmTowerByteStreamxAODCnv.cxx:64
LVL1BS
Definition
ZdcModifySlices.h:10
SG::asStorable
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Definition
DataObjectSharedPtr.h:31
xAOD::CPMTowerContainer
CPMTowerContainer_v2 CPMTowerContainer
Define the latest version of the CPMHits container.
Definition
CPMTowerContainer.h:15
xAOD::CPMTower
CPMTower_v2 CPMTower
Define the latest version of the CPMTower class.
Definition
Event/xAOD/xAODTrigL1Calo/xAODTrigL1Calo/CPMTower.h:16
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