CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  unsigned int fw,
18  int muInBx);
19  static void fillMuon(Muon& mu, uint32_t raw_data_spare, uint64_t dataword, int fed, unsigned int fw, int muInBx);
20  static void fillIntermediateMuon(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, unsigned int fw);
21  static bool showerFired(uint32_t shower_word, int fedId, unsigned 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<uint32_t, 4> getPackedShowerDataWords(const MuonShower& shower, int fedId, unsigned int fwId);
32  static int calcHwEta(const uint32_t& raw, unsigned absEtaShift, unsigned etaSignShift);
33 
34  static constexpr unsigned ptMask_ = 0x1FF;
35  static constexpr unsigned ptShift_ = 10;
36  static constexpr unsigned qualMask_ = 0xF;
37  static constexpr unsigned qualShift_ = 19;
38  static constexpr unsigned absEtaMask_ = 0xFF;
39  static constexpr unsigned absEtaShift_ = 21;
40  static constexpr unsigned absEtaAtVtxShift_ = 23;
41  static constexpr unsigned etaSignShift_ = 29;
42  static constexpr unsigned etaAtVtxSignShift_ = 31;
43  static constexpr unsigned phiMask_ = 0x3FF;
44  static constexpr unsigned phiShift_ = 11;
45  static constexpr unsigned phiAtVtxShift_ = 0;
46  static constexpr unsigned chargeShift_ = 2;
47  static constexpr unsigned chargeValidShift_ = 3;
48  static constexpr unsigned tfMuonIndexMask_ = 0x7F;
49  static constexpr unsigned tfMuonIndexShift_ = 4;
50  static constexpr unsigned isoMask_ = 0x3;
51  static constexpr unsigned isoShift_ = 0;
52  static constexpr unsigned dxyMask_ = 0x3;
53  static constexpr unsigned dxyShift_ = 30;
54  static constexpr unsigned ptUnconstrainedMask_ = 0xFF;
55  static constexpr unsigned ptUnconstrainedShift_ = 21;
56  static constexpr unsigned ptUnconstrainedIntermedidateShift_ = 0;
57  static constexpr unsigned showerShift_ = 29; // For Run-3
58  static constexpr unsigned absEtaMu1Shift_ = 13; // For Run-3
59  static constexpr unsigned etaMu1SignShift_ = 21; // For Run-3
60  static constexpr unsigned absEtaMu2Shift_ = 22; // For Run-3
61  static constexpr unsigned etaMu2SignShift_ = 30; // For Run-3
62 
63  private:
64  static void fillMuonStableQuantities(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63);
65  static void fillMuonCoordinates2016(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63);
66  static void fillMuonCoordinatesFrom2017(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63);
67  static void fillMuonQuantitiesRun3(Muon& mu,
68  uint32_t raw_data_spare,
69  uint32_t raw_data_00_31,
70  uint32_t raw_data_32_63,
71  int muInBx,
72  bool wasSpecialMWGR = false);
73  static void fillIntermediateMuonQuantitiesRun3(Muon& mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63);
74  static void generatePackedMuonDataWordsRun3(const Muon& mu,
75  int abs_eta,
76  int abs_eta_at_vtx,
77  uint32_t& raw_data_spare,
78  uint32_t& raw_data_00_31,
79  uint32_t& raw_data_32_63,
80  int muInBx,
81  bool wasSpecialMWGR = false);
82  };
83 } // namespace l1t
84 
85 #endif
static std::array< uint32_t, 4 > getPackedShowerDataWords(const MuonShower &shower, int fedId, unsigned int fwId)
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 unsigned dxyMask_
static constexpr unsigned tfMuonIndexShift_
static constexpr unsigned isoShift_
static constexpr unsigned absEtaAtVtxShift_
static int calcHwEta(const uint32_t &raw, unsigned absEtaShift, unsigned etaSignShift)
static constexpr unsigned qualMask_
static constexpr unsigned isoMask_
static void fillIntermediateMuon(Muon &mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63, unsigned int fw)
static constexpr unsigned qualShift_
static constexpr unsigned etaMu2SignShift_
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 unsigned absEtaMu1Shift_
static constexpr unsigned etaAtVtxSignShift_
const int mu
Definition: Constants.h:22
static constexpr unsigned chargeValidShift_
static constexpr unsigned phiAtVtxShift_
static constexpr unsigned ptShift_
Definition: Muon.h:21
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 void fillMuon(Muon &mu, uint32_t raw_data_spare, uint32_t raw_data_00_31, uint32_t raw_data_32_63, int fed, unsigned int fw, int muInBx)
static constexpr unsigned absEtaShift_
static void fillMuonCoordinates2016(Muon &mu, uint32_t raw_data_00_31, uint32_t raw_data_32_63)
static bool showerFired(uint32_t shower_word, int fedId, unsigned int fwId)
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 unsigned ptUnconstrainedShift_
static constexpr unsigned ptMask_
static constexpr unsigned tfMuonIndexMask_
static constexpr unsigned showerShift_