CMS 3D CMS Logo

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