ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1CaloByteStream
src
xaod
CmxRoIByteStreamAuxCnv.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 "
TrigT1CaloEvent/CMXRoI.h
"
38
// ============================================================================
39
// xAOD
40
// ============================================================================
41
#include "
xAODTrigL1Calo/CMXRoI.h
"
42
#include "
xAODTrigL1Calo/CMXRoIContainer.h
"
43
#include "
xAODTrigL1Calo/CMXRoIAuxContainer.h
"
44
// ============================================================================
45
// Local
46
// ============================================================================
47
#include "
CmxRoIByteStreamAuxCnv.h
"
48
#include "
../JepRoiByteStreamV2Tool.h
"
49
#include "
../ToString.h
"
50
// ============================================================================
51
52
namespace
LVL1BS
{
53
CmxRoIByteStreamAuxCnv::CmxRoIByteStreamAuxCnv
(ISvcLocator* svcloc) :
54
Converter
(
storageType
(),
classID
(), svcloc),
55
AthMessaging
(svcloc != 0 ? msgSvc() : 0,
"CmxRoIByteStreamAuxCnv"
),
56
m_name
(
"CmxRoIByteStreamAuxCnv"
),
57
m_readTool
(
"LVL1BS::JepRoiByteStreamV2Tool/JepRoiByteStreamV2Tool"
)
58
{
59
}
60
61
CLID
CmxRoIByteStreamAuxCnv::classID
() {
62
return
ClassID_traits<xAOD::CMXRoIAuxContainer>::ID
();
63
}
64
65
long
CmxRoIByteStreamAuxCnv::storageType
()
66
{
67
return
ByteStreamAddress::storageType
();
68
}
69
70
// Init method gets all necessary services etc.
71
72
StatusCode
CmxRoIByteStreamAuxCnv::initialize
() {
73
ATH_MSG_DEBUG
(
"Initializing "
<<
m_name
);
74
75
CHECK
(Converter::initialize());
76
CHECK
(
m_readTool
.retrieve());
77
78
return
StatusCode::SUCCESS;
79
}
80
81
// createObj should create the RDO from bytestream.
82
StatusCode
CmxRoIByteStreamAuxCnv::createObj
(IOpaqueAddress* pAddr,
83
DataObject*& pObj) {
84
ATH_MSG_DEBUG
(
"createObj() called"
);
85
// -------------------------------------------------------------------------
86
ByteStreamAddress
*pBS_Addr =
dynamic_cast<
ByteStreamAddress
*
>
(pAddr);
87
if
(not pBS_Addr)
return
StatusCode::FAILURE;
88
// -------------------------------------------------------------------------
89
const
EventContext& ctx = pBS_Addr->
getEventContext
();
90
const
std::string nm = *(pBS_Addr->par());
91
ATH_MSG_DEBUG
(
"Creating Objects "
<< nm);
92
93
auto
aux =
new
xAOD::CMXRoIAuxContainer
;
94
xAOD::CMXRoIContainer
container;
95
container.
setStore
(aux);
96
// -------------------------------------------------------------------------
97
LVL1::CMXRoI
source;
98
StatusCode
sc
=
m_readTool
->convert(ctx, nm, &source);
99
if
(
sc
.isFailure()) {
100
ATH_MSG_ERROR
(
"Failed to create objects"
);
101
delete
aux;
102
return
sc
;
103
}
104
105
xAOD::CMXRoI
* item =
new
xAOD::CMXRoI
();
106
container.push_back(item);
107
108
item->
initialize
(source.ex(), source.ey(), source.et(),
109
source.exError(), source.eyError(), source.etError(),
110
//source.sumEtHits(), source.missingEtHits(),
111
// amazurov: values for EtHits and missingEtHits are swaped in source
112
source.missingEtHits(), source.sumEtHits(),
113
source.missingEtSigHits(),
114
source.ex(
LVL1::CMXRoI::SumType::MASKED
),
115
source.ey(
LVL1::CMXRoI::SumType::MASKED
),
116
source.et(
LVL1::CMXRoI::SumType::MASKED
),
117
source.exError(
LVL1::CMXRoI::SumType::MASKED
),
118
source.eyError(
LVL1::CMXRoI::SumType::MASKED
),
119
source.etError(
LVL1::CMXRoI::SumType::MASKED
),
120
// source.sumEtHits(LVL1::CMXRoI::SumType::MASKED), source.missingEtHits(LVL1::CMXRoI::SumType::MASKED)
121
// amazurov: values for EtHits and missingEtHits are swaped in source
122
source.missingEtHits(
LVL1::CMXRoI::SumType::MASKED
), source.sumEtHits(
LVL1::CMXRoI::SumType::MASKED
)
123
);
124
125
// -------------------------------------------------------------------------
126
//ATH_MSG_VERBOSE(ToString(container));
127
ATH_MSG_DEBUG
(
"Number of readed CMXRoI: "
<< aux->size());
128
// -------------------------------------------------------------------------
129
pObj =
SG::asStorable
(aux);
130
return
StatusCode::SUCCESS;
131
}
132
133
// createRep should create the bytestream from RDOs.
134
StatusCode
CmxRoIByteStreamAuxCnv::createRep
(DataObject*
/*pObj*/
,
135
IOpaqueAddress*&
/*pAddr*/
) {
136
return
StatusCode::FAILURE;
137
}
138
139
}
// 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
CMXRoIAuxContainer.h
CMXRoIContainer.h
CmxRoIByteStreamAuxCnv.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
CMXRoI.h
IROBDataProviderSvc.h
JepRoiByteStreamV2Tool.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
ToString.h
CMXRoI.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::CmxRoIByteStreamAuxCnv::storageType
static long storageType()
Definition
CmxRoIByteStreamAuxCnv.cxx:65
LVL1BS::CmxRoIByteStreamAuxCnv::CmxRoIByteStreamAuxCnv
CmxRoIByteStreamAuxCnv(ISvcLocator *svcloc)
Definition
CmxRoIByteStreamAuxCnv.cxx:53
LVL1BS::CmxRoIByteStreamAuxCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Create TriggerTowers from ByteStream.
Definition
CmxRoIByteStreamAuxCnv.cxx:82
LVL1BS::CmxRoIByteStreamAuxCnv::classID
static CLID classID()
Definition
CmxRoIByteStreamAuxCnv.cxx:61
LVL1BS::CmxRoIByteStreamAuxCnv::initialize
virtual StatusCode initialize()
Definition
CmxRoIByteStreamAuxCnv.cxx:72
LVL1BS::CmxRoIByteStreamAuxCnv::createRep
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
Create ByteStream from TriggerTowers.
Definition
CmxRoIByteStreamAuxCnv.cxx:134
LVL1BS::CmxRoIByteStreamAuxCnv::m_readTool
ToolHandle< JepRoiByteStreamV2Tool > m_readTool
Do the main job - retrieve objects from robs.
Definition
CmxRoIByteStreamAuxCnv.h:59
LVL1BS::CmxRoIByteStreamAuxCnv::m_name
std::string m_name
Converter name.
Definition
CmxRoIByteStreamAuxCnv.h:56
LVL1::CMXRoI
CMX RoI data.
Definition
Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXRoI.h:22
LVL1::CMXRoI::MASKED
@ MASKED
Definition
Trigger/TrigT1/TrigT1CaloEvent/TrigT1CaloEvent/CMXRoI.h:26
SG::AuxVectorData::setStore
void setStore(SG::IAuxStore *store)
Set the store associated with this object.
Definition
AuxVectorData.cxx:116
xAOD::CMXRoI_v1::initialize
virtual void initialize(uint32_t roiWord0, uint32_t roiWord1, uint32_t roiWord2, uint32_t roiWord3, uint32_t roiWord4, uint32_t roiWord5)
initialize
LVL1BS
Definition
ZdcModifySlices.h:10
SG::asStorable
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Definition
DataObjectSharedPtr.h:31
xAOD::CMXRoI
CMXRoI_v1 CMXRoI
Define the latest version of the CMXRoI class.
Definition
Event/xAOD/xAODTrigL1Calo/xAODTrigL1Calo/CMXRoI.h:14
xAOD::CMXRoIAuxContainer
CMXRoIAuxContainer_v1 CMXRoIAuxContainer
Define the latest version of the CMXRoI auxiliary info.
Definition
CMXRoIAuxContainer.h:13
xAOD::CMXRoIContainer
CMXRoIContainer_v1 CMXRoIContainer
Define the latest version of the CMXRoI container.
Definition
CMXRoIContainer.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