CMS 3D CMS Logo

DebugInfo.cc
Go to the documentation of this file.
6 
7 #include <iostream>
8 
9 namespace spr {
10 
11  void debugEcalDets(unsigned int i, const DetId& det, bool flag) {
12  std::cout << "Cell [" << i << "] 0x";
13  if (det.subdetId() == EcalBarrel) {
14  EBDetId id = det;
15  std::cout << std::hex << det() << std::dec << " " << id;
16  } else if (det.subdetId() == EcalEndcap) {
17  EEDetId id = det;
18  std::cout << std::hex << det() << std::dec << " " << id;
19  } else {
20  std::cout << std::hex << det() << std::dec << " Unknown Type";
21  }
22  if (flag)
23  std::cout << std::endl;
24  }
25 
26  void debugEcalDets(unsigned int last, std::vector<DetId>& vdets) {
27  for (unsigned int i = last; i < vdets.size(); ++i) {
28  debugEcalDets(i, vdets[i], true);
29  }
30  }
31 
32  void debugEcalDets(unsigned int last, std::vector<DetId>& vdets, std::vector<CaloDirection>& dirs) {
33  for (unsigned int i = last; i < vdets.size(); ++i) {
34  debugEcalDets(i, vdets[i], false);
35  std::cout << " along " << dirs[i] << std::endl;
36  }
37  }
38 
39  void debugHcalDets(unsigned int last, std::vector<DetId>& vdets) {
40  for (unsigned int i = last; i < vdets.size(); ++i) {
41  HcalDetId id = vdets[i]();
42  std::cout << "Cell [" << i << "] 0x" << std::hex << vdets[i]() << std::dec << " " << id << std::endl;
43  }
44  }
45 } // namespace spr
void debugEcalDets(unsigned int, const DetId &, bool)
Definition: DebugInfo.cc:11
void debugHcalDets(unsigned int, std::vector< DetId > &)
Definition: DebugInfo.cc:39
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Definition: DetId.h:17