File indexing completed on 2023-10-25 09:39:14
0001 #ifndef L1CALOMIPQUIETREGION_H
0002 #define L1CALOMIPQUIETREGION_H
0003
0004 #include <ostream>
0005
0006 #include "DataFormats/L1CaloTrigger/interface/L1CaloRegionDetId.h"
0007
0008
0009
0010
0011
0012
0013
0014
0015 class L1CaloMipQuietRegion {
0016 public:
0017
0018
0019
0020 L1CaloMipQuietRegion();
0021
0022
0023 L1CaloMipQuietRegion(bool mip, bool quiet, unsigned crate, unsigned card, unsigned rgn, int16_t bx);
0024
0025
0026 L1CaloMipQuietRegion(bool mip, bool quiet, unsigned ieta, unsigned iphi, int16_t bx = 0);
0027
0028
0029 ~L1CaloMipQuietRegion() {}
0030
0031
0032
0033
0034 bool operator==(const L1CaloMipQuietRegion& rhs) const;
0035
0036
0037 bool operator!=(const L1CaloMipQuietRegion& rhs) const { return !(*this == rhs); }
0038
0039
0040
0041 uint8_t raw() const { return m_data; }
0042
0043 bool mip() const { return (m_data & 0x1) != 0; }
0044
0045 bool quiet() const { return ((m_data >> 1) & 0x1) != 0; }
0046
0047 int16_t bx() const { return m_bx; }
0048
0049
0050
0051 void setMip(bool mip) { mip ? m_data |= 1 : m_data &= ~1; }
0052
0053 void setQuiet(bool quiet) { quiet ? m_data |= 2 : m_data &= ~2; }
0054
0055 void setBx(int16_t bx) { m_bx = bx; }
0056
0057
0058
0059 L1CaloRegionDetId id() const { return m_id; }
0060
0061 unsigned rctCrate() const { return m_id.rctCrate(); }
0062
0063 unsigned rctCard() const { return m_id.rctCard(); }
0064
0065 unsigned rctRegionIndex() const { return m_id.rctRegion(); }
0066
0067 unsigned rctEta() const { return m_id.rctEta(); }
0068
0069 unsigned rctPhi() const { return m_id.rctPhi(); }
0070
0071 unsigned gctEta() const { return m_id.ieta(); }
0072
0073 unsigned gctPhi() const { return m_id.iphi(); }
0074
0075
0076
0077
0078 bool empty() const { return false; }
0079
0080
0081 void reset() {
0082 m_data = 0;
0083 m_bx = 0;
0084 }
0085
0086 private:
0087
0088
0089 L1CaloRegionDetId m_id;
0090
0091 uint8_t m_data;
0092
0093 int16_t m_bx;
0094
0095
0096
0097
0098 void pack(bool mip, bool quiet) { m_data = (mip ? 1 : 0) | (quiet ? 2 : 0); }
0099 };
0100
0101
0102 std::ostream& operator<<(std::ostream& os, const L1CaloMipQuietRegion& rhs);
0103
0104 #endif