A tool to decode MM ROB fragments into MM RDO (based on the sTGC tool).
More...
#include <MM_RawDataProviderTool.h>
|
| virtual | ~MM_RawDataProviderTool ()=default |
| | Default destructor.
|
| virtual StatusCode | initialize () override |
| | Standard AlgTool method.
|
| virtual StatusCode | convert (const EventContext &) const override |
| virtual StatusCode | convert (const std::vector< IdentifierHash > &, const EventContext &) const override |
| virtual StatusCode | convert (const std::vector< uint32_t > &, const EventContext &) const override |
|
| ServiceHandle< Muon::IMuonIdHelperSvc > | m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"} |
| | The ID helper.
|
| ToolHandle< IMM_ROD_Decoder > | m_decoder {this, "Decoder", "Muon::MmROD_Decoder/MmROD_Decoder"} |
| | Decoder for ROB fragment RDO conversion.
|
| SG::WriteHandleKey< MM_RawDataContainer > | m_rdoContainerKey { this, "RdoLocation", "MMRDO", "Name of the MMRDO produced by RawDataProvider"} |
| | RDO container key.
|
| unsigned int | m_maxhashtoUse {0} |
| ServiceHandle< IROBDataProviderSvc > | m_robDataProvider {this, "ROBDataProviderSvc", "ROBDataProviderSvc"} |
| Gaudi::Property< bool > | m_skipDecoding {this, "SkipDecoding", false, "Skip the decoding but still write the container"} |
| | Flag to skip decoding and write empty container.
|
| std::vector< uint32_t > | m_allRobIds |
| SG::UpdateHandleKey< MM_RawDataCollection_Cache > | m_rdoContainerCacheKey |
A tool to decode MM ROB fragments into MM RDO (based on the sTGC tool).
- Author
- Leonidas Fountas leoni.nosp@m.das..nosp@m.fount.nosp@m.as@c.nosp@m.ern.c.nosp@m.h
Definition at line 29 of file MM_RawDataProviderTool.h.
◆ ~MM_RawDataProviderTool()
| virtual Muon::MM_RawDataProviderTool::~MM_RawDataProviderTool |
( |
| ) |
|
|
virtualdefault |
◆ convert() [1/3]
| StatusCode Muon::MM_RawDataProviderTool::convert |
( |
const EventContext & | ctx | ) |
const |
|
overridevirtual |
Definition at line 154 of file MM_RawDataProviderTool.cxx.
155{
156
157
158 MM_RawDataContainer* rdoContainer{nullptr};
161
162 ROBFragmentList vecRobf;
164
165
166 const std::vector<IdentifierHash> rdoIdhVect;
167
169}
#define ATH_CHECK
Evaluate an expression and check for errors.
◆ convert() [2/3]
| StatusCode Muon::MM_RawDataProviderTool::convert |
( |
const std::vector< IdentifierHash > & | rdoIdhVect, |
|
|
const EventContext & | ctx ) const |
|
overridevirtual |
Definition at line 137 of file MM_RawDataProviderTool.cxx.
138{
139
140
141
142 MM_RawDataContainer* rdoContainer{nullptr};
144
145 if (rdoIdhVect.empty() ||
m_skipDecoding)
return StatusCode::SUCCESS;
146
147 ROBFragmentList vecRobf;
149
151}
◆ convert() [3/3]
| StatusCode Muon::MM_RawDataProviderTool::convert |
( |
const std::vector< uint32_t > & | robIds, |
|
|
const EventContext & | ctx ) const |
|
overridevirtual |
Definition at line 121 of file MM_RawDataProviderTool.cxx.
121 {
122
123 MM_RawDataContainer* rdoContainer{nullptr};
125
127
128 ROBFragmentList vecRobf;
130
131
132 const std::vector<IdentifierHash> hashIDList;
134}
◆ convertIntoContainer()
| StatusCode Muon::MM_RawDataProviderTool::convertIntoContainer |
( |
const EventContext & | ctx, |
|
|
const ROBFragmentList & | , |
|
|
const std::vector< IdentifierHash > & | , |
|
|
MM_RawDataContainer & | ) const |
|
protectedvirtual |
Method that converts the ROBFragments into the passed container.
Definition at line 55 of file MM_RawDataProviderTool.cxx.
56{
57
58
59 std::unordered_map<IdentifierHash, std::unique_ptr<MM_RawDataCollection>> rdo_map;
60
61
64
65
66 int nerr_duplicate{0}, nerr_rdo{0};
67
68
69 for (auto& [hash, collection]: rdo_map) {
70
71 if ((!collection) or collection->empty()) continue;
72
74
75 if (lock.alreadyPresent()) {
76 ++nerr_duplicate;
77 } else if (!lock.addOrDelete(std::move(collection)).isSuccess()) {
78
79 ++nerr_rdo;
80 }
81 }
82
83
84 if (nerr_duplicate)
ATH_MSG_WARNING(nerr_duplicate <<
" elinks skipped since the same module hash has been added by a previous ROB fragment");
85 if (nerr_rdo){
86 ATH_MSG_ERROR(
"Failed to add "<<nerr_rdo<<
" RDOs into the identifiable container");
87 return StatusCode::FAILURE;
88 }
89
90 ATH_MSG_DEBUG(
"Size of mmRdoContainer is " << mmRdoContainer.size());
91 return StatusCode::SUCCESS;
92}
#define ATH_MSG_WARNING(x)
friend class IDC_WriteHandle
eformat::ROBFragment< PointerType > ROBFragment
◆ initialize()
| StatusCode Muon::MM_RawDataProviderTool::initialize |
( |
| ) |
|
|
overridevirtual |
Standard AlgTool method.
Definition at line 18 of file MM_RawDataProviderTool.cxx.
19{
24
26
27
28
29 for (uint32_t detID : {eformat::MUON_MMEGA_ENDCAP_A_SIDE, eformat::MUON_MMEGA_ENDCAP_C_SIDE}) {
30 for (uint8_t sectorID(0); sectorID < 16; ++sectorID) {
31
32
33
34 uint16_t moduleID = (0x0 << 8) | sectorID;
35 SourceIdentifier sid(static_cast<eformat::SubDetector>(detID), moduleID);
37
38 moduleID = (0x1 << 8) | sectorID;
39 sid = SourceIdentifier(static_cast<eformat::SubDetector>(detID), moduleID);
41
42 moduleID = (0x2 << 8) | sectorID;
43 sid = SourceIdentifier(static_cast<eformat::SubDetector>(detID), moduleID);
45 }
46 }
47
49
50 return StatusCode::SUCCESS;
51}
◆ initRdoContainer()
| StatusCode Muon::MM_RawDataProviderTool::initRdoContainer |
( |
const EventContext & | ctx, |
|
|
MM_RawDataContainer *& | rdoContainer ) const |
|
protected |
Definition at line 95 of file MM_RawDataProviderTool.cxx.
96{
97
99
101 if(!externalCacheRDO){
104 } else {
107 ATH_CHECK(rdoContainerHandle.record(std::make_unique<MM_RawDataContainer>(
update.ptr())));
109 }
110
111
112 if (!(rdoContainer = rdoContainerHandle.ptr())) {
113 ATH_MSG_ERROR(
"the MM RDO container is null, cannot decode MM data");
114 return StatusCode::FAILURE;
115 }
116
117 return StatusCode::SUCCESS;
118}
◆ m_allRobIds
| std::vector<uint32_t> Muon::MM_RawDataProviderTool::m_allRobIds |
|
protected |
◆ m_decoder
| ToolHandle<IMM_ROD_Decoder> Muon::MM_RawDataProviderTool::m_decoder {this, "Decoder", "Muon::MmROD_Decoder/MmROD_Decoder"} |
|
protected |
◆ m_idHelperSvc
The ID helper.
Definition at line 54 of file MM_RawDataProviderTool.h.
54{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
◆ m_maxhashtoUse
| unsigned int Muon::MM_RawDataProviderTool::m_maxhashtoUse {0} |
|
protected |
◆ m_rdoContainerCacheKey
Initial value:{this, "MmContainerCacheKey",
"", "Optional external cache for the MM container"}
Definition at line 74 of file MM_RawDataProviderTool.h.
74 {this, "MmContainerCacheKey",
75 "", "Optional external cache for the MM container"};
◆ m_rdoContainerKey
RDO container key.
Definition at line 60 of file MM_RawDataProviderTool.h.
60{ this, "RdoLocation", "MMRDO", "Name of the MMRDO produced by RawDataProvider"};
◆ m_robDataProvider
◆ m_skipDecoding
| Gaudi::Property<bool> Muon::MM_RawDataProviderTool::m_skipDecoding {this, "SkipDecoding", false, "Skip the decoding but still write the container"} |
|
protected |
Flag to skip decoding and write empty container.
Definition at line 69 of file MM_RawDataProviderTool.h.
69{this, "SkipDecoding", false, "Skip the decoding but still write the container"};
The documentation for this class was generated from the following files: