ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1CaloByteStream
src
xaod
PpmByteStreamAuxCnv.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 <cstdint>
7
#include <memory>
8
9
#include "
ByteStreamCnvSvcBase/ByteStreamAddress.h
"
10
#include "
ByteStreamCnvSvcBase/IROBDataProviderSvc.h
"
11
12
#include "
ByteStreamData/RawEvent.h
"
13
#include "
ByteStreamData/ROBData.h
"
14
15
#include "
AthenaKernel/errorcheck.h
"
16
#include "GaudiKernel/DataObject.h"
17
#include "GaudiKernel/IOpaqueAddress.h"
18
#include "GaudiKernel/IRegistry.h"
19
#include "GaudiKernel/ISvcLocator.h"
20
#include "GaudiKernel/StatusCode.h"
21
22
#include "
AthenaKernel/ClassID_traits.h
"
23
#include "
AthenaKernel/StorableConversions.h
"
24
#include "
StoreGate/StoreGateSvc.h
"
25
26
#include "
xAODTrigL1Calo/TriggerTower.h
"
27
#include "
xAODTrigL1Calo/TriggerTowerContainer.h
"
28
#include "
xAODTrigL1Calo/TriggerTowerAuxContainer.h
"
29
30
#include "
ZdcByteStream/ZdcByteStreamReadV1V2Tool.h
"
31
32
#include "
PpmByteStreamAuxCnv.h
"
33
#include "
../ToString.h
"
34
#include "
PpmByteStreamReadV1V2Tool.h
"
35
36
namespace
LVL1BS
{
37
PpmByteStreamAuxCnv::PpmByteStreamAuxCnv
(ISvcLocator* svcloc) :
38
Converter
(
storageType
(),
classID
(), svcloc),
39
AthMessaging
(svcloc != 0 ? msgSvc() : 0,
"PpmByteStreamAuxCnv"
),
40
m_name
(
"PpmByteStreamAuxCnv"
),
41
m_readTool
(
"LVL1BS::PpmByteStreamReadV1V2Tool/PpmByteStreamReadV1V2Tool"
),
42
m_zdcTool
(
"ZdcByteStreamReadV1V2Tool/ZdcByteStreamReadV1V2Tool"
) {
43
44
}
45
46
CLID
PpmByteStreamAuxCnv::classID
() {
47
return
ClassID_traits<xAOD::TriggerTowerAuxContainer>::ID
();
48
}
49
50
long
PpmByteStreamAuxCnv::storageType
()
51
{
52
return
ByteStreamAddress::storageType
();
53
}
54
55
// Init method gets all necessary services etc.
56
57
StatusCode
PpmByteStreamAuxCnv::initialize
() {
58
ATH_MSG_DEBUG
(
"Initializing "
<<
m_name
);
59
60
CHECK
(Converter::initialize());
61
CHECK
(
m_readTool
.retrieve());
62
63
return
StatusCode::SUCCESS;
64
}
65
66
// createObj should create the RDO from bytestream.
67
StatusCode
PpmByteStreamAuxCnv::createObj
(IOpaqueAddress* pAddr,
68
DataObject*& pObj) {
69
ATH_MSG_DEBUG
(
"createObj() called"
);
70
// -------------------------------------------------------------------------
71
ByteStreamAddress
*pBS_Addr =
dynamic_cast<
ByteStreamAddress
*
>
(pAddr);
72
if
(not pBS_Addr)
return
StatusCode::FAILURE;
73
// -------------------------------------------------------------------------
74
const
EventContext& ctx = pBS_Addr->
getEventContext
();
75
const
std::string nm = *(pBS_Addr->par());
76
ATH_MSG_DEBUG
(
"Creating Objects "
<< nm);
77
78
auto
aux =
new
xAOD::TriggerTowerAuxContainer
;
79
xAOD::TriggerTowerContainer
ttCollection;
80
ttCollection.setStore(aux);
81
// -------------------------------------------------------------------------
82
StatusCode
sc
;
83
if
(nm.substr(0,3) !=
"Zdc"
)
84
{
85
ATH_MSG_DEBUG
(
"converting for L1Calo: "
<< nm );
86
sc
=
m_readTool
->convert(ctx, nm, &ttCollection);
87
}
88
else
89
{
90
ATH_MSG_DEBUG
(
"converting for ZDC: "
<< nm );
91
sc
=
m_zdcTool
->convert(nm, &ttCollection);
92
}
93
if
(
sc
.isFailure()) {
94
ATH_MSG_ERROR
(
"Failed to create Objects"
<< nm);
95
delete
aux;
96
return
sc
;
97
}
98
// -------------------------------------------------------------------------
99
ATH_MSG_VERBOSE
(
ToString
(ttCollection));
100
ATH_MSG_DEBUG
(
"Number of readed objects: "
<< aux->size());
101
// -------------------------------------------------------------------------
102
pObj =
SG::asStorable
(aux);
103
return
StatusCode::SUCCESS;
104
}
105
106
// createRep should create the bytestream from RDOs.
107
StatusCode
PpmByteStreamAuxCnv::createRep
(DataObject*
/*pObj*/
,
108
IOpaqueAddress*&
/*pAddr*/
) {
109
return
StatusCode::FAILURE;
110
}
111
112
}
// end namespace
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
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
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
PpmByteStreamAuxCnv.h
PpmByteStreamReadV1V2Tool.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
ToString.h
TriggerTowerAuxContainer.h
TriggerTowerContainer.h
ZdcByteStreamReadV1V2Tool.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
LVL1BS::PpmByteStreamAuxCnv::initialize
virtual StatusCode initialize()
Definition
PpmByteStreamAuxCnv.cxx:57
LVL1BS::PpmByteStreamAuxCnv::storageType
static long storageType()
Definition
PpmByteStreamAuxCnv.cxx:50
LVL1BS::PpmByteStreamAuxCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create TriggerTowers from ByteStream.
Definition
PpmByteStreamAuxCnv.cxx:67
LVL1BS::PpmByteStreamAuxCnv::classID
static CLID classID()
Definition
PpmByteStreamAuxCnv.cxx:46
LVL1BS::PpmByteStreamAuxCnv::m_zdcTool
ToolHandle< ZdcByteStreamReadV1V2Tool > m_zdcTool
Definition
PpmByteStreamAuxCnv.h:64
LVL1BS::PpmByteStreamAuxCnv::createRep
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create ByteStream from TriggerTowers.
Definition
PpmByteStreamAuxCnv.cxx:107
LVL1BS::PpmByteStreamAuxCnv::m_name
std::string m_name
Converter name.
Definition
PpmByteStreamAuxCnv.h:60
LVL1BS::PpmByteStreamAuxCnv::m_readTool
ToolHandle< PpmByteStreamReadV1V2Tool > m_readTool
Do the main job - retrieve xAOD TriggerTowers from robs.
Definition
PpmByteStreamAuxCnv.h:63
LVL1BS::PpmByteStreamAuxCnv::PpmByteStreamAuxCnv
PpmByteStreamAuxCnv(ISvcLocator *svcloc)
Definition
PpmByteStreamAuxCnv.cxx:37
LVL1BS
Definition
ZdcModifySlices.h:10
LVL1BS::ToString
std::string ToString(const xAOD::TriggerTower &tt)
Definition
ToString.cxx:23
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::TriggerTowerAuxContainer
TriggerTowerAuxContainer_v2 TriggerTowerAuxContainer
Define the latest version of the TriggerTower auxiliary container.
Definition
TriggerTowerAuxContainer.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