CMS 3D CMS Logo

SiStripPedestalsReader.cc
Go to the documentation of this file.
1 // system include files
2 //#include <memory>
3 #include <iostream>
4 #include <cstdio>
5 #include <sys/time.h>
6 
7 // user include files
18 
20 public:
22  ~SiStripPedestalsReader() override = default;
23 
24  void analyze(const edm::Event&, const edm::EventSetup&) override;
25 
26 private:
27  uint32_t printdebug_;
29 };
30 
31 using namespace std;
32 using namespace cms;
33 
35  : printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug", 1)), pedestalsToken_(esConsumes()) {}
36 
38  const auto& pedestals = iSetup.getData(pedestalsToken_);
39  edm::LogInfo("SiStripPedestalsReader") << "[SiStripPedestalsReader::analyze] End Reading SiStripPedestals"
40  << std::endl;
41 
42  std::vector<uint32_t> detid;
43  pedestals.getDetIds(detid);
44  edm::LogInfo("Number of detids ") << detid.size() << std::endl;
45 
46  if (printdebug_)
47  for (size_t id = 0; id < detid.size() && id < printdebug_; id++) {
48  SiStripPedestals::Range range = pedestals.getRange(detid[id]);
49 
50  int strip = 0;
51  for (int it = 0; it < (range.second - range.first) * 8 / 10; it++) {
52  edm::LogInfo("SiStripPedestalsReader")
53  << "detid " << detid[id] << " \t"
54  << " strip " << strip++ << " \t" << pedestals.getPed(it, range) << " \t" << std::endl;
55  }
56  }
57 }
58 
61 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
const edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcd > pedestalsToken_
~SiStripPedestalsReader() override=default
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void analyze(const edm::Event &, const edm::EventSetup &) override
std::pair< ContainerIterator, ContainerIterator > Range
bool getData(T &iHolder) const
Definition: EventSetup.h:122
Namespace of DDCMS conversion namespace.
Log< level::Info, false > LogInfo
SiStripPedestalsReader(const edm::ParameterSet &)