test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiPixelPhase1DigisHarvester.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelPhase1DigisHarvester
4 // Class: SiPixelPhase1DigisHarvester
5 //
6 
7 // Original Author: Marcel Schneider
8 
11 
13  SiPixelPhase1Harvester(iConfig)
14 {
15  histo[NDIGIS_FED].setCustomHandler([&] (SummationStep& s, HistogramManager::Table& t,
17  for (auto e : t) {
18  TH1* th1 = e.second.th1;
19  assert(th1->GetDimension() == 2);
20  TH2D* th2 = dynamic_cast<TH2D*>(th1);
21  assert(th2);
22  iBooker.setCurrentFolder(e.second.me->getPathname());
23  MonitorElement* out = iBooker.book2DD(e.second.me->getName() + "_norm", th2);
24 
25  for (int x = 1; x <= th1->GetNbinsX(); x++) {
26  double sum = 0;
27  int nonzero = 0;
28  for (int y = 1; y <= th1->GetNbinsY(); y++) {
29  double val = th1->GetBinContent(x, y);
30  sum += val;
31  if (val != 0.0) nonzero++;
32  }
33 
34  if (nonzero == 0) continue;
35 
36  double avg = sum / nonzero;
37 
38  for (int y = 1; y <= th1->GetNbinsY(); y++) {
39  out->setBinContent(x, y, th1->GetBinContent(x, y) / avg);
40  }
41  }
42  }
43  });
44 }
45 
void setBinContent(int binx, double content)
set content of bin (1-D)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
SiPixelPhase1DigisHarvester(const edm::ParameterSet &conf)
assert(m_qm.get())
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
std::map< GeometryInterface::Values, AbstractHistogram > Table
std::vector< HistogramManager > histo
MonitorElement * book2DD(Args &&...args)
Definition: DQMStore.h:145