ATLAS Offline Software
MURoIThresholdsTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 #include "MURoIThresholdsTool.h"
5 #include "utilities.h"
6 #include <memory>
7 using namespace HLTSeedingNs;
8 
9 uint64_t MURoIThresholdsTool::getPattern(const EventContext& /*ctx*/,
10  const xAOD::MuonRoI& roi,
11  const RoIThresholdsTool::ThrVec& menuThresholds,
12  const TrigConf::L1ThrExtraInfoBase& /*menuExtraInfo*/) const {
13  uint32_t thr_num = static_cast<uint32_t>(roi.getThrNumber());
14 
15  uint64_t thresholdsPattern = 0;
16 
17  // Iterate through thresholds and see which ones are passed
18  for (const std::shared_ptr<TrigConf::L1Threshold>& thrBase : menuThresholds) {
19  std::shared_ptr<TrigConf::L1Threshold_MU> thr = std::static_pointer_cast<TrigConf::L1Threshold_MU>(thrBase);
20 
21  bool passed{false};
22 
23  // e.g. threshold number is simply required.
24  if (thr_num >= thr->idxBarrel() || thr_num >= thr->idxEndcap() || thr_num >= thr->idxForward()) {
25  passed = true;
26  }
27 
28  if (passed) {
29  // set the corresponding bit in the pattern
30  thresholdsPattern |= (1_u64 << thr->mapping());
31  }
32 
33  } // loop over thresholds
34 
35  return thresholdsPattern;
36 }
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:118
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TrigConf::L1ThrExtraInfoBase
L1 extra information for certain threshold types.
Definition: L1ThresholdBase.h:72
IBLCalibrationConfig.thr
thr
Definition: IBLCalibrationConfig.py:39
MURoIThresholdsTool::getPattern
virtual uint64_t getPattern(const EventContext &ctx, const xAOD::MuonRoI &roi, const ThrVec &menuThresholds, const TrigConf::L1ThrExtraInfoBase &menuExtraInfo) const override
Definition: MURoIThresholdsTool.cxx:9
xAOD::MuonRoI_v1
Class describing a LVL1 muon region of interest.
Definition: MuonRoI_v1.h:29
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
RoIThresholdsTool::ThrVec
std::vector< std::shared_ptr< TrigConf::L1Threshold > > ThrVec
Definition: IRoIThresholdsTool.h:24
utilities.h
MURoIThresholdsTool.h
xAOD::MuonRoI_v1::getThrNumber
int getThrNumber() const
Get the logic number of the highest threshold this RoI passed.
Definition: MuonRoI_v1.cxx:76
HLTSeedingNs
Definition: utilities.h:8