CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
20 
21 void L1GctChannelMask::maskEmCrate(unsigned crate) {
22  if (crate < 18) emCrateMask_[crate] = true;
23 }
24 
25 
26 void L1GctChannelMask::maskRegion(unsigned ieta, unsigned iphi) {
27  if (ieta < 22 && iphi < 18) regionMask_[ieta][iphi] = true;
28 }
29 
30 
31 void L1GctChannelMask::maskTotalEt(unsigned ieta) {
32  if (ieta < 22) tetMask_[ieta] = true;
33 }
34 
35 
36 void L1GctChannelMask::maskMissingEt(unsigned ieta) {
37  if (ieta < 22) metMask_[ieta] = true;
38 }
39 
40 
41 void L1GctChannelMask::maskTotalHt(unsigned ieta) {
42  if (ieta < 22) htMask_[ieta] = true;
43 }
44 
45 
46 void L1GctChannelMask::maskMissingHt(unsigned ieta) {
47  if (ieta < 22) mhtMask_[ieta] = true;
48 }
49 
50 
51 bool L1GctChannelMask::emCrateMask(unsigned crate) const {
52  if (crate < 18) { return emCrateMask_[crate]; }
53  else return true;
54 }
55 
56 
57 bool L1GctChannelMask::regionMask(unsigned ieta, unsigned iphi) const {
58  if (ieta < 22 && iphi < 18) { return regionMask_[ieta][iphi]; }
59  else return true;
60 }
61 
62 
63 bool L1GctChannelMask::totalEtMask(unsigned ieta) const {
64  if (ieta < 22) return tetMask_[ieta];
65  else return true;
66 }
67 
68 
69 bool L1GctChannelMask::missingEtMask(unsigned ieta) const {
70  if (ieta < 22) return metMask_[ieta];
71  else return true;
72 }
73 
74 
75 bool L1GctChannelMask::totalHtMask(unsigned ieta) const {
76  if (ieta < 22) return htMask_[ieta];
77  else return true;
78 }
79 
80 
81 bool L1GctChannelMask::missingHtMask(unsigned ieta) const {
82  if (ieta < 22) return mhtMask_[ieta];
83  else return true;
84 }
85 
86 std::ostream& operator << (std::ostream& os, const L1GctChannelMask obj) {
87  os << "L1GctChannelMask :" << std::endl;
88 
89  // get masks without changing interface, sigh
90  unsigned emCrateMask(0), tetMask(0), metMask(0), htMask(0), mhtMask(0);
91  for (unsigned i=0; i<18; ++i) {
92  emCrateMask |= ((obj.emCrateMask(i)?1:0)<<i);
93  }
94 
95  for (unsigned i=0; i<22; ++i) {
96  tetMask |= ((obj.totalEtMask(i)?1:0)<<i);
97  metMask |= ((obj.missingEtMask(i)?1:0)<<i);
98  htMask |= ((obj.totalHtMask(i)?1:0)<<i);
99  mhtMask |= ((obj.missingHtMask(i)?1:0)<<i);
100  }
101 
102  os << " EM crate mask = " << std::hex << emCrateMask << std::endl;
103  os << " EtTot mask = " << std::hex << tetMask << std::endl;
104  os << " EtMiss mask = " << std::hex << metMask << std::endl;
105  os << " HtTot mask = " << std::hex << htMask << std::endl;
106  os << " HtMiss mask = " << std::hex << mhtMask << std::endl;
107 
108  for (unsigned ieta=0; ieta<22; ++ieta) {
109  for (unsigned iphi=0; iphi<18; ++iphi) {
110  if ( obj.regionMask(ieta, iphi) ) {
111  os << " Region mask : " << std::dec << ieta << ", " << iphi << std::endl;
112  }
113  }
114  }
115  return os;
116 }
int i
Definition: DBlmapReader.cc:9
void maskMissingEt(unsigned ieta)
mask eta range from missing Et sum
bool totalHtMask(unsigned ieta) const
bool missingHtMask(unsigned ieta) const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
void maskEmCrate(unsigned crate)
mask EM candidates from an RCT crate
bool emCrateMask(unsigned crate) const
get EM masks for an RCT crate
bool regionMask(unsigned ieta, unsigned iphi) const
get region masks
void maskTotalHt(unsigned ieta)
mask eta range from total Ht sum
L1GctChannelMask()
default constructor sets all masks to false
void maskRegion(unsigned ieta, unsigned iphi)
mask a region
bool regionMask_[22][18]
void maskTotalEt(unsigned ieta)
mask eta range from total Et sum
bool totalEtMask(unsigned ieta) const
void maskMissingHt(unsigned ieta)
mask eta range from missing Ht sum
bool missingEtMask(unsigned ieta) const