CMS 3D CMS Logo

HcalFinegrainBit.cc
Go to the documentation of this file.
2 
3 #include <cassert>
4 
5 std::bitset<4>
7 {
8  if (version_ == 0) {
9  std::bitset<4> result;
10 
11  // First layer consistent with a MIP
12  result[0] = tower[is_mip][0];
13 
14  // First layer consistent with a MIP, at least one layer with more
15  // than MIP energy deposition
16  result[1] = result[0] & (tower[is_above_mip].count() > 0);
17 
18  // There layers consistent with a MIP
19  result[2] = tower[is_mip].count() >= 3;
20 
21  // Unset
22  result[3] = false;
23 
24  return result;
25  }
26  if (version_ == 1) {
27  std::bitset<4> result;
28 
29  // All algorithms the same for testing purposes
30  result[0] = result[1] = result[2] = result [3] = tower[is_mip][0];
31 
32  return result;
33  }
34  if (version_ == 2) {
35  std::bitset<4> result;
36 
37  // All algorithms the same for testing purposes
38  result[0] = result[1] = result[2] = result [3] = true;
39 
40  return result;
41  }
42  return 0;
43 }
std::array< std::bitset< 6 >, 2 > Tower
const int is_above_mip
std::bitset< 4 > compute(const Tower &) const