File indexing completed on 2024-04-06 12:04:26
0001 #ifndef L1GCTEMCAND_H
0002 #define L1GCTEMCAND_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 #include "DataFormats/L1CaloTrigger/interface/L1CaloEmCand.h"
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 class L1GctEmCand : public L1GctCand {
0022 public:
0023
0024 L1GctEmCand();
0025
0026
0027 L1GctEmCand(uint16_t rawData, bool iso);
0028
0029
0030 L1GctEmCand(uint16_t rawData, bool iso, uint16_t block, uint16_t index, int16_t bx);
0031
0032
0033
0034 L1GctEmCand(unsigned rank, unsigned phi, unsigned eta, bool iso);
0035
0036
0037
0038 L1GctEmCand(unsigned rank, unsigned phi, unsigned eta, bool iso, uint16_t block, uint16_t index, int16_t bx);
0039
0040
0041 L1GctEmCand(L1CaloEmCand& c);
0042
0043
0044 ~L1GctEmCand() override;
0045
0046
0047 L1CaloRegionDetId regionId() const override;
0048
0049
0050 std::string name() const;
0051
0052
0053 bool empty() const override { return (rank() == 0); }
0054
0055
0056 uint16_t raw() const { return m_data; }
0057
0058
0059 unsigned rank() const override { return m_data & 0x3f; }
0060
0061
0062 unsigned etaIndex() const override { return (m_data >> 6) & 0xf; }
0063
0064
0065 unsigned etaSign() const override { return (m_data >> 9) & 0x1; }
0066
0067
0068 unsigned phiIndex() const override { return (m_data >> 10) & 0x1f; }
0069
0070
0071 bool isolated() const { return m_iso; }
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 L1GctEmCand& c) const {
0084 return ((m_data == c.raw() && m_iso == c.isolated()) || (this->empty() && c.empty()));
0085 }
0086
0087
0088 int operator!=(const L1GctEmCand& c) const { return !(*this == c); }
0089
0090 private:
0091
0092 void construct(unsigned rank, unsigned eta, unsigned phi);
0093
0094 private:
0095 uint16_t m_data;
0096 bool m_iso;
0097 uint16_t m_captureBlock;
0098 uint8_t m_captureIndex;
0099 int16_t m_bx;
0100 };
0101
0102 std::ostream& operator<<(std::ostream& s, const L1GctEmCand& cand);
0103
0104 #endif