ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::NSWMMTP_RawDataProviderToolMT Class Reference

#include <NSWMMTP_RawDataProviderToolMT.h>

Inheritance diagram for Muon::NSWMMTP_RawDataProviderToolMT:
Collaboration diagram for Muon::NSWMMTP_RawDataProviderToolMT:

Public Member Functions

virtual ~NSWMMTP_RawDataProviderToolMT ()=default
StatusCode initialize () override
StatusCode convert (const EventContext &ctx) const override
StatusCode convert (const std::vector< IdentifierHash > &, const EventContext &) const override
StatusCode convert (const std::vector< uint32_t > &, const EventContext &) const override

Private Member Functions

StatusCode convertFragments (const ROBFragmentList &fragments, const EventContext &ctx) const

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
ToolHandle< INSWMMTP_ROD_Decoderm_decoder {this, "Decoder", "Muon::NSWMMTP_ROD_Decoder/NSWMMTP_ROD_Decoder"}
ServiceHandle< IROBDataProviderSvcm_robDataProvider {this, "ROBDataProviderSvc", "ROBDataProviderSvc"}
SG::WriteHandleKey< xAOD::NSWMMTPRDOContainerm_rdoContainerKey {this, "RdoLocation", "", "NSWMMTPRDOContainer"}

Detailed Description

Definition at line 19 of file NSWMMTP_RawDataProviderToolMT.h.

Constructor & Destructor Documentation

◆ ~NSWMMTP_RawDataProviderToolMT()

virtual Muon::NSWMMTP_RawDataProviderToolMT::~NSWMMTP_RawDataProviderToolMT ( )
virtualdefault

Member Function Documentation

◆ convert() [1/3]

StatusCode Muon::NSWMMTP_RawDataProviderToolMT::convert ( const EventContext & ctx) const
override

Definition at line 43 of file NSWMMTP_RawDataProviderToolMT.cxx.

44 {
45 // Get all ROBs!
46 ROBFragmentList fragments;
47 std::vector<uint32_t> robIDs;
48
49 // Generate all possible ROB IDs, aka Source Identifiers
50 // Valid values are: 0x00{6b,6c}001[0..f]
51 robIDs.reserve(32);
52 for (uint32_t detectorID : {eformat::MUON_MMEGA_ENDCAP_A_SIDE, eformat::MUON_MMEGA_ENDCAP_C_SIDE}) { // 0x6B, 0x6C
53 for (uint8_t sector{}; sector < 16; sector++) {
54 uint16_t moduleID = (0x1 << 4) | sector;
55 eformat::helper::SourceIdentifier sourceID{static_cast<eformat::SubDetector>(detectorID), moduleID};
56 robIDs.push_back(sourceID.simple_code());
57 }
58 }
59
60 m_robDataProvider->getROBData(ctx, robIDs, fragments);
61 return convertFragments(fragments, ctx);
62 }
StatusCode convertFragments(const ROBFragmentList &fragments, const EventContext &ctx) const
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
setWord1 uint16_t

◆ convert() [2/3]

StatusCode Muon::NSWMMTP_RawDataProviderToolMT::convert ( const std::vector< IdentifierHash > & ,
const EventContext &  ) const
override

Definition at line 64 of file NSWMMTP_RawDataProviderToolMT.cxx.

64 {
65 ATH_MSG_ERROR(__PRETTY_FUNCTION__ << " not implemented!");
66 return StatusCode::FAILURE;
67 }
#define ATH_MSG_ERROR(x)

◆ convert() [3/3]

StatusCode Muon::NSWMMTP_RawDataProviderToolMT::convert ( const std::vector< uint32_t > & ,
const EventContext &  ) const
override

Definition at line 68 of file NSWMMTP_RawDataProviderToolMT.cxx.

68 {
69 ATH_MSG_ERROR(__PRETTY_FUNCTION__ << " not implemented!");
70 return StatusCode::FAILURE;
71 }

◆ convertFragments()

StatusCode Muon::NSWMMTP_RawDataProviderToolMT::convertFragments ( const ROBFragmentList & fragments,
const EventContext & ctx ) const
private

Definition at line 24 of file NSWMMTP_RawDataProviderToolMT.cxx.

24 {
25 ATH_MSG_DEBUG(__PRETTY_FUNCTION__ << ": Got " << fragments.size() << " fragments");
26 SG::WriteHandle rdoContainerHandle{m_rdoContainerKey, ctx};
27 xAOD::NSWMMTPRDOContainer* pContainer{nullptr};
28
29 // Retrieve container, if it exists in the event store; otherwise, create one
30
31 ATH_CHECK(rdoContainerHandle.record(std::make_unique<xAOD::NSWMMTPRDOContainer>(), std::make_unique<xAOD::NSWMMTPRDOAuxContainer>()));
32 pContainer = rdoContainerHandle.ptr();
33 for (const auto *const fragment : fragments) {
34 // NSW Common Decoder has already a try/catch inside and it's reporting errors/exceptions: wanna handle them here too?
35 ATH_CHECK(m_decoder->fillCollection(*fragment, *pContainer));
36 }
37
38 return StatusCode::SUCCESS;
39 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
ToolHandle< INSWMMTP_ROD_Decoder > m_decoder
SG::WriteHandleKey< xAOD::NSWMMTPRDOContainer > m_rdoContainerKey
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
NSWMMTPRDOContainer_v1 NSWMMTPRDOContainer
Define the version of the NSW MM RDO container.

◆ initialize()

StatusCode Muon::NSWMMTP_RawDataProviderToolMT::initialize ( )
override

Definition at line 11 of file NSWMMTP_RawDataProviderToolMT.cxx.

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 }
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc

Member Data Documentation

◆ m_decoder

ToolHandle<INSWMMTP_ROD_Decoder> Muon::NSWMMTP_RawDataProviderToolMT::m_decoder {this, "Decoder", "Muon::NSWMMTP_ROD_Decoder/NSWMMTP_ROD_Decoder"}
private

Definition at line 39 of file NSWMMTP_RawDataProviderToolMT.h.

39{this, "Decoder", "Muon::NSWMMTP_ROD_Decoder/NSWMMTP_ROD_Decoder"};

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::NSWMMTP_RawDataProviderToolMT::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 38 of file NSWMMTP_RawDataProviderToolMT.h.

38{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_rdoContainerKey

SG::WriteHandleKey<xAOD::NSWMMTPRDOContainer> Muon::NSWMMTP_RawDataProviderToolMT::m_rdoContainerKey {this, "RdoLocation", "", "NSWMMTPRDOContainer"}
private

Definition at line 43 of file NSWMMTP_RawDataProviderToolMT.h.

43{this, "RdoLocation", "", "NSWMMTPRDOContainer"};

◆ m_robDataProvider

ServiceHandle<IROBDataProviderSvc> Muon::NSWMMTP_RawDataProviderToolMT::m_robDataProvider {this, "ROBDataProviderSvc", "ROBDataProviderSvc"}
private

Definition at line 41 of file NSWMMTP_RawDataProviderToolMT.h.

41{this, "ROBDataProviderSvc", "ROBDataProviderSvc"};

The documentation for this class was generated from the following files: