CMS 3D CMS Logo

L1GctMet.h
Go to the documentation of this file.
1 #ifndef L1GCTMET_H
2 #define L1GCTMET_H
3 
16 
17 class L1CaloEtScale;
18 class L1GctHtMissLut;
19 
20 class L1GctMet {
21 public:
23 
27 
28  struct etmiss_vec {
31  };
32 
33  L1GctMet(const unsigned ex = 0, const unsigned ey = 0, const metAlgoType algo = cordicTranslate);
35  ~L1GctMet();
36 
37  // return the missing Et as (magnitude, angle)
38  etmiss_vec metVector() const;
39 
40  // set and get the components
41  void setComponents(const unsigned ex, const unsigned ey) {
42  setExComponent(ex);
43  setEyComponent(ey);
44  }
45  void setComponents(const etComponentType& ex, const etComponentType& ey) {
46  setExComponent(ex);
47  setEyComponent(ey);
48  }
49  void setExComponent(const unsigned ex);
50  void setEyComponent(const unsigned ey);
51  void setExComponent(const etComponentType& ex) { m_exComponent = ex; }
52  void setEyComponent(const etComponentType& ey) { m_eyComponent = ey; }
55 
56  // set and get the algorithm type
58  metAlgoType getAlgoType() const { return m_algoType; }
59 
60  // set and get the bit shift
61  // This parameter can be used to scale the output relative to the input
62  void setBitShift(const unsigned nbits) { m_bitShift = nbits; }
63  unsigned getBitShift() const { return m_bitShift; }
64 
65  // get the LUT (used by L1GctPrintLuts)
66  const L1GctHtMissLut* getHtMissLut() const { return m_htMissLut; }
67 
68  // set and get the LUT parameters
69  void setEtScale(const L1CaloEtScale* const fn);
70  void setEtComponentLsb(const double lsb);
71 
72  const L1CaloEtScale* etScale() const;
73  const double componentLsb() const;
74 
75 private:
77 
78  struct etmiss_internal {
79  unsigned mag;
80  unsigned phi;
81  };
82 
85  const bool inputOverFlow() const;
86 
90  unsigned short m_bitShift;
91 
93 
94  etmiss_internal cordicTranslateAlgo(const int ex, const int ey, const bool of) const;
95  etmiss_internal useHtMissLutAlgo(const int ex, const int ey, const bool of) const;
96  etmiss_internal oldGctAlgo(const int ex, const int ey) const;
97  etmiss_internal floatingPointAlgo(const int ex, const int ey) const;
98 
99  int cordicShiftAndRoundBits(const int e, const unsigned nBits) const;
100 };
101 
102 #endif
etmiss_internal floatingPointAlgo(const int ex, const int ey) const
Definition: L1GctMet.cc:284
etmiss_vec metVector() const
Definition: L1GctMet.cc:16
void setComponents(const etComponentType &ex, const etComponentType &ey)
Definition: L1GctMet.h:45
etComponentType m_exComponent
Definition: L1GctMet.h:87
const L1GctHtMissLut * getHtMissLut() const
Definition: L1GctMet.h:66
void setEyComponent(const etComponentType &ey)
Definition: L1GctMet.h:52
L1GctMet(const unsigned ex=0, const unsigned ey=0, const metAlgoType algo=cordicTranslate)
Definition: L1GctMet.cc:7
~L1GctMet()
Definition: L1GctMet.cc:13
const double componentLsb() const
Definition: L1GctMet.cc:310
etMissPhiType phi
Definition: L1GctMet.h:30
LUT for conversion of Ht components x and y to magnitude and angle.
const bool inputOverFlow() const
Definition: L1GctMet.cc:314
Stores Level-1 missing Et in (Ex, Ey) form, allowing it to be retrieved as (magnitude, angle)
Definition: L1GctMet.h:20
void setComponents(const unsigned ex, const unsigned ey)
Definition: L1GctMet.h:41
void setEyComponent(const unsigned ey)
Definition: L1GctMet.cc:59
void setExComponent(const unsigned ex)
Definition: L1GctMet.cc:54
etmiss_internal cordicTranslateAlgo(const int ex, const int ey, const bool of) const
Definition: L1GctMet.cc:66
void setEtScale(const L1CaloEtScale *const fn)
Definition: L1GctMet.cc:302
etComponentShift
Definition: L1GctMet.h:76
unsigned getBitShift() const
Definition: L1GctMet.h:63
etmiss_internal oldGctAlgo(const int ex, const int ey) const
Definition: L1GctMet.cc:198
L1GctHtMissLut * m_htMissLut
Definition: L1GctMet.h:92
void setAlgoType(const metAlgoType algo)
Definition: L1GctMet.h:57
etComponentType m_eyComponent
Definition: L1GctMet.h:88
etmiss_internal useHtMissLutAlgo(const int ex, const int ey, const bool of) const
Definition: L1GctMet.cc:158
etComponentType getExComponent() const
Definition: L1GctMet.h:53
const L1CaloEtScale * etScale() const
Definition: L1GctMet.cc:308
void setExComponent(const etComponentType &ex)
Definition: L1GctMet.h:51
metAlgoType
Definition: L1GctMet.h:22
etMissType mag
Definition: L1GctMet.h:29
int cordicShiftAndRoundBits(const int e, const unsigned nBits) const
Definition: L1GctMet.cc:148
L1GctUnsignedInt< L1GctEtMiss::kEtMissNBits > etMissType
Definition: L1GctMet.h:24
metAlgoType m_algoType
Definition: L1GctMet.h:89
etComponentType getEyComponent() const
Definition: L1GctMet.h:54
metAlgoType getAlgoType() const
Definition: L1GctMet.h:58
void setBitShift(const unsigned nbits)
Definition: L1GctMet.h:62
L1GctWheelEnergyFpga::etComponentType etComponentType
Definition: L1GctMet.h:26
L1GctUnsignedInt< L1GctEtMiss::kEtMissPhiNBits > etMissPhiType
Definition: L1GctMet.h:25
unsigned short m_bitShift
Definition: L1GctMet.h:90
void setEtComponentLsb(const double lsb)
Definition: L1GctMet.cc:304