7 #include "TLorentzVector.h"
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");
40 MassWindow_up_ = ps.
getParameter<
double>(
"MassWindow_up");
41 MassWindow_down_ = ps.
getParameter<
double>(
"MassWindow_down");
43 for (
int i = 0;
i < 100; ++
i) {
54 TriggerEff_ =
nullptr;
57 Nmuons_iso_ =
nullptr;
58 Nmuons_charge_ =
nullptr;
59 VxVy_muons_ =
nullptr;
65 Nelecs_iso_ =
nullptr;
66 Nelecs_charge_ =
nullptr;
67 HoverE_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;
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;
100 Events_ = iBooker.
book1D(
"00_Events",
"Isolated dilepton events", 5, 0., 5.);
102 Events_->setBinLabel(3,
"#mu e", 1);
103 Events_->setBinLabel(4,
"e e", 1);
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.);
108 "HL Trigger Efficiencies #epsilon_{signal} = #frac{[signal] && "
109 "[control]}{[control]}");
110 Ntracks_ = iBooker.
book1D(
"Ntracks",
"Number of tracks", 50, 0., 50.);
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.);
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.);
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.);
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.);
141 const int nbins = 200;
149 double log = logmin + (logmax - logmin) *
i /
nbins;
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);
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.);
173 const int N_TriggerPaths = hltPaths_.size();
174 const int N_SignalPaths = hltPaths_sig_.size();
175 const int N_ControlPaths = hltPaths_trig_.size();
177 bool Fired_Signal_Trigger[100] = {
false};
178 bool Fired_Control_Trigger[100] = {
false};
184 double DilepMass = 0.;
186 double vertex_X = 100.;
187 double vertex_Y = 100.;
188 double vertex_Z = 100.;
204 Ntracks_->Fill(numberTracks);
206 if (!fake && numberTracks > 3) {
221 int N_Triggers = trigResults->
size();
225 for (
int i_Trig = 0; i_Trig < N_Triggers; ++i_Trig) {
229 for (
int i = 0;
i < N_TriggerPaths;
i++) {
230 if (
trigName.triggerName(i_Trig) == hltPaths_[
i]) {
232 Trigs_->setBinLabel(
i + 1, hltPaths_[
i], 1);
238 for (
int j = 0;
j < N_SignalPaths; ++
j) {
239 if (
trigName.triggerName(i_Trig) == hltPaths_sig_[
j])
240 Fired_Signal_Trigger[
j] =
true;
243 for (
int k = 0;
k < N_ControlPaths; ++
k) {
244 if (
trigName.triggerName(i_Trig) == hltPaths_trig_[
k])
245 Fired_Control_Trigger[
k] =
true;
258 reco::MuonCollection::const_iterator
muon;
260 if (!
muons.failedToGet()) {
261 Nmuons_->Fill(
muons->size());
263 N_leptons = N_leptons +
muons->size();
266 float N_muons =
muons->size();
267 float Q_muon =
muon->charge();
269 Nmuons_charge_->Fill(N_muons * Q_muon);
271 double track_X = 100.;
272 double track_Y = 100.;
273 double track_Z = 100.;
275 if (
muon->isGlobalMuon()) {
278 track_X =
track->vx();
279 track_Y =
track->vy();
280 track_Z =
track->vz();
282 VxVy_muons_->Fill(track_X, track_Y);
283 Vz_muons_->Fill(track_Z);
288 if (track_X > vertex_X_cut_)
290 if (track_Y > vertex_Y_cut_)
292 if (track_Z > vertex_Z_cut_)
294 if (
muon->pt() < muon_pT_cut_)
296 if (
abs(
muon->eta()) > muon_eta_cut_)
301 double muonCombRelIso = 1.;
303 if (
muon->pt() != 0.)
306 MuIso_CombRelIso03_->Fill(muonCombRelIso);
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);
315 if (muonCombRelIso < muon_iso_cut_)
319 Nmuons_iso_->Fill(N_iso_mu);
329 reco::GsfElectronCollection::const_iterator elec;
331 if (!
elecs.failedToGet()) {
332 Nelecs_->Fill(
elecs->size());
334 N_leptons = N_leptons +
elecs->size();
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();
341 HoverE_elecs_->Fill(HoverE);
343 Nelecs_charge_->Fill(N_elecs * Q_elec);
345 double track_X = 100.;
346 double track_Y = 100.;
347 double track_Z = 100.;
351 track_X =
track->vx();
352 track_Y =
track->vy();
353 track_Z =
track->vz();
357 if (track_X > vertex_X_cut_)
359 if (track_Y > vertex_Y_cut_)
361 if (track_Z > vertex_Z_cut_)
363 if (elec->pt() < elec_pT_cut_)
365 if (
abs(elec->eta()) > elec_eta_cut_)
367 if (HoverE > elec_emf_cut_)
372 double elecCombRelIso = 1.;
374 if (elec->et() != 0.)
377 ElecIso_CombRelIso_->Fill(elecCombRelIso);
380 ElecIso_trk_->Fill(elecIso.
tkSumPt);
382 if (elecCombRelIso < elec_iso_cut_)
386 Nelecs_iso_->Fill(N_iso_el);
396 if (vertex_X < vertex_X_cut_ && vertex_Y < vertex_Y_cut_ && vertex_Z < vertex_Z_cut_) {
401 reco::MuonCollection::const_reference mu1 =
muons->at(0);
402 reco::MuonCollection::const_reference mu2 =
muons->at(1);
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()));
410 if (mu1.charge() * mu2.charge() < 0.) {
411 dimassRC_LOG10_->Fill(log10(DilepMass));
412 dimassRC_->Fill(DilepMass);
413 dimassRC_LOGX_->Fill(DilepMass);
415 if (DilepMass > MassWindow_down_ && DilepMass < MassWindow_up_) {
417 pT_muons_->Fill(
muon->pt());
418 eta_muons_->Fill(
muon->eta());
419 phi_muons_->Fill(
muon->phi());
422 D_eta_muons_->Fill(mu1.eta() - mu2.eta());
423 D_phi_muons_->Fill(mu1.phi() - mu2.phi());
427 for (
int k = 0;
k < N_SignalPaths; ++
k) {
428 if (Fired_Signal_Trigger[
k] && Fired_Control_Trigger[
k])
431 if (Fired_Control_Trigger[
k])
435 Eff[
k] = N_sig[
k] / static_cast<float>(N_trig[
k]);
437 TriggerEff_->setBinContent(
k + 1, Eff[
k]);
438 TriggerEff_->setBinLabel(
k + 1,
"#frac{[" + hltPaths_sig_[
k] +
"]}{vs. [" + hltPaths_trig_[
k] +
"]}", 1);
445 if (mu1.charge() * mu2.charge() > 0.) {
446 dimassWC_LOG10_->Fill(log10(DilepMass));
447 dimassWC_->Fill(DilepMass);
448 dimassWC_LOGX_->Fill(DilepMass);
457 if (N_iso_el > 0 && N_iso_mu > 0) {
460 if (vertex_X < vertex_X_cut_ && vertex_Y < vertex_Y_cut_ && vertex_Z < vertex_Z_cut_) {
465 reco::MuonCollection::const_reference mu1 =
muons->at(0);
466 reco::GsfElectronCollection::const_reference el1 =
elecs->at(0);
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()));
474 if (mu1.charge() * el1.charge() < 0.) {
475 dimassRC_LOG10_->Fill(log10(DilepMass));
476 dimassRC_->Fill(DilepMass);
477 dimassRC_LOGX_->Fill(DilepMass);
479 if (DilepMass > MassWindow_down_ && DilepMass < MassWindow_up_) {
481 pT_muons_->Fill(
muon->pt());
482 eta_muons_->Fill(
muon->eta());
483 phi_muons_->Fill(
muon->phi());
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());
492 D_eta_lepts_->Fill(mu1.eta() - el1.eta());
493 D_phi_lepts_->Fill(mu1.phi() - el1.phi());
497 for (
int k = 0;
k < N_SignalPaths; ++
k) {
498 if (Fired_Signal_Trigger[
k] && Fired_Control_Trigger[
k])
501 if (Fired_Control_Trigger[
k])
505 Eff[
k] = N_sig[
k] / static_cast<float>(N_trig[
k]);
507 TriggerEff_->setBinContent(
k + 1, Eff[
k]);
508 TriggerEff_->setBinLabel(
k + 1,
"#frac{[" + hltPaths_sig_[
k] +
"]}{vs. [" + hltPaths_trig_[
k] +
"]}", 1);
515 if (mu1.charge() * el1.charge() > 0.) {
516 dimassWC_LOG10_->Fill(log10(DilepMass));
517 dimassWC_->Fill(DilepMass);
518 dimassWC_LOGX_->Fill(DilepMass);
530 if (vertex_X < vertex_X_cut_ && vertex_Y < vertex_Y_cut_ && vertex_Z < vertex_Z_cut_) {
535 reco::GsfElectronCollection::const_reference el1 =
elecs->at(0);
536 reco::GsfElectronCollection::const_reference el2 =
elecs->at(1);
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()));
544 if (el1.charge() * el2.charge() < 0.) {
545 dimassRC_LOG10_->Fill(log10(DilepMass));
546 dimassRC_->Fill(DilepMass);
547 dimassRC_LOGX_->Fill(DilepMass);
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());
556 D_eta_elecs_->Fill(el1.eta() - el2.eta());
557 D_phi_elecs_->Fill(el1.phi() - el2.phi());
561 for (
int k = 0;
k < N_SignalPaths; ++
k) {
562 if (Fired_Signal_Trigger[
k] && Fired_Control_Trigger[
k])
565 if (Fired_Control_Trigger[
k])
569 Eff[
k] = N_sig[
k] / static_cast<float>(N_trig[
k]);
571 TriggerEff_->setBinContent(
k + 1, Eff[
k]);
572 TriggerEff_->setBinLabel(
k + 1,
"#frac{[" + hltPaths_sig_[
k] +
"]}{vs. [" + hltPaths_trig_[
k] +
"]}", 1);
579 if (el1.charge() * el2.charge() > 0.) {
580 dimassWC_LOG10_->Fill(log10(DilepMass));
581 dimassWC_->Fill(DilepMass);
582 dimassWC_LOGX_->Fill(DilepMass);