CMS 3D CMS Logo

SiStripDetVOffReader.cc
Go to the documentation of this file.
1 // system include files
2 #include <iostream>
3 #include <cstdio>
4 #include <sys/time.h>
5 
6 // user include files
17 
18 //
19 //
20 // class decleration
21 //
23 public:
24  explicit SiStripDetVOffReader(const edm::ParameterSet&);
25  ~SiStripDetVOffReader() override = default;
26 
27  void analyze(const edm::Event&, const edm::EventSetup&) override;
28 
29 private:
30  const bool printdebug_;
32  std::vector<uint32_t> detids;
33 };
34 
36  : printdebug_(iConfig.getUntrackedParameter<bool>("printDebug", true)), detVOffToken_(esConsumes()) {}
37 
39  const auto& detVOff = iSetup.getData(detVOffToken_);
40  edm::LogInfo("SiStripDetVOffReader") << "[SiStripDetVOffReader::analyze] End Reading SiStripDetVOff" << std::endl;
41 
42  // put here a vector of DetIds to compare
43  // Here we just take the vector with all modules that have HV OFF
44 
45  // replace this code, with Your own detids
46  std::vector<uint32_t> detid;
47  detVOff.getDetIds(detid);
48  //
49 
50  if (printdebug_) {
51  for (uint32_t id = 0; id <= detid.size(); id++) {
52  bool hvflag = detVOff.IsModuleHVOff(detid[id]);
53  bool lvflag = detVOff.IsModuleLVOff(detid[id]);
54  bool vflag = detVOff.IsModuleVOff(detid[id]);
55  if (hvflag == true) {
56  edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " HV\t OFF\n";
57  } else {
58  edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " HV\t ON\n";
59  }
60  if (lvflag == true) {
61  edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " LV\t OFF\n";
62  } else {
63  edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " LV\t ON\n";
64  }
65  if (vflag == true) {
66  edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " V\t OFF\n";
67  } else {
68  edm::LogInfo("SiStripDetVOffReader") << "detid: " << detid[id] << " V\t ON\n";
69  }
70  }
71  }
72 }
73 
76 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
const edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcd > detVOffToken_
std::vector< uint32_t > detids
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
SiStripDetVOffReader(const edm::ParameterSet &)
void analyze(const edm::Event &, const edm::EventSetup &) override
bool getData(T &iHolder) const
Definition: EventSetup.h:122
Log< level::Info, false > LogInfo
~SiStripDetVOffReader() override=default