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 showerFired(uint32_t shower_word, int fedId, int fwId);
22  static void generatePackedMuonDataWords(const Muon& mu,
23  uint32_t& raw_data_spare,
24  uint32_t& raw_data_00_31,
25  uint32_t& raw_data_32_63,
26  int fedId,
27  int fwId,
28  int muInBx);
29  static void generate64bitDataWord(
30  const Muon& mu, uint32_t& raw_data_spare, uint64_t& dataword, int fedId, int fwId, int muInBx);
31  static std::array<std::array<uint32_t, 4>, 2> getPackedShowerDataWords(const MuonShower& shower,
32  int fedId,
33  int fwId);
34  static int calcHwEta(const uint32_t& raw, unsigned absEtaShift, unsigned etaSignShift);
35 
36  static constexpr unsigned ptMask_ = 0x1FF;
37  static constexpr unsigned ptShift_ = 10;
38  static constexpr unsigned qualMask_ = 0xF;
39  static constexpr unsigned qualShift_ = 19;
40  static constexpr unsigned absEtaMask_ = 0xFF;
41  static constexpr unsigned absEtaShift_ = 21;
42  static constexpr unsigned absEtaAtVtxShift_ = 23;
43  static constexpr unsigned etaSignShift_ = 29;
44  static constexpr unsigned etaAtVtxSignShift_ = 31;
45  static constexpr unsigned phiMask_ = 0x3FF;
46  static constexpr unsigned phiShift_ = 11;
47  static constexpr unsigned phiAtVtxShift_ = 0;
48  static constexpr unsigned chargeShift_ = 2;
49  static constexpr unsigned chargeValidShift_ = 3;
50  static constexpr unsigned tfMuonIndexMask_ = 0x7F;
51  static constexpr unsigned tfMuonIndexShift_ = 4;
52  static constexpr unsigned isoMask_ = 0x3;
53  static constexpr unsigned isoShift_ = 0;
54  static constexpr unsigned dxyMask_ = 0x3;
55  static constexpr unsigned dxyShift_ = 30;
56  static constexpr unsigned ptUnconstrainedMask_ = 0xFF;
57  static constexpr unsigned ptUnconstrainedShift_ = 21;
58  static constexpr unsigned ptUnconstrainedIntermedidateShift_ = 0;
59  static constexpr unsigned showerShift_ = 29; // For Run-3
60  static constexpr unsigned absEtaMu1Shift_ = 13; // For Run-3
61  static constexpr unsigned etaMu1SignShift_ = 21; // For Run-3
62  static constexpr unsigned absEtaMu2Shift_ = 22; // For Run-3
63  static constexpr unsigned etaMu2SignShift_ = 30; // For Run-3
64  static constexpr int kUgmtFedId = 1402;
65  static constexpr int kUgtFedId = 1404;
66  static constexpr int kUgmtFwVersionUntil2016 = 0x4010000;
67  static constexpr int kUgtFwVersionUntil2016 = 0x10A6;
68  static constexpr int kUgmtFwVersionUntil2017 = 0x6000000;
69  static constexpr int kUgtFwVersionUntil2017 = 0x1120;
70  static constexpr int kUgmtFwVersionRun3Start = 0x6000001;
71  static constexpr int kUgtFwVersionUntilRun3Start = 0x1130;
72  static constexpr int kUgmtFwVersionFirstWithShowers = 0x7000000;
73  static constexpr int kUgtFwVersionFirstWithShowers = 0x113B;
74  static constexpr int kUgmtFwVersionShowersFrom2023 = 0x8000000;
75  static constexpr int kUgtFwVersionShowersFrom2023 = 0x1150;
76 
77  private:
78  static void fillMuonStableQuantities(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63);
79  static void fillMuonCoordinates2016(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63);
80  static void fillMuonCoordinatesFrom2017(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63);
81  static void fillMuonQuantitiesRun3(Muon& mu,
82  uint32_t raw_data_spare,
83  uint32_t raw_data_00_31,
84  uint32_t raw_data_32_63,
85  int muInBx,
86  bool wasSpecialMWGR = false);
87  static void fillIntermediateMuonQuantitiesRun3(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63);
88  static void generatePackedMuonDataWordsRun3(const Muon& mu,
89  int abs_eta,
90  int abs_eta_at_vtx,
91  uint32_t& raw_data_spare,
92  uint32_t& raw_data_00_31,
93  uint32_t& raw_data_32_63,
94  int muInBx,
95  bool wasSpecialMWGR = false);
96  };
97 } // namespace l1t
98 
99 #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 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 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_