ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonSTGC_CnvTools
src
NSWTP_RawDataProviderTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
NSWTP_RawDataProviderTool.h
"
5
#include "
xAODMuonRDO/NSWTPRDOAuxContainer.h
"
6
7
namespace
Muon
{
8
9
//=====================================================================
10
StatusCode
NSWTP_RawDataProviderTool::initialize
()
11
{
12
ATH_CHECK
(
m_decoder
.retrieve());
13
ATH_CHECK
(
m_idHelperSvc
.retrieve());
14
ATH_CHECK
(
m_robDataProvider
.retrieve());
15
ATH_CHECK
(
m_rdoContainerKey
.initialize());
16
17
return
StatusCode::SUCCESS;
18
}
19
20
21
//=====================================================================
22
// Convert all Pad Trigger ROBFragments within the given EventContext
23
StatusCode
NSWTP_RawDataProviderTool::convert
(
const
EventContext& ctx)
const
{
24
// Get all ROBs!
25
ROBFragmentList fragments;
26
std::vector<uint32_t> robIDs;
27
28
// Generate all possible ROB IDs, aka Source Identifiers
29
// Valid values are: 0x00{6d,6e}002[0..f]
30
for
(uint32_t detectorID : {eformat::MUON_STGC_ENDCAP_A_SIDE, eformat::MUON_STGC_ENDCAP_C_SIDE}) {
// 0x6D, 0x6E
31
for
(uint8_t sector{}; sector < 16; sector++) {
32
uint16_t moduleID = (0x1 << 4) | sector;
33
eformat::helper::SourceIdentifier sourceID{
static_cast<
eformat::SubDetector
>
(detectorID), moduleID};
34
robIDs.push_back(sourceID.simple_code());
35
}
36
}
37
38
m_robDataProvider
->getROBData(ctx, robIDs, fragments);
39
ATH_MSG_DEBUG
(__PRETTY_FUNCTION__ <<
": Got "
<< fragments.size() <<
" fragments"
);
40
SG::WriteHandle<xAOD::NSWTPRDOContainer>
rdoContainerHandle{
m_rdoContainerKey
, ctx};
41
xAOD::NSWTPRDOContainer
* pContainer{
nullptr
};
42
43
// Retrieve container, if it exists in the event store; otherwise, create one
44
45
ATH_CHECK
(rdoContainerHandle.
record
(std::make_unique<xAOD::NSWTPRDOContainer>(), std::make_unique<xAOD::NSWTPRDOAuxContainer>()));
46
pContainer = rdoContainerHandle.
ptr
();
47
for
(
const
auto
*
const
fragment : fragments) {
48
// TODO should an error here be a hard failure?
49
ATH_CHECK
(
m_decoder
->fillCollection(*fragment, *pContainer));
50
}
51
return
StatusCode::SUCCESS;
52
}
53
54
55
StatusCode
NSWTP_RawDataProviderTool::convert
(
const
std::vector<IdentifierHash>& ,
56
const
EventContext&)
const
{
57
ATH_MSG_ERROR
(__PRETTY_FUNCTION__<<
" not implemented"
);
58
return
StatusCode::FAILURE;
59
}
60
StatusCode
NSWTP_RawDataProviderTool::convert
(
const
std::vector<uint32_t>& ,
61
const
EventContext& )
const
{
62
ATH_MSG_ERROR
(__PRETTY_FUNCTION__<<
" not implemented"
);
63
return
StatusCode::FAILURE;
64
}
65
66
67
}
// namespace Muon
68
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
NSWTPRDOAuxContainer.h
NSWTP_RawDataProviderTool.h
Muon::NSWTP_RawDataProviderTool::m_robDataProvider
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Definition
NSWTP_RawDataProviderTool.h:41
Muon::NSWTP_RawDataProviderTool::m_decoder
ToolHandle< INSWTP_ROD_Decoder > m_decoder
Definition
NSWTP_RawDataProviderTool.h:40
Muon::NSWTP_RawDataProviderTool::convert
StatusCode convert(const std::vector< IdentifierHash > &chamberHashes, const EventContext &ctx) const override
Definition
NSWTP_RawDataProviderTool.cxx:55
Muon::NSWTP_RawDataProviderTool::m_rdoContainerKey
SG::WriteHandleKey< xAOD::NSWTPRDOContainer > m_rdoContainerKey
Definition
NSWTP_RawDataProviderTool.h:42
Muon::NSWTP_RawDataProviderTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition
NSWTP_RawDataProviderTool.h:39
Muon::NSWTP_RawDataProviderTool::initialize
StatusCode initialize() override
Definition
NSWTP_RawDataProviderTool.cxx:10
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition
TrackSystemController.h:46
xAOD::NSWTPRDOContainer
NSWTPRDOContainer_v1 NSWTPRDOContainer
Define the version of the NRPC RDO container.
Definition
NSWTPRDOContainer.h:14
Generated on
for ATLAS Offline Software by
1.17.0