CMS 3D CMS Logo

L1GctJet.cc
Go to the documentation of this file.
3 
5 
6 L1GctJet::L1GctJet(const uint16_t rawsum,
7  const unsigned eta,
8  const unsigned phi,
9  const bool overFlow,
10  const bool forwardJet,
11  const bool tauVeto,
12  const int16_t bx)
13  : m_rawsum(rawsum & kRawsumMaxValue),
14  m_id(eta, phi),
15  m_overFlow(overFlow || (rawsum > kRawsumMaxValue)),
16  m_forwardJet(forwardJet),
17  m_tauVeto(tauVeto || forwardJet),
18  m_bx(bx) {}
19 
21 
22 std::ostream& operator<<(std::ostream& os, const L1GctJet& cand) {
23  os << "L1 Gct jet";
24  os << " energy sum " << cand.m_rawsum;
25  if (cand.overFlow()) {
26  os << ", overflow bit set;";
27  }
28  os << " Eta " << cand.globalEta();
29  os << " Phi " << cand.globalPhi();
30  if (cand.isForwardJet()) {
31  os << ", Forward jet";
32  }
33  if (cand.isCentralJet()) {
34  os << ", Central jet";
35  }
36  if (cand.isTauJet()) {
37  os << ", Tau jet";
38  }
39  if (cand.isNullJet()) {
40  os << ", Null jet";
41  }
42 
43  return os;
44 }
45 
47 bool L1GctJet::operator==(const L1GctJet& cand) const {
48  bool result = true;
49  result &= (this->rawsum() == cand.rawsum());
50  result &= (this->overFlow() == cand.overFlow());
51  result &= (this->isForwardJet() == cand.isForwardJet());
52  result &= (this->tauVeto() == cand.tauVeto());
53  result &= (this->globalEta() == cand.globalEta());
54  result &= (this->globalPhi() == cand.globalPhi());
55  result |= (this->isNullJet() && cand.isNullJet());
56  return result;
57 }
58 
60 bool L1GctJet::operator!=(const L1GctJet& cand) const {
61  bool result = false;
62  result |= !(this->rawsum() == cand.rawsum());
63  result |= !(this->overFlow() == cand.overFlow());
64  result |= !(this->isForwardJet() == cand.isForwardJet());
65  result |= !(this->tauVeto() == cand.tauVeto());
66  result |= !(this->globalEta() == cand.globalEta());
67  result |= !(this->globalPhi() == cand.globalPhi());
68  result &= !(this->isNullJet() && cand.isNullJet());
69  return result;
70 }
71 
72 void L1GctJet::setupJet(const uint16_t rawsum,
73  const unsigned eta,
74  const unsigned phi,
75  const bool overFlow,
76  const bool forwardJet,
77  const bool tauVeto,
78  const int16_t bx) {
81  m_id = temp;
83  m_forwardJet = forwardJet;
84  m_tauVeto = tauVeto || forwardJet;
85  m_bx = bx;
86 }
87 
89 unsigned L1GctJet::hwEta() const {
90  // Force into 4 bits.
91  // Count eta bins separately for central and forward jets. Set MSB to indicate the Wheel
92  return (((m_id.rctEta() % 7) & 0x7) | (m_id.ieta() < 11 ? 0x8 : 0));
93 }
94 
96 unsigned L1GctJet::hwPhi() const {
97  // Force into 5 bits.
98  return m_id.iphi() & 0x1f;
99 }
100 
103  return L1GctJetCand(rank(lut), hwPhi(), hwEta(), isTauJet(), isForwardJet(), (uint16_t)0, (uint16_t)0, m_bx);
104 }
105 
107 L1GctJetCand L1GctJet::jetCand(const std::vector<lutPtr>& luts) const {
109  if (rctEta() < luts.size())
110  result = jetCand(luts.at(rctEta()));
111  return result;
112 }
113 
115 uint16_t L1GctJet::rank(const lutPtr lut) const { return lutValue(lut); }
116 
117 unsigned L1GctJet::calibratedEt(const lutPtr lut) const { return m_rawsum; }
118 
119 // internal function to find the lut contents for a jet
120 uint16_t L1GctJet::lutValue(const lutPtr lut) const {
121  uint16_t result;
122  if (m_overFlow) {
123  // Set output values to maximum
124  result = 0x3f;
125  } else {
126  unsigned addrBits = m_rawsum;
127  // Set the MSB for tau jets
128  if (!m_tauVeto && !m_forwardJet) {
130  }
131  uint16_t address = static_cast<uint16_t>(addrBits);
132  result = lut->lutValue(address);
133  }
134  return result;
135 }
L1GctJetEtCalibrationLut.h
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
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
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
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
L1CaloRegionDetId::ieta
unsigned ieta() const
global eta index (0-21)
Definition: L1CaloRegionDetId.h:37
L1GctJetEtCalibrationLut::JET_ENERGY_BITWIDTH
static const unsigned JET_ENERGY_BITWIDTH
Input bitwidth of jet energy; must be 10 or more.
Definition: L1GctJetEtCalibrationLut.h:32
L1GctJetCand.h
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::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
operator<<
std::ostream & operator<<(std::ostream &os, const L1GctJet &cand)
Definition: L1GctJet.cc:22
PVValHelper::phi
Definition: PVValidationHelpers.h:68
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:34
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::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
L1GctJet.h
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
L1GctJet::bx
int16_t bx() const
the bunch crossing number
Definition: L1GctJet.h:111
L1GctJet::m_tauVeto
bool m_tauVeto
Definition: L1GctJet.h:127
mps_fire.result
result
Definition: mps_fire.py:303
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::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::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