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