CMS 3D CMS Logo

DTCertificationSummary.cc
Go to the documentation of this file.
1 
2 /*
3  * See header file for a description of this class.
4  *
5  * \author G. Cerminara - INFN Torino
6  */
7 
10 
14 
17 
18 using namespace std;
19 using namespace edm;
20 
22 
24 
26  DQMStore::IGetter& igetter,
27  edm::LuminosityBlock const& lumiSeg,
28  edm::EventSetup const& context) {
29  //FR moved here from beginJob
30 
31  // book the ME
32  ibooker.setCurrentFolder("DT/EventInfo");
33  // global fraction
34  if (!igetter.get("CertificationSummary")) {
35  totalCertFraction = ibooker.bookFloat("CertificationSummary");
36  totalCertFraction->Fill(-1);
37 
38  // certification map
39  certMap = ibooker.book2D("CertificationSummaryMap", "DT Certification Summary Map", 12, 1, 13, 5, -2, 3);
40  certMap->setAxisTitle("sector", 1);
41  certMap->setAxisTitle("wheel", 2);
42 
43  ibooker.setCurrentFolder("DT/EventInfo/CertificationContents");
44  // Wheel "fractions" -> will be 0 or 1
45  for (int wheel = -2; wheel != 3; ++wheel) {
46  stringstream streams;
47  streams << "DT_Wheel" << wheel;
48  certFractions[wheel] = ibooker.bookFloat(streams.str());
49  certFractions[wheel]->Fill(-1);
50  }
51  }
52 }
53 
55 
57 
59  // get the relevant summary histos
60  MonitorElement* effSummary = igetter.get("DT/05-ChamberEff/EfficiencyGlbSummary");
61  MonitorElement* resSummary = igetter.get("DT/02-Segments/ResidualsGlbSummary");
62  MonitorElement* segQualSummary = igetter.get("DT/02-Segments/segmentSummary");
63 
64  // check that all needed histos are there
65  if (effSummary == nullptr || resSummary == nullptr || segQualSummary == nullptr) {
66  LogWarning("DQM|DTMonitorClient|DTCertificationSummary")
67  << "*** Warning: not all needed summaries are present!" << endl;
68  return;
69  }
70 
71  // reset the MEs
72  totalCertFraction->Fill(0.);
73  certFractions[-2]->Fill(0.);
74  certFractions[-1]->Fill(0.);
75  certFractions[-0]->Fill(0.);
76  certFractions[1]->Fill(0.);
77  certFractions[2]->Fill(0.);
78  certMap->Reset();
79 
80  // loop over all sectors and wheels
81  for (int wheel = -2; wheel != 3; ++wheel) {
82  for (int sector = 1; sector != 13; ++sector) {
83  double eff = effSummary->getBinContent(sector, wheel + 3);
84  double res = resSummary->getBinContent(sector, wheel + 3);
85  double segQual = segQualSummary->getBinContent(sector, wheel + 3);
86 
87  double total = 0;
88  if (segQual != 0) {
89  total = min(res, eff);
90  } else {
91  total = eff;
92  }
93 
94  certMap->Fill(sector, wheel, total);
95  // can use variable weight depending on the sector
96  double weight = 1. / 12.;
97  certFractions[wheel]->Fill(certFractions[wheel]->getFloatValue() + weight * total);
98  double totalWeight = 1. / 60.;
99  totalCertFraction->Fill(totalCertFraction->getFloatValue() + totalWeight * total);
100  }
101  }
102 }
void beginRun(const edm::Run &run, const edm::EventSetup &setup) override
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
Definition: weight.py:1
DTCertificationSummary(const edm::ParameterSet &pset)
Constructor.
void endRun(const edm::Run &run, const edm::EventSetup &setup) override
Definition: Electron.h:6
void Fill(long long x)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:680
HLT enums.
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
DQM Client Diagnostic in offline mode.
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
DQM Client Diagnostic in online mode.
~DTCertificationSummary() override
Destructor.
Log< level::Warning, false > LogWarning
Definition: Run.h:45
virtual double getBinContent(int binx) const
get content of bin (1-D)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)