CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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++) {
52  SiStripThreshold::Data data = thresholds.getData(it, range);
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
uint16_t *__restrict__ id
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
const uint16_t range(const Frame &aFrame)
bool getData(T &iHolder) const
Definition: EventSetup.h:128
SiStripThresholdReader(const edm::ParameterSet &)
uint16_t getFirstStrip() const
Log< level::Info, false > LogInfo
void print(std::stringstream &ss) const
std::pair< ContainerIterator, ContainerIterator > Range
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
const edm::ESGetToken< SiStripThreshold, SiStripThresholdRcd > thresholdToken_
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
void analyze(const edm::Event &, const edm::EventSetup &) override
float getClusth() const