00001 #ifndef L1GCTINTERNEMCAND_H
00002 #define L1GCTINTERNEMCAND_H
00003
00004 #include <ostream>
00005 #include <string>
00006
00007
00008 #include "DataFormats/L1CaloTrigger/interface/L1CaloEmCand.h"
00009
00020 class L1GctInternEmCand {
00021 public:
00022
00024 L1GctInternEmCand();
00025
00027 L1GctInternEmCand(uint16_t data, bool iso, unsigned block, unsigned index, int16_t bx);
00028
00029
00030 L1GctInternEmCand(unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi, bool iso, unsigned block, unsigned index, int16_t bx);
00031
00033 virtual ~L1GctInternEmCand();
00034
00036 L1CaloRegionDetId regionId() const;
00037
00039 std::string name() const;
00040
00042 bool empty() const;
00043
00045 uint16_t raw() const { return m_data; }
00046
00048 unsigned rank() const { return m_data & 0x3f; }
00049
00051 unsigned etaIndex() const { return (m_data>>6) & 0x1f; }
00052
00054 unsigned etaSign() const { return (m_data>>10) & 0x1; }
00055
00057 unsigned phiIndex() const { return (m_data>>11) & 0x1f; }
00058
00060 bool isolated() const { return m_iso; }
00061
00063 unsigned capBlock() const { return m_captureBlock; }
00064
00066 unsigned capIndex() const { return m_captureIndex; }
00067
00069 int16_t bx() const { return m_bx; }
00070
00072 int operator==(const L1GctInternEmCand& c) const { return ((m_data==c.raw() && m_iso==c.isolated())
00073 || (this->empty() && c.empty())); }
00074
00076 int operator!=(const L1GctInternEmCand& c) const { return ((m_data!=c.raw() || m_iso!=c.isolated())
00077 && (!this->empty() || !c.empty())); }
00078
00079 private:
00080
00081
00082 void construct(unsigned rank, unsigned eta, unsigned etaSgn, unsigned phi);
00083
00084 private:
00085
00086 uint16_t m_data;
00087 uint16_t m_captureBlock;
00088 uint8_t m_captureIndex;
00089 bool m_iso;
00090 int16_t m_bx;
00091
00092 };
00093
00094
00095 std::ostream& operator<<(std::ostream& s, const L1GctInternEmCand& cand);
00096
00097
00098
00099 #endif