CMS 3D CMS Logo

SiStripThresholdReader.cc
Go to the documentation of this file.
1 // user include files
12 
13 // system include files
14 #include <memory>
15 #include <iostream>
16 #include <cstdio>
17 #include <sys/time.h>
18 
20 public:
22  ~SiStripThresholdReader() 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", 3)), thresholdToken_(esConsumes()) {}
36 
38  const auto& thresholds = iSetup.getData(thresholdToken_);
39  edm::LogInfo("SiStripThresholdReader") << "[SiStripThresholdReader::analyze] End Reading SiStripThreshold"
40  << std::endl;
41 
42  std::vector<uint32_t> detid;
43  thresholds.getDetIds(detid);
44  edm::LogInfo("Number of detids ") << detid.size() << std::endl;
45  if (printdebug_)
46  for (size_t id = 0; id < detid.size() && id < printdebug_; id++) {
47  SiStripThreshold::Range range = thresholds.getRange(detid[id]);
48 
49  //int strip=0;
50  float old_clusTh = -1, old_lowTh = -1, old_highTh = -1, old_FirstStrip = -1;
51  for (int it = 0; it < 768; it++) {
53  std::stringstream ss;
54  data.print(ss);
55  if (old_clusTh != data.getClusth() || old_lowTh != data.getLth() || old_highTh != data.getHth() ||
56  old_FirstStrip != data.getFirstStrip()) {
57  edm::LogInfo("SiStripThresholdReader")
58  << "detid: " << detid[id] << " \t"
59  << "strip: " << it << " \t" << ss.str() << "FirstStrip_and_Hth: " << data.FirstStrip_and_Hth << " \n"
60  << std::endl;
61  old_lowTh = data.getLth();
62  old_highTh = data.getHth();
63  old_clusTh = data.getClusth();
64  old_FirstStrip = data.getFirstStrip();
65  }
66  }
67  }
68 }
69 
72 
~SiStripThresholdReader() override=default
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
SiStripThresholdReader(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Namespace of DDCMS conversion namespace.
Log< level::Info, false > LogInfo
std::pair< ContainerIterator, ContainerIterator > Range
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
const edm::ESGetToken< SiStripThreshold, SiStripThresholdRcd > thresholdToken_
void analyze(const edm::Event &, const edm::EventSetup &) override