CMS 3D CMS Logo

SiStripSummaryReader.cc
Go to the documentation of this file.
3 
5 
6 #include <iostream>
7 #include <string>
8 #include <sstream>
9 #include <cstdio>
10 #include <sys/time.h>
11 
13  : printdebug_(iConfig.getUntrackedParameter<uint32_t>("printDebug", 1)) {}
14 
16 
18  edm::ESHandle<SiStripSummary> SiStripSummary_;
19  iSetup.get<SiStripSummaryRcd>().get(SiStripSummary_);
20  edm::LogInfo("SiStripSummaryReader") << "[SiStripSummaryReader::analyze] End Reading SiStripSummary" << std::endl;
21 
22  std::vector<uint32_t> detid = SiStripSummary_->getDetIds();
23 
24  std::vector<std::string> userDB = SiStripSummary_->getUserDBContent();
25  std::stringstream ss;
26  for (size_t i = 0; i < userDB.size(); ++i)
27  ss << userDB[i] << " \n";
28 
29  if (printdebug_)
30  for (size_t id = 0; id < detid.size(); id++) {
31  ss << "\n\tdetid " << detid[id];
32  SiStripSummary::Range range = SiStripSummary_->getRange(detid[id]);
33 
34  size_t c = 0;
35  for (SiStripSummary::ContainerIterator it = range.first; it != range.second; ++it) {
36  ss << "\n\t\t " << userDB[c++] << " " << *it;
37  }
38  }
39  edm::LogInfo("SiStripSummaryReader") << ss.str();
40 }
std::vector< uint32_t > getDetIds() const
const Range getRange(const uint32_t &detID) const
std::pair< ContainerIterator, ContainerIterator > Range
void analyze(const edm::Event &, const edm::EventSetup &) override
SiStripSummaryReader(const edm::ParameterSet &)
std::vector< std::string > getUserDBContent() const
T get() const
Definition: EventSetup.h:73
std::vector< float >::const_iterator ContainerIterator