CMS 3D CMS Logo

SiStripNoisesReader.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 
19 public:
20  explicit SiStripNoisesReader(const edm::ParameterSet&);
21  ~SiStripNoisesReader() override;
22 
23  void analyze(const edm::Event&, const edm::EventSetup&) override;
24 
25 private:
26  const uint32_t printdebug_;
28 };
29 
30 using namespace cms;
31 
33  : printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug", 1)), noisesToken_(esConsumes()) {}
34 
36 
38  const auto& stripNoises = iSetup.getData(noisesToken_);
39  edm::LogInfo("SiStripNoisesReader") << "[SiStripNoisesReader::analyze] End Reading SiStripNoises" << std::endl;
40 
41  std::vector<uint32_t> detid;
42  stripNoises.getDetIds(detid);
43  edm::LogInfo("Number of detids ") << detid.size() << std::endl;
44 
45  if (printdebug_)
46  for (size_t id = 0; id < detid.size() && id < printdebug_; id++) {
47  SiStripNoises::Range range = stripNoises.getRange(detid[id]);
48 
49  int strip = 0;
50  for (int it = 0; it < (range.second - range.first) * 8 / 9; it++) {
51  edm::LogInfo("SiStripNoisesReader") << "detid " << detid[id] << " \t"
52  << " strip " << strip++ << " \t" << stripNoises.getNoise(it, range)
53  << " \t"
54  //<< stripNoises.getDisable(it,range) << " \t"
55  << std::endl;
56  }
57  }
58 }
59 
62 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
void analyze(const edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
const uint32_t printdebug_
bool getData(T &iHolder) const
Definition: EventSetup.h:122
Namespace of DDCMS conversion namespace.
Log< level::Info, false > LogInfo
const edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > noisesToken_
SiStripNoisesReader(const edm::ParameterSet &)
~SiStripNoisesReader() override
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47