CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
8 
11 
15 
19 
20 using namespace std;
21 using namespace edm;
22 
23 
24 
26 
27 
29 
30 
31 
32 
34  edm::LuminosityBlock const & lumiSeg, edm::EventSetup const& context){
35 
36  //FR moved here from beginJob
37 
38  // book the ME
39  ibooker.setCurrentFolder("DT/EventInfo");
40  // global fraction
41  if (! igetter.get("CertificationSummary")) {
42  totalCertFraction = ibooker.bookFloat("CertificationSummary");
43  totalCertFraction->Fill(-1);
44 
45  // certification map
46  certMap = ibooker.book2D("CertificationSummaryMap","DT Certification Summary Map",12,1,13,5,-2,3);
47  certMap->setAxisTitle("sector",1);
48  certMap->setAxisTitle("wheel",2);
49 
50  ibooker.setCurrentFolder("DT/EventInfo/CertificationContents");
51  // Wheel "fractions" -> will be 0 or 1
52  for(int wheel = -2; wheel != 3; ++wheel) {
53  stringstream streams;
54  streams << "DT_Wheel" << wheel;
55  certFractions[wheel] = ibooker.bookFloat(streams.str());
56  certFractions[wheel]->Fill(-1);
57  }
58  }
59 }
60 
61 
63 }
64 
65 
66 
68 
69 }
70 
72 
73  // get the relevant summary histos
74  MonitorElement* effSummary = igetter.get("DT/05-ChamberEff/EfficiencyGlbSummary");
75  MonitorElement* resSummary = igetter.get("DT/02-Segments/ResidualsGlbSummary");
76  MonitorElement* segQualSummary = igetter.get("DT/02-Segments/segmentSummary");
77 
78  // check that all needed histos are there
79  if(effSummary == 0 || resSummary == 0 || segQualSummary == 0) {
80  LogWarning("DQM|DTMonitorClient|DTCertificationSummary") << "*** Warning: not all needed summaries are present!" << endl;
81  return;
82  }
83 
84  // reset the MEs
85  totalCertFraction->Fill(0.);
86  certFractions[-2]->Fill(0.);
87  certFractions[-1]->Fill(0.);
88  certFractions[-0]->Fill(0.);
89  certFractions[1]->Fill(0.);
90  certFractions[2]->Fill(0.);
91  certMap->Reset();
92 
93  // loop over all sectors and wheels
94  for(int wheel = -2; wheel != 3; ++wheel) {
95  for(int sector = 1; sector != 13; ++sector) {
96  double eff = effSummary->getBinContent(sector, wheel+3);
97  double res = resSummary->getBinContent(sector, wheel+3);
98  double segQual = segQualSummary->getBinContent(sector, wheel+3);
99 
100  double total = 0;
101  if(segQual != 0) {
102  total = min(res,eff);
103  } else {
104  total = eff;
105  }
106 
107  certMap->Fill(sector,wheel,total);
108  // can use variable weight depending on the sector
109  double weight = 1./12.;
110  certFractions[wheel]->Fill(certFractions[wheel]->getFloatValue() + weight*total);
111  double totalWeight = 1./60.;
112  totalCertFraction->Fill(totalCertFraction->getFloatValue() + totalWeight*total);
113  }
114  }
115 
116 }
117 
118 
119 
120 
121 
122 
123 
124 
125 
126 
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)
DQM Client Diagnostic in offline mode.
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:304
DTCertificationSummary(const edm::ParameterSet &pset)
Constructor.
void Fill(long long x)
void endRun(const edm::Run &run, const edm::EventSetup &setup)
void beginRun(const edm::Run &run, const edm::EventSetup &setup)
virtual ~DTCertificationSummary()
Destructor.
T min(T a, T b)
Definition: MathUtil.h:58
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
DQM Client Diagnostic in online mode.
Definition: Run.h:43