CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GctJet.h
Go to the documentation of this file.
1 #ifndef L1GCTJET_H_
2 #define L1GCTJET_H_
3 
4 #include <boost/cstdint.hpp> //for uint16_t
5 #include <functional>
6 #include <vector>
7 #include <ostream>
8 
10 
22 #include "boost/shared_ptr.hpp"
23 
24 class L1GctJetCand;
26 
27 class L1GctJet
28 {
29 
30 public:
31  //Statics
32  enum numberOfBits {
35  };
36 
37  //Typedefs
38  typedef boost::shared_ptr<L1GctJetEtCalibrationLut> lutPtr;
39 
40  //Constructors/destructors
41  L1GctJet(const uint16_t rawsum=0, const unsigned eta=0, const unsigned phi=0, const bool overFlow=false,
42  const bool forwardJet=true, const bool tauVeto=true, const int16_t bx=0);
43  ~L1GctJet();
44 
45  // set rawsum and position bits
46  void setRawsum(const uint16_t rawsum) { m_rawsum = rawsum & kRawsumMaxValue; m_overFlow |= (rawsum > kRawsumMaxValue); }
47  void setDetId(const L1CaloRegionDetId detId) { m_id = detId; }
48  void setOverFlow(const bool overFlow) { m_overFlow = overFlow; }
49  void setTauVeto(const bool tauVeto) { m_tauVeto = tauVeto; }
50  void setForward(const bool forward) { m_forwardJet = forward; }
51  void setBx(const int16_t bx) { m_bx = bx; }
52 
53  // get rawsum and position bits
54  uint16_t rawsum()const { return m_rawsum; }
55  L1CaloRegionDetId id() const { return m_id(); }
56  bool tauVeto()const { return m_tauVeto; }
57 
59  bool overFlow() const { return m_overFlow; }
60 
62  bool isTauJet() const { return (!m_forwardJet && !m_tauVeto); }
63 
65  bool isCentralJet() const { return (!m_forwardJet && m_tauVeto); }
66 
68  bool isForwardJet() const { return m_forwardJet; }
69 
71  bool isNullJet() const { return ((m_rawsum==0) && (globalEta()==0) && (globalPhi()==0)); }
72 
73  friend std::ostream& operator << (std::ostream& os, const L1GctJet& cand);
74 
76  bool operator== (const L1GctJet& cand) const;
77 
79  bool operator!= (const L1GctJet& cand) const;
80 
82  void setupJet(const uint16_t rawsum, const unsigned eta, const unsigned phi, const bool overFlow,
83  const bool forwardJet, const bool tauVeto=true, const int16_t bx=0);
84 
86  unsigned globalEta() const { return m_id.ieta(); }
87 
89  unsigned globalPhi() const { return m_id.iphi(); }
90 
92  unsigned rctEta() const { return m_id.rctEta(); }
93 
95  unsigned rctPhi() const { return m_id.rctPhi(); }
96 
98  unsigned hwEta() const;
99 
101  unsigned hwPhi() const;
102 
104  int16_t bx() const { return m_bx; }
105 
107  L1GctJetCand jetCand(const lutPtr lut) const;
108  L1GctJetCand jetCand(const std::vector<lutPtr> luts) const;
109 
111  uint16_t rank(const lutPtr lut) const;
112  unsigned calibratedEt(const lutPtr lut) const;
113 
114 
115  private:
116 
117  uint16_t m_rawsum;
122  bool m_tauVeto;
123  int16_t m_bx;
124 
125  uint16_t lutValue (const lutPtr lut) const;
126 
127 };
128 
129 std::ostream& operator << (std::ostream& os, const L1GctJet& cand);
130 
131 #endif /*L1GCTJET_H_*/
bool m_tauVeto
Definition: L1GctJet.h:122
bool tauVeto() const
Definition: L1GctJet.h:56
unsigned hwEta() const
eta value as encoded in hardware at the GCT output
Definition: L1GctJet.cc:79
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:66
void setRawsum(const uint16_t rawsum)
Definition: L1GctJet.h:46
unsigned ieta() const
global eta index (0-21)
Jet Et calibration LUT.
Level-1 Trigger jet candidate.
Definition: L1GctJetCand.h:18
unsigned rctPhi() const
return local RCT phi index (0-1)
unsigned rctEta() const
return local RCT eta index (0-10)
~L1GctJet()
Definition: L1GctJet.cc:19
T eta() const
void setOverFlow(const bool overFlow)
Definition: L1GctJet.h:48
unsigned hwPhi() const
phi value as encoded in hardware at the GCT output
Definition: L1GctJet.cc:87
A Level-1 jet candidate, used within GCT emulation.
Definition: L1GctJet.h:27
uint16_t rank(const lutPtr lut) const
The two separate Lut outputs.
Definition: L1GctJet.cc:108
void setBx(const int16_t bx)
Definition: L1GctJet.h:51
uint16_t rawsum() const
Definition: L1GctJet.h:54
void setDetId(const L1CaloRegionDetId detId)
Definition: L1GctJet.h:47
int16_t m_bx
Definition: L1GctJet.h:123
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:8
bool isTauJet() const
test whether this jet candidate is a valid tau jet
Definition: L1GctJet.h:62
uint16_t m_rawsum
Definition: L1GctJet.h:117
void setForward(const bool forward)
Definition: L1GctJet.h:50
bool isNullJet() const
test whether this jet candidate has been filled
Definition: L1GctJet.h:71
tuple lut
Definition: lumiPlot.py:244
bool operator==(const L1GctJet &cand) const
test whether two jets are the same
Definition: L1GctJet.cc:39
bool m_forwardJet
Definition: L1GctJet.h:121
void setTauVeto(const bool tauVeto)
Definition: L1GctJet.h:49
unsigned calibratedEt(const lutPtr lut) const
Definition: L1GctJet.cc:113
int16_t bx() const
the bunch crossing number
Definition: L1GctJet.h:104
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:119
unsigned globalPhi() const
phi value in global CMS coordinates
Definition: L1GctJet.h:89
uint16_t lutValue(const lutPtr lut) const
Definition: L1GctJet.cc:119
unsigned globalEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:86
boost::shared_ptr< L1GctJetEtCalibrationLut > lutPtr
Definition: L1GctJet.h:38
bool operator!=(const L1GctJet &cand) const
test whether two jets are different
Definition: L1GctJet.cc:53
numberOfBits
Definition: L1GctJet.h:32
L1CaloRegionDetId id() const
Definition: L1GctJet.h:55
bool m_overFlow
Definition: L1GctJet.h:120
bool overFlow() const
get overflow
Definition: L1GctJet.h:59
unsigned rctPhi() const
phi value in global CMS coordinates
Definition: L1GctJet.h:95
unsigned iphi() const
global phi index (0-17)
bool isForwardJet() const
test whether this jet candidate is a forward jet
Definition: L1GctJet.h:68
unsigned rctEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:92
bool isCentralJet() const
test whether this jet candidate is a (non-tau) central jet
Definition: L1GctJet.h:65
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:94
friend std::ostream & operator<<(std::ostream &os, const L1GctJet &cand)
Definition: L1GctJet.cc:23
Definition: DDAxes.h:10