CMS 3D CMS Logo

List of all members | Static Public Member Functions | Static Public Attributes
l1t::RegionalMuonRawDigiTranslator Class Reference

#include <RegionalMuonRawDigiTranslator.h>

Static Public Member Functions

static void fillRegionalMuonCand (RegionalMuonCand &mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int proc, tftype tf, bool isKbmtf, bool useOmtfDisplacementInfo, bool useEmtfDisplacementInfo)
 
static void fillRegionalMuonCand (RegionalMuonCand &mu, uint64_t dataword, int proc, tftype tf, bool isKbmtf, bool useOmtfDisplacementInfo, bool useEmtfDisplacementInfo)
 
static bool fillRegionalMuonShower (RegionalMuonShower &muShower, std::vector< uint32_t > bxPayload, int proc, tftype tf, bool useEmtfNominalTightShowers, bool useEmtfLooseShowers)
 
static uint64_t generate64bitDataWord (const RegionalMuonCand &mu, bool isKbmtf, bool useOmtfDisplacementInfo, bool useEmtfDisplacementInfo)
 
static void generatePackedDataWords (const RegionalMuonCand &mu, uint32_t &raw_data_00_31, uint32_t &raw_data_32_63, bool isKbmtf, bool useOmtfDisplacementInfo, bool useEmtfDisplacementInfo)
 
static void generatePackedShowerPayload (const RegionalMuonShower &shower, std::array< uint32_t, 6 > &payload, bool useEmtfNominalTightShowers, bool useEmtfLooseShowers)
 
static int generateRawTrkAddress (const RegionalMuonCand &, bool isKalman)
 

Static Public Attributes

static constexpr unsigned absEtaMask_ = 0xFF
 
static constexpr unsigned absEtaShift_ = 13
 
static constexpr unsigned absPhiMask_ = 0x7F
 
static constexpr unsigned absPhiShift_ = 23
 
static constexpr unsigned bmtfDxyShift_ = 2
 
static constexpr unsigned bmtfPtUnconstrainedShift_ = 23
 
static constexpr unsigned bmtfTrAddrDetSideShift_ = 20
 
static constexpr unsigned bmtfTrAddrSegSelMask_ = 0xF
 
static constexpr unsigned bmtfTrAddrSegSelShift_ = 21
 
static constexpr unsigned bmtfTrAddrStat1Mask_ = 0x3
 
static constexpr unsigned bmtfTrAddrStat1Shift_ = 14
 
static constexpr unsigned bmtfTrAddrStat2Mask_ = 0xF
 
static constexpr unsigned bmtfTrAddrStat2Shift_ = 10
 
static constexpr unsigned bmtfTrAddrStat3Mask_ = 0xF
 
static constexpr unsigned bmtfTrAddrStat3Shift_ = 6
 
static constexpr unsigned bmtfTrAddrStat4Mask_ = 0xF
 
static constexpr unsigned bmtfTrAddrStat4Shift_ = 2
 
static constexpr unsigned bmtfTrAddrWheelMask_ = 0x3
 
static constexpr unsigned bmtfTrAddrWheelShift_ = 18
 
static constexpr unsigned dxyMask_ = 0x3
 
static constexpr unsigned emtfDxyShift_ = 29
 
static constexpr unsigned emtfPtUnconstrainedShift_ = 20
 
static constexpr unsigned emtfTrAddrBxMask_ = 0x7FF
 
static constexpr unsigned emtfTrAddrBxShift_ = 18
 
static constexpr unsigned emtfTrAddrMe1ChMask_ = 0x7
 
static constexpr unsigned emtfTrAddrMe1ChShift_ = 1
 
static constexpr unsigned emtfTrAddrMe1SegShift_ = 0
 
static constexpr unsigned emtfTrAddrMe2ChMask_ = 0x7
 
static constexpr unsigned emtfTrAddrMe2ChShift_ = 5
 
static constexpr unsigned emtfTrAddrMe2SegShift_ = 4
 
static constexpr unsigned emtfTrAddrMe3ChMask_ = 0x7
 
static constexpr unsigned emtfTrAddrMe3ChShift_ = 9
 
static constexpr unsigned emtfTrAddrMe3SegShift_ = 8
 
static constexpr unsigned emtfTrAddrMe4ChMask_ = 0x7
 
static constexpr unsigned emtfTrAddrMe4ChShift_ = 13
 
static constexpr unsigned emtfTrAddrMe4SegShift_ = 12
 
static constexpr unsigned emtfTrAddrTrkNumMask_ = 0x3
 
static constexpr unsigned emtfTrAddrTrkNumShift_ = 16
 
static constexpr unsigned etaSignShift_ = 21
 
static constexpr unsigned hfMask_ = 0x1
 
static constexpr unsigned hfShift_ = 22
 
static constexpr unsigned kEmtfShowerExtendedFrame = 3
 
static constexpr unsigned kEmtfShowerMask = 0x1
 
static constexpr unsigned kEmtfShowerOneLooseShift = kEmtfShowerOneNominalShift
 
static constexpr unsigned kEmtfShowerOneNominalShift = 18
 
static constexpr unsigned kEmtfShowerOneTightShift = 19
 
static constexpr unsigned kEmtfShowerStandardFrame = 1
 
static constexpr unsigned kOmtfPtUnconstrainedShift_ = 20
 
static constexpr unsigned omtfTrAddrLayersMask_ = 0x3FFFF
 
static constexpr unsigned omtfTrAddrLayersShift_ = 0
 
static constexpr unsigned omtfTrAddrWeightMask_ = 0x1F
 
static constexpr unsigned omtfTrAddrWeightShift_ = 18
 
static constexpr unsigned phiSignShift_ = 30
 
static constexpr unsigned ptMask_ = 0x1FF
 
static constexpr unsigned ptShift_ = 0
 
static constexpr unsigned ptUnconstrainedMask_ = 0xFF
 
static constexpr unsigned qualMask_ = 0xF
 
static constexpr unsigned qualShift_ = 9
 
static constexpr unsigned signShift_ = 0
 
static constexpr unsigned signValidShift_ = 1
 
static constexpr unsigned trackAddressMask_ = 0x1FFFFFFF
 
static constexpr unsigned trackAddressShift_ = 2
 

Detailed Description

Definition at line 8 of file RegionalMuonRawDigiTranslator.h.

Member Function Documentation

◆ fillRegionalMuonCand() [1/2]

void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand ( RegionalMuonCand mu,
uint32_t  raw_data_00_31,
uint32_t  raw_data_32_63,
int  proc,
tftype  tf,
bool  isKbmtf,
bool  useOmtfDisplacementInfo,
bool  useEmtfDisplacementInfo 
)
static

Definition at line 4 of file RegionalMuonRawDigiTranslator.cc.

References absEtaMask_, absEtaShift_, absPhiMask_, absPhiShift_, l1t::bmtf, bmtfDxyShift_, bmtfPtUnconstrainedShift_, bmtfTrAddrDetSideShift_, bmtfTrAddrStat1Mask_, bmtfTrAddrStat1Shift_, bmtfTrAddrStat2Mask_, bmtfTrAddrStat2Shift_, bmtfTrAddrStat3Mask_, bmtfTrAddrStat3Shift_, bmtfTrAddrStat4Mask_, bmtfTrAddrStat4Shift_, bmtfTrAddrWheelMask_, bmtfTrAddrWheelShift_, dxyMask_, l1t::emtf_neg, l1t::emtf_pos, emtfDxyShift_, emtfPtUnconstrainedShift_, emtfTrAddrBxMask_, emtfTrAddrBxShift_, emtfTrAddrMe1ChMask_, emtfTrAddrMe1ChShift_, emtfTrAddrMe1SegShift_, emtfTrAddrMe2ChMask_, emtfTrAddrMe2ChShift_, emtfTrAddrMe2SegShift_, emtfTrAddrMe3ChMask_, emtfTrAddrMe3ChShift_, emtfTrAddrMe3SegShift_, emtfTrAddrMe4ChMask_, emtfTrAddrMe4ChShift_, emtfTrAddrMe4SegShift_, emtfTrAddrTrkNumMask_, emtfTrAddrTrkNumShift_, etaSignShift_, hfMask_, hfShift_, l1t::RegionalMuonCand::kBX, l1t::RegionalMuonCand::kLayers, l1t::RegionalMuonCand::kME1Ch, l1t::RegionalMuonCand::kME1Seg, l1t::RegionalMuonCand::kME2Ch, l1t::RegionalMuonCand::kME2Seg, l1t::RegionalMuonCand::kME3Ch, l1t::RegionalMuonCand::kME3Seg, l1t::RegionalMuonCand::kME4Ch, l1t::RegionalMuonCand::kME4Seg, kOmtfPtUnconstrainedShift_, l1t::RegionalMuonCand::kSegSelStat1, l1t::RegionalMuonCand::kSegSelStat2, l1t::RegionalMuonCand::kSegSelStat3, l1t::RegionalMuonCand::kSegSelStat4, l1t::RegionalMuonCand::kStat1, l1t::RegionalMuonCand::kStat2, l1t::RegionalMuonCand::kStat3, l1t::RegionalMuonCand::kStat4, l1t::RegionalMuonCand::kTrkNum, l1t::RegionalMuonCand::kWeight, l1t::RegionalMuonCand::kWheelNum, l1t::RegionalMuonCand::kWheelSide, l1t::RegionalMuonCand::kZero, amptDefaultParameters_cff::mu, l1t::omtf_neg, l1t::omtf_pos, omtfTrAddrLayersMask_, omtfTrAddrLayersShift_, omtfTrAddrWeightMask_, omtfTrAddrWeightShift_, phiSignShift_, ValidateTausOnZEEFastSim_cff::proc, ptMask_, ptShift_, ptUnconstrainedMask_, qualMask_, qualShift_, signShift_, signValidShift_, trackAddressMask_, and trackAddressShift_.

Referenced by l1t::stage2::RegionalMuonGMTUnpacker::unpack(), and l1t::stage2::BMTFUnpackerOutput::unpack().

11  {
12  // translations as defined in DN-15-017
13  mu.setHwPt((raw_data_00_31 >> ptShift_) & ptMask_);
14  mu.setHwQual((raw_data_00_31 >> qualShift_) & qualMask_);
15 
16  // eta is coded as two's complement
17  int abs_eta = (raw_data_00_31 >> absEtaShift_) & absEtaMask_;
18  if ((raw_data_00_31 >> etaSignShift_) & 0x1) {
19  mu.setHwEta(abs_eta - (1 << (etaSignShift_ - absEtaShift_)));
20  } else {
21  mu.setHwEta(abs_eta);
22  }
23 
24  // phi is coded as two's complement
25  int abs_phi = (raw_data_00_31 >> absPhiShift_) & absPhiMask_;
26  if ((raw_data_00_31 >> phiSignShift_) & 0x1) {
27  mu.setHwPhi(abs_phi - (1 << (phiSignShift_ - absPhiShift_)));
28  } else {
29  mu.setHwPhi(abs_phi);
30  }
31 
32  // sign is coded as -1^signBit
33  mu.setHwSign((raw_data_32_63 >> signShift_) & 0x1);
34  mu.setHwSignValid((raw_data_32_63 >> signValidShift_) & 0x1);
35  mu.setHwHF((raw_data_00_31 >> hfShift_) & hfMask_);
36 
37  // set track address with subaddresses
38  int rawTrackAddress = (raw_data_32_63 >> trackAddressShift_) & trackAddressMask_;
39  if (tf == bmtf) {
40  int detSide = (rawTrackAddress >> bmtfTrAddrDetSideShift_) & 0x1;
41  int wheelNum = (rawTrackAddress >> bmtfTrAddrWheelShift_) & bmtfTrAddrWheelMask_;
42  int statAddr1 = ((rawTrackAddress >> bmtfTrAddrStat1Shift_) & bmtfTrAddrStat1Mask_);
43  int statAddr2 = ((rawTrackAddress >> bmtfTrAddrStat2Shift_) & bmtfTrAddrStat2Mask_);
44  int statAddr3 = ((rawTrackAddress >> bmtfTrAddrStat3Shift_) & bmtfTrAddrStat3Mask_);
45  int statAddr4 = ((rawTrackAddress >> bmtfTrAddrStat4Shift_) & bmtfTrAddrStat4Mask_);
46 
47  mu.setTrackSubAddress(RegionalMuonCand::kWheelSide, detSide);
48  mu.setTrackSubAddress(RegionalMuonCand::kWheelNum, wheelNum);
49  if (!isKbmtf) { // The Run-2 standard configuration for BMTF
50  mu.setTrackSubAddress(RegionalMuonCand::kStat1, statAddr1);
51  mu.setTrackSubAddress(RegionalMuonCand::kStat2, statAddr2);
52  mu.setTrackSubAddress(RegionalMuonCand::kStat3, statAddr3);
53  mu.setTrackSubAddress(RegionalMuonCand::kStat4, statAddr4);
54  } else {
55  // For Run-3 track address encoding has changed as the Kalman Filter tracks from outside in.
56  // As a result station assignment is inverted
57  // (i.e. the field that contained the station 1 information for Run-2 now contains station 4 information and so on.)
58  mu.setTrackSubAddress(RegionalMuonCand::kStat1, statAddr4);
59  mu.setTrackSubAddress(RegionalMuonCand::kStat2, statAddr3);
60  mu.setTrackSubAddress(RegionalMuonCand::kStat3, statAddr2);
61  mu.setTrackSubAddress(RegionalMuonCand::kStat4, statAddr1);
62  // Additionally we now have displacement information from the BMTF
63  mu.setHwPtUnconstrained((raw_data_32_63 >> bmtfPtUnconstrainedShift_) & ptUnconstrainedMask_);
64  mu.setHwDXY((raw_data_32_63 >> bmtfDxyShift_) & dxyMask_);
65  }
66  mu.setTrackSubAddress(RegionalMuonCand::kSegSelStat1, 0);
67  mu.setTrackSubAddress(RegionalMuonCand::kSegSelStat2, 0);
68  mu.setTrackSubAddress(RegionalMuonCand::kSegSelStat3, 0);
69  mu.setTrackSubAddress(RegionalMuonCand::kSegSelStat4, 0);
70  //mu.setTrackSubAddress(RegionalMuonCand::kNumBmtfSubAddr, 0);
71  } else if (tf == emtf_neg || tf == emtf_pos) {
72  mu.setTrackSubAddress(RegionalMuonCand::kME1Seg, (rawTrackAddress >> emtfTrAddrMe1SegShift_) & 0x1);
73  mu.setTrackSubAddress(RegionalMuonCand::kME1Ch, (rawTrackAddress >> emtfTrAddrMe1ChShift_) & emtfTrAddrMe1ChMask_);
74  mu.setTrackSubAddress(RegionalMuonCand::kME2Seg, (rawTrackAddress >> emtfTrAddrMe2SegShift_) & 0x1);
75  mu.setTrackSubAddress(RegionalMuonCand::kME2Ch, (rawTrackAddress >> emtfTrAddrMe2ChShift_) & emtfTrAddrMe2ChMask_);
76  mu.setTrackSubAddress(RegionalMuonCand::kME3Seg, (rawTrackAddress >> emtfTrAddrMe3SegShift_) & 0x1);
77  mu.setTrackSubAddress(RegionalMuonCand::kME3Ch, (rawTrackAddress >> emtfTrAddrMe3ChShift_) & emtfTrAddrMe3ChMask_);
78  mu.setTrackSubAddress(RegionalMuonCand::kME4Seg, (rawTrackAddress >> emtfTrAddrMe4SegShift_) & 0x1);
79  mu.setTrackSubAddress(RegionalMuonCand::kME4Ch, (rawTrackAddress >> emtfTrAddrMe4ChShift_) & emtfTrAddrMe4ChMask_);
80  if (useEmtfDisplacementInfo) { // In Run-3 we receive displaced muon information from EMTF
81  mu.setHwPtUnconstrained((raw_data_32_63 >> emtfPtUnconstrainedShift_) & ptUnconstrainedMask_);
82  mu.setHwDXY((raw_data_32_63 >> emtfDxyShift_) & dxyMask_);
83  mu.setTrackSubAddress(RegionalMuonCand::kTrkNum, 0);
84  mu.setTrackSubAddress(RegionalMuonCand::kBX, 0);
85  } else {
86  mu.setTrackSubAddress(RegionalMuonCand::kTrkNum,
87  (rawTrackAddress >> emtfTrAddrTrkNumShift_) & emtfTrAddrTrkNumMask_);
88  mu.setTrackSubAddress(RegionalMuonCand::kBX, (rawTrackAddress >> emtfTrAddrBxShift_) & emtfTrAddrBxMask_);
89  }
90  } else if (tf == omtf_neg || tf == omtf_pos) {
91  if (useOmtfDisplacementInfo) { // In Run-3 2024 we receive displaced muon information from OMTF
92  mu.setHwPtUnconstrained((raw_data_32_63 >> kOmtfPtUnconstrainedShift_) & ptUnconstrainedMask_);
93  }
94  mu.setTrackSubAddress(RegionalMuonCand::kLayers,
95  (rawTrackAddress >> omtfTrAddrLayersShift_) & omtfTrAddrLayersMask_);
96  mu.setTrackSubAddress(RegionalMuonCand::kZero, 0);
97  mu.setTrackSubAddress(RegionalMuonCand::kWeight,
98  (rawTrackAddress >> omtfTrAddrWeightShift_) & omtfTrAddrWeightMask_);
99  } else {
100  std::map<int, int> trackAddr;
101  trackAddr[0] = rawTrackAddress;
102  mu.setTrackAddress(trackAddr);
103  }
104 
105  mu.setTFIdentifiers(proc, tf);
106  mu.setDataword(raw_data_32_63, raw_data_00_31);
107 }
static constexpr unsigned kOmtfPtUnconstrainedShift_

◆ fillRegionalMuonCand() [2/2]

void l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand ( RegionalMuonCand mu,
uint64_t  dataword,
int  proc,
tftype  tf,
bool  isKbmtf,
bool  useOmtfDisplacementInfo,
bool  useEmtfDisplacementInfo 
)
static

Definition at line 109 of file RegionalMuonRawDigiTranslator.cc.

References amptDefaultParameters_cff::mu, and ValidateTausOnZEEFastSim_cff::proc.

115  {
117  (uint32_t)(dataword & 0xFFFFFFFF),
118  (uint32_t)((dataword >> 32) & 0xFFFFFFFF),
119  proc,
120  tf,
121  isKbmtf,
122  useOmtfDisplacementInfo,
123  useEmtfDisplacementInfo);
124 }
static void fillRegionalMuonCand(RegionalMuonCand &mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int proc, tftype tf, bool isKbmtf, bool useOmtfDisplacementInfo, bool useEmtfDisplacementInfo)

◆ fillRegionalMuonShower()

bool l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonShower ( RegionalMuonShower muShower,
std::vector< uint32_t >  bxPayload,
int  proc,
tftype  tf,
bool  useEmtfNominalTightShowers,
bool  useEmtfLooseShowers 
)
static

Definition at line 126 of file RegionalMuonRawDigiTranslator.cc.

References l1t::emtf_neg, l1t::emtf_pos, l1t::RegionalMuonShower::isValid(), ValidateTausOnZEEFastSim_cff::proc, l1t::RegionalMuonShower::setOneLooseInTime(), l1t::RegionalMuonShower::setOneNominalInTime(), l1t::RegionalMuonShower::setOneTightInTime(), and l1t::RegionalMuonShower::setTFIdentifiers().

Referenced by l1t::stage2::RegionalMuonGMTUnpacker::unpack().

131  {
132  muShower.setTFIdentifiers(proc, tf);
133  bool showerValid{false};
134  if (useEmtfNominalTightShowers && (tf == emtf_pos || tf == emtf_neg)) {
135  muShower.setOneNominalInTime(((bxPayload[kEmtfShowerStandardFrame] >> kEmtfShowerOneNominalShift) & 1) == 1);
136  muShower.setOneTightInTime(((bxPayload[kEmtfShowerStandardFrame] >> kEmtfShowerOneTightShift) & 1) == 1);
137 
138  showerValid = muShower.isValid();
139  }
140  if (useEmtfLooseShowers && (tf == emtf_pos || tf == emtf_neg)) {
141  muShower.setOneLooseInTime(((bxPayload[kEmtfShowerExtendedFrame] >> kEmtfShowerOneLooseShift) & 1) == 1);
142 
143  showerValid = muShower.isValid();
144  }
145  return showerValid;
146 }
static constexpr unsigned kEmtfShowerOneNominalShift

◆ generate64bitDataWord()

uint64_t l1t::RegionalMuonRawDigiTranslator::generate64bitDataWord ( const RegionalMuonCand mu,
bool  isKbmtf,
bool  useOmtfDisplacementInfo,
bool  useEmtfDisplacementInfo 
)
static

Definition at line 206 of file RegionalMuonRawDigiTranslator.cc.

References amptDefaultParameters_cff::mu.

209  {
210  uint32_t lsw;
211  uint32_t msw;
212 
213  generatePackedDataWords(mu, lsw, msw, isKbmtf, useOmtfDisplacementInfo, useEmtfDisplacementInfo);
214  return (((uint64_t)msw) << 32) + lsw;
215 }
static void generatePackedDataWords(const RegionalMuonCand &mu, uint32_t &raw_data_00_31, uint32_t &raw_data_32_63, bool isKbmtf, bool useOmtfDisplacementInfo, bool useEmtfDisplacementInfo)
unsigned long long uint64_t
Definition: Time.h:13

◆ generatePackedDataWords()

void l1t::RegionalMuonRawDigiTranslator::generatePackedDataWords ( const RegionalMuonCand mu,
uint32_t &  raw_data_00_31,
uint32_t &  raw_data_32_63,
bool  isKbmtf,
bool  useOmtfDisplacementInfo,
bool  useEmtfDisplacementInfo 
)
static

Definition at line 171 of file RegionalMuonRawDigiTranslator.cc.

References l1t::bmtf, l1t::emtf_neg, l1t::emtf_pos, amptDefaultParameters_cff::mu, l1t::omtf_neg, and l1t::omtf_pos.

Referenced by l1t::stage2::BMTFPackerOutput::pack(), and l1t::stage2::RegionalMuonGMTPacker::packTF().

176  {
177  int abs_eta = mu.hwEta();
178  if (abs_eta < 0) {
179  abs_eta += (1 << (etaSignShift_ - absEtaShift_));
180  }
181  int abs_phi = mu.hwPhi();
182  if (abs_phi < 0) {
183  abs_phi += (1 << (phiSignShift_ - absPhiShift_));
184  }
185  raw_data_00_31 = (mu.hwPt() & ptMask_) << ptShift_ | (mu.hwQual() & qualMask_) << qualShift_ |
186  (abs_eta & absEtaMask_) << absEtaShift_ | (mu.hwEta() < 0) << etaSignShift_ |
187  (mu.hwHF() & hfMask_) << hfShift_ | (abs_phi & absPhiMask_) << absPhiShift_ |
188  (mu.hwPhi() < 0) << phiSignShift_;
189 
190  // generate the raw track address from the subaddresses
191  int rawTrkAddr = generateRawTrkAddress(mu, isKbmtf);
192 
193  raw_data_32_63 = mu.hwSign() << signShift_ | mu.hwSignValid() << signValidShift_ |
194  (rawTrkAddr & trackAddressMask_) << trackAddressShift_;
195  if (isKbmtf && mu.trackFinderType() == bmtf) {
196  raw_data_32_63 |= (mu.hwPtUnconstrained() & ptUnconstrainedMask_) << bmtfPtUnconstrainedShift_ |
197  (mu.hwDXY() & dxyMask_) << bmtfDxyShift_;
198  } else if (useOmtfDisplacementInfo && (mu.trackFinderType() == omtf_pos || mu.trackFinderType() == omtf_neg)) {
199  raw_data_32_63 |= (mu.hwPtUnconstrained() & ptUnconstrainedMask_) << kOmtfPtUnconstrainedShift_;
200  } else if (useEmtfDisplacementInfo && (mu.trackFinderType() == emtf_pos || mu.trackFinderType() == emtf_neg)) {
201  raw_data_32_63 |= (mu.hwPtUnconstrained() & ptUnconstrainedMask_) << emtfPtUnconstrainedShift_ |
202  (mu.hwDXY() & dxyMask_) << emtfDxyShift_;
203  }
204 }
static int generateRawTrkAddress(const RegionalMuonCand &, bool isKalman)
static constexpr unsigned kOmtfPtUnconstrainedShift_

◆ generatePackedShowerPayload()

void l1t::RegionalMuonRawDigiTranslator::generatePackedShowerPayload ( const RegionalMuonShower shower,
std::array< uint32_t, 6 > &  payload,
bool  useEmtfNominalTightShowers,
bool  useEmtfLooseShowers 
)
static

Definition at line 148 of file RegionalMuonRawDigiTranslator.cc.

References l1t::RegionalMuonShower::isOneNominalInTime(), l1t::RegionalMuonShower::isOneNominalOutOfTime(), l1t::RegionalMuonShower::isOneTightInTime(), l1t::RegionalMuonShower::isOneTightOutOfTime(), l1t::RegionalMuonShower::isValid(), and jetsAK4_Puppi_cff::payload.

Referenced by l1t::stage2::RegionalMuonGMTPacker::packTF().

151  {
152  if (!useEmtfNominalTightShowers || !useEmtfLooseShowers || !shower.isValid()) {
153  return;
154  }
155  // First we check whether we're going to overwrite something in the payload.
159  edm::LogError("L1T") << "Check constants for RegionalMuonShower fields! It looks like we're in danger of "
160  "overwriting muon data in the packer! StandardFrame is "
161  << payload.at(kEmtfShowerStandardFrame) << ", ExtendedFrame is "
163  return;
164  }
165  payload.at(kEmtfShowerStandardFrame) |= (shower.isOneNominalInTime() & 1) << kEmtfShowerOneNominalShift |
166  (shower.isOneTightInTime() & 1) << kEmtfShowerOneTightShift;
167  payload.at(kEmtfShowerExtendedFrame) |= (shower.isOneNominalOutOfTime() & 1) << kEmtfShowerOneNominalShift |
168  (shower.isOneTightOutOfTime() & 1) << kEmtfShowerOneTightShift;
169 }
Log< level::Error, false > LogError
static constexpr unsigned kEmtfShowerOneNominalShift

◆ generateRawTrkAddress()

int l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress ( const RegionalMuonCand mu,
bool  isKalman 
)
static

Definition at line 217 of file RegionalMuonRawDigiTranslator.cc.

References l1t::bmtf, l1t::emtf_neg, l1t::emtf_pos, l1t::RegionalMuonCand::kLayers, l1t::RegionalMuonCand::kME1Ch, l1t::RegionalMuonCand::kME1Seg, l1t::RegionalMuonCand::kME2Ch, l1t::RegionalMuonCand::kME2Seg, l1t::RegionalMuonCand::kME3Ch, l1t::RegionalMuonCand::kME3Seg, l1t::RegionalMuonCand::kME4Ch, l1t::RegionalMuonCand::kME4Seg, l1t::RegionalMuonCand::kNumBmtfSubAddr, l1t::RegionalMuonCand::kNumEmtfSubAddr, l1t::RegionalMuonCand::kNumOmtfSubAddr, l1t::RegionalMuonCand::kStat1, l1t::RegionalMuonCand::kStat2, l1t::RegionalMuonCand::kStat3, l1t::RegionalMuonCand::kStat4, l1t::RegionalMuonCand::kWeight, l1t::RegionalMuonCand::kWheelNum, l1t::RegionalMuonCand::kWheelSide, amptDefaultParameters_cff::mu, l1t::omtf_neg, and l1t::omtf_pos.

Referenced by L1Analysis::L1AnalysisL1UpgradeTfMuon::SetTfMuon().

217  {
218  int tf = mu.trackFinderType();
219  int rawTrkAddr = 0;
220  if (tf == bmtf) {
221  // protection against a track address map with the wrong size
222  if (mu.trackAddress().size() == RegionalMuonCand::kNumBmtfSubAddr) {
223  int detSide = mu.trackSubAddress(RegionalMuonCand::kWheelSide);
224  int wheelNum = mu.trackSubAddress(RegionalMuonCand::kWheelNum);
225  int stat1 = mu.trackSubAddress(RegionalMuonCand::kStat1);
226  int stat2 = mu.trackSubAddress(RegionalMuonCand::kStat2);
227  int stat3 = mu.trackSubAddress(RegionalMuonCand::kStat3);
228  int stat4 = mu.trackSubAddress(RegionalMuonCand::kStat4);
229  if (isKalman) {
230  stat1 = mu.trackSubAddress(RegionalMuonCand::kStat4);
231  stat2 = mu.trackSubAddress(RegionalMuonCand::kStat3);
232  stat3 = mu.trackSubAddress(RegionalMuonCand::kStat2);
233  stat4 = mu.trackSubAddress(RegionalMuonCand::kStat1);
234  }
235 
236  rawTrkAddr = (detSide & 0x1) << bmtfTrAddrDetSideShift_ |
242  } else {
243  edm::LogWarning("L1T") << "BMTF muon track address map contains " << mu.trackAddress().size()
244  << " instead of the expected " << RegionalMuonCand::kNumBmtfSubAddr
245  << " subaddresses. Check the data format. Setting track address to 0.";
246  rawTrkAddr = 0;
247  }
248  } else if (tf == emtf_neg || tf == emtf_pos) {
249  // protection against a track address map with the wrong size
250  if (mu.trackAddress().size() == RegionalMuonCand::kNumEmtfSubAddr) {
251  rawTrkAddr = (mu.trackSubAddress(RegionalMuonCand::kME1Seg) & 0x1) << emtfTrAddrMe1SegShift_ |
253  (mu.trackSubAddress(RegionalMuonCand::kME2Seg) & 0x1) << emtfTrAddrMe2SegShift_ |
255  (mu.trackSubAddress(RegionalMuonCand::kME3Seg) & 0x1) << emtfTrAddrMe3SegShift_ |
257  (mu.trackSubAddress(RegionalMuonCand::kME4Seg) & 0x1) << emtfTrAddrMe4SegShift_ |
259 
260  } else {
261  edm::LogWarning("L1T") << "EMTF muon track address map contains " << mu.trackAddress().size()
262  << " instead of the expected " << RegionalMuonCand::kNumEmtfSubAddr
263  << " subaddresses. Check the data format. Setting track address to 0.";
264  rawTrkAddr = 0;
265  }
266  } else if (tf == omtf_neg || tf == omtf_pos) {
267  // protection against a track address map with the wrong size
268  if (mu.trackAddress().size() == RegionalMuonCand::kNumOmtfSubAddr) {
269  rawTrkAddr = (mu.trackSubAddress(RegionalMuonCand::kLayers) & omtfTrAddrLayersMask_) << omtfTrAddrLayersShift_ |
271 
272  } else {
273  edm::LogWarning("L1T") << "OMTF muon track address map contains " << mu.trackAddress().size()
274  << " instead of the expected " << RegionalMuonCand::kNumOmtfSubAddr
275  << " subaddresses. Check the data format. Setting track address to 0.";
276  rawTrkAddr = 0;
277  }
278  } else {
279  rawTrkAddr = mu.trackAddress().at(0);
280  }
281 
282  return rawTrkAddr;
283 }
Log< level::Warning, false > LogWarning

Member Data Documentation

◆ absEtaMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::absEtaMask_ = 0xFF
static

Definition at line 51 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ absEtaShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::absEtaShift_ = 13
static

Definition at line 52 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ absPhiMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::absPhiMask_ = 0x7F
static

Definition at line 56 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ absPhiShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::absPhiShift_ = 23
static

Definition at line 57 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ bmtfDxyShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::bmtfDxyShift_ = 2
static

Definition at line 62 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ bmtfPtUnconstrainedShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::bmtfPtUnconstrainedShift_ = 23
static

Definition at line 65 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ bmtfTrAddrDetSideShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::bmtfTrAddrDetSideShift_ = 20
static

Definition at line 80 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ bmtfTrAddrSegSelMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::bmtfTrAddrSegSelMask_ = 0xF
static

Definition at line 78 of file RegionalMuonRawDigiTranslator.h.

◆ bmtfTrAddrSegSelShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::bmtfTrAddrSegSelShift_ = 21
static

Definition at line 79 of file RegionalMuonRawDigiTranslator.h.

◆ bmtfTrAddrStat1Mask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::bmtfTrAddrStat1Mask_ = 0x3
static

Definition at line 83 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ bmtfTrAddrStat1Shift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::bmtfTrAddrStat1Shift_ = 14
static

Definition at line 84 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ bmtfTrAddrStat2Mask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::bmtfTrAddrStat2Mask_ = 0xF
static

Definition at line 85 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ bmtfTrAddrStat2Shift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::bmtfTrAddrStat2Shift_ = 10
static

Definition at line 86 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ bmtfTrAddrStat3Mask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::bmtfTrAddrStat3Mask_ = 0xF
static

Definition at line 87 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ bmtfTrAddrStat3Shift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::bmtfTrAddrStat3Shift_ = 6
static

Definition at line 88 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ bmtfTrAddrStat4Mask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::bmtfTrAddrStat4Mask_ = 0xF
static

Definition at line 89 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ bmtfTrAddrStat4Shift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::bmtfTrAddrStat4Shift_ = 2
static

Definition at line 90 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ bmtfTrAddrWheelMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::bmtfTrAddrWheelMask_ = 0x3
static

Definition at line 81 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ bmtfTrAddrWheelShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::bmtfTrAddrWheelShift_ = 18
static

Definition at line 82 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ dxyMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::dxyMask_ = 0x3
static

Definition at line 61 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfDxyShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfDxyShift_ = 29
static

Definition at line 63 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfPtUnconstrainedShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfPtUnconstrainedShift_ = 20
static

Definition at line 67 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrBxMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrBxMask_ = 0x7FF
static

Definition at line 107 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrBxShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrBxShift_ = 18
static

Definition at line 106 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrMe1ChMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrMe1ChMask_ = 0x7
static

Definition at line 94 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrMe1ChShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrMe1ChShift_ = 1
static

Definition at line 93 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrMe1SegShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrMe1SegShift_ = 0
static

Definition at line 92 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrMe2ChMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrMe2ChMask_ = 0x7
static

Definition at line 97 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrMe2ChShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrMe2ChShift_ = 5
static

Definition at line 96 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrMe2SegShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrMe2SegShift_ = 4
static

Definition at line 95 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrMe3ChMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrMe3ChMask_ = 0x7
static

Definition at line 100 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrMe3ChShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrMe3ChShift_ = 9
static

Definition at line 99 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrMe3SegShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrMe3SegShift_ = 8
static

Definition at line 98 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrMe4ChMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrMe4ChMask_ = 0x7
static

Definition at line 103 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrMe4ChShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrMe4ChShift_ = 13
static

Definition at line 102 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrMe4SegShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrMe4SegShift_ = 12
static

Definition at line 101 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrTrkNumMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrTrkNumMask_ = 0x3
static

Definition at line 105 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ emtfTrAddrTrkNumShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::emtfTrAddrTrkNumShift_ = 16
static

Definition at line 104 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ etaSignShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::etaSignShift_ = 21
static

Definition at line 53 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ hfMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::hfMask_ = 0x1
static

Definition at line 54 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ hfShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::hfShift_ = 22
static

Definition at line 55 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ kEmtfShowerExtendedFrame

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::kEmtfShowerExtendedFrame = 3
static

Definition at line 72 of file RegionalMuonRawDigiTranslator.h.

◆ kEmtfShowerMask

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::kEmtfShowerMask = 0x1
static

Definition at line 70 of file RegionalMuonRawDigiTranslator.h.

◆ kEmtfShowerOneLooseShift

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::kEmtfShowerOneLooseShift = kEmtfShowerOneNominalShift
static

Definition at line 74 of file RegionalMuonRawDigiTranslator.h.

◆ kEmtfShowerOneNominalShift

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::kEmtfShowerOneNominalShift = 18
static

Definition at line 73 of file RegionalMuonRawDigiTranslator.h.

◆ kEmtfShowerOneTightShift

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::kEmtfShowerOneTightShift = 19
static

Definition at line 75 of file RegionalMuonRawDigiTranslator.h.

◆ kEmtfShowerStandardFrame

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::kEmtfShowerStandardFrame = 1
static

Definition at line 71 of file RegionalMuonRawDigiTranslator.h.

◆ kOmtfPtUnconstrainedShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::kOmtfPtUnconstrainedShift_ = 20
static

Definition at line 66 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ omtfTrAddrLayersMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::omtfTrAddrLayersMask_ = 0x3FFFF
static

Definition at line 110 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ omtfTrAddrLayersShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::omtfTrAddrLayersShift_ = 0
static

Definition at line 109 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ omtfTrAddrWeightMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::omtfTrAddrWeightMask_ = 0x1F
static

Definition at line 112 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ omtfTrAddrWeightShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::omtfTrAddrWeightShift_ = 18
static

Definition at line 111 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ phiSignShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::phiSignShift_ = 30
static

Definition at line 58 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ ptMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::ptMask_ = 0x1FF
static

◆ ptShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::ptShift_ = 0
static

◆ ptUnconstrainedMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::ptUnconstrainedMask_ = 0xFF
static

Definition at line 64 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ qualMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::qualMask_ = 0xF
static

Definition at line 49 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ qualShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::qualShift_ = 9
static

Definition at line 50 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ signShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::signShift_ = 0
static

Definition at line 59 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ signValidShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::signValidShift_ = 1
static

Definition at line 60 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ trackAddressMask_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::trackAddressMask_ = 0x1FFFFFFF
static

Definition at line 68 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

◆ trackAddressShift_

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::trackAddressShift_ = 2
static

Definition at line 69 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().