ATLAS Offline Software
Loading...
Searching...
No Matches
L1Muon::RPCPatternMatching Class Reference

#include <RPCPatternMatching.h>

Inheritance diagram for L1Muon::RPCPatternMatching:
Collaboration diagram for L1Muon::RPCPatternMatching:

Public Member Functions

virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) const override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

using RdoPairs = std::array<const xAOD::NRPCRDO*, 2>
using PatternContainer = std::map<uint16_t, std::map<uint16_t, std::vector<RPCMuonPattern>>>
typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

StatusCode initializePatterns ()
StatusCode loadPatternFile (const std::string &filePath, const std::string &patternType, PatternContainer &patternContainer)
void getStripIdforAlg (const RdoPairs &rdoPairs, std::vector< uint32_t > &stripIDs, std::map< uint32_t, uint32_t > &strip_coordinates, std::map< uint32_t, uint32_t > &strip_etabin, const Muon::RpcCablingData &cabling, const Identifier &offId, const ActsTrk::GeometryContext &geoCtx) const
uint32_t getSLStripId (bool side, int sector, int doubletPhi, Muon::MuonStationIndex::StIndex RPClayer, int doubletR, int stationEta, int doubletZ, int stripNumber, bool measuresPhi) const
int getVirtualBIPhiStripNumber (float loc_pos_along_BIstrip, const MuonGMR4::RpcReadoutElement &readoutElement) const
uint32_t getVirtualBIPhiStripCoordinate (const Amg::Vector3D &stripPos, float loc_pos_along_BIstrip) const
uint32_t getBMBOPhiStripCoordinate (const Amg::Vector3D &stripPos) const
void matchPattern (const RPCMuonPattern &pattern, const std::vector< uint32_t > &stripIDs, std::vector< RPCMuonPattern > &matchedPatterns, const uint16_t &sector_header) const
void matchEtaAndPhiPatterns (const RPCMuonPattern &etaPattern, const RPCMuonPattern &phiPattern, std::vector< RPCMuonPattern > &matchedPatterns) const
bool checkStripCoincidence (std::vector< uint32_t > &stripIDs) const
StatusCode createCandidate (const std::map< uint16_t, std::vector< RPCMuonPattern > > &matchedPatterns, xAOD::L1RPCCandDataContainer &outputCandHandle) const
void getBestCandidatesPerEtaBin (const std::vector< RPCMuonPattern > &matchedPatterns, std::map< uint32_t, RPCMuonPattern > &bestCandidates) const
bool patternSanityCheck (const RPCMuonPattern &pattern) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

PatternContainer m_etaPatterns
PatternContainer m_phiPatterns
SG::ReadHandleKey< xAOD::NRPCRDOContainer > m_keyRpcRdo {this,"NrpcRdoKey","NRPCRDO","Location of input RpcRDO"}
 RPC Rdo.
SG::WriteHandleKey< xAOD::L1RPCCandDataContainer > m_outputCandKey
 Output Trigger candidates.
SG::ReadCondHandleKey< Muon::RpcCablingMap > m_cablingKey
 RPC cabling map.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc {"Muon::MuonIdHelperSvc/MuonIdHelperSvc", name()}
 RPC Id helper.
const MuonGMR4::MuonDetectorManager * m_detMgr {nullptr}
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 32 of file RPCPatternMatching.h.

Member Typedef Documentation

◆ PatternContainer

using L1Muon::RPCPatternMatching::PatternContainer = std::map<uint16_t, std::map<uint16_t, std::vector<RPCMuonPattern>>>
private

Definition at line 40 of file RPCPatternMatching.h.

◆ RdoPairs

using L1Muon::RPCPatternMatching::RdoPairs = std::array<const xAOD::NRPCRDO*, 2>
private

Definition at line 39 of file RPCPatternMatching.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Member Function Documentation

◆ checkStripCoincidence()

bool L1Muon::RPCPatternMatching::checkStripCoincidence ( std::vector< uint32_t > & stripIDs) const
private

Definition at line 399 of file RPCPatternMatching.cxx.

399 {
400 // This function checks for the required strip coincidence within each RPC layer
401 // (2/3 majority logic for BI and 1/2 logic for BM and BO) and verifies that there
402 // is a valid muon candidate to process.
403
404 // Loop over all possible trigger sectors (0-63) to check for coincidences
405 bool validCandidate = false;
406 std::vector<uint32_t> stripIDsAfterStripCoincidence;
407
408 std::sort(stripIDs.begin(), stripIDs.end());
409 for (uint16_t triggerSector = 0; triggerSector < 64; triggerSector++) {
410 std::vector<uint32_t> stripIDsInSector;
411 for (const auto& stripID : stripIDs) {
412 if (RPCSLStripConverter::getTriggerSector(stripID) == triggerSector) {
413 stripIDsInSector.push_back(stripID);
414 }
415 }
416
417 if (stripIDsInSector.empty()) continue; // No strips for this triggerSector, skip to the next one
418
419 // Check for coincidences in the current sector
420 bool hasBI[2] = {false, false}; // [0] = measuresEta, [1] = measuresPhi
421 bool hasBM1[2] = {false, false}; // [0] = measuresEta, [1] = measuresPhi
422 bool hasBM2[2] = {false, false}; // [0] = measuresEta, [1] = measuresPhi
423 bool hasBO[2] = {false, false}; // [0] = measuresEta, [1] = measuresPhi
424
425 std::sort(stripIDsInSector.begin(), stripIDsInSector.end());
426 std::vector<uint32_t> stripID_unique = stripIDsInSector; // create a copy of the original vector to keep only unique strip IDs that pass the coincidence requirement
427 stripID_unique.erase(std::unique(stripID_unique.begin(), stripID_unique.end()), stripID_unique.end());
428
429 for (int i = 0; i < int(stripID_unique.size()); ++i) {
431 uint32_t current_strip = stripID_unique[i];
432 uint32_t next_strip = current_strip + 0x2;
433 uint32_t prev_strip = current_strip - 0x2;
434 int count = std::count(stripIDsInSector.begin(), stripIDsInSector.end(), current_strip) +
435 std::count(stripIDsInSector.begin(), stripIDsInSector.end(), next_strip) +
436 std::count(stripIDsInSector.begin(), stripIDsInSector.end(), prev_strip);
437 if (count < 2) {
438 stripID_unique.erase(std::remove(stripID_unique.begin(), stripID_unique.end(), stripID_unique[i]), stripID_unique.end());
439 i--; // Adjust index after erasing
440 }
441 else {
442 if (!hasBI[stripID_unique[i]& 0x1]) {
443 hasBI[stripID_unique[i]& 0x1] = true;
444 }
445 }
446 }
447 else if (RPCSLStripConverter::getStation(stripID_unique[i]) == SLRPCStation::BM1) {
448 hasBM1[stripID_unique[i] & 0x1] = true;
449 } else if (RPCSLStripConverter::getStation(stripID_unique[i]) == SLRPCStation::BM2) {
450 hasBM2[stripID_unique[i] & 0x1] = true;
451 } else if (RPCSLStripConverter::getStation(stripID_unique[i]) == SLRPCStation::BO) {
452 // BORBOM are treated as BI strips
453 // if (some condition){
454 // // Do something
455 // } else {
456 hasBO[stripID_unique[i] & 0x1] = true;
457 // }
458 }
459 }
460 stripIDsAfterStripCoincidence.insert(stripIDsAfterStripCoincidence.end(), stripID_unique.begin(), stripID_unique.end());
461
462 bool valid_eta_cand = (hasBI[0] + hasBM1[0] + hasBM2[0] + hasBO[0] > 2) || (hasBI[0] + hasBO[0] == 2);
463 bool valid_phi_cand = (hasBI[1] + hasBM1[1] + hasBM2[1] + hasBO[1] > 2) || (hasBI[1] + hasBO[1] == 2);
464 if (valid_eta_cand && valid_phi_cand) {
465 validCandidate = true;
466 }
467 }
468
469 stripIDs = std::move(stripIDsAfterStripCoincidence); // Update the original stripIDs vector with the filtered results
470 return validCandidate;
471 }
static SLRPCStation getStation(uint32_t packed)
static uint16_t getTriggerSector(uint32_t packed)
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:148
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
DataModel_detail::iterator< DVL > remove(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, const T &value)
Specialization of remove for DataVector/List.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
setEventNumber uint32_t

◆ createCandidate()

StatusCode L1Muon::RPCPatternMatching::createCandidate ( const std::map< uint16_t, std::vector< RPCMuonPattern > > & matchedPatterns,
xAOD::L1RPCCandDataContainer & outputCandHandle ) const
private

Definition at line 473 of file RPCPatternMatching.cxx.

473 {
474 // This function creates the final muon candidates from the matched patterns
475 // and stores them in the output container
476 static const std::map<int, int> th_map = {{4, 0}, {5, 1}, {6, 2}, {7, 3}, {8, 4}, {9, 5}, {10, 6}, \
477 {12, 7}, {15, 8}, {18, 9}, {20, 10}, {25, 11}, {30, 12}, \
478 {40, 13}, {80, 14}, {100, 15}};
479
480 // Provide up to two candidates per sector
481 for (const auto & [sector, patterns] : matchedPatterns){
482 int cand_count = 0;
483 //Select one pattern per eta bin (the one with the highest priority and then highest pt)
484 std::map<uint32_t, RPCMuonPattern> best_patterns;
485 getBestCandidatesPerEtaBin(patterns, best_patterns);
486
487 for (const auto& [etaBin, pattern] : best_patterns) {
488 if (cand_count >=2) {
489 ATH_MSG_DEBUG("Maximum number of candidates reached for sector " << sector << ", skipping remaining patterns.");
490 break; // limit to 2 candidates per sector
491 }
492 cand_count++;
493 uint16_t subdetectorId = pattern.getTriggerSector() > 31 ? 0x65 : 0x66; // 0x65 for positive eta, 0x66 for negative eta
494 uint16_t sectorId = pattern.getTriggerSector();
495 uint16_t bcTag = 0; // placeholder, to be set properly
496
497
498 xAOD::L1RPCCandData* newCand = outputCand.push_back(std::make_unique<xAOD::L1RPCCandData>());
499
500 newCand->initialize(subdetectorId, sectorId, bcTag);
501 newCand->setL1Eta(pattern.getEtaFloat());
502 newCand->setL1Phi(pattern.getPhiFloat());
503 newCand->setL1Pt(pattern.getPtFloat());
504 newCand->setL1Threshold(pattern.getMaxThreshold());
505 newCand->setL1CandCharge(pattern.getCharge());
506 newCand->setCoinType(pattern.getPriority());
507
508 std::array<float, 4> zPos{
509 pattern.getCoordBIFloat(),
510 pattern.getCoordBM1Float(),
511 pattern.getCoordBM2Float(),
512 pattern.getCoordBOFloat()};
513
514 newCand->setL1ZPos(zPos);
515
516 }
517 }
518
519 return StatusCode::SUCCESS;
520}
#define ATH_MSG_DEBUG(x,...)
unsigned bcTag(unsigned bcBitMap)
void getBestCandidatesPerEtaBin(const std::vector< RPCMuonPattern > &matchedPatterns, std::map< uint32_t, RPCMuonPattern > &bestCandidates) const
void setL1Pt(float pt)
Set the candidate pT.
void initialize(uint16_t subdetectorId, uint16_t sectorId, uint16_t bcTag)
Initialize candidate with basic properties.
void setCoinType(uint8_t coinType)
Set the coincidence type.
void setL1Eta(float eta)
Set the eta.
void setL1Threshold(uint8_t threshold)
Set the threshold.
void setL1Phi(float phi)
Set the phi.
void setL1CandCharge(uint8_t candCharge)
Set the candidate charge.
void setL1ZPos(std::array< float, 4 > &zPos)
Set the z positions of the RPC sector logic.
std::vector< std::string > patterns
Definition listroot.cxx:187
L1RPCCandData_v1 L1RPCCandData
setWord1 uint16_t

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode L1Muon::RPCPatternMatching::execute ( const EventContext & ctx) const
overridevirtual

output container for candidates

Definition at line 36 of file RPCPatternMatching.cxx.

36 {
37 ATH_MSG_DEBUG("Executing " << name() << "...");
38
39 // Retrieve the input containers
40 const xAOD::NRPCRDOContainer* rdoContainer{nullptr};
41 ATH_CHECK(SG::get(rdoContainer, m_keyRpcRdo, ctx));
42
43 const Muon::RpcCablingMap* cablingMap{nullptr};
44 ATH_CHECK(SG::get(cablingMap, m_cablingKey, ctx));
45
46 // Get ActsGeometryContext
47 const ActsTrk::GeometryContext* gctxHandle{};
48 ATH_CHECK(SG::get(gctxHandle, m_geoCtxKey, ctx));
49 const ActsTrk::GeometryContext& geoCtx = *gctxHandle;
50
52 SG::WriteHandle<xAOD::L1RPCCandDataContainer> outputCandHandle(m_outputCandKey, ctx);
53 ATH_CHECK(outputCandHandle.record(std::make_unique<xAOD::L1RPCCandDataContainer>(), std::make_unique<xAOD::L1RPCCandDataAuxContainer>()));
54 auto outputCands = outputCandHandle.ptr();
55
56 // Get strip IDs for PatternMatching from SDOs/RDOs
57 std::vector<uint32_t> stripIDs;
58 std::map<uint32_t, uint32_t> strip_coordinates;
59 std::map<uint32_t, uint32_t> strip_etabin;
60
61 // sorting RDOs by offline Identifier to easily access both strip sides --> we can compute phi coordinate for BI strips
62 std::map<Identifier, RdoPairs, Muon::IdentifierByDetElSorter> sortedRdos{Muon::IdentifierByDetElSorter{m_idHelperSvc.get()}};
63 std::map<Identifier, Muon::RpcCablingData> sortedCabling;
64 for (const xAOD::NRPCRDO* rdo : *rdoContainer){
65 /* cabling data conversion */
66 Muon::RpcCablingData cabling{};
67 cabling.subDetector = rdo->subdetector();
68 cabling.boardSector = rdo->boardsector();
69 cabling.board = rdo->board();
70 cabling.channelId = rdo->channel();
71
72 if (!cablingMap->getOfflineId(cabling, msgStream())){
73 ATH_MSG_FATAL("Cabling retrieval failed "<<cabling);
74 return StatusCode::FAILURE;
75 }
76
77 Identifier offId{};
78 if (!cablingMap->convert(cabling, offId)){
79 ATH_MSG_FATAL("Cabling conversion failed "<<cabling);
80 return StatusCode::FAILURE;
81 }
82
83 const bool stripSide = cabling.stripSide();
84 sortedRdos[offId][stripSide] = rdo;
85 sortedCabling[offId] = cabling;
86 }
87
88 for (const auto& [offId, rdoPairs] : sortedRdos) {
89 Muon::RpcCablingData cabling = sortedCabling[offId];
90 getStripIdforAlg(rdoPairs, stripIDs, strip_coordinates, strip_etabin, cabling, offId, geoCtx);
91 }
92
93 // check for the required strip coincidence within each RPC layer
94 if (!checkStripCoincidence(stripIDs)) {
95 ATH_MSG_DEBUG("No required strip coincidence found, unable to form a valid muon candidate.");
96 return StatusCode::SUCCESS;
97 }
98 // use BI strip coordinates as seed for pattern matching
99 // to avoid multiple matches for the same eta bin, we store the already matched eta bins
100 // in uint16_t identifiers with the following structure:
101 // bits 0-4: eta bin (0-21)
102 // bits 5-10: sector (0-63)
103 std::map<uint16_t, std::vector<uint32_t>> usedEtaBins; // to store already matched eta bins
104 std::map<uint16_t, std::vector<RPCMuonPattern>> matchedEtaPatterns; // to store matched eta patterns
105 std::map<uint16_t, std::vector<RPCMuonPattern>> matchedPhiPatterns; // to store matched phi patterns
106 std::map<uint16_t, std::vector<RPCMuonPattern>> matchedPatterns; // to store matched eta+phi patterns --> muon candidates
107
108 // Check eta_bin from BI strips only to reduce combinatorics
109 // First check if any BI strip is present, if not use BM1 strips as seed (if present)
110 bool hasBIStrip = false;
111 for (auto strip: stripIDs) {
113 hasBIStrip = true;
114 break;
115 }
116 }
117
118 for (auto strip: stripIDs) {
119 bool isBIorBM1 = (RPCSLStripConverter::getStation(strip) == SLRPCStation::BI_BOR_BOM && RPCSLStripConverter::getMeasuresPhi(strip) == 0); // check if the strip is in the BI layer and is an eta strip
120 if (!hasBIStrip) {
121 isBIorBM1 = (RPCSLStripConverter::getStation(strip) == SLRPCStation::BM1 && RPCSLStripConverter::getMeasuresPhi(strip) == 0); // if no BI strip, check for BM1 eta strips
122 }
123 if (isBIorBM1) {
124 ATH_MSG_DEBUG("Using BI strip ID: " << std::hex << strip << " with coord: " << std::dec << strip_etabin[strip] << " as seed for pattern matching");
125 // Perform pattern matching using this BI strip as seed
126 // We get the eta bin from the strip coordinates and the trigger sector from the strip ID
127 uint16_t triggerSector = RPCSLStripConverter::getTriggerSector(strip); // extract trigger sector from strip ID
128 uint32_t etaBin = strip_etabin[strip];
129
130 std::vector<uint32_t>& binsInSector = usedEtaBins[triggerSector];
131
132 if (Acts::rangeContainsValue(binsInSector, etaBin)) {
133 ATH_MSG_DEBUG("Eta bin " << etaBin << " in sector " << triggerSector << " already matched, skipping to avoid duplicates.");
134 continue;
135 }
136
137 auto it_sector = m_etaPatterns.find(triggerSector);
138 if (it_sector == m_etaPatterns.end()) {
139 ATH_MSG_WARNING("No eta patterns found for sector: " << triggerSector);
140 continue;
141 }
142
143 auto it_etabin = it_sector->second.find(static_cast<uint16_t>(etaBin));
144 if (it_etabin == it_sector->second.end()) {
145 ATH_MSG_WARNING("No eta patterns found for sector: " << triggerSector << " and eta bin: " << etaBin);
146 continue;
147 }
148
149 for (const auto& pattern : it_etabin->second) {
150 matchPattern(pattern, stripIDs, matchedEtaPatterns[triggerSector], RPCSLStripConverter::getTriggerSector(strip));
151 }
152
153 if (matchedEtaPatterns[triggerSector].empty()) {
154 ATH_MSG_DEBUG("No eta patterns matched for sector: " << triggerSector << " and eta bin: " << etaBin);
155 continue;
156 } else {
157 ATH_MSG_DEBUG("Matched " << matchedEtaPatterns[triggerSector].size() << " eta patterns for sector: " << triggerSector << " and eta bin: " << etaBin);
158 }
159
160 it_sector = m_phiPatterns.find(triggerSector);
161 if (it_sector == m_phiPatterns.end()) {
162 ATH_MSG_WARNING("No phi patterns found for sector: " << triggerSector);
163 continue;
164 }
165
166 it_etabin = it_sector->second.find(static_cast<uint16_t>(etaBin));
167 if (it_etabin == it_sector->second.end()) {
168 ATH_MSG_WARNING("No phi patterns found for sector: " << triggerSector << " and eta bin: " << etaBin);
169 continue;
170 }
171
172 for (const auto& pattern : it_etabin->second) {
173 matchPattern(pattern, stripIDs, matchedPhiPatterns[triggerSector], RPCSLStripConverter::getTriggerSector(strip));
174 }
175
176 if (matchedPhiPatterns[triggerSector].empty()) {
177 ATH_MSG_DEBUG("No phi patterns matched for sector: " << triggerSector << " and eta bin: " << etaBin);
178 continue;
179 } else {
180 ATH_MSG_DEBUG("Matched " << matchedPhiPatterns[triggerSector].size() << " phi patterns for sector: " << triggerSector << " and eta bin: " << etaBin);
181 }
182
183 for (const auto& etaPattern : matchedEtaPatterns[triggerSector]) {
184 for (const auto& phiPattern : matchedPhiPatterns[triggerSector]) {
185 matchEtaAndPhiPatterns(etaPattern, phiPattern, matchedPatterns[triggerSector]);
186 }
187 }
188 usedEtaBins[triggerSector].push_back(etaBin); // mark this eta bin in this sector as matched
189 }
190 }
191
192 // For now, we directly create final candidates
193 if (!createCandidate(matchedPatterns, *outputCands)) {
194 ATH_MSG_WARNING("Failed to create candidates from matched patterns.");
195 return StatusCode::SUCCESS; // continue even if candidate creation fails
196 }
197 return StatusCode::SUCCESS;
198}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_FATAL(x,...)
size_t size() const
Number of registered mappings.
static const Attributes_t empty
bool checkStripCoincidence(std::vector< uint32_t > &stripIDs) const
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
StatusCode createCandidate(const std::map< uint16_t, std::vector< RPCMuonPattern > > &matchedPatterns, xAOD::L1RPCCandDataContainer &outputCandHandle) const
SG::WriteHandleKey< xAOD::L1RPCCandDataContainer > m_outputCandKey
Output Trigger candidates.
void getStripIdforAlg(const RdoPairs &rdoPairs, std::vector< uint32_t > &stripIDs, std::map< uint32_t, uint32_t > &strip_coordinates, std::map< uint32_t, uint32_t > &strip_etabin, const Muon::RpcCablingData &cabling, const Identifier &offId, const ActsTrk::GeometryContext &geoCtx) const
void matchPattern(const RPCMuonPattern &pattern, const std::vector< uint32_t > &stripIDs, std::vector< RPCMuonPattern > &matchedPatterns, const uint16_t &sector_header) const
void matchEtaAndPhiPatterns(const RPCMuonPattern &etaPattern, const RPCMuonPattern &phiPattern, std::vector< RPCMuonPattern > &matchedPatterns) const
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
RPC Id helper.
SG::ReadCondHandleKey< Muon::RpcCablingMap > m_cablingKey
RPC cabling map.
SG::ReadHandleKey< xAOD::NRPCRDOContainer > m_keyRpcRdo
RPC Rdo.
static uint8_t getMeasuresPhi(uint32_t packed)
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
NRPCRDO_v1 NRPCRDO
Define the version of the NRPC RDO class.
Definition NRPCRDO.h:13
NRPCRDOContainer_v1 NRPCRDOContainer
Define the version of the NRPC RDO container.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ getBestCandidatesPerEtaBin()

void L1Muon::RPCPatternMatching::getBestCandidatesPerEtaBin ( const std::vector< RPCMuonPattern > & matchedPatterns,
std::map< uint32_t, RPCMuonPattern > & bestCandidates ) const
private

Definition at line 522 of file RPCPatternMatching.cxx.

523 {
524 // This function selects the best candidate per eta bin based on priority and pt
525 // TO DO: review the selection criteria if SL firmware logic is different
526 // 1) Group patterns by eta bin
527 std::map<uint32_t, std::vector<RPCMuonPattern>> patterns_per_eta;
528 for (const auto& pattern : patterns) {
529 uint32_t etaBin = pattern.getEtaBin();
530 patterns_per_eta[etaBin].push_back(pattern);
531 }
532 // 2) Sort patterns within each eta bin by priority and pt
533 for (auto& [etaBin, eta_patterns] : patterns_per_eta) {
534 std::sort(eta_patterns.begin(), eta_patterns.end(),
535 [](const RPCMuonPattern& a, const RPCMuonPattern& b) {
536 if (a.getPriority() != b.getPriority()) {
537 return a.getPriority() > b.getPriority(); // higher priority first
538 }
539 return a.getPt() > b.getPt(); // higher pt first
540 });
541 // 3) Select the best pattern for this eta bin
542 best_patterns.emplace(etaBin, eta_patterns.front());
543 }
544}
static Double_t a

◆ getBMBOPhiStripCoordinate()

uint32_t L1Muon::RPCPatternMatching::getBMBOPhiStripCoordinate ( const Amg::Vector3D & stripPos) const
private

Definition at line 349 of file RPCPatternMatching.cxx.

349 {
351}
uint32_t getBMBOPhiStripCoordinate(const Amg::Vector3D &stripPos)

◆ getSLStripId()

uint32_t L1Muon::RPCPatternMatching::getSLStripId ( bool side,
int sector,
int doubletPhi,
Muon::MuonStationIndex::StIndex RPClayer,
int doubletR,
int stationEta,
int doubletZ,
int stripNumber,
bool measuresPhi ) const
private

Definition at line 343 of file RPCPatternMatching.cxx.

343 {
344 return RPCPatternUtils::getSLStripId(side, sector, doubletPhi,
345 RPClayer, doubletR, stationEta,
346 doubletZ, stripNumber, measuresPhi);
347}
uint32_t getSLStripId(bool side, int sector, int doubletPhi, Muon::MuonStationIndex::StIndex RPClayer, int doubletR, int stationEta, int doubletZ, int stripNumber, bool measuresPhi)

◆ getStripIdforAlg()

void L1Muon::RPCPatternMatching::getStripIdforAlg ( const RdoPairs & rdoPairs,
std::vector< uint32_t > & stripIDs,
std::map< uint32_t, uint32_t > & strip_coordinates,
std::map< uint32_t, uint32_t > & strip_etabin,
const Muon::RpcCablingData & cabling,
const Identifier & offId,
const ActsTrk::GeometryContext & geoCtx ) const
private

Definition at line 353 of file RPCPatternMatching.cxx.

354 {
355 return RPCPatternUtils::getStripIdforAlg(rdo_pair, stripIDs, strip_coordinates, strip_etabin, cabling, offId, geoCtx, m_idHelperSvc.get(), m_detMgr);
356}
const MuonGMR4::MuonDetectorManager * m_detMgr
void getStripIdforAlg(const RdoPairs &rdo_pair, std::vector< uint32_t > &stripIDs, std::map< uint32_t, uint32_t > &strip_coordinates, std::map< uint32_t, uint32_t > &strip_etabin, const Muon::RpcCablingData &cabling, const Identifier &offId, const ActsTrk::GeometryContext &geoCtx, const Muon::IMuonIdHelperSvc *idHelperSvc, const MuonGMR4::MuonDetectorManager *detMgr)

◆ getVirtualBIPhiStripCoordinate()

uint32_t L1Muon::RPCPatternMatching::getVirtualBIPhiStripCoordinate ( const Amg::Vector3D & stripPos,
float loc_pos_along_BIstrip ) const
private

Definition at line 339 of file RPCPatternMatching.cxx.

339 {
340 return RPCPatternUtils::getVirtualBIPhiStripCoordinate(stripPos, loc_pos_along_BIstrip);
341}
uint32_t getVirtualBIPhiStripCoordinate(const Amg::Vector3D &stripPos, float loc_pos_along_BIstrip)

◆ getVirtualBIPhiStripNumber()

int L1Muon::RPCPatternMatching::getVirtualBIPhiStripNumber ( float loc_pos_along_BIstrip,
const MuonGMR4::RpcReadoutElement & readoutElement ) const
private

Definition at line 335 of file RPCPatternMatching.cxx.

335 {
336 return RPCPatternUtils::getVirtualBIPhiStripNumber(loc_pos_along_BIstrip, readoutElement);
337}
int getVirtualBIPhiStripNumber(float loc_pos_along_BIstrip, const MuonGMR4::RpcReadoutElement &readoutElement)

◆ initialize()

StatusCode L1Muon::RPCPatternMatching::initialize ( )
overridevirtual

container of output trigger candidates

Definition at line 15 of file RPCPatternMatching.cxx.

15 {
16 ATH_MSG_INFO("Initializing " << name() << "...");
17
18 ATH_CHECK(m_keyRpcRdo.initialize());
19 ATH_CHECK(m_cablingKey.initialize());
20 ATH_CHECK(m_idHelperSvc.retrieve());
21 ATH_CHECK(m_geoCtxKey.initialize());
22 ATH_CHECK(detStore()->retrieve(m_detMgr));
23
25 ATH_CHECK(m_outputCandKey.initialize());
26
27 // Initialize patterns
28 if (!initializePatterns()) {
29 ATH_MSG_FATAL("Failed to initialize patterns.");
30 return StatusCode::FAILURE;
31 }
32
33 return StatusCode::SUCCESS;
34}
#define ATH_MSG_INFO(x,...)
const ServiceHandle< StoreGateSvc > & detStore() const

◆ initializePatterns()

StatusCode L1Muon::RPCPatternMatching::initializePatterns ( )
private

Definition at line 313 of file RPCPatternMatching.cxx.

313 {
314 ATH_MSG_INFO("Initializing patterns...");
315
316 for (int sec = 0; sec < 64; ++sec) { // 64 trigger sectors
317 std::string etaFileName = std::format("dev/L1MuonS1RPCPattern/v1/L1MuonRPCPattern_Eta_Sector_{:}.bin", sec);
318 std::string phiFileName = std::format("dev/L1MuonS1RPCPattern/v1/L1MuonRPCPattern_Phi_Sector_{:}.bin", sec);
319 std::string etaFilePath = PathResolverFindCalibFile(etaFileName);
320 std::string phiFilePath = PathResolverFindCalibFile(phiFileName);
321
322 if (etaFilePath.empty() || phiFilePath.empty()) {
323 ATH_MSG_ERROR("Could not locate pattern files for sector " << sec);
324 return StatusCode::FAILURE;
325 }
326
327 if (loadPatternFile(etaFilePath, "eta", m_etaPatterns).isFailure()) return StatusCode::FAILURE;
328 if (loadPatternFile(phiFilePath, "phi", m_phiPatterns).isFailure()) return StatusCode::FAILURE;
329 }
330
331 ATH_MSG_INFO("Pattern initialization complete.");
332 return StatusCode::SUCCESS;
333}
#define ATH_MSG_ERROR(x,...)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
StatusCode loadPatternFile(const std::string &filePath, const std::string &patternType, PatternContainer &patternContainer)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ loadPatternFile()

StatusCode L1Muon::RPCPatternMatching::loadPatternFile ( const std::string & filePath,
const std::string & patternType,
PatternContainer & patternContainer )
private

Definition at line 220 of file RPCPatternMatching.cxx.

220 {
221 std::ifstream file(filePath, std::ios::binary);
222 if (!file) {
223 ATH_MSG_ERROR("Failed to open " << patternType << " pattern file: " << filePath);
224 return StatusCode::FAILURE;
225 }
226
227 // Read global triggerSector (sector ID)
228 uint16_t sector_id;
229 file.read(reinterpret_cast<char*>(&sector_id), sizeof(sector_id));
230 if (!file) {
231 ATH_MSG_ERROR("Failed to read sector ID from " << patternType << " pattern file: " << filePath);
232 return StatusCode::FAILURE;
233 }
234 ATH_MSG_INFO("Reading " << patternType << " patterns for sector ID: " << sector_id);
235
236 // Read patterns until EOF
237 while (true) {
238 uint32_t etaBin, numPatterns;
239 file.read(reinterpret_cast<char*>(&etaBin), sizeof(etaBin));
240 if (!file) break; // EOF
241 file.read(reinterpret_cast<char*>(&numPatterns), sizeof(numPatterns));
242 if (!file) break; // EOF
243
244 // Apply eta-specific assertions
245 if (patternType == "eta") {
246 assert(etaBin < 22); // assuming a maximum of 22 eta bins (0-21)
247 assert(numPatterns < 20000); // assuming a maximum of 20000 patterns per eta bin
248 }
249
250 std::vector<RPCMuonPattern> patterns;
251 ATH_MSG_DEBUG("Reading " << numPatterns << " patterns for eta bin: " << etaBin);
252 patterns.reserve(numPatterns);
253
254 for (uint32_t i = 0; i < numPatterns; i++) {
255 uint32_t bibm1, bm2bo, coordbibm1, coordbm2bo, infos, separator;
256 file.read(reinterpret_cast<char*>(&bibm1), sizeof(bibm1));
257 file.read(reinterpret_cast<char*>(&bm2bo), sizeof(bm2bo));
258 file.read(reinterpret_cast<char*>(&coordbibm1), sizeof(coordbibm1));
259 file.read(reinterpret_cast<char*>(&coordbm2bo), sizeof(coordbm2bo));
260 file.read(reinterpret_cast<char*>(&infos), sizeof(infos));
261 file.read(reinterpret_cast<char*>(&separator), sizeof(separator));
262
263 if (!file) {
264 ATH_MSG_ERROR("Incomplete pattern data in " << patternType << " file.");
265 return StatusCode::FAILURE;
266 }
267
268 if (separator != 0xFFFFFFFF) {
269 ATH_MSG_ERROR("Invalid separator " << std::hex << separator << " found in " << patternType << " patterns");
270 return StatusCode::FAILURE;
271 }
272
273 if (!patternSanityCheck(RPCMuonPattern(sector_id, bibm1, bm2bo, coordbibm1, coordbm2bo, infos))) {
274 ATH_MSG_WARNING("Pattern sanity check failed for " << patternType << " pattern with bibm1: " << std::hex << bibm1 << std::dec
275 << ", bm2bo: " << std::hex << bm2bo << std::dec
276 << ", coordbibm1: " << coordbibm1
277 << ", coordbm2bo: " << coordbm2bo
278 << ", infos: " << infos
279 << " in sector " << sector_id
280 << " and eta bin " << etaBin << ". Skipping this pattern.");
281 continue;
282 }
283
284 // Construct RPCMuonPattern
285 patterns.emplace_back(sector_id, bibm1, bm2bo, coordbibm1, coordbm2bo, infos);
286 }
287
288 patternContainer[static_cast<uint16_t>(sector_id)][static_cast<uint16_t>(etaBin)] = std::move(patterns);
289
290 auto& loadedPatterns = patternContainer[static_cast<uint16_t>(sector_id)][static_cast<uint16_t>(etaBin)];
291 ATH_MSG_DEBUG("Loaded " << loadedPatterns.size() << " / " << numPatterns << " " << patternType << " patterns for sector: " << sector_id << " and eta bin: " << etaBin);
292
293 if (!loadedPatterns.empty()) {
294 ATH_MSG_DEBUG("First pattern details - bibm1: " << std::hex << loadedPatterns.front().getBIBM1() << std::dec
295 << ", bm2bo: " << std::hex << loadedPatterns.front().getBM2BO() << std::dec
296 << ", coordbibm1: " << loadedPatterns.front().getCoordBIBM1()
297 << ", coordbm2bo: " << loadedPatterns.front().getCoordBM2BO()
298 << ", infos: " << loadedPatterns.front().getInfos());
299
300 ATH_MSG_DEBUG("Last pattern details - bibm1: " << std::hex << loadedPatterns.back().getBIBM1() << std::dec
301 << ", bm2bo: " << std::hex << loadedPatterns.back().getBM2BO() << std::dec
302 << ", coordbibm1: " << loadedPatterns.back().getCoordBIBM1()
303 << ", coordbm2bo: " << loadedPatterns.back().getCoordBM2BO()
304 << ", infos: " << loadedPatterns.back().getInfos());
305 } else {
306 ATH_MSG_WARNING("Pattern vector is empty! Skipping details printout.");
307 }
308 }
309
310 return StatusCode::SUCCESS;
311}
bool patternSanityCheck(const RPCMuonPattern &pattern) const
TFile * file

◆ matchEtaAndPhiPatterns()

void L1Muon::RPCPatternMatching::matchEtaAndPhiPatterns ( const RPCMuonPattern & etaPattern,
const RPCMuonPattern & phiPattern,
std::vector< RPCMuonPattern > & matchedPatterns ) const
private

Definition at line 200 of file RPCPatternMatching.cxx.

200 {
201 // This function implements the logic to match a given eta and phi pattern together to form a muon candidate
202 // The matching logic can be based on the compatibility of the eta and phi patterns (e.g. same sector, compatible coordinates, etc.)
203 // For simplicity, we will just check if they belong to the same sector and if they have compatible eta bins
204
205 if (etaPattern.getTriggerSector() != phiPattern.getTriggerSector()) {
206 return; // patterns must be in the same sector to be matched
207 }
208
209 if (etaPattern.getEtaBin() != phiPattern.getEtaBin()) {
210 return; // patterns must have the same eta bin to be matched
211 }
212
213 // combine the eta and phi patterns infos
214 uint32_t combinedInfos = etaPattern.getInfos() | phiPattern.getInfos();
215
216 // create a new pattern with the combined infos and add it to the matched patterns
217 matchedPatterns.push_back(RPCMuonPattern(etaPattern, combinedInfos));
218
219}

◆ matchPattern()

void L1Muon::RPCPatternMatching::matchPattern ( const RPCMuonPattern & pattern,
const std::vector< uint32_t > & stripIDs,
std::vector< RPCMuonPattern > & matchedPatterns,
const uint16_t & sector_header ) const
private

Definition at line 358 of file RPCPatternMatching.cxx.

359 {
360 // This function implements the logic to match a given pattern against the provided strip IDs
361 bool match = false;
362 auto stripBI = pattern.getStripBI() | static_cast<uint32_t>(triggerSector) << 16;
363 auto stripBM1 = pattern.getStripBM1() | static_cast<uint32_t>(triggerSector) << 16;
364 auto stripBM2 = pattern.getStripBM2() | static_cast<uint32_t>(triggerSector) << 16;
365 auto stripBO = pattern.getStripBO() | static_cast<uint32_t>(triggerSector) << 16;
366 auto priority = pattern.getPriority();
367
368 // different case depending on the pattern priority
369 if (priority == 5) { //BI-BM2-BO
370 match = Acts::rangeContainsValue(stripIDs, stripBI) &&
371 Acts::rangeContainsValue(stripIDs, stripBM2) &&
372 Acts::rangeContainsValue(stripIDs, stripBO);
373 } else if (priority == 4) { //BI-BM1-BO
374 match = Acts::rangeContainsValue(stripIDs, stripBI) &&
375 Acts::rangeContainsValue(stripIDs, stripBM1) &&
376 Acts::rangeContainsValue(stripIDs, stripBO);
377 } else if (priority == 3) { //BM1-BM2-BO
378 match = Acts::rangeContainsValue(stripIDs, stripBM1) &&
379 Acts::rangeContainsValue(stripIDs, stripBM2) &&
380 Acts::rangeContainsValue(stripIDs, stripBO);
381 } else if (priority == 2) { //BI-BM1-BM2
382 match = Acts::rangeContainsValue(stripIDs, stripBI) &&
383 Acts::rangeContainsValue(stripIDs, stripBM1) &&
384 Acts::rangeContainsValue(stripIDs, stripBM2);
385 } else if (priority == 1) { //BI-BO
386 match = Acts::rangeContainsValue(stripIDs, stripBI) &&
387 Acts::rangeContainsValue(stripIDs, stripBO);
388 } else {
389 ATH_MSG_WARNING("Unknown pattern priority: " << priority);
390 }
391
392 if (match) {
393 matchedPatterns.push_back(pattern);
394 ATH_MSG_DEBUG("Pattern matched.");
395 // pattern.print();
396 }
397}
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition hcg.cxx:359

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ patternSanityCheck()

bool L1Muon::RPCPatternMatching::patternSanityCheck ( const RPCMuonPattern & pattern) const
private

Definition at line 546 of file RPCPatternMatching.cxx.

546 {
547 // This function checks the sanity of the pattern data read from the files
548 // For example, it can check that the strip IDs are within expected ranges,
549 // that the priority is valid, etc.
550
551 if (pattern.getPriority() < 1 || pattern.getPriority() > 5) {
552 ATH_MSG_DEBUG("Invalid pattern priority: " << pattern.getPriority());
553 return false;
554 }
555 if (pattern.getStripBI() > 0x4000) {
556 ATH_MSG_DEBUG("Invalid BI strip ID: " << std::hex << pattern.getStripBI() << std::dec);
557 return false;
558 }
559 if (pattern.getStripBM1() > 0x8000 || pattern.getStripBM1() < 0x4000) {
560 ATH_MSG_DEBUG("Invalid BM1 strip ID: " << std::hex << pattern.getStripBM1() << std::dec);
561 return false;
562 }
563 if (pattern.getStripBM2() > 0xC000 || pattern.getStripBM2() < 0x8000) {
564 ATH_MSG_DEBUG("Invalid BM2 strip ID: " << std::hex << pattern.getStripBM2() << std::dec);
565 return false;
566 }
567 if (pattern.getStripBO() > 0x10000 || pattern.getStripBO() < 0xC000) {
568 ATH_MSG_DEBUG("Invalid BO strip ID: " << std::hex << pattern.getStripBO() << std::dec);
569 return false;
570 }
571 if (pattern.getEtaBin() > 22) {
572 ATH_MSG_DEBUG("Invalid eta bin: " << pattern.getEtaBin());
573 return false;
574 }
575
576 return true;
577}

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

Member Data Documentation

◆ m_cablingKey

SG::ReadCondHandleKey<Muon::RpcCablingMap> L1Muon::RPCPatternMatching::m_cablingKey
private
Initial value:
{this, "CablingKey", "MuonNRPC_CablingMap",
"Key of MuonNRPC_CablingMap"}

RPC cabling map.

Definition at line 92 of file RPCPatternMatching.h.

92 {this, "CablingKey", "MuonNRPC_CablingMap",
93 "Key of MuonNRPC_CablingMap"};

◆ m_detMgr

const MuonGMR4::MuonDetectorManager* L1Muon::RPCPatternMatching::m_detMgr {nullptr}
private

Definition at line 98 of file RPCPatternMatching.h.

98{nullptr};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_etaPatterns

PatternContainer L1Muon::RPCPatternMatching::m_etaPatterns
private

Definition at line 81 of file RPCPatternMatching.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_geoCtxKey

SG::ReadHandleKey<ActsTrk::GeometryContext> L1Muon::RPCPatternMatching::m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"}
private

Definition at line 99 of file RPCPatternMatching.h.

99{this, "AlignmentKey", "ActsAlignment", "cond handle key"};

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> L1Muon::RPCPatternMatching::m_idHelperSvc {"Muon::MuonIdHelperSvc/MuonIdHelperSvc", name()}
private

RPC Id helper.

Definition at line 96 of file RPCPatternMatching.h.

96{"Muon::MuonIdHelperSvc/MuonIdHelperSvc", name()};

◆ m_keyRpcRdo

SG::ReadHandleKey<xAOD::NRPCRDOContainer> L1Muon::RPCPatternMatching::m_keyRpcRdo {this,"NrpcRdoKey","NRPCRDO","Location of input RpcRDO"}
private

RPC Rdo.

Definition at line 85 of file RPCPatternMatching.h.

85{this,"NrpcRdoKey","NRPCRDO","Location of input RpcRDO"};

◆ m_outputCandKey

SG::WriteHandleKey<xAOD::L1RPCCandDataContainer> L1Muon::RPCPatternMatching::m_outputCandKey
private
Initial value:
{this, "xRPCCandKey", "L1RPCCandData",
"LVL1 xAOD Barrel trigger candidates in the Muon RPC"}

Output Trigger candidates.

Definition at line 88 of file RPCPatternMatching.h.

88 {this, "xRPCCandKey", "L1RPCCandData",
89 "LVL1 xAOD Barrel trigger candidates in the Muon RPC"};

◆ m_phiPatterns

PatternContainer L1Muon::RPCPatternMatching::m_phiPatterns
private

Definition at line 82 of file RPCPatternMatching.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.


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