CMS 3D CMS Logo

OuterTrackerMCHarvester.cc
Go to the documentation of this file.
2 
4 
6 
7 // ------------ method called once each job just after ending the event loop
8 // ------------
10  using namespace edm;
11 
12  float eta_bins[] = {0.0, 0.7, 1.0, 1.2, 1.6, 2.0, 2.4};
13  int eta_binnum = 6;
14 
15  dbe = nullptr;
17 
18  if (dbe) {
19  // Find all monitor elements for histograms
20  MonitorElement *meN_eta = dbe->get("SiOuterTrackerV/Tracks/Efficiency/match_tp_eta");
21  MonitorElement *meD_eta = dbe->get("SiOuterTrackerV/Tracks/Efficiency/tp_eta");
22  MonitorElement *meN_pt = dbe->get("SiOuterTrackerV/Tracks/Efficiency/match_tp_pt");
23  MonitorElement *meD_pt = dbe->get("SiOuterTrackerV/Tracks/Efficiency/tp_pt");
24  MonitorElement *meN_pt_zoom = dbe->get("SiOuterTrackerV/Tracks/Efficiency/match_tp_pt_zoom");
25  MonitorElement *meD_pt_zoom = dbe->get("SiOuterTrackerV/Tracks/Efficiency/tp_pt_zoom");
26  MonitorElement *meN_d0 = dbe->get("SiOuterTrackerV/Tracks/Efficiency/match_tp_d0");
27  MonitorElement *meD_d0 = dbe->get("SiOuterTrackerV/Tracks/Efficiency/tp_d0");
28  MonitorElement *meN_VtxR = dbe->get("SiOuterTrackerV/Tracks/Efficiency/match_tp_VtxR");
29  MonitorElement *meD_VtxR = dbe->get("SiOuterTrackerV/Tracks/Efficiency/tp_VtxR");
30  MonitorElement *meN_VtxZ = dbe->get("SiOuterTrackerV/Tracks/Efficiency/match_tp_VtxZ");
31  MonitorElement *meD_VtxZ = dbe->get("SiOuterTrackerV/Tracks/Efficiency/tp_VtxZ");
32 
33  MonitorElement *merespt_eta0to0p7_pt2to3 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta0to0p7_pt2to3");
34  MonitorElement *merespt_eta0p7to1_pt2to3 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta0p7to1_pt2to3");
35  MonitorElement *merespt_eta1to1p2_pt2to3 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1to1p2_pt2to3");
36  MonitorElement *merespt_eta1p2to1p6_pt2to3 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1p2to1p6_pt2to3");
37  MonitorElement *merespt_eta1p6to2_pt2to3 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1p6to2_pt2to3");
38  MonitorElement *merespt_eta2to2p4_pt2to3 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta2to2p4_pt2to3");
39  MonitorElement *merespt_eta0to0p7_pt3to8 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta0to0p7_pt3to8");
40  MonitorElement *merespt_eta0p7to1_pt3to8 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta0p7to1_pt3to8");
41  MonitorElement *merespt_eta1to1p2_pt3to8 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1to1p2_pt3to8");
42  MonitorElement *merespt_eta1p2to1p6_pt3to8 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1p2to1p6_pt3to8");
43  MonitorElement *merespt_eta1p6to2_pt3to8 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1p6to2_pt3to8");
44  MonitorElement *merespt_eta2to2p4_pt3to8 = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta2to2p4_pt3to8");
45  MonitorElement *merespt_eta0to0p7_pt8toInf = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta0to0p7_pt8toInf");
46  MonitorElement *merespt_eta0p7to1_pt8toInf = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta0p7to1_pt8toInf");
47  MonitorElement *merespt_eta1to1p2_pt8toInf = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1to1p2_pt8toInf");
48  MonitorElement *merespt_eta1p2to1p6_pt8toInf =
49  dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1p2to1p6_pt8toInf");
50  MonitorElement *merespt_eta1p6to2_pt8toInf = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta1p6to2_pt8toInf");
51  MonitorElement *merespt_eta2to2p4_pt8toInf = dbe->get("SiOuterTrackerV/Tracks/Resolution/respt_eta2to2p4_pt8toInf");
52 
53  MonitorElement *mereseta_eta0to0p7 = dbe->get("SiOuterTrackerV/Tracks/Resolution/reseta_eta0to0p7");
54  MonitorElement *mereseta_eta0p7to1 = dbe->get("SiOuterTrackerV/Tracks/Resolution/reseta_eta0p7to1");
55  MonitorElement *mereseta_eta1to1p2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/reseta_eta1to1p2");
56  MonitorElement *mereseta_eta1p2to1p6 = dbe->get("SiOuterTrackerV/Tracks/Resolution/reseta_eta1p2to1p6");
57  MonitorElement *mereseta_eta1p6to2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/reseta_eta1p6to2");
58  MonitorElement *mereseta_eta2to2p4 = dbe->get("SiOuterTrackerV/Tracks/Resolution/reseta_eta2to2p4");
59 
60  MonitorElement *meresphi_eta0to0p7 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resphi_eta0to0p7");
61  MonitorElement *meresphi_eta0p7to1 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resphi_eta0p7to1");
62  MonitorElement *meresphi_eta1to1p2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resphi_eta1to1p2");
63  MonitorElement *meresphi_eta1p2to1p6 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resphi_eta1p2to1p6");
64  MonitorElement *meresphi_eta1p6to2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resphi_eta1p6to2");
65  MonitorElement *meresphi_eta2to2p4 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resphi_eta2to2p4");
66 
67  MonitorElement *meresVtxZ_eta0to0p7 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resVtxZ_eta0to0p7");
68  MonitorElement *meresVtxZ_eta0p7to1 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resVtxZ_eta0p7to1");
69  MonitorElement *meresVtxZ_eta1to1p2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resVtxZ_eta1to1p2");
70  MonitorElement *meresVtxZ_eta1p2to1p6 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resVtxZ_eta1p2to1p6");
71  MonitorElement *meresVtxZ_eta1p6to2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resVtxZ_eta1p6to2");
72  MonitorElement *meresVtxZ_eta2to2p4 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resVtxZ_eta2to2p4");
73 
74  MonitorElement *meresd0_eta0to0p7 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resd0_eta0to0p7");
75  MonitorElement *meresd0_eta0p7to1 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resd0_eta0p7to1");
76  MonitorElement *meresd0_eta1to1p2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resd0_eta1to1p2");
77  MonitorElement *meresd0_eta1p2to1p6 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resd0_eta1p2to1p6");
78  MonitorElement *meresd0_eta1p6to2 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resd0_eta1p6to2");
79  MonitorElement *meresd0_eta2to2p4 = dbe->get("SiOuterTrackerV/Tracks/Resolution/resd0_eta2to2p4");
80 
81  if (meN_eta && meD_eta) {
82  // Get the numerator and denominator histograms
83  TH1F *numerator = meN_eta->getTH1F();
84  TH1F *denominator = meD_eta->getTH1F();
85  numerator->Sumw2();
86  denominator->Sumw2();
87 
88  // Set the current directory
89  dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalEfficiency");
90 
91  // Book the new histogram to contain the results
92  MonitorElement *me_effic_eta = ibooker.book1D("EtaEfficiency",
93  "#eta efficiency",
94  numerator->GetNbinsX(),
95  numerator->GetXaxis()->GetXmin(),
96  numerator->GetXaxis()->GetXmax());
97 
98  // Calculate the efficiency
99  me_effic_eta->getTH1F()->Divide(numerator, denominator, 1., 1., "B");
100  me_effic_eta->setAxisTitle("tracking particle #eta");
101  me_effic_eta->getTH1F()->GetYaxis()->SetTitle("Efficiency");
102  me_effic_eta->getTH1F()->SetMaximum(1.0);
103  me_effic_eta->getTH1F()->SetMinimum(0.0);
104  me_effic_eta->getTH1F()->SetStats(false);
105  } // if ME found
106  else {
107  edm::LogWarning("DataNotFound") << "Monitor elements for eta efficiency cannot be found!\n";
108  }
109 
110  if (meN_pt && meD_pt) {
111  // Get the numerator and denominator histograms
112  TH1F *numerator2 = meN_pt->getTH1F();
113  numerator2->Sumw2();
114  TH1F *denominator2 = meD_pt->getTH1F();
115  denominator2->Sumw2();
116 
117  // Set the current directory
118  dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalEfficiency");
119 
120  // Book the new histogram to contain the results
121  MonitorElement *me_effic_pt = ibooker.book1D("PtEfficiency",
122  "p_{T} efficiency",
123  numerator2->GetNbinsX(),
124  numerator2->GetXaxis()->GetXmin(),
125  numerator2->GetXaxis()->GetXmax());
126 
127  // Calculate the efficiency
128  me_effic_pt->getTH1F()->Divide(numerator2, denominator2, 1., 1., "B");
129  me_effic_pt->setAxisTitle("Tracking particle p_{T} [GeV]");
130  me_effic_pt->getTH1F()->GetYaxis()->SetTitle("Efficiency");
131  me_effic_pt->getTH1F()->SetMaximum(1.0);
132  me_effic_pt->getTH1F()->SetMinimum(0.0);
133  me_effic_pt->getTH1F()->SetStats(false);
134  } // if ME found
135  else {
136  edm::LogWarning("DataNotFound") << "Monitor elements for pT efficiency cannot be found!\n";
137  }
138 
139  if (meN_pt_zoom && meD_pt_zoom) {
140  // Get the numerator and denominator histograms
141  TH1F *numerator2_zoom = meN_pt_zoom->getTH1F();
142  numerator2_zoom->Sumw2();
143  TH1F *denominator2_zoom = meD_pt_zoom->getTH1F();
144  denominator2_zoom->Sumw2();
145 
146  // Set the current directory
147  dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalEfficiency");
148 
149  // Book the new histogram to contain the results
150  MonitorElement *me_effic_pt_zoom = ibooker.book1D("PtEfficiency_zoom",
151  "p_{T} efficiency",
152  numerator2_zoom->GetNbinsX(),
153  numerator2_zoom->GetXaxis()->GetXmin(),
154  numerator2_zoom->GetXaxis()->GetXmax());
155 
156  // Calculate the efficiency
157  me_effic_pt_zoom->getTH1F()->Divide(numerator2_zoom, denominator2_zoom, 1., 1., "B");
158  me_effic_pt_zoom->setAxisTitle("Tracking particle p_{T} [GeV]");
159  me_effic_pt_zoom->getTH1F()->GetYaxis()->SetTitle("Efficiency");
160  me_effic_pt_zoom->getTH1F()->SetMaximum(1.0);
161  me_effic_pt_zoom->getTH1F()->SetMinimum(0.0);
162  me_effic_pt_zoom->getTH1F()->SetStats(false);
163  } // if ME found
164  else {
165  edm::LogWarning("DataNotFound") << "Monitor elements for zoom pT efficiency cannot be found!\n";
166  }
167 
168  if (meN_d0 && meD_d0) {
169  // Get the numerator and denominator histograms
170  TH1F *numerator5 = meN_d0->getTH1F();
171  numerator5->Sumw2();
172  TH1F *denominator5 = meD_d0->getTH1F();
173  denominator5->Sumw2();
174 
175  // Set the current directory
176  dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalEfficiency");
177 
178  // Book the new histogram to contain the results
179  MonitorElement *me_effic_d0 = ibooker.book1D("d0Efficiency",
180  "d_{0} efficiency",
181  numerator5->GetNbinsX(),
182  numerator5->GetXaxis()->GetXmin(),
183  numerator5->GetXaxis()->GetXmax());
184 
185  // Calculate the efficiency
186  me_effic_d0->getTH1F()->Divide(numerator5, denominator5, 1., 1., "B");
187  me_effic_d0->setAxisTitle("Tracking particle d_{0} [cm]");
188  me_effic_d0->getTH1F()->GetYaxis()->SetTitle("Efficiency");
189  me_effic_d0->getTH1F()->SetMaximum(1.0);
190  me_effic_d0->getTH1F()->SetMinimum(0.0);
191  me_effic_d0->getTH1F()->SetStats(false);
192  } // if ME found
193  else {
194  edm::LogWarning("DataNotFound") << "Monitor elements for d0 efficiency cannot be found!\n";
195  }
196 
197  if (meN_VtxR && meD_VtxR) {
198  // Get the numerator and denominator histograms
199  TH1F *numerator6 = meN_VtxR->getTH1F();
200  numerator6->Sumw2();
201  TH1F *denominator6 = meD_VtxR->getTH1F();
202  denominator6->Sumw2();
203 
204  // Set the current directory
205  dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalEfficiency");
206 
207  // Book the new histogram to contain the results
208  MonitorElement *me_effic_VtxR = ibooker.book1D("VtxREfficiency",
209  "Vtx R efficiency",
210  numerator6->GetNbinsX(),
211  numerator6->GetXaxis()->GetXmin(),
212  numerator6->GetXaxis()->GetXmax());
213 
214  // Calculate the efficiency
215  me_effic_VtxR->getTH1F()->Divide(numerator6, denominator6, 1., 1., "B");
216  me_effic_VtxR->setAxisTitle("Tracking particle VtxR [cm]");
217  me_effic_VtxR->getTH1F()->GetYaxis()->SetTitle("Efficiency");
218  me_effic_VtxR->getTH1F()->SetMaximum(1.0);
219  me_effic_VtxR->getTH1F()->SetMinimum(0.0);
220  me_effic_VtxR->getTH1F()->SetStats(false);
221  } // if ME found
222  else {
223  edm::LogWarning("DataNotFound") << "Monitor elements for VtxR efficiency cannot be found!\n";
224  }
225 
226  if (meN_VtxZ && meD_VtxZ) {
227  // Get the numerator and denominator histograms
228  TH1F *numerator7 = meN_VtxZ->getTH1F();
229  numerator7->Sumw2();
230  TH1F *denominator7 = meD_VtxZ->getTH1F();
231  denominator7->Sumw2();
232 
233  // Set the current directory
234  dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalEfficiency");
235 
236  // Book the new histogram to contain the results
237  MonitorElement *me_effic_VtxZ = ibooker.book1D("VtxZEfficiency",
238  "Vtx Z efficiency",
239  numerator7->GetNbinsX(),
240  numerator7->GetXaxis()->GetXmin(),
241  numerator7->GetXaxis()->GetXmax());
242 
243  // Calculate the efficiency
244  me_effic_VtxZ->getTH1F()->Divide(numerator7, denominator7, 1., 1., "B");
245  me_effic_VtxZ->setAxisTitle("Tracking particle VtxZ [cm]");
246  me_effic_VtxZ->getTH1F()->GetYaxis()->SetTitle("Efficiency");
247  me_effic_VtxZ->getTH1F()->SetMaximum(1.0);
248  me_effic_VtxZ->getTH1F()->SetMinimum(0.0);
249  me_effic_VtxZ->getTH1F()->SetStats(false);
250  } // if ME found
251  else {
252  edm::LogWarning("DataNotFound") << "Monitor elements for VtxZ efficiency cannot be found!\n";
253  }
254 
255  if (merespt_eta0to0p7_pt2to3 && merespt_eta0p7to1_pt2to3 && merespt_eta1to1p2_pt2to3 &&
256  merespt_eta1p2to1p6_pt2to3 && merespt_eta1p6to2_pt2to3 && merespt_eta2to2p4_pt2to3) {
257  // Set the current directoy
258  dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalResolution");
259 
260  // Grab the histograms
261  TH1F *resPt1a = merespt_eta0to0p7_pt2to3->getTH1F();
262  TH1F *resPt2a = merespt_eta0p7to1_pt2to3->getTH1F();
263  TH1F *resPt3a = merespt_eta1to1p2_pt2to3->getTH1F();
264  TH1F *resPt4a = merespt_eta1p2to1p6_pt2to3->getTH1F();
265  TH1F *resPt5a = merespt_eta1p6to2_pt2to3->getTH1F();
266  TH1F *resPt6a = merespt_eta2to2p4_pt2to3->getTH1F();
267 
268  // Book the new histogram to contain the results
269  MonitorElement *me_res_pt1 =
270  ibooker.book1D("pTResVsEta_2-3", "p_{T} resolution vs |#eta|, for p_{T}: 2-3 GeV", eta_binnum, eta_bins);
271  TH1F *resPt1 = me_res_pt1->getTH1F();
272  resPt1->GetXaxis()->SetTitle("tracking particle |#eta|");
273  resPt1->GetYaxis()->SetTitle("#sigma(#Deltap_{T}/p_{T})");
274  resPt1->SetMinimum(0.0);
275  resPt1->SetStats(false);
276 
277  std::vector<TH1F *> vResPt1 = {resPt1a, resPt2a, resPt3a, resPt4a, resPt5a, resPt6a};
278  for (int i = 0; i < 6; i++) {
279  resPt1->SetBinContent(i + 1, vResPt1[i]->GetStdDev());
280  resPt1->SetBinError(i + 1, vResPt1[i]->GetStdDevError());
281  }
282  } // if ME found
283  else {
284  edm::LogWarning("DataNotFound") << "Monitor elements for pT resolution (2-3) cannot be found!\n";
285  }
286 
287  if (merespt_eta0to0p7_pt3to8 && merespt_eta0p7to1_pt3to8 && merespt_eta1to1p2_pt3to8 &&
288  merespt_eta1p2to1p6_pt3to8 && merespt_eta1p6to2_pt3to8 && merespt_eta2to2p4_pt3to8) {
289  // Set the current directoy
290  dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalResolution");
291 
292  // Grab the histograms
293  TH1F *resPt1b = merespt_eta0to0p7_pt3to8->getTH1F();
294  TH1F *resPt2b = merespt_eta0p7to1_pt3to8->getTH1F();
295  TH1F *resPt3b = merespt_eta1to1p2_pt3to8->getTH1F();
296  TH1F *resPt4b = merespt_eta1p2to1p6_pt3to8->getTH1F();
297  TH1F *resPt5b = merespt_eta1p6to2_pt3to8->getTH1F();
298  TH1F *resPt6b = merespt_eta2to2p4_pt3to8->getTH1F();
299 
300  // Book the new histogram to contain the results
301  MonitorElement *me_res_pt2 =
302  ibooker.book1D("pTResVsEta_3-8", "p_{T} resolution vs |#eta|, for p_{T}: 3-8 GeV", eta_binnum, eta_bins);
303  TH1F *resPt2 = me_res_pt2->getTH1F();
304  resPt2->GetXaxis()->SetTitle("tracking particle |#eta|");
305  resPt2->GetYaxis()->SetTitle("#sigma(#Deltap_{T}/p_{T})");
306  resPt2->SetMinimum(0.0);
307  resPt2->SetStats(false);
308 
309  std::vector<TH1F *> vResPt2 = {resPt1b, resPt2b, resPt3b, resPt4b, resPt5b, resPt6b};
310  for (int i = 0; i < 6; i++) {
311  resPt2->SetBinContent(i + 1, vResPt2[i]->GetStdDev());
312  resPt2->SetBinError(i + 1, vResPt2[i]->GetStdDevError());
313  }
314  } // if ME found
315  else {
316  edm::LogWarning("DataNotFound") << "Monitor elements for pT resolution (3-8) cannot be found!\n";
317  }
318 
319  if (merespt_eta0to0p7_pt8toInf && merespt_eta0p7to1_pt8toInf && merespt_eta1to1p2_pt8toInf &&
320  merespt_eta1p2to1p6_pt8toInf && merespt_eta1p6to2_pt8toInf && merespt_eta2to2p4_pt8toInf) {
321  // Set the current directoy
322  dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalResolution");
323 
324  // Grab the histograms
325  TH1F *resPt1c = merespt_eta0to0p7_pt8toInf->getTH1F();
326  TH1F *resPt2c = merespt_eta0p7to1_pt8toInf->getTH1F();
327  TH1F *resPt3c = merespt_eta1to1p2_pt8toInf->getTH1F();
328  TH1F *resPt4c = merespt_eta1p2to1p6_pt8toInf->getTH1F();
329  TH1F *resPt5c = merespt_eta1p6to2_pt8toInf->getTH1F();
330  TH1F *resPt6c = merespt_eta2to2p4_pt8toInf->getTH1F();
331 
332  // Book the new histogram to contain the results
333  MonitorElement *me_res_pt3 =
334  ibooker.book1D("pTResVsEta_8-inf", "p_{T} resolution vs |#eta|, for p_{T}: >8 GeV", eta_binnum, eta_bins);
335  TH1F *resPt3 = me_res_pt3->getTH1F();
336  resPt3->GetXaxis()->SetTitle("tracking particle |#eta|");
337  resPt3->GetYaxis()->SetTitle("#sigma(#Deltap_{T}/p_{T})");
338  resPt3->SetMinimum(0.0);
339  resPt3->SetStats(false);
340 
341  std::vector<TH1F *> vResPt3 = {resPt1c, resPt2c, resPt3c, resPt4c, resPt5c, resPt6c};
342  for (int i = 0; i < 6; i++) {
343  resPt3->SetBinContent(i + 1, vResPt3[i]->GetStdDev());
344  resPt3->SetBinError(i + 1, vResPt3[i]->GetStdDevError());
345  }
346  } // if ME found
347  else {
348  edm::LogWarning("DataNotFound") << "Monitor elements for pT resolution (8-inf) cannot be found!\n";
349  }
350 
351  if (mereseta_eta0to0p7 && mereseta_eta0p7to1 && mereseta_eta1to1p2 && mereseta_eta1p2to1p6 && mereseta_eta1p6to2 &&
352  mereseta_eta2to2p4) {
353  // Set the current directoy
354  dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalResolution");
355 
356  // Grab the histograms
357  TH1F *resEta1 = mereseta_eta0to0p7->getTH1F();
358  TH1F *resEta2 = mereseta_eta0p7to1->getTH1F();
359  TH1F *resEta3 = mereseta_eta1to1p2->getTH1F();
360  TH1F *resEta4 = mereseta_eta1p2to1p6->getTH1F();
361  TH1F *resEta5 = mereseta_eta1p6to2->getTH1F();
362  TH1F *resEta6 = mereseta_eta2to2p4->getTH1F();
363 
364  // Book the new histogram to contain the results
365  MonitorElement *me_res_eta = ibooker.book1D("EtaResolution", "#eta resolution vs |#eta|", eta_binnum, eta_bins);
366  TH1F *resEta = me_res_eta->getTH1F();
367  resEta->GetXaxis()->SetTitle("tracking particle |#eta|");
368  resEta->GetYaxis()->SetTitle("#sigma(#Delta#eta)");
369  resEta->SetMinimum(0.0);
370  resEta->SetStats(false);
371 
372  std::vector<TH1F *> vResEta = {resEta1, resEta2, resEta3, resEta4, resEta5, resEta6};
373  for (int i = 0; i < 6; i++) {
374  resEta->SetBinContent(i + 1, vResEta[i]->GetStdDev());
375  resEta->SetBinError(i + 1, vResEta[i]->GetStdDevError());
376  }
377  } // if ME found
378  else {
379  edm::LogWarning("DataNotFound") << "Monitor elements for eta resolution cannot be found!\n";
380  }
381 
382  if (meresphi_eta0to0p7 && meresphi_eta0p7to1 && meresphi_eta1to1p2 && meresphi_eta1p2to1p6 && meresphi_eta1p6to2 &&
383  meresphi_eta2to2p4) {
384  // Set the current directoy
385  dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalResolution");
386 
387  // Grab the histograms
388  TH1F *resPhi1 = meresphi_eta0to0p7->getTH1F();
389  TH1F *resPhi2 = meresphi_eta0p7to1->getTH1F();
390  TH1F *resPhi3 = meresphi_eta1to1p2->getTH1F();
391  TH1F *resPhi4 = meresphi_eta1p2to1p6->getTH1F();
392  TH1F *resPhi5 = meresphi_eta1p6to2->getTH1F();
393  TH1F *resPhi6 = meresphi_eta2to2p4->getTH1F();
394 
395  // Book the new histogram to contain the results
396  MonitorElement *me_res_phi = ibooker.book1D("PhiResolution", "#phi resolution vs |#eta|", eta_binnum, eta_bins);
397  TH1F *resPhi = me_res_phi->getTH1F();
398  resPhi->GetXaxis()->SetTitle("tracking particle |#eta|");
399  resPhi->GetYaxis()->SetTitle("#sigma(#Delta#phi)");
400  resPhi->SetMinimum(0.0);
401  resPhi->SetStats(false);
402 
403  std::vector<TH1F *> vResPhi = {resPhi1, resPhi2, resPhi3, resPhi4, resPhi5, resPhi6};
404  for (int i = 0; i < 6; i++) {
405  resPhi->SetBinContent(i + 1, vResPhi[i]->GetStdDev());
406  resPhi->SetBinError(i + 1, vResPhi[i]->GetStdDevError());
407  }
408  } // if ME found
409  else {
410  edm::LogWarning("DataNotFound") << "Monitor elements for phi resolution cannot be found!\n";
411  }
412 
413  if (meresVtxZ_eta0to0p7 && meresVtxZ_eta0p7to1 && meresVtxZ_eta1to1p2 && meresVtxZ_eta1p2to1p6 &&
414  meresVtxZ_eta1p6to2 && meresVtxZ_eta2to2p4) {
415  // Set the current directoy
416  dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalResolution");
417 
418  // Grab the histograms
419  TH1F *resVtxZ_1 = meresVtxZ_eta0to0p7->getTH1F();
420  TH1F *resVtxZ_2 = meresVtxZ_eta0p7to1->getTH1F();
421  TH1F *resVtxZ_3 = meresVtxZ_eta1to1p2->getTH1F();
422  TH1F *resVtxZ_4 = meresVtxZ_eta1p2to1p6->getTH1F();
423  TH1F *resVtxZ_5 = meresVtxZ_eta1p6to2->getTH1F();
424  TH1F *resVtxZ_6 = meresVtxZ_eta2to2p4->getTH1F();
425 
426  // Book the new histogram to contain the results
427  MonitorElement *me_res_VtxZ = ibooker.book1D("VtxZResolution", "VtxZ resolution vs |#eta|", eta_binnum, eta_bins);
428  TH1F *resVtxZ = me_res_VtxZ->getTH1F();
429  resVtxZ->GetXaxis()->SetTitle("tracking particle |#eta|");
430  resVtxZ->GetYaxis()->SetTitle("#sigma(#DeltaVtxZ) [cm]");
431  resVtxZ->SetMinimum(0.0);
432  resVtxZ->SetStats(false);
433 
434  std::vector<TH1F *> vResVtxZ = {resVtxZ_1, resVtxZ_2, resVtxZ_3, resVtxZ_4, resVtxZ_5, resVtxZ_6};
435  for (int i = 0; i < 6; i++) {
436  resVtxZ->SetBinContent(i + 1, vResVtxZ[i]->GetStdDev());
437  resVtxZ->SetBinError(i + 1, vResVtxZ[i]->GetStdDevError());
438  }
439  } // if ME found
440  else {
441  edm::LogWarning("DataNotFound") << "Monitor elements for VtxZ resolution cannot be found!\n";
442  }
443 
444  if (meresd0_eta0to0p7 && meresd0_eta0p7to1 && meresd0_eta1to1p2 && meresd0_eta1p2to1p6 && meresd0_eta1p6to2 &&
445  meresd0_eta2to2p4) {
446  // Set the current directoy
447  dbe->setCurrentFolder("SiOuterTrackerV/Tracks/FinalResolution");
448 
449  // Grab the histograms
450  TH1F *resd0_1 = meresd0_eta0to0p7->getTH1F();
451  TH1F *resd0_2 = meresd0_eta0p7to1->getTH1F();
452  TH1F *resd0_3 = meresd0_eta1to1p2->getTH1F();
453  TH1F *resd0_4 = meresd0_eta1p2to1p6->getTH1F();
454  TH1F *resd0_5 = meresd0_eta1p6to2->getTH1F();
455  TH1F *resd0_6 = meresd0_eta2to2p4->getTH1F();
456 
457  // Book the new histogram to contain the results
458  MonitorElement *me_res_d0 = ibooker.book1D("d0Resolution", "d_{0} resolution vs |#eta|", eta_binnum, eta_bins);
459  TH1F *resd0 = me_res_d0->getTH1F();
460  resd0->GetXaxis()->SetTitle("tracking particle |#eta|");
461  resd0->GetYaxis()->SetTitle("#sigma(#Deltad_{0}) [cm]");
462  resd0->SetMinimum(0.0);
463  resd0->SetStats(false);
464 
465  std::vector<TH1F *> vResD0 = {resd0_1, resd0_2, resd0_3, resd0_4, resd0_5, resd0_6};
466  for (int i = 0; i < 6; i++) {
467  resd0->SetBinContent(i + 1, vResD0[i]->GetStdDev());
468  resd0->SetBinError(i + 1, vResD0[i]->GetStdDevError());
469  }
470  } // if ME found
471  else {
472  edm::LogWarning("DataNotFound") << "Monitor elements for d0 resolution cannot be found!\n";
473  }
474 
475  } // if dbe found
476  else {
477  edm::LogWarning("DataNotFound") << "Cannot find valid DQM back end \n";
478  }
479 } // end dqmEndJob
480 
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:646
OuterTrackerMCHarvester(const edm::ParameterSet &)
virtual TH1F * getTH1F() const
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
HLT enums.
void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)