CMS 3D CMS Logo

L1GctChannelMask.cc
Go to the documentation of this file.
2 
4  for (unsigned i = 0; i < 18; ++i) {
5  emCrateMask_[i] = false;
6  }
7  for (unsigned ieta = 0; ieta < 22; ++ieta) {
8  for (unsigned iphi = 0; iphi < 18; ++iphi) {
9  regionMask_[ieta][iphi] = false;
10  }
11  }
12  for (unsigned i = 0; i < 22; ++i) {
13  tetMask_[i] = false;
14  metMask_[i] = false;
15  htMask_[i] = false;
16  mhtMask_[i] = false;
17  }
18 }
19 
21  if (crate < 18)
22  emCrateMask_[crate] = true;
23 }
24 
25 void L1GctChannelMask::maskRegion(unsigned ieta, unsigned iphi) {
26  if (ieta < 22 && iphi < 18)
27  regionMask_[ieta][iphi] = true;
28 }
29 
31  if (ieta < 22)
32  tetMask_[ieta] = true;
33 }
34 
36  if (ieta < 22)
37  metMask_[ieta] = true;
38 }
39 
41  if (ieta < 22)
42  htMask_[ieta] = true;
43 }
44 
46  if (ieta < 22)
47  mhtMask_[ieta] = true;
48 }
49 
50 bool L1GctChannelMask::emCrateMask(unsigned crate) const {
51  if (crate < 18) {
52  return emCrateMask_[crate];
53  } else
54  return true;
55 }
56 
57 bool L1GctChannelMask::regionMask(unsigned ieta, unsigned iphi) const {
58  if (ieta < 22 && iphi < 18) {
59  return regionMask_[ieta][iphi];
60  } else
61  return true;
62 }
63 
64 bool L1GctChannelMask::totalEtMask(unsigned ieta) const {
65  if (ieta < 22)
66  return tetMask_[ieta];
67  else
68  return true;
69 }
70 
71 bool L1GctChannelMask::missingEtMask(unsigned ieta) const {
72  if (ieta < 22)
73  return metMask_[ieta];
74  else
75  return true;
76 }
77 
78 bool L1GctChannelMask::totalHtMask(unsigned ieta) const {
79  if (ieta < 22)
80  return htMask_[ieta];
81  else
82  return true;
83 }
84 
85 bool L1GctChannelMask::missingHtMask(unsigned ieta) const {
86  if (ieta < 22)
87  return mhtMask_[ieta];
88  else
89  return true;
90 }
91 
92 std::ostream& operator<<(std::ostream& os, const L1GctChannelMask obj) {
93  os << "L1GctChannelMask :" << std::endl;
94 
95  // get masks without changing interface, sigh
96  unsigned emCrateMask(0), tetMask(0), metMask(0), htMask(0), mhtMask(0);
97  for (unsigned i = 0; i < 18; ++i) {
98  emCrateMask |= ((obj.emCrateMask(i) ? 1 : 0) << i);
99  }
100 
101  for (unsigned i = 0; i < 22; ++i) {
102  tetMask |= ((obj.totalEtMask(i) ? 1 : 0) << i);
103  metMask |= ((obj.missingEtMask(i) ? 1 : 0) << i);
104  htMask |= ((obj.totalHtMask(i) ? 1 : 0) << i);
105  mhtMask |= ((obj.missingHtMask(i) ? 1 : 0) << i);
106  }
107 
108  os << " EM crate mask = " << std::hex << emCrateMask << std::endl;
109  os << " EtTot mask = " << std::hex << tetMask << std::endl;
110  os << " EtMiss mask = " << std::hex << metMask << std::endl;
111  os << " HtTot mask = " << std::hex << htMask << std::endl;
112  os << " HtMiss mask = " << std::hex << mhtMask << std::endl;
113 
114  for (unsigned ieta = 0; ieta < 22; ++ieta) {
115  for (unsigned iphi = 0; iphi < 18; ++iphi) {
116  if (obj.regionMask(ieta, iphi)) {
117  os << " Region mask : " << std::dec << ieta << ", " << iphi << std::endl;
118  }
119  }
120  }
121  return os;
122 }
bool totalEtMask(unsigned ieta) const
void maskMissingEt(unsigned ieta)
mask eta range from missing Et sum
bool emCrateMask(unsigned crate) const
get EM masks for an RCT crate
void maskEmCrate(unsigned crate)
mask EM candidates from an RCT crate
void maskTotalHt(unsigned ieta)
mask eta range from total Ht sum
L1GctChannelMask()
default constructor sets all masks to false
bool regionMask(unsigned ieta, unsigned iphi) const
get region masks
void maskRegion(unsigned ieta, unsigned iphi)
mask a region
bool totalHtMask(unsigned ieta) const
bool regionMask_[22][18]
bool missingEtMask(unsigned ieta) const
void maskTotalEt(unsigned ieta)
mask eta range from total Et sum
bool missingHtMask(unsigned ieta) const
void maskMissingHt(unsigned ieta)
mask eta range from missing Ht sum
std::ostream & operator<<(std::ostream &os, const L1GctChannelMask obj)