00001 #include "CondFormats/L1TObjects/interface/L1GctChannelMask.h" 00002 00003 L1GctChannelMask::L1GctChannelMask() { 00004 for (unsigned i=0; i<18; ++i) { 00005 emCrateMask_[i] = false; 00006 } 00007 for (unsigned ieta=0; ieta<22; ++ieta) { 00008 for (unsigned iphi=0; iphi<18; ++iphi) { 00009 regionMask_[ieta][iphi] = false; 00010 } 00011 } 00012 for (unsigned i=0; i<22; ++i) { 00013 tetMask_[i] = false; 00014 metMask_[i] = false; 00015 htMask_[i] = false; 00016 mhtMask_[i] = false; 00017 } 00018 } 00019 00020 00021 void L1GctChannelMask::maskEmCrate(unsigned crate) { 00022 if (crate < 18) emCrateMask_[crate] = true; 00023 } 00024 00025 00026 void L1GctChannelMask::maskRegion(unsigned ieta, unsigned iphi) { 00027 if (ieta < 22 && iphi < 18) regionMask_[ieta][iphi] = true; 00028 } 00029 00030 00031 void L1GctChannelMask::maskTotalEt(unsigned ieta) { 00032 if (ieta < 22) tetMask_[ieta] = true; 00033 } 00034 00035 00036 void L1GctChannelMask::maskMissingEt(unsigned ieta) { 00037 if (ieta < 22) metMask_[ieta] = true; 00038 } 00039 00040 00041 void L1GctChannelMask::maskTotalHt(unsigned ieta) { 00042 if (ieta < 22) htMask_[ieta] = true; 00043 } 00044 00045 00046 void L1GctChannelMask::maskMissingHt(unsigned ieta) { 00047 if (ieta < 22) mhtMask_[ieta] = true; 00048 } 00049 00050 00051 bool L1GctChannelMask::emCrateMask(unsigned crate) const { 00052 if (crate < 18) { return emCrateMask_[crate]; } 00053 else return true; 00054 } 00055 00056 00057 bool L1GctChannelMask::regionMask(unsigned ieta, unsigned iphi) const { 00058 if (ieta < 22 && iphi < 18) { return regionMask_[ieta][iphi]; } 00059 else return true; 00060 } 00061 00062 00063 bool L1GctChannelMask::totalEtMask(unsigned ieta) const { 00064 if (ieta < 22) return tetMask_[ieta]; 00065 else return true; 00066 } 00067 00068 00069 bool L1GctChannelMask::missingEtMask(unsigned ieta) const { 00070 if (ieta < 22) return metMask_[ieta]; 00071 else return true; 00072 } 00073 00074 00075 bool L1GctChannelMask::totalHtMask(unsigned ieta) const { 00076 if (ieta < 22) return htMask_[ieta]; 00077 else return true; 00078 } 00079 00080 00081 bool L1GctChannelMask::missingHtMask(unsigned ieta) const { 00082 if (ieta < 22) return mhtMask_[ieta]; 00083 else return true; 00084 } 00085 00086 std::ostream& operator << (std::ostream& os, const L1GctChannelMask obj) { 00087 os << "L1GctChannelMask :" << std::endl; 00088 // os << " EM crate mask = " << obj.emCrateMask_ << std::endl; 00089 // os << " EtTot mask = " << obj.tetMask_ << std::endl; 00090 // os << " EtMiss mask = " << obj.metMask_ << std::endl; 00091 // os << " HtTot mask = " << obj.htMask_ << std::endl; 00092 // os << " HtMiss mask = " << obj.mhtMask_ << std::endl; 00093 for (unsigned ieta=0; ieta<22; ++ieta) { 00094 for (unsigned iphi=0; iphi<18; ++iphi) { 00095 if ( obj.regionMask(ieta, iphi) ) { 00096 os << " Region mask : " << ieta << ", " << iphi << std::endl; 00097 } 00098 } 00099 } 00100 return os; 00101 }