CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TopDiLeptonDQM.cc
Go to the documentation of this file.
1 /*
2  * $Date: 2012/01/11 13:53:29 $
3  * $Revision: 1.14 $
4  * \author M. Marienfeld - DESY Hamburg
5  */
6 
7 #include "TLorentzVector.h"
12 
13 using namespace std;
14 using namespace edm;
15 
17  moduleName_ = ps.getUntrackedParameter<string>("moduleName");
18  outputFile_ = ps.getUntrackedParameter<string>("outputFile");
19  triggerResults_ = consumes<TriggerResults>(
20  ps.getParameter<edm::InputTag>("TriggerResults"));
21  hltPaths_ = ps.getParameter<vector<string> >("hltPaths");
22  hltPaths_sig_ = ps.getParameter<vector<string> >("hltPaths_sig");
23  hltPaths_trig_ = ps.getParameter<vector<string> >("hltPaths_trig");
24 
25  vertex_ = consumes<reco::VertexCollection>(
26  ps.getParameter<edm::InputTag>("vertexCollection"));
27  vertex_X_cut_ = ps.getParameter<double>("vertex_X_cut");
28  vertex_Y_cut_ = ps.getParameter<double>("vertex_Y_cut");
29  vertex_Z_cut_ = ps.getParameter<double>("vertex_Z_cut");
30 
31  muons_ = consumes<reco::MuonCollection>(
32  ps.getParameter<edm::InputTag>("muonCollection"));
33  muon_pT_cut_ = ps.getParameter<double>("muon_pT_cut");
34  muon_eta_cut_ = ps.getParameter<double>("muon_eta_cut");
35  muon_iso_cut_ = ps.getParameter<double>("muon_iso_cut");
36 
37  elecs_ = consumes<reco::GsfElectronCollection>(
38  ps.getParameter<edm::InputTag>("elecCollection"));
39  elec_pT_cut_ = ps.getParameter<double>("elec_pT_cut");
40  elec_eta_cut_ = ps.getParameter<double>("elec_eta_cut");
41  elec_iso_cut_ = ps.getParameter<double>("elec_iso_cut");
42  elec_emf_cut_ = ps.getParameter<double>("elec_emf_cut");
43 
44  MassWindow_up_ = ps.getParameter<double>("MassWindow_up");
45  MassWindow_down_ = ps.getParameter<double>("MassWindow_down");
46 
47  for (int i = 0; i < 100; ++i) {
48  N_sig[i] = 0;
49  N_trig[i] = 0;
50  Eff[i] = 0.;
51  }
52 
53  N_mumu = 0;
54  N_muel = 0;
55  N_elel = 0;
56  Events_ = 0;
57  Trigs_ = 0;
58  TriggerEff_ = 0;
59  Ntracks_ = 0;
60  Nmuons_ = 0;
61  Nmuons_iso_ = 0;
62  Nmuons_charge_ = 0;
63  VxVy_muons_ = 0;
64  Vz_muons_ = 0;
65  pT_muons_ = 0;
66  eta_muons_ = 0;
67  phi_muons_ = 0;
68  Nelecs_ = 0;
69  Nelecs_iso_ = 0;
70  Nelecs_charge_ = 0;
71  HoverE_elecs_ = 0;
72  pT_elecs_ = 0;
73  eta_elecs_ = 0;
74  phi_elecs_ = 0;
75  MuIso_emEt03_ = 0;
76  MuIso_hadEt03_ = 0;
77  MuIso_hoEt03_ = 0;
78  MuIso_nJets03_ = 0;
79  MuIso_nTracks03_ = 0;
80  MuIso_sumPt03_ = 0;
81  MuIso_CombRelIso03_ = 0;
82  ElecIso_cal_ = 0;
83  ElecIso_trk_ = 0;
84  ElecIso_CombRelIso_ = 0;
85  dimassRC_ = 0;
86  dimassWC_ = 0;
87  dimassRC_LOGX_ = 0;
88  dimassWC_LOGX_ = 0;
89  dimassRC_LOG10_ = 0;
90  dimassWC_LOG10_ = 0;
91  D_eta_muons_ = 0;
92  D_phi_muons_ = 0;
93  D_eta_elecs_ = 0;
94  D_phi_elecs_ = 0;
95  D_eta_lepts_ = 0;
96  D_phi_lepts_ = 0;
97 }
98 
100 
102  edm::Run const &,
103  edm::EventSetup const &) {
104  iBooker.setCurrentFolder(moduleName_);
105 
106  Events_ = iBooker.book1D("00_Events", "Isolated dilepton events", 5, 0., 5.);
107  Events_->setBinLabel(2, "#mu #mu", 1);
108  Events_->setBinLabel(3, "#mu e", 1);
109  Events_->setBinLabel(4, "e e", 1);
110 
111  Trigs_ =
112  iBooker.book1D("01_Trigs", "Fired muon/electron triggers", 15, 0., 15.);
113  TriggerEff_ =
114  iBooker.book1D("02_TriggerEff", "HL Trigger Efficiencies", 10, 0., 10.);
115  TriggerEff_->setTitle(
116  "HL Trigger Efficiencies #epsilon_{signal} = #frac{[signal] && "
117  "[control]}{[control]}");
118  Ntracks_ = iBooker.book1D("Ntracks", "Number of tracks", 50, 0., 50.);
119 
120  Nmuons_ = iBooker.book1D("03_Nmuons", "Number of muons", 20, 0., 10.);
121  Nmuons_iso_ =
122  iBooker.book1D("04_Nmuons_iso", "Number of isolated muons", 20, 0., 10.);
123  Nmuons_charge_ = iBooker.book1D("Nmuons_charge",
124  "Number of muons * moun charge", 19, -10., 10.);
125  VxVy_muons_ = iBooker.book2D("VxVy_muons", "Vertex x-y-positon (global)", 40,
126  -1., 1., 40, -1., 1.);
127  Vz_muons_ =
128  iBooker.book1D("Vz_muons", "Vertex z-positon (global)", 40, -20., 20.);
129  pT_muons_ = iBooker.book1D("pT_muons", "P_T of muons", 40, 0., 200.);
130  eta_muons_ = iBooker.book1D("eta_muons", "Eta of muons", 50, -5., 5.);
131  phi_muons_ = iBooker.book1D("phi_muons", "Phi of muons", 40, -4., 4.);
132 
133  Nelecs_ = iBooker.book1D("05_Nelecs", "Number of electrons", 20, 0., 10.);
134  Nelecs_iso_ = iBooker.book1D("06_Nelecs_iso", "Number of isolated electrons",
135  20, 0., 10.);
136  Nelecs_charge_ = iBooker.book1D("Nelecs_charge",
137  "Number of elecs * elec charge", 19, -10., 10.);
138  HoverE_elecs_ =
139  iBooker.book1D("HoverE_elecs", "Hadronic over Ecal energy", 50, 0., 1.);
140  pT_elecs_ = iBooker.book1D("pT_elecs", "P_T of electrons", 40, 0., 200.);
141  eta_elecs_ = iBooker.book1D("eta_elecs", "Eta of electrons", 50, -5., 5.);
142  phi_elecs_ = iBooker.book1D("phi_elecs", "Phi of electrons", 40, -4., 4.);
143 
144  MuIso_emEt03_ = iBooker.book1D("MuIso_emEt03", "Muon emEt03", 20, 0., 20.);
145  MuIso_hadEt03_ = iBooker.book1D("MuIso_hadEt03", "Muon hadEt03", 20, 0., 20.);
146  MuIso_hoEt03_ = iBooker.book1D("MuIso_hoEt03", "Muon hoEt03", 20, 0., 20.);
147  MuIso_nJets03_ = iBooker.book1D("MuIso_nJets03", "Muon nJets03", 10, 0., 10.);
148  MuIso_nTracks03_ =
149  iBooker.book1D("MuIso_nTracks03", "Muon nTracks03", 20, 0., 20.);
150  MuIso_sumPt03_ = iBooker.book1D("MuIso_sumPt03", "Muon sumPt03", 20, 0., 40.);
151  MuIso_CombRelIso03_ =
152  iBooker.book1D("07_MuIso_CombRelIso03", "Muon CombRelIso03", 20, 0., 1.);
153 
154  ElecIso_cal_ = iBooker.book1D("ElecIso_cal", "Electron Iso_cal", 21, -1., 20.);
155  ElecIso_trk_ = iBooker.book1D("ElecIso_trk", "Electron Iso_trk", 21, -2., 40.);
156  ElecIso_CombRelIso_ =
157  iBooker.book1D("08_ElecIso_CombRelIso", "Electron CombRelIso", 20, 0., 1.);
158 
159  const int nbins = 200;
160 
161  double logmin = 0.;
162  double logmax = 3.; // 10^(3.)=1000
163 
164  float bins[nbins + 1];
165 
166  for (int i = 0; i <= nbins; i++) {
167  double log = logmin + (logmax - logmin) * i / nbins;
168  bins[i] = std::pow(10.0, log);
169  }
170 
171  dimassRC_ = iBooker.book1D("09_dimassRC", "Dilepton mass RC", 50, 0., 200.);
172  dimassWC_ = iBooker.book1D("11_dimassWC", "Dilepton mass WC", 50, 0., 200.);
173  dimassRC_LOGX_ =
174  iBooker.book1D("10_dimassRC_LOGX", "Dilepton mass RC LOG", nbins, &bins[0]);
175  dimassWC_LOGX_ =
176  iBooker.book1D("12_dimassWC_LOGX", "Dilepton mass WC LOG", nbins, &bins[0]);
177  dimassRC_LOG10_ =
178  iBooker.book1D("dimassRC_LOG10", "Dilepton mass RC LOG", 50, 0., 2.5);
179  dimassWC_LOG10_ =
180  iBooker.book1D("dimassWC_LOG10", "Dilepton mass WC LOG", 50, 0., 2.5);
181 
182  D_eta_muons_ =
183  iBooker.book1D("13_D_eta_muons", "#Delta eta_muons", 20, -5., 5.);
184  D_phi_muons_ =
185  iBooker.book1D("14_D_phi_muons", "#Delta phi_muons", 20, -5., 5.);
186  D_eta_elecs_ = iBooker.book1D("D_eta_elecs", "#Delta eta_elecs", 20, -5., 5.);
187  D_phi_elecs_ = iBooker.book1D("D_phi_elecs", "#Delta phi_elecs", 20, -5., 5.);
188  D_eta_lepts_ = iBooker.book1D("D_eta_lepts", "#Delta eta_lepts", 20, -5., 5.);
189  D_phi_lepts_ = iBooker.book1D("D_phi_lepts", "#Delta phi_lepts", 20, -5., 5.);
190 }
191 
193  const edm::EventSetup& context) {
194  // ------------------------
195  // Global Event Variables
196  // ------------------------
197 
198  const int N_TriggerPaths = hltPaths_.size();
199  const int N_SignalPaths = hltPaths_sig_.size();
200  const int N_ControlPaths = hltPaths_trig_.size();
201 
202  bool Fired_Signal_Trigger[100] = {false};
203  bool Fired_Control_Trigger[100] = {false};
204 
205  int N_leptons = 0;
206  int N_iso_mu = 0;
207  int N_iso_el = 0;
208 
209  double DilepMass = 0.;
210 
211  double vertex_X = 100.;
212  double vertex_Y = 100.;
213  double vertex_Z = 100.;
214 
215  // ------------------------
216  // Analyze Primary Vertex
217  // ------------------------
218 
220  evt.getByToken(vertex_, vertexs);
221 
222  if (!vertexs.failedToGet()) {
223  reco::Vertex primaryVertex = vertexs->front();
224 
225  int numberTracks = primaryVertex.tracksSize();
226  // double ndof = primaryVertex.ndof();
227  bool fake = primaryVertex.isFake();
228 
229  Ntracks_->Fill(numberTracks);
230 
231  if (!fake && numberTracks > 3) {
232  vertex_X = primaryVertex.x();
233  vertex_Y = primaryVertex.y();
234  vertex_Z = primaryVertex.z();
235  }
236  }
237 
238  // -------------------------
239  // Analyze Trigger Results
240  // -------------------------
241 
242  edm::Handle<TriggerResults> trigResults;
243  evt.getByToken(triggerResults_, trigResults);
244 
245  if (!trigResults.failedToGet()) {
246  int N_Triggers = trigResults->size();
247 
248  const edm::TriggerNames& trigName = evt.triggerNames(*trigResults);
249 
250  for (int i_Trig = 0; i_Trig < N_Triggers; ++i_Trig) {
251  if (trigResults.product()->accept(i_Trig)) {
252  // Check for all trigger paths
253 
254  for (int i = 0; i < N_TriggerPaths; i++) {
255  if (trigName.triggerName(i_Trig) == hltPaths_[i]) {
256  Trigs_->Fill(i);
257  Trigs_->setBinLabel(i + 1, hltPaths_[i], 1);
258  }
259  }
260 
261  // Check for signal & control trigger paths
262 
263  for (int j = 0; j < N_SignalPaths; ++j) {
264  if (trigName.triggerName(i_Trig) == hltPaths_sig_[j])
265  Fired_Signal_Trigger[j] = true;
266  }
267 
268  for (int k = 0; k < N_ControlPaths; ++k) {
269  if (trigName.triggerName(i_Trig) == hltPaths_trig_[k])
270  Fired_Control_Trigger[k] = true;
271  }
272  }
273  }
274  }
275 
276  // ------------------------
277  // Analyze Muon Isolation
278  // ------------------------
279 
281  evt.getByToken(muons_, muons);
282 
283  reco::MuonCollection::const_iterator muon;
284 
285  if (!muons.failedToGet()) {
286  Nmuons_->Fill(muons->size());
287 
288  N_leptons = N_leptons + muons->size();
289 
290  for (muon = muons->begin(); muon != muons->end(); ++muon) {
291  float N_muons = muons->size();
292  float Q_muon = muon->charge();
293 
294  Nmuons_charge_->Fill(N_muons * Q_muon);
295 
296  double track_X = 100.;
297  double track_Y = 100.;
298  double track_Z = 100.;
299 
300  if (muon->isGlobalMuon()) {
301  reco::TrackRef track = muon->globalTrack();
302 
303  track_X = track->vx();
304  track_Y = track->vy();
305  track_Z = track->vz();
306 
307  VxVy_muons_->Fill(track_X, track_Y);
308  Vz_muons_->Fill(track_Z);
309  }
310 
311  // Vertex and kinematic cuts
312 
313  if (track_X > vertex_X_cut_) continue;
314  if (track_Y > vertex_Y_cut_) continue;
315  if (track_Z > vertex_Z_cut_) continue;
316  if (muon->pt() < muon_pT_cut_) continue;
317  if (abs(muon->eta()) > muon_eta_cut_) continue;
318 
319  reco::MuonIsolation muIso03 = muon->isolationR03();
320 
321  double muonCombRelIso = 1.;
322 
323  if (muon->pt() != 0.)
324  muonCombRelIso =
325  (muIso03.emEt + muIso03.hadEt + muIso03.hoEt + muIso03.sumPt) /
326  muon->pt();
327 
328  MuIso_CombRelIso03_->Fill(muonCombRelIso);
329 
330  MuIso_emEt03_->Fill(muIso03.emEt);
331  MuIso_hadEt03_->Fill(muIso03.hadEt);
332  MuIso_hoEt03_->Fill(muIso03.hoEt);
333  MuIso_nJets03_->Fill(muIso03.nJets);
334  MuIso_nTracks03_->Fill(muIso03.nTracks);
335  MuIso_sumPt03_->Fill(muIso03.sumPt);
336 
337  if (muonCombRelIso < muon_iso_cut_) ++N_iso_mu;
338  }
339 
340  Nmuons_iso_->Fill(N_iso_mu);
341  }
342 
343  // ----------------------------
344  // Analyze Electron Isolation
345  // ----------------------------
346 
348  evt.getByToken(elecs_, elecs);
349 
350  reco::GsfElectronCollection::const_iterator elec;
351 
352  if (!elecs.failedToGet()) {
353  Nelecs_->Fill(elecs->size());
354 
355  N_leptons = N_leptons + elecs->size();
356 
357  for (elec = elecs->begin(); elec != elecs->end(); ++elec) {
358  float N_elecs = elecs->size();
359  float Q_elec = elec->charge();
360  float HoverE = elec->hcalOverEcal();
361 
362  HoverE_elecs_->Fill(HoverE);
363 
364  Nelecs_charge_->Fill(N_elecs * Q_elec);
365 
366  double track_X = 100.;
367  double track_Y = 100.;
368  double track_Z = 100.;
369 
370  reco::GsfTrackRef track = elec->gsfTrack();
371 
372  track_X = track->vx();
373  track_Y = track->vy();
374  track_Z = track->vz();
375 
376  // Vertex and kinematic cuts
377 
378  if (track_X > vertex_X_cut_) continue;
379  if (track_Y > vertex_Y_cut_) continue;
380  if (track_Z > vertex_Z_cut_) continue;
381  if (elec->pt() < elec_pT_cut_) continue;
382  if (abs(elec->eta()) > elec_eta_cut_) continue;
383  if (HoverE > elec_emf_cut_) continue;
384 
386  elec->dr03IsolationVariables();
387 
388  double elecCombRelIso = 1.;
389 
390  if (elec->et() != 0.)
391  elecCombRelIso = (elecIso.ecalRecHitSumEt +
392  elecIso.hcalDepth1TowerSumEt + elecIso.tkSumPt) /
393  elec->et();
394 
395  ElecIso_CombRelIso_->Fill(elecCombRelIso);
396 
397  ElecIso_cal_->Fill(elecIso.ecalRecHitSumEt);
398  ElecIso_trk_->Fill(elecIso.tkSumPt);
399 
400  if (elecCombRelIso < elec_iso_cut_) ++N_iso_el;
401  }
402 
403  Nelecs_iso_->Fill(N_iso_el);
404  }
405 
406  // --------------------
407  // TWO Isolated MUONS
408  // --------------------
409 
410  if (N_iso_mu > 1) {
411  // Vertex cut
412 
413  if (vertex_X < vertex_X_cut_ && vertex_Y < vertex_Y_cut_ &&
414  vertex_Z < vertex_Z_cut_) {
415  ++N_mumu;
416 
417  Events_->Fill(1.);
418 
419  reco::MuonCollection::const_reference mu1 = muons->at(0);
420  reco::MuonCollection::const_reference mu2 = muons->at(1);
421 
422  DilepMass =
423  sqrt((mu1.energy() + mu2.energy()) * (mu1.energy() + mu2.energy()) -
424  (mu1.px() + mu2.px()) * (mu1.px() + mu2.px()) -
425  (mu1.py() + mu2.py()) * (mu1.py() + mu2.py()) -
426  (mu1.pz() + mu2.pz()) * (mu1.pz() + mu2.pz()));
427 
428  // Opposite muon charges -> Right Charge (RC)
429 
430  if (mu1.charge() * mu2.charge() < 0.) {
431  dimassRC_LOG10_->Fill(log10(DilepMass));
432  dimassRC_->Fill(DilepMass);
433  dimassRC_LOGX_->Fill(DilepMass);
434 
435  if (DilepMass > MassWindow_down_ && DilepMass < MassWindow_up_) {
436  for (muon = muons->begin(); muon != muons->end(); ++muon) {
437  pT_muons_->Fill(muon->pt());
438  eta_muons_->Fill(muon->eta());
439  phi_muons_->Fill(muon->phi());
440  }
441 
442  D_eta_muons_->Fill(mu1.eta() - mu2.eta());
443  D_phi_muons_->Fill(mu1.phi() - mu2.phi());
444 
445  // Determinating trigger efficiencies
446 
447  for (int k = 0; k < N_SignalPaths; ++k) {
448  if (Fired_Signal_Trigger[k] && Fired_Control_Trigger[k]) ++N_sig[k];
449 
450  if (Fired_Control_Trigger[k]) ++N_trig[k];
451 
452  if (N_trig[k] != 0)
453  Eff[k] = N_sig[k] / static_cast<float>(N_trig[k]);
454 
455  TriggerEff_->setBinContent(k + 1, Eff[k]);
456  TriggerEff_->setBinLabel(k + 1,
457  "#frac{[" + hltPaths_sig_[k] + "]}{vs. [" +
458  hltPaths_trig_[k] + "]}",
459  1);
460  }
461  }
462  }
463 
464  // Same muon charges -> Wrong Charge (WC)
465 
466  if (mu1.charge() * mu2.charge() > 0.) {
467  dimassWC_LOG10_->Fill(log10(DilepMass));
468  dimassWC_->Fill(DilepMass);
469  dimassWC_LOGX_->Fill(DilepMass);
470  }
471  }
472  }
473 
474  // -----------------------------
475  // TWO Isolated LEPTONS (mu/e)
476  // -----------------------------
477 
478  if (N_iso_el > 0 && N_iso_mu > 0) {
479  // Vertex cut
480 
481  if (vertex_X < vertex_X_cut_ && vertex_Y < vertex_Y_cut_ &&
482  vertex_Z < vertex_Z_cut_) {
483  ++N_muel;
484 
485  Events_->Fill(2.);
486 
487  reco::MuonCollection::const_reference mu1 = muons->at(0);
488  reco::GsfElectronCollection::const_reference el1 = elecs->at(0);
489 
490  DilepMass =
491  sqrt((mu1.energy() + el1.energy()) * (mu1.energy() + el1.energy()) -
492  (mu1.px() + el1.px()) * (mu1.px() + el1.px()) -
493  (mu1.py() + el1.py()) * (mu1.py() + el1.py()) -
494  (mu1.pz() + el1.pz()) * (mu1.pz() + el1.pz()));
495 
496  // Opposite lepton charges -> Right Charge (RC)
497 
498  if (mu1.charge() * el1.charge() < 0.) {
499  dimassRC_LOG10_->Fill(log10(DilepMass));
500  dimassRC_->Fill(DilepMass);
501  dimassRC_LOGX_->Fill(DilepMass);
502 
503  if (DilepMass > MassWindow_down_ && DilepMass < MassWindow_up_) {
504  for (muon = muons->begin(); muon != muons->end(); ++muon) {
505  pT_muons_->Fill(muon->pt());
506  eta_muons_->Fill(muon->eta());
507  phi_muons_->Fill(muon->phi());
508  }
509 
510  for (elec = elecs->begin(); elec != elecs->end(); ++elec) {
511  pT_elecs_->Fill(elec->pt());
512  eta_elecs_->Fill(elec->eta());
513  phi_elecs_->Fill(elec->phi());
514  }
515 
516  D_eta_lepts_->Fill(mu1.eta() - el1.eta());
517  D_phi_lepts_->Fill(mu1.phi() - el1.phi());
518 
519  // Determinating trigger efficiencies
520 
521  for (int k = 0; k < N_SignalPaths; ++k) {
522  if (Fired_Signal_Trigger[k] && Fired_Control_Trigger[k]) ++N_sig[k];
523 
524  if (Fired_Control_Trigger[k]) ++N_trig[k];
525 
526  if (N_trig[k] != 0)
527  Eff[k] = N_sig[k] / static_cast<float>(N_trig[k]);
528 
529  TriggerEff_->setBinContent(k + 1, Eff[k]);
530  TriggerEff_->setBinLabel(k + 1,
531  "#frac{[" + hltPaths_sig_[k] + "]}{vs. [" +
532  hltPaths_trig_[k] + "]}",
533  1);
534  }
535  }
536  }
537 
538  // Same muon charges -> Wrong Charge (WC)
539 
540  if (mu1.charge() * el1.charge() > 0.) {
541  dimassWC_LOG10_->Fill(log10(DilepMass));
542  dimassWC_->Fill(DilepMass);
543  dimassWC_LOGX_->Fill(DilepMass);
544  }
545  }
546  }
547 
548  // ------------------------
549  // TWO Isolated ELECTRONS
550  // ------------------------
551 
552  if (N_iso_el > 1) {
553  // Vertex cut
554 
555  if (vertex_X < vertex_X_cut_ && vertex_Y < vertex_Y_cut_ &&
556  vertex_Z < vertex_Z_cut_) {
557  ++N_elel;
558 
559  Events_->Fill(3.);
560 
561  reco::GsfElectronCollection::const_reference el1 = elecs->at(0);
562  reco::GsfElectronCollection::const_reference el2 = elecs->at(1);
563 
564  DilepMass =
565  sqrt((el1.energy() + el2.energy()) * (el1.energy() + el2.energy()) -
566  (el1.px() + el2.px()) * (el1.px() + el2.px()) -
567  (el1.py() + el2.py()) * (el1.py() + el2.py()) -
568  (el1.pz() + el2.pz()) * (el1.pz() + el2.pz()));
569 
570  // Opposite lepton charges -> Right Charge (RC)
571 
572  if (el1.charge() * el2.charge() < 0.) {
573  dimassRC_LOG10_->Fill(log10(DilepMass));
574  dimassRC_->Fill(DilepMass);
575  dimassRC_LOGX_->Fill(DilepMass);
576 
577  if (DilepMass > MassWindow_down_ && DilepMass < MassWindow_up_) {
578  for (elec = elecs->begin(); elec != elecs->end(); ++elec) {
579  pT_elecs_->Fill(elec->pt());
580  eta_elecs_->Fill(elec->eta());
581  phi_elecs_->Fill(elec->phi());
582  }
583 
584  D_eta_elecs_->Fill(el1.eta() - el2.eta());
585  D_phi_elecs_->Fill(el1.phi() - el2.phi());
586 
587  // Determinating trigger efficiencies
588 
589  for (int k = 0; k < N_SignalPaths; ++k) {
590  if (Fired_Signal_Trigger[k] && Fired_Control_Trigger[k]) ++N_sig[k];
591 
592  if (Fired_Control_Trigger[k]) ++N_trig[k];
593 
594  if (N_trig[k] != 0)
595  Eff[k] = N_sig[k] / static_cast<float>(N_trig[k]);
596 
597  TriggerEff_->setBinContent(k + 1, Eff[k]);
598  TriggerEff_->setBinLabel(k + 1,
599  "#frac{[" + hltPaths_sig_[k] + "]}{vs. [" +
600  hltPaths_trig_[k] + "]}",
601  1);
602  }
603  }
604  }
605 
606  // Same muon charges -> Wrong Charge (WC)
607 
608  if (el1.charge() * el2.charge() > 0.) {
609  dimassWC_LOG10_->Fill(log10(DilepMass));
610  dimassWC_->Fill(DilepMass);
611  dimassWC_LOGX_->Fill(DilepMass);
612  }
613  }
614  }
615 }
float hadEt
hcal sum-Et
Definition: MuonIsolation.h:9
T getParameter(std::string const &) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:215
float sumPt
sum-pt of tracks
Definition: MuonIsolation.h:7
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
double y() const
y coordinate
Definition: Vertex.h:103
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
tuple primaryVertex
TopDiLeptonDQM(const edm::ParameterSet &)
T sqrt(T t)
Definition: SSEVec.h:18
float emEt
ecal sum-Et
Definition: MuonIsolation.h:8
int nJets
number of jets in the cone
Definition: MuonIsolation.h:12
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
double z() const
y coordinate
Definition: Vertex.h:105
float hoEt
ho sum-Et
Definition: MuonIsolation.h:10
void setTitle(const std::string &title)
set (ie. change) histogram/profile title
virtual void analyze(const edm::Event &, const edm::EventSetup &)
int nTracks
number of tracks in the cone (excluding veto region)
Definition: MuonIsolation.h:11
bool failedToGet() const
Definition: HandleBase.h:79
double x() const
x coordinate
Definition: Vertex.h:101
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
bool isFake() const
Definition: Vertex.h:64
T const * product() const
Definition: Handle.h:81
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
tuple muons
Definition: patZpeak.py:38
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
size_t tracksSize() const
number of tracks
Definition: Vertex.cc:34
Definition: Run.h:43