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 
20 void L1GctChannelMask::maskEmCrate(unsigned crate) {
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 }
L1GctChannelMask::emCrateMask_
bool emCrateMask_[18]
Definition: L1GctChannelMask.h:51
mps_fire.i
i
Definition: mps_fire.py:428
L1GctChannelMask::maskMissingEt
void maskMissingEt(unsigned ieta)
mask eta range from missing Et sum
Definition: L1GctChannelMask.cc:35
L1GctChannelMask::mhtMask_
bool mhtMask_[22]
Definition: L1GctChannelMask.h:56
L1GctChannelMask::emCrateMask
bool emCrateMask(unsigned crate) const
get EM masks for an RCT crate
Definition: L1GctChannelMask.cc:50
L1GctChannelMask::metMask_
bool metMask_[22]
Definition: L1GctChannelMask.h:54
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
L1GctChannelMask::regionMask_
bool regionMask_[22][18]
Definition: L1GctChannelMask.h:52
L1GctChannelMask::totalEtMask
bool totalEtMask(unsigned ieta) const
Definition: L1GctChannelMask.cc:64
L1GctChannelMask::totalHtMask
bool totalHtMask(unsigned ieta) const
Definition: L1GctChannelMask.cc:78
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
L1GctChannelMask::maskMissingHt
void maskMissingHt(unsigned ieta)
mask eta range from missing Ht sum
Definition: L1GctChannelMask.cc:45
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
L1GctChannelMask::maskTotalEt
void maskTotalEt(unsigned ieta)
mask eta range from total Et sum
Definition: L1GctChannelMask.cc:30
L1GctChannelMask.h
L1GctChannelMask::maskEmCrate
void maskEmCrate(unsigned crate)
mask EM candidates from an RCT crate
Definition: L1GctChannelMask.cc:20
L1GctChannelMask::maskRegion
void maskRegion(unsigned ieta, unsigned iphi)
mask a region
Definition: L1GctChannelMask.cc:25
L1GctChannelMask::tetMask_
bool tetMask_[22]
Definition: L1GctChannelMask.h:53
L1GctChannelMask::maskTotalHt
void maskTotalHt(unsigned ieta)
mask eta range from total Ht sum
Definition: L1GctChannelMask.cc:40
L1GctChannelMask::regionMask
bool regionMask(unsigned ieta, unsigned iphi) const
get region masks
Definition: L1GctChannelMask.cc:57
L1GctChannelMask::missingHtMask
bool missingHtMask(unsigned ieta) const
Definition: L1GctChannelMask.cc:85
L1GctChannelMask::missingEtMask
bool missingEtMask(unsigned ieta) const
Definition: L1GctChannelMask.cc:71
L1GctChannelMask
Definition: L1GctChannelMask.h:8
L1GctChannelMask::L1GctChannelMask
L1GctChannelMask()
default constructor sets all masks to false
Definition: L1GctChannelMask.cc:3
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
operator<<
std::ostream & operator<<(std::ostream &os, const L1GctChannelMask obj)
Definition: L1GctChannelMask.cc:92
L1GctChannelMask::htMask_
bool htMask_[22]
Definition: L1GctChannelMask.h:55