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_*/
L1GctJet::numberOfBits
numberOfBits
Definition: L1GctJet.h:29
L1GctJet::setRawsum
void setRawsum(const uint16_t rawsum)
Definition: L1GctJet.h:45
L1GctJetCand
Level-1 Trigger jet candidate.
Definition: L1GctJetCand.h:17
L1CaloRegionDetId::rctEta
unsigned rctEta() const
return local RCT eta index (0-10)
Definition: L1CaloRegionDetId.h:55
L1GctJet::lutPtr
std::shared_ptr< L1GctJetEtCalibrationLut > lutPtr
Definition: L1GctJet.h:32
L1GctJet::operator<<
friend std::ostream & operator<<(std::ostream &os, const L1GctJet &cand)
Definition: L1GctJet.cc:22
L1GctJet::rctEta
unsigned rctEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:99
L1GctJet::kRawsumMaxValue
Definition: L1GctJet.h:29
L1GctJet::rank
uint16_t rank(const lutPtr lut) const
The two separate Lut outputs.
Definition: L1GctJet.cc:115
L1GctJet::rawsum
uint16_t rawsum() const
Definition: L1GctJet.h:56
L1GctJet::globalEta
unsigned globalEta() const
eta value in global CMS coordinates
Definition: L1GctJet.h:93
L1GctJet::setForward
void setForward(const bool forward)
Definition: L1GctJet.h:52
L1GctJet::setBx
void setBx(const int16_t bx)
Definition: L1GctJet.h:53
L1CaloRegionDetId::ieta
unsigned ieta() const
global eta index (0-21)
Definition: L1CaloRegionDetId.h:37
L1GctJetEtCalibrationLut
Jet Et calibration LUT.
Definition: L1GctJetEtCalibrationLut.h:28
L1GctJet::setDetId
void setDetId(const L1CaloRegionDetId detId)
Definition: L1GctJet.h:49
L1CaloRegionDetId
Definition: L1CaloRegionDetId.h:18
L1GctJet::jetCand
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
PVValHelper::eta
Definition: PVValidationHelpers.h:69
L1GctJet::isCentralJet
bool isCentralJet() const
test whether this jet candidate is a (non-tau) central jet
Definition: L1GctJet.h:67
L1GctJet::operator==
bool operator==(const L1GctJet &cand) const
test whether two jets are the same
Definition: L1GctJet.cc:47
L1GctJet::lutValue
uint16_t lutValue(const lutPtr lut) const
Definition: L1GctJet.cc:120
L1GctJet::isTauJet
bool isTauJet() const
test whether this jet candidate is a valid tau jet
Definition: L1GctJet.h:64
L1GctJet::isNullJet
bool isNullJet() const
test whether this jet candidate has been filled
Definition: L1GctJet.h:73
L1CaloRegionDetId.h
L1GctJet::setTauVeto
void setTauVeto(const bool tauVeto)
Definition: L1GctJet.h:51
L1GctJet::m_bx
int16_t m_bx
Definition: L1GctJet.h:128
L1GctJet::hwPhi
unsigned hwPhi() const
phi value as encoded in hardware at the GCT output
Definition: L1GctJet.cc:96
L1GctJet::globalPhi
unsigned globalPhi() const
phi value in global CMS coordinates
Definition: L1GctJet.h:96
L1GctJet::m_rawsum
uint16_t m_rawsum
Definition: L1GctJet.h:122
L1CaloRegionDetId::iphi
unsigned iphi() const
global phi index (0-17)
Definition: L1CaloRegionDetId.h:40
cand
Definition: decayParser.h:32
L1GctJet::L1GctJet
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
L1GctJet::setOverFlow
void setOverFlow(const bool overFlow)
Definition: L1GctJet.h:50
L1GctJet::m_forwardJet
bool m_forwardJet
Definition: L1GctJet.h:126
L1GctJet::hwEta
unsigned hwEta() const
eta value as encoded in hardware at the GCT output
Definition: L1GctJet.cc:89
L1CaloRegionDetId::rctPhi
unsigned rctPhi() const
return local RCT phi index (0-1)
Definition: L1CaloRegionDetId.h:58
DDAxes::phi
L1GctJet::m_id
L1CaloRegionDetId m_id
region id, encodes eta and phi
Definition: L1GctJet.h:124
L1GctJet::isForwardJet
bool isForwardJet() const
test whether this jet candidate is a forward jet
Definition: L1GctJet.h:70
L1GctJet
A Level-1 jet candidate, used within GCT emulation.
Definition: L1GctJet.h:26
operator<<
std::ostream & operator<<(std::ostream &os, const L1GctJet &cand)
Definition: L1GctJet.cc:22
L1GctJet::id
L1CaloRegionDetId id() const
Definition: L1GctJet.h:57
L1GctJet::bx
int16_t bx() const
the bunch crossing number
Definition: L1GctJet.h:111
L1GctJet::m_tauVeto
bool m_tauVeto
Definition: L1GctJet.h:127
L1GctJet::m_overFlow
bool m_overFlow
Definition: L1GctJet.h:125
L1GctJet::calibratedEt
unsigned calibratedEt(const lutPtr lut) const
Definition: L1GctJet.cc:117
L1GctJet::tauVeto
bool tauVeto() const
Definition: L1GctJet.h:58
L1GctJet::kRawsumBitWidth
Definition: L1GctJet.h:29
L1GctJet::overFlow
bool overFlow() const
get overflow
Definition: L1GctJet.h:61
L1GctJet::operator!=
bool operator!=(const L1GctJet &cand) const
test whether two jets are different
Definition: L1GctJet.cc:60
L1GctJet::rctPhi
unsigned rctPhi() const
phi value in global CMS coordinates
Definition: L1GctJet.h:102
L1GctJet::setupJet
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
L1GctJet::~L1GctJet
~L1GctJet()
Definition: L1GctJet.cc:20