File indexing completed on 2023-10-25 09:39:15
0001 #ifndef L1GCTJETCAND_H
0002 #define L1GCTJETCAND_H
0003
0004 #include <ostream>
0005 #include <string>
0006
0007 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctCand.h"
0008
0009 #include "DataFormats/L1CaloTrigger/interface/L1CaloRegionDetId.h"
0010
0011
0012
0013
0014
0015
0016
0017 class L1GctJetCand : public L1GctCand {
0018 public:
0019
0020 L1GctJetCand();
0021
0022
0023 L1GctJetCand(uint16_t rawData, bool isTau, bool isFor);
0024
0025
0026 L1GctJetCand(uint16_t rawData, bool isTau, bool isFor, uint16_t block, uint16_t index, int16_t bx);
0027
0028
0029
0030 L1GctJetCand(unsigned rank, unsigned phi, unsigned eta, bool isTau, bool isFor);
0031
0032
0033
0034 L1GctJetCand(
0035 unsigned rank, unsigned phi, unsigned eta, bool isTau, bool isFor, uint16_t block, uint16_t index, int16_t bx);
0036
0037
0038 ~L1GctJetCand() override;
0039
0040
0041 L1CaloRegionDetId regionId() const override;
0042
0043
0044 std::string name() const;
0045
0046
0047 bool empty() const override { return (rank() == 0); }
0048
0049
0050 uint16_t raw() const { return m_data; }
0051
0052
0053 unsigned rank() const override { return m_data & 0x3f; }
0054
0055
0056 unsigned etaIndex() const override { return (m_data >> 6) & 0xf; }
0057
0058
0059 unsigned etaSign() const override { return (m_data >> 9) & 0x1; }
0060
0061
0062 unsigned phiIndex() const override { return (m_data >> 10) & 0x1f; }
0063
0064
0065 bool isCentral() const { return (!m_isTau) && (!m_isFor); }
0066
0067
0068 bool isTau() const { return m_isTau; }
0069
0070
0071 bool isForward() const { return m_isFor; }
0072
0073
0074 unsigned capBlock() const { return m_captureBlock; }
0075
0076
0077 unsigned capIndex() const { return m_captureIndex; }
0078
0079
0080 int16_t bx() const { return m_bx; }
0081
0082
0083 int operator==(const L1GctJetCand& c) const {
0084 return ((m_data == c.raw() && m_isTau == c.isTau() && m_isFor == c.isForward()) || (this->empty() && c.empty()));
0085 }
0086
0087
0088 int operator!=(const L1GctJetCand& c) const { return !(*this == c); }
0089
0090 private:
0091 uint16_t m_data;
0092 bool m_isTau;
0093 bool m_isFor;
0094 uint16_t m_captureBlock;
0095 uint8_t m_captureIndex;
0096 int16_t m_bx;
0097 };
0098
0099 std::ostream& operator<<(std::ostream& s, const L1GctJetCand& cand);
0100
0101 #endif