CMS 3D CMS Logo

MuonRawDigiTranslator.h
Go to the documentation of this file.
1 #ifndef MuonRawDigiTranslator_h
2 #define MuonRawDigiTranslator_h
3 
6 
7 #include <array>
8 
9 namespace l1t {
11  public:
12  static void fillMuon(Muon& mu,
13  uint32_t raw_data_spare,
14  uint32_t raw_data_00_31,
15  uint32_t raw_data_32_63,
16  int fed,
17  int fw,
18  int muInBx);
19  static void fillMuon(Muon& mu, uint32_t raw_data_spare, uint64_t dataword, int fed, int fw, int muInBx);
20  static void fillIntermediateMuon(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int fw);
21  static bool isFwVersionWithShowers(int fedId, int fwId);
22  static bool showerFired(uint32_t shower_word, int fedId, int fwId);
23  static void generatePackedMuonDataWords(const Muon& mu,
24  uint32_t& raw_data_spare,
25  uint32_t& raw_data_00_31,
26  uint32_t& raw_data_32_63,
27  int fedId,
28  int fwId,
29  int muInBx);
30  static void generate64bitDataWord(
31  const Muon& mu, uint32_t& raw_data_spare, uint64_t& dataword, int fedId, int fwId, int muInBx);
32  static std::array<std::array<uint32_t, 4>, 2> getPackedShowerDataWords(const MuonShower& shower,
33  int fedId,
34  int fwId);
35  static int calcHwEta(const uint32_t& raw, unsigned absEtaShift, unsigned etaSignShift);
36 
37  static constexpr unsigned ptMask_ = 0x1FF;
38  static constexpr unsigned ptShift_ = 10;
39  static constexpr unsigned qualMask_ = 0xF;
40  static constexpr unsigned qualShift_ = 19;
41  static constexpr unsigned absEtaMask_ = 0xFF;
42  static constexpr unsigned absEtaShift_ = 21;
43  static constexpr unsigned absEtaAtVtxShift_ = 23;
44  static constexpr unsigned etaSignShift_ = 29;
45  static constexpr unsigned etaAtVtxSignShift_ = 31;
46  static constexpr unsigned phiMask_ = 0x3FF;
47  static constexpr unsigned phiShift_ = 11;
48  static constexpr unsigned phiAtVtxShift_ = 0;
49  static constexpr unsigned chargeShift_ = 2;
50  static constexpr unsigned chargeValidShift_ = 3;
51  static constexpr unsigned tfMuonIndexMask_ = 0x7F;
52  static constexpr unsigned tfMuonIndexShift_ = 4;
53  static constexpr unsigned isoMask_ = 0x3;
54  static constexpr unsigned isoShift_ = 0;
55  static constexpr unsigned dxyMask_ = 0x3;
56  static constexpr unsigned dxyShift_ = 30;
57  static constexpr unsigned ptUnconstrainedMask_ = 0xFF;
58  static constexpr unsigned ptUnconstrainedShift_ = 21;
60  static constexpr unsigned showerShift_ = 29; // For Run-3
61  static constexpr unsigned absEtaMu1Shift_ = 13; // For Run-3
62  static constexpr unsigned etaMu1SignShift_ = 21; // For Run-3
63  static constexpr unsigned absEtaMu2Shift_ = 22; // For Run-3
64  static constexpr unsigned etaMu2SignShift_ = 30; // For Run-3
65  static constexpr int kUgmtFedId = 1402;
66  static constexpr int kUgtFedId = 1404;
67  static constexpr int kUgmtFwVersionUntil2016 = 0x4010000;
68  static constexpr int kUgtFwVersionUntil2016 = 0x10A6;
69  static constexpr int kUgmtFwVersionUntil2017 = 0x6000000;
70  static constexpr int kUgtFwVersionUntil2017 = 0x1120;
71  static constexpr int kUgmtFwVersionRun3Start = 0x6000001;
73  static constexpr int kUgmtFwVersionFirstWithShowers = 0x7000000;
75  static constexpr int kUgmtFwVersionShowersFrom2023 = 0x8000000;
77  0x8000001; // This fixed a miscommunication wrt the link used for the two loose shower bit
79 
80  private:
81  static void fillMuonStableQuantities(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63);
82  static void fillMuonCoordinates2016(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63);
83  static void fillMuonCoordinatesFrom2017(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63);
84  static void fillMuonQuantitiesRun3(Muon& mu,
85  uint32_t raw_data_spare,
86  uint32_t raw_data_00_31,
87  uint32_t raw_data_32_63,
88  int muInBx,
89  bool wasSpecialMWGR = false);
90  static void fillIntermediateMuonQuantitiesRun3(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63);
91  static void generatePackedMuonDataWordsRun3(const Muon& mu,
92  int abs_eta,
93  int abs_eta_at_vtx,
94  uint32_t& raw_data_spare,
95  uint32_t& raw_data_00_31,
96  uint32_t& raw_data_32_63,
97  int muInBx,
98  bool wasSpecialMWGR = false);
99  };
100 } // namespace l1t
101 
102 #endif
static constexpr int kUgtFwVersionUntil2016
static void fillMuonQuantitiesRun3(Muon &mu, uint32_t raw_data_spare, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int muInBx, bool wasSpecialMWGR=false)
static constexpr int kUgtFwVersionUntil2017
static constexpr unsigned dxyMask_
static constexpr unsigned tfMuonIndexShift_
static void fillMuon(Muon &mu, uint32_t raw_data_spare, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int fed, int fw, int muInBx)
static std::array< std::array< uint32_t, 4 >, 2 > getPackedShowerDataWords(const MuonShower &shower, int fedId, int fwId)
static constexpr unsigned isoShift_
static constexpr unsigned absEtaAtVtxShift_
static int calcHwEta(const uint32_t &raw, unsigned absEtaShift, unsigned etaSignShift)
static constexpr int kUgmtFedId
delete x;
Definition: CaloConfig.h:22
static constexpr unsigned qualMask_
static constexpr unsigned isoMask_
static constexpr unsigned qualShift_
static constexpr unsigned etaMu2SignShift_
static constexpr int kUgmtFwVersionFirstWithShowers
static void fillIntermediateMuon(Muon &mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int fw)
static constexpr int kUgmtFwVersionRun3Start
static constexpr unsigned ptUnconstrainedMask_
static void fillIntermediateMuonQuantitiesRun3(Muon &mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63)
static constexpr unsigned etaMu1SignShift_
static constexpr int kUgmtFwVersionUntil2016
static constexpr int kUgmtFwVersionShowersFrom2023
Definition: Muon.py:1
static constexpr int kUgtFedId
static constexpr unsigned absEtaMu1Shift_
static bool isFwVersionWithShowers(int fedId, int fwId)
static constexpr int kUgtFwVersionFirstWithShowers
static constexpr unsigned etaAtVtxSignShift_
static constexpr unsigned chargeValidShift_
static constexpr unsigned phiAtVtxShift_
static bool showerFired(uint32_t shower_word, int fedId, int fwId)
static constexpr unsigned ptShift_
static constexpr unsigned ptUnconstrainedIntermedidateShift_
static constexpr int kUgmtFwVersionShowersFrom2023_patched
static constexpr unsigned chargeShift_
static void fillMuonStableQuantities(Muon &mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63)
static void generatePackedMuonDataWords(const Muon &mu, uint32_t &raw_data_spare, uint32_t &raw_data_00_31, uint32_t &raw_data_32_63, int fedId, int fwId, int muInBx)
static constexpr unsigned etaSignShift_
static constexpr unsigned dxyShift_
unsigned long long uint64_t
Definition: Time.h:13
static void generate64bitDataWord(const Muon &mu, uint32_t &raw_data_spare, uint64_t &dataword, int fedId, int fwId, int muInBx)
static constexpr unsigned phiShift_
static constexpr unsigned phiMask_
static void fillMuonCoordinatesFrom2017(Muon &mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63)
static constexpr unsigned absEtaMu2Shift_
static constexpr unsigned absEtaShift_
static void fillMuonCoordinates2016(Muon &mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63)
static constexpr unsigned absEtaMask_
static void generatePackedMuonDataWordsRun3(const Muon &mu, int abs_eta, int abs_eta_at_vtx, uint32_t &raw_data_spare, uint32_t &raw_data_00_31, uint32_t &raw_data_32_63, int muInBx, bool wasSpecialMWGR=false)
static constexpr int kUgtFwVersionUntilRun3Start
static constexpr int kUgtFwVersionShowersFrom2023
static constexpr unsigned ptUnconstrainedShift_
static constexpr unsigned ptMask_
static constexpr int kUgmtFwVersionUntil2017
static constexpr unsigned tfMuonIndexMask_
static constexpr unsigned showerShift_