CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 useEmtfDisplacementInfo)
 
static void fillRegionalMuonCand (RegionalMuonCand &mu, uint64_t dataword, int proc, tftype tf, bool isKbmtf, bool useEmtfDisplacementInfo)
 
static bool fillRegionalMuonShower (RegionalMuonShower &muShower, std::vector< uint32_t > bxPayload, int proc, tftype tf, bool useEmtfShowers)
 
static uint64_t generate64bitDataWord (const RegionalMuonCand &mu, bool isKbmtf, bool useEmtfDisplacementInfo)
 
static void generatePackedDataWords (const RegionalMuonCand &mu, uint32_t &raw_data_00_31, uint32_t &raw_data_32_63, bool isKbmtf, bool useEmtfDisplacementInfo)
 
static void generatePackedShowerPayload (const RegionalMuonShower &shower, std::array< uint32_t, 6 > &payload, bool useEmtfShowers)
 
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 emtfShowerInTimeFrame_ = 1
 
static constexpr unsigned emtfShowerMask_ = 0x1
 
static constexpr unsigned emtfShowerOneNominalShift_ = 18
 
static constexpr unsigned emtfShowerOneTightShift_ = 19
 
static constexpr unsigned emtfShowerOOTFrame_ = 3
 
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 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

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  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, 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, l1t::omtf_neg, l1t::omtf_pos, omtfTrAddrLayersMask_, omtfTrAddrLayersShift_, omtfTrAddrWeightMask_, omtfTrAddrWeightShift_, phiSignShift_, ptMask_, ptShift_, ptUnconstrainedMask_, qualMask_, qualShift_, l1t::RegionalMuonCand::setDataword(), l1t::RegionalMuonCand::setHwDXY(), l1t::RegionalMuonCand::setHwEta(), l1t::RegionalMuonCand::setHwHF(), l1t::RegionalMuonCand::setHwPhi(), l1t::RegionalMuonCand::setHwPt(), l1t::RegionalMuonCand::setHwPtUnconstrained(), l1t::RegionalMuonCand::setHwQual(), l1t::RegionalMuonCand::setHwSign(), l1t::RegionalMuonCand::setHwSignValid(), l1t::RegionalMuonCand::setTFIdentifiers(), l1t::RegionalMuonCand::setTrackAddress(), l1t::RegionalMuonCand::setTrackSubAddress(), signShift_, signValidShift_, trackAddressMask_, and trackAddressShift_.

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

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

Definition at line 105 of file RegionalMuonRawDigiTranslator.cc.

110  {
112  (uint32_t)(dataword & 0xFFFFFFFF),
113  (uint32_t)((dataword >> 32) & 0xFFFFFFFF),
114  proc,
115  tf,
116  isKbmtf,
117  useEmtfDisplacementInfo);
118 }
const int mu
Definition: Constants.h:22
static void fillRegionalMuonCand(RegionalMuonCand &mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int proc, tftype tf, bool isKbmtf, bool useEmtfDisplacementInfo)
bool l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonShower ( RegionalMuonShower muShower,
std::vector< uint32_t >  bxPayload,
int  proc,
tftype  tf,
bool  useEmtfShowers 
)
static

Definition at line 120 of file RegionalMuonRawDigiTranslator.cc.

References l1t::emtf_neg, l1t::emtf_pos, l1t::RegionalMuonShower::isValid(), l1t::RegionalMuonShower::setOneNominalInTime(), l1t::RegionalMuonShower::setOneNominalOutOfTime(), l1t::RegionalMuonShower::setOneTightInTime(), l1t::RegionalMuonShower::setOneTightOutOfTime(), and l1t::RegionalMuonShower::setTFIdentifiers().

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

121  {
122  if (useEmtfShowers && (tf == emtf_pos || tf == emtf_neg)) {
123  muShower.setTFIdentifiers(proc, tf);
124 
125  muShower.setOneNominalInTime(((bxPayload[emtfShowerInTimeFrame_] >> emtfShowerOneNominalShift_) & 1) == 1);
126  muShower.setOneNominalOutOfTime(((bxPayload[emtfShowerOOTFrame_] >> emtfShowerOneNominalShift_) & 1) == 1);
127  muShower.setOneTightInTime(((bxPayload[emtfShowerInTimeFrame_] >> emtfShowerOneTightShift_) & 1) == 1);
128  muShower.setOneTightOutOfTime(((bxPayload[emtfShowerOOTFrame_] >> emtfShowerOneTightShift_) & 1) == 1);
129 
130  return muShower.isValid();
131  } else {
132  return false;
133  }
134 }
static constexpr unsigned emtfShowerOneNominalShift_
uint64_t l1t::RegionalMuonRawDigiTranslator::generate64bitDataWord ( const RegionalMuonCand mu,
bool  isKbmtf,
bool  useEmtfDisplacementInfo 
)
static

Definition at line 190 of file RegionalMuonRawDigiTranslator.cc.

192  {
193  uint32_t lsw;
194  uint32_t msw;
195 
196  generatePackedDataWords(mu, lsw, msw, isKbmtf, useEmtfDisplacementInfo);
197  return (((uint64_t)msw) << 32) + lsw;
198 }
static void generatePackedDataWords(const RegionalMuonCand &mu, uint32_t &raw_data_00_31, uint32_t &raw_data_32_63, bool isKbmtf, bool useEmtfDisplacementInfo)
const int mu
Definition: Constants.h:22
unsigned long long uint64_t
Definition: Time.h:13
void l1t::RegionalMuonRawDigiTranslator::generatePackedDataWords ( const RegionalMuonCand mu,
uint32_t &  raw_data_00_31,
uint32_t &  raw_data_32_63,
bool  isKbmtf,
bool  useEmtfDisplacementInfo 
)
static

Definition at line 158 of file RegionalMuonRawDigiTranslator.cc.

References l1t::bmtf, l1t::emtf_neg, l1t::emtf_pos, l1t::RegionalMuonCand::hwDXY(), l1t::RegionalMuonCand::hwEta(), l1t::RegionalMuonCand::hwHF(), l1t::RegionalMuonCand::hwPhi(), l1t::RegionalMuonCand::hwPt(), l1t::RegionalMuonCand::hwPtUnconstrained(), l1t::RegionalMuonCand::hwQual(), l1t::RegionalMuonCand::hwSign(), l1t::RegionalMuonCand::hwSignValid(), and l1t::RegionalMuonCand::trackFinderType().

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

162  {
163  int abs_eta = mu.hwEta();
164  if (abs_eta < 0) {
165  abs_eta += (1 << (etaSignShift_ - absEtaShift_));
166  }
167  int abs_phi = mu.hwPhi();
168  if (abs_phi < 0) {
169  abs_phi += (1 << (phiSignShift_ - absPhiShift_));
170  }
171  raw_data_00_31 = (mu.hwPt() & ptMask_) << ptShift_ | (mu.hwQual() & qualMask_) << qualShift_ |
172  (abs_eta & absEtaMask_) << absEtaShift_ | (mu.hwEta() < 0) << etaSignShift_ |
173  (mu.hwHF() & hfMask_) << hfShift_ | (abs_phi & absPhiMask_) << absPhiShift_ |
174  (mu.hwPhi() < 0) << phiSignShift_;
175 
176  // generate the raw track address from the subaddresses
177  int rawTrkAddr = generateRawTrkAddress(mu, isKbmtf);
178 
179  raw_data_32_63 = mu.hwSign() << signShift_ | mu.hwSignValid() << signValidShift_ |
180  (rawTrkAddr & trackAddressMask_) << trackAddressShift_;
181  if (isKbmtf && mu.trackFinderType() == bmtf) {
182  raw_data_32_63 |= (mu.hwPtUnconstrained() & ptUnconstrainedMask_) << bmtfPtUnconstrainedShift_ |
183  (mu.hwDXY() & dxyMask_) << bmtfDxyShift_;
184  } else if (useEmtfDisplacementInfo && (mu.trackFinderType() == emtf_pos || mu.trackFinderType() == emtf_neg)) {
185  raw_data_32_63 |= (mu.hwPtUnconstrained() & ptUnconstrainedMask_) << emtfPtUnconstrainedShift_ |
186  (mu.hwDXY() & dxyMask_) << emtfDxyShift_;
187  }
188 }
const int mu
Definition: Constants.h:22
static int generateRawTrkAddress(const RegionalMuonCand &, bool isKalman)
void l1t::RegionalMuonRawDigiTranslator::generatePackedShowerPayload ( const RegionalMuonShower shower,
std::array< uint32_t, 6 > &  payload,
bool  useEmtfShowers 
)
static

Definition at line 136 of file RegionalMuonRawDigiTranslator.cc.

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

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

138  {
139  if (!useEmtfShowers || !shower.isValid()) {
140  return;
141  }
142  // First we check whether we're going to overwrite something in the payload.
144  (((payload.at(emtfShowerInTimeFrame_) >> emtfShowerOneTightShift_) & emtfShowerMask_) != 0) ||
145  (((payload.at(emtfShowerOOTFrame_) >> emtfShowerOneNominalShift_) & emtfShowerMask_) != 0) ||
146  (((payload.at(emtfShowerOOTFrame_) >> emtfShowerOneTightShift_) & emtfShowerMask_) != 0)) {
147  edm::LogError("L1T") << "Check constants for RegionalMuonShower fields! It looks like we're in danger of "
148  "overwriting muon data in the packer! InTimeFrame is "
149  << payload.at(emtfShowerInTimeFrame_) << ", OOTFrame is " << payload.at(emtfShowerOOTFrame_);
150  return;
151  }
152  payload.at(emtfShowerInTimeFrame_) |= (shower.isOneNominalInTime() & 1) << emtfShowerOneNominalShift_ |
153  (shower.isOneTightInTime() & 1) << emtfShowerOneTightShift_;
154  payload.at(emtfShowerOOTFrame_) |= (shower.isOneNominalOutOfTime() & 1) << emtfShowerOneNominalShift_ |
155  (shower.isOneTightOutOfTime() & 1) << emtfShowerOneTightShift_;
156 }
Log< level::Error, false > LogError
static constexpr unsigned emtfShowerOneNominalShift_
int l1t::RegionalMuonRawDigiTranslator::generateRawTrkAddress ( const RegionalMuonCand mu,
bool  isKalman 
)
static

Definition at line 200 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, l1t::omtf_neg, l1t::omtf_pos, l1t::RegionalMuonCand::trackAddress(), l1t::RegionalMuonCand::trackFinderType(), and l1t::RegionalMuonCand::trackSubAddress().

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

200  {
201  int tf = mu.trackFinderType();
202  int rawTrkAddr = 0;
203  if (tf == bmtf) {
204  // protection against a track address map with the wrong size
205  if (mu.trackAddress().size() == RegionalMuonCand::kNumBmtfSubAddr) {
206  int detSide = mu.trackSubAddress(RegionalMuonCand::kWheelSide);
207  int wheelNum = mu.trackSubAddress(RegionalMuonCand::kWheelNum);
208  int stat1 = mu.trackSubAddress(RegionalMuonCand::kStat1);
209  int stat2 = mu.trackSubAddress(RegionalMuonCand::kStat2);
210  int stat3 = mu.trackSubAddress(RegionalMuonCand::kStat3);
211  int stat4 = mu.trackSubAddress(RegionalMuonCand::kStat4);
212  if (isKalman) {
213  stat1 = mu.trackSubAddress(RegionalMuonCand::kStat4);
214  stat2 = mu.trackSubAddress(RegionalMuonCand::kStat3);
215  stat3 = mu.trackSubAddress(RegionalMuonCand::kStat2);
216  stat4 = mu.trackSubAddress(RegionalMuonCand::kStat1);
217  }
218 
219  rawTrkAddr = (detSide & 0x1) << bmtfTrAddrDetSideShift_ |
225  } else {
226  edm::LogWarning("L1T") << "BMTF muon track address map contains " << mu.trackAddress().size()
227  << " instead of the expected " << RegionalMuonCand::kNumBmtfSubAddr
228  << " subaddresses. Check the data format. Setting track address to 0.";
229  rawTrkAddr = 0;
230  }
231  } else if (tf == emtf_neg || tf == emtf_pos) {
232  // protection against a track address map with the wrong size
233  if (mu.trackAddress().size() == RegionalMuonCand::kNumEmtfSubAddr) {
234  rawTrkAddr = (mu.trackSubAddress(RegionalMuonCand::kME1Seg) & 0x1) << emtfTrAddrMe1SegShift_ |
236  (mu.trackSubAddress(RegionalMuonCand::kME2Seg) & 0x1) << emtfTrAddrMe2SegShift_ |
238  (mu.trackSubAddress(RegionalMuonCand::kME3Seg) & 0x1) << emtfTrAddrMe3SegShift_ |
240  (mu.trackSubAddress(RegionalMuonCand::kME4Seg) & 0x1) << emtfTrAddrMe4SegShift_ |
242 
243  } else {
244  edm::LogWarning("L1T") << "EMTF muon track address map contains " << mu.trackAddress().size()
245  << " instead of the expected " << RegionalMuonCand::kNumEmtfSubAddr
246  << " subaddresses. Check the data format. Setting track address to 0.";
247  rawTrkAddr = 0;
248  }
249  } else if (tf == omtf_neg || tf == omtf_pos) {
250  // protection against a track address map with the wrong size
251  if (mu.trackAddress().size() == RegionalMuonCand::kNumOmtfSubAddr) {
252  rawTrkAddr = (mu.trackSubAddress(RegionalMuonCand::kLayers) & omtfTrAddrLayersMask_) << omtfTrAddrLayersShift_ |
254 
255  } else {
256  edm::LogWarning("L1T") << "OMTF muon track address map contains " << mu.trackAddress().size()
257  << " instead of the expected " << RegionalMuonCand::kNumOmtfSubAddr
258  << " subaddresses. Check the data format. Setting track address to 0.";
259  rawTrkAddr = 0;
260  }
261  } else {
262  rawTrkAddr = mu.trackAddress().at(0);
263  }
264 
265  return rawTrkAddr;
266 }
const int mu
Definition: Constants.h:22
Log< level::Warning, false > LogWarning

Member Data Documentation

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

Definition at line 36 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 37 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 41 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 42 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 47 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 50 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 63 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 61 of file RegionalMuonRawDigiTranslator.h.

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

Definition at line 62 of file RegionalMuonRawDigiTranslator.h.

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

Definition at line 66 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 67 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 68 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 69 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 70 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 71 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 72 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 73 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 64 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 65 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 46 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 48 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 51 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 55 of file RegionalMuonRawDigiTranslator.h.

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

Definition at line 54 of file RegionalMuonRawDigiTranslator.h.

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

Definition at line 57 of file RegionalMuonRawDigiTranslator.h.

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

Definition at line 58 of file RegionalMuonRawDigiTranslator.h.

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

Definition at line 56 of file RegionalMuonRawDigiTranslator.h.

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

Definition at line 90 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 89 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 77 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 76 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 75 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 80 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 79 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 78 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 83 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 82 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 81 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 86 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 85 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 84 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 88 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 87 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 38 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 39 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 40 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 93 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 92 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 95 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 94 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 43 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

constexpr unsigned l1t::RegionalMuonRawDigiTranslator::ptMask_ = 0x1FF
static
constexpr unsigned l1t::RegionalMuonRawDigiTranslator::ptShift_ = 0
static
constexpr unsigned l1t::RegionalMuonRawDigiTranslator::ptUnconstrainedMask_ = 0xFF
static

Definition at line 49 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 34 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 35 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 44 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 45 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 52 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().

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

Definition at line 53 of file RegionalMuonRawDigiTranslator.h.

Referenced by fillRegionalMuonCand().