CMS 3D CMS Logo

L1GctJet.h
Go to the documentation of this file.
1 #ifndef L1GCTJET_H_
2 #define L1GCTJET_H_
3 
4 #include <functional>
5 #include <vector>
6 #include <ostream>
7 #include <memory>
8 
10 #include <cstdint>
11 
23 class L1GctJetCand;
25 
26 class L1GctJet {
27 public:
28  //Statics
30 
31  //Typedefs
32  typedef std::shared_ptr<L1GctJetEtCalibrationLut> lutPtr;
33 
34  //Constructors/destructors
35  L1GctJet(const uint16_t rawsum = 0,
36  const unsigned eta = 0,
37  const unsigned phi = 0,
38  const bool overFlow = false,
39  const bool forwardJet = true,
40  const bool tauVeto = true,
41  const int16_t bx = 0);
42  ~L1GctJet();
43 
44  // set rawsum and position bits
45  void setRawsum(const uint16_t rawsum) {
48  }
49  void setDetId(const L1CaloRegionDetId detId) { m_id = detId; }
50  void setOverFlow(const bool overFlow) { m_overFlow = overFlow; }
51  void setTauVeto(const bool tauVeto) { m_tauVeto = tauVeto; }
52  void setForward(const bool forward) { m_forwardJet = forward; }
53  void setBx(const int16_t bx) { m_bx = bx; }
54 
55  // get rawsum and position bits
56  uint16_t rawsum() const { return m_rawsum; }
57  L1CaloRegionDetId id() const { return m_id(); }
58  bool tauVeto() const { return m_tauVeto; }
59 
61  bool overFlow() const { return m_overFlow; }
62 
64  bool isTauJet() const { return (!m_forwardJet && !m_tauVeto); }
65 
67  bool isCentralJet() const { return (!m_forwardJet && m_tauVeto); }
68 
70  bool isForwardJet() const { return m_forwardJet; }
71 
73  bool isNullJet() const { return ((m_rawsum == 0) && (globalEta() == 0) && (globalPhi() == 0)); }
74 
75  friend std::ostream& operator<<(std::ostream& os, const L1GctJet& cand);
76 
78  bool operator==(const L1GctJet& cand) const;
79 
81  bool operator!=(const L1GctJet& cand) const;
82 
84  void setupJet(const uint16_t rawsum,
85  const unsigned eta,
86  const unsigned phi,
87  const bool overFlow,
88  const bool forwardJet,
89  const bool tauVeto = true,
90  const int16_t bx = 0);
91 
93  unsigned globalEta() const { return m_id.ieta(); }
94 
96  unsigned globalPhi() const { return m_id.iphi(); }
97 
99  unsigned rctEta() const { return m_id.rctEta(); }
100 
102  unsigned rctPhi() const { return m_id.rctPhi(); }
103 
105  unsigned hwEta() const;
106 
108  unsigned hwPhi() const;
109 
111  int16_t bx() const { return m_bx; }
112 
114  L1GctJetCand jetCand(const lutPtr lut) const;
115  L1GctJetCand jetCand(const std::vector<lutPtr>& luts) const;
116 
118  uint16_t rank(const lutPtr lut) const;
119  unsigned calibratedEt(const lutPtr lut) const;
120 
121 private:
122  uint16_t m_rawsum;
127  bool m_tauVeto;
128  int16_t m_bx;
129 
130  uint16_t lutValue(const lutPtr lut) const;
131 };
132 
133 std::ostream& operator<<(std::ostream& os, const L1GctJet& cand);
134 
135 #endif /*L1GCTJET_H_*/
unsigned hwEta() const
eta value as encoded in hardware at the GCT output
Definition: L1GctJet.cc:89
bool m_tauVeto
Definition: L1GctJet.h:127
unsigned rctPhi() const
phi value in global CMS coordinates
Definition: L1GctJet.h:102
uint16_t rawsum() const
Definition: L1GctJet.h:56
void setupJet(const uint16_t rawsum, const unsigned eta, const unsigned phi, const bool overFlow, const bool forwardJet, const bool tauVeto=true, const int16_t bx=0)
Setup an existing jet all in one go.
Definition: L1GctJet.cc:72
unsigned globalEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:93
void setRawsum(const uint16_t rawsum)
Definition: L1GctJet.h:45
Jet Et calibration LUT.
unsigned calibratedEt(const lutPtr lut) const
Definition: L1GctJet.cc:117
std::ostream & operator<<(std::ostream &os, const L1GctJet &cand)
Definition: L1GctJet.cc:22
bool operator==(const L1GctJet &cand) const
test whether two jets are the same
Definition: L1GctJet.cc:47
Level-1 Trigger jet candidate.
Definition: L1GctJetCand.h:17
~L1GctJet()
Definition: L1GctJet.cc:20
L1GctJetCand jetCand(const lutPtr lut) const
Functions to convert from internal format to external jet candidates at the output of the jetFinder...
Definition: L1GctJet.cc:102
bool tauVeto() const
Definition: L1GctJet.h:58
unsigned ieta() const
global eta index (0-21)
unsigned rctEta() const
return local RCT eta index (0-10)
void setOverFlow(const bool overFlow)
Definition: L1GctJet.h:50
A Level-1 jet candidate, used within GCT emulation.
Definition: L1GctJet.h:26
void setBx(const int16_t bx)
Definition: L1GctJet.h:53
void setDetId(const L1CaloRegionDetId detId)
Definition: L1GctJet.h:49
int16_t m_bx
Definition: L1GctJet.h:128
bool isNullJet() const
test whether this jet candidate has been filled
Definition: L1GctJet.h:73
uint16_t rank(const lutPtr lut) const
The two separate Lut outputs.
Definition: L1GctJet.cc:115
L1GctJet(const uint16_t rawsum=0, const unsigned eta=0, const unsigned phi=0, const bool overFlow=false, const bool forwardJet=true, const bool tauVeto=true, const int16_t bx=0)
Definition: L1GctJet.cc:6
unsigned rctEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:99
bool isCentralJet() const
test whether this jet candidate is a (non-tau) central jet
Definition: L1GctJet.h:67
bool isTauJet() const
test whether this jet candidate is a valid tau jet
Definition: L1GctJet.h:64
uint16_t m_rawsum
Definition: L1GctJet.h:122
void setForward(const bool forward)
Definition: L1GctJet.h:52
bool m_forwardJet
Definition: L1GctJet.h:126
void setTauVeto(const bool tauVeto)
Definition: L1GctJet.h:51
unsigned globalPhi() const
phi value in global CMS coordinates
Definition: L1GctJet.h:96
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:124
unsigned rctPhi() const
return local RCT phi index (0-1)
uint16_t lutValue(const lutPtr lut) const
Definition: L1GctJet.cc:120
unsigned hwPhi() const
phi value as encoded in hardware at the GCT output
Definition: L1GctJet.cc:96
numberOfBits
Definition: L1GctJet.h:29
unsigned iphi() const
global phi index (0-17)
bool m_overFlow
Definition: L1GctJet.h:125
bool isForwardJet() const
test whether this jet candidate is a forward jet
Definition: L1GctJet.h:70
int16_t bx() const
the bunch crossing number
Definition: L1GctJet.h:111
bool overFlow() const
get overflow
Definition: L1GctJet.h:61
L1CaloRegionDetId id() const
Definition: L1GctJet.h:57
bool operator!=(const L1GctJet &cand) const
test whether two jets are different
Definition: L1GctJet.cc:60
std::shared_ptr< L1GctJetEtCalibrationLut > lutPtr
Definition: L1GctJet.h:32
friend std::ostream & operator<<(std::ostream &os, const L1GctJet &cand)
Definition: L1GctJet.cc:22