File indexing completed on 2024-04-06 12:04:26
0001 #ifndef L1GCTINTERNEMCAND_H
0002 #define L1GCTINTERNEMCAND_H
0003
0004 #include <ostream>
0005 #include <string>
0006
0007 #include "DataFormats/L1CaloTrigger/interface/L1CaloEmCand.h"
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 class L1GctInternEmCand {
0019 public:
0020
0021 L1GctInternEmCand();
0022
0023
0024 L1GctInternEmCand(uint16_t data, bool iso, unsigned block, unsigned index, int16_t bx);
0025
0026
0027 L1GctInternEmCand(
0028 unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi, bool iso, unsigned block, unsigned index, int16_t bx);
0029
0030
0031 virtual ~L1GctInternEmCand();
0032
0033
0034 L1CaloRegionDetId regionId() const;
0035
0036
0037 std::string name() const;
0038
0039
0040 bool empty() const;
0041
0042
0043 uint16_t raw() const { return m_data; }
0044
0045
0046 unsigned rank() const { return m_data & 0x3f; }
0047
0048
0049 unsigned etaIndex() const { return (m_data >> 6) & 0x1f; }
0050
0051
0052 unsigned etaSign() const { return (m_data >> 10) & 0x1; }
0053
0054
0055 unsigned phiIndex() const { return (m_data >> 11) & 0x1f; }
0056
0057
0058 bool isolated() const { return m_iso; }
0059
0060
0061 unsigned capBlock() const { return m_captureBlock; }
0062
0063
0064 unsigned capIndex() const { return m_captureIndex; }
0065
0066
0067 int16_t bx() const { return m_bx; }
0068
0069
0070 int operator==(const L1GctInternEmCand& c) const {
0071 return ((m_data == c.raw() && m_iso == c.isolated()) || (this->empty() && c.empty()));
0072 }
0073
0074
0075 int operator!=(const L1GctInternEmCand& c) const {
0076 return ((m_data != c.raw() || m_iso != c.isolated()) && (!this->empty() || !c.empty()));
0077 }
0078
0079 private:
0080
0081 void construct(unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi);
0082
0083 private:
0084 uint16_t m_data;
0085 uint16_t m_captureBlock;
0086 uint8_t m_captureIndex;
0087 bool m_iso;
0088 int16_t m_bx;
0089 };
0090
0091 std::ostream& operator<<(std::ostream& s, const L1GctInternEmCand& cand);
0092
0093 #endif