CMS 3D CMS Logo

SiStripBadStripReader.cc
Go to the documentation of this file.
9 
10 #include <iostream>
11 #include <cstdio>
12 #include <sys/time.h>
13 
15 public:
16  explicit SiStripBadStripReader(const edm::ParameterSet& iConfig)
17  : printdebug_(iConfig.getUntrackedParameter<bool>("printDebug", false)), badStripToken_(esConsumes()) {}
18 
19  ~SiStripBadStripReader() override;
20 
21  void analyze(const edm::Event&, const edm::EventSetup&) override;
22 
23 private:
24  const bool printdebug_;
26 };
27 
29 
31  const auto& badStrip = iSetup.getData(badStripToken_);
32  edm::LogInfo("SiStripBadStripReader") << "[SiStripBadStripReader::analyze] End Reading SiStripBadStrip" << std::endl;
33 
34  std::vector<uint32_t> detid;
35  badStrip.getDetIds(detid);
36 
37  if (printdebug_)
38  for (size_t id = 0; id < detid.size(); id++) {
39  SiStripBadStrip::Range range = badStrip.getRange(detid[id]);
40 
41  for (int it = 0; it < range.second - range.first; it++) {
42  unsigned int value = (*(range.first + it));
43  edm::LogInfo("SiStripBadStripReader") << "detid " << detid[id] << " \t"
44  << " firstBadStrip " << badStrip.decode(value).firstStrip << "\t "
45  << " NconsecutiveBadStrips " << badStrip.decode(value).range << "\t "
46  << " flag " << badStrip.decode(value).flag << "\t "
47  << " packed integer " << std::hex << value << std::dec
48  << "\t "
49  //<< badStrip.getBadStrips(range) << " \t"
50  << std::endl;
51  }
52  }
53 }
54 
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
~SiStripBadStripReader() override
SiStripBadStripReader(const edm::ParameterSet &iConfig)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Definition: value.py:1
Log< level::Info, false > LogInfo
std::pair< ContainerIterator, ContainerIterator > Range
void analyze(const edm::Event &, const edm::EventSetup &) override
const edm::ESGetToken< SiStripBadStrip, SiStripBadStripRcd > badStripToken_