59 void endJob()
override;
74 double etamax_,
ptmin_, massMin_, massMax_, isoMax_;
129 bothMuons_(
pset.getParameter<
bool>(
"bothMuons")),
131 etamax_(
pset.getUntrackedParameter<double>(
"etamax")),
132 ptmin_(
pset.getUntrackedParameter<double>(
"ptmin")),
133 massMin_(
pset.getUntrackedParameter<double>(
"zMassMin")),
134 massMax_(
pset.getUntrackedParameter<double>(
"zMassMax")),
135 isoMax_(
pset.getUntrackedParameter<double>(
"isomax")) {
142 h_muon_vz = fs->
make<TH1D>(
"muonVz",
"z vertex of muons", 50, -20., 20.);
144 h_dimuon_vz = fs->
make<TH1D>(
"dimuonVz",
"z vertex of dimuon", 50, -20., 20.);
146 fs->
make<TH1D>(
"muonVz_respectToPV",
"z vertex of muons respect to PrimaryVertex", 50, -.05, .05);
148 fs->
make<TH1D>(
"muonD0signed_respectToPV",
"d0 vertex of muons respect to PrimaryVertex", 50, -.05, .05);
154 "zmumuSele_muonVz_respectToPV",
"z vertex of muons respect to PrimaryVertex (zmumu sele)", 50, -.05, .05);
156 "zmumuSele_muonD0signed_respectToPV",
"d0 vertex of muons respect to PrimaryVertex (zmumu sele)", 50, -.05, .05);
159 fs->
make<TH1D>(
"zmumuNotIsoSele_dimuonVz",
"z vertex of dimuon (zmumuNotIso sele)", 50, -20., 20.);
161 fs->
make<TH1D>(
"zmumuNotIsoSele_muonIsoVz",
"z vertex of muons (zmumuNotIso sele muon Iso)", 50, -20., 20.);
163 fs->
make<TH1D>(
"zmumuNotIsoSele_muonIsoD0signed",
"d0 vertex of muons (zmumuNotIso sele muon Iso)", 50, -.1, .1);
165 fs->
make<TH1D>(
"zmumuNotIsoSele_muonIsoVz_respectToPV",
166 "z vertex of muons respect to PrimaryVertex (zmumuNotIso sele muon Iso)",
171 fs->
make<TH1D>(
"zmumuNotIsoSele_muonIsoD0signed_respectToPV",
172 "d0 vertex of muons respect to PrimaryVertex (zmumuNotIso sele muon Iso)",
177 "zmumuNotIsoSele_muonNotIsoVz",
"z vertex of muons (zmumuNotIso sele muon Not Iso)", 50, -20., 20.);
179 "zmumuNotIsoSele_muonNotIsoD0signed",
"d0 vertex of muons (zmumuNotIso sele muon Not Iso)", 50, -.1, .1);
181 fs->
make<TH1D>(
"zmumuNotIsoSele_muonNotIsoVz_respectToPV",
182 "z vertex of muons respect to PrimaryVertex (zmumuNotIso sele muon Not Iso)",
187 fs->
make<TH1D>(
"zmumuNotIsoSele_muonNotIsoD0signed_respectToPV",
188 "d0 vertex of muons respect to PrimaryVertex (zmumuNotIso sele muon Not Iso)",
195 fs->
make<TH1D>(
"zmutrackSele_muonD0signed",
"d0 vertex of muon (zmutrack sele)", 50, -.1, .1);
197 "zmutrackSele_muonVz_respectToPV",
"z vertex of muon respect to PV (zmutrack sele)", 50, -.05, .05);
199 "zmutrackSele_muonD0signed_respectToPV",
"d0 vertex of muon respect to PV (zmutrack sele)", 50, -.1, .1);
202 fs->
make<TH1D>(
"zmutrackSele_trackD0signed",
"d0 vertex of track (zmutrack sele)", 50, -.1, .1);
204 "zmutrackSele_trackVz_respectToPV",
"z vertex of track respect to PV (zmutrack sele)", 50, -.05, .05);
206 "zmutrackSele_trackD0signed_respectToPV",
"d0 vertex of track respect to PV (zmutrack sele)", 50, -.1, .1);
210 fs->
make<TH1D>(
"zmustaSele_muonD0signed",
"d0 vertex of muon (zmusta sele)", 50, -.1, .1);
212 fs->
make<TH1D>(
"zmustaSele_muonVz_respectToPV",
"z vertex of muon respect to PV (zmusta sele)", 50, -.05, .05);
214 "zmustaSele_muonD0signed_respectToPV",
"d0 vertex of muon respect to PV (zmusta sele)", 50, -.1, .1);
218 fs->
make<TH1D>(
"zmustaSele_staVz_respectToPV",
"z vertex of sta respect to PV (zmusta sele)", 50, -.05, .05);
220 fs->
make<TH1D>(
"zmustaSele_staD0signed_respectToPV",
"d0 vertex of sta respect to PV (zmusta sele)", 50, -.1, .1);
256 bool zMuMu_found =
false;
259 if (!
zMuMu->empty()) {
261 for (
unsigned int i = 0;
i <
zMuMu->size(); ++
i) {
268 double trkiso0 = muonDau0.
trackIso();
269 const pat::Muon &muonDau1 = dynamic_cast<const pat::Muon &>(*
lep1->masterClone());
270 double trkiso1 = muonDau1.
trackIso();
278 float d0signed_mu0 = (*mu0TrkRef).dxy();
279 float d0signed_mu0_respectToPV = (*mu0TrkRef).dxy(
primaryVertices->begin()->position());
280 float vz_mu0_respectToPV = (*mu0TrkRef).dz(
primaryVertices->begin()->position());
283 float d0signed_mu1 = (*mu1TrkRef).dxy();
284 float d0signed_mu1_respectToPV = (*mu1TrkRef).dxy(
primaryVertices->begin()->position());
285 float vz_mu1_respectToPV = (*mu1TrkRef).dz(
primaryVertices->begin()->position());
304 bool trig0found =
false;
305 bool trig1found =
false;
306 if (!mu0HLTMatches.empty())
308 if (!mu1HLTMatches.empty())
336 if (trkiso0 < isoMax_ && trkiso1 >=
isoMax_) {
352 bool zMuSta_found =
false;
353 if (!zMuMu_found && !zMuStandAlone->
empty()) {
355 for (
unsigned int i = 0;
i < zMuStandAlone->
size(); ++
i) {
356 const Candidate &zMuStandAloneCand = (*zMuStandAlone)[
i];
358 GenParticleRef zMuStandAloneMatch = (*zMuStandAloneMatchMap)[zMuStandAloneCandRef];
363 double trkiso0 = muonDau0.
trackIso();
364 const pat::Muon &muonDau1 = dynamic_cast<const pat::Muon &>(*
lep1->masterClone());
365 double trkiso1 = muonDau1.
trackIso();
370 float d0signed_mu0 = (*mu0TrkRef).dxy();
371 float d0signed_mu0_respectToPV = (*mu0TrkRef).dxy(
primaryVertices->begin()->position());
372 float vz_mu0_respectToPV = (*mu0TrkRef).dz(
primaryVertices->begin()->position());
375 float d0signed_mu1 = (*mu1TrkRef).dxy();
376 float d0signed_mu1_respectToPV = (*mu1TrkRef).dxy(
primaryVertices->begin()->position());
377 float vz_mu1_respectToPV = (*mu1TrkRef).dz(
primaryVertices->begin()->position());
379 double pt0 = zMuStandAloneCand.
daughter(0)->
pt();
381 double eta0 = zMuStandAloneCand.
daughter(0)->
eta();
383 double mass = zMuStandAloneCand.
mass();
389 bool trig0found =
false;
390 bool trig1found =
false;
391 if (!mu0HLTMatches.empty())
393 if (!mu1HLTMatches.empty())
397 bool trigfound =
false;
399 trigfound = trig0found;
401 trigfound = trig1found;
421 if (!zMuMu_found && !zMuSta_found && !zMuTrack->
empty()) {
423 for (
unsigned int i = 0;
i < zMuTrack->
size(); ++
i) {
424 const Candidate &zMuTrackCand = (*zMuTrack)[
i];
429 double trkiso0 = muonDau0.
trackIso();
431 double trkiso1 = trackDau1.
trackIso();
436 float d0signed_mu0 = (*mu0TrkRef).dxy();
437 float d0signed_mu0_respectToPV = (*mu0TrkRef).dxy(
primaryVertices->begin()->position());
438 float vz_mu0_respectToPV = (*mu0TrkRef).dz(
primaryVertices->begin()->position());
441 float d0signed_mu1 = (*mu1TrkRef).dxy();
442 float d0signed_mu1_respectToPV = (*mu1TrkRef).dxy(
primaryVertices->begin()->position());
443 float vz_mu1_respectToPV = (*mu1TrkRef).dz(
primaryVertices->begin()->position());
456 bool trig0found =
false;
457 if (!mu0HLTMatches.empty())
479 int partId0 = dauGen0->
pdgId();
480 int partId1 = dauGen1->
pdgId();
481 int partId2 = dauGen2->
pdgId();
482 bool muplusFound =
false;
483 bool muminusFound =
false;
485 if (partId0 == 13 || partId1 == 13 || partId2 == 13)
487 if (partId0 == -13 || partId1 == -13 || partId2 == -13)
489 if (partId0 == 23 || partId1 == 23 || partId2 == 23)
491 return (muplusFound && muminusFound && ZFound);
498 int partId0 = dauGen0->
pdgId();
499 int partId1 = dauGen1->
pdgId();
500 int partId2 = dauGen2->
pdgId();
502 if (partId0 == ipart) {
505 if (dauMuGen->
pdgId() == ipart && dauMuGen->
status() == 1) {
506 ptpart = dauMuGen->
pt();
510 if (partId1 == ipart) {
513 if (dauMuGen->
pdgId() == ipart && dauMuGen->
status() == 1) {
514 ptpart = dauMuGen->
pt();
518 if (partId2 == ipart) {
522 ptpart = dauMuGen->
pt();
533 int partId0 = dauGen0->
pdgId();
534 int partId1 = dauGen1->
pdgId();
535 int partId2 = dauGen2->
pdgId();
537 if (partId0 == ipart) {
540 if (dauMuGen->
pdgId() == ipart && dauMuGen->
status() == 1) {
541 etapart = dauMuGen->
eta();
545 if (partId1 == ipart) {
548 if (dauMuGen->
pdgId() == ipart && dauMuGen->
status() == 1) {
549 etapart = dauMuGen->
eta();
553 if (partId2 == ipart) {
557 etapart = dauMuGen->
eta();
568 int partId0 = dauGen0->
pdgId();
569 int partId1 = dauGen1->
pdgId();
570 int partId2 = dauGen2->
pdgId();
572 if (partId0 == ipart) {
575 if (dauMuGen->
pdgId() == ipart && dauMuGen->
status() == 1) {
576 phipart = dauMuGen->
phi();
580 if (partId1 == ipart) {
583 if (dauMuGen->
pdgId() == ipart && dauMuGen->
status() == 1) {
584 phipart = dauMuGen->
phi();
588 if (partId2 == ipart) {
592 phipart = dauMuGen->
phi();
603 int partId0 = dauGen0->
pdgId();
604 int partId1 = dauGen1->
pdgId();
605 int partId2 = dauGen2->
pdgId();
607 if (partId0 == ipart) {
610 if (dauMuGen->
pdgId() == ipart && dauMuGen->
status() == 1) {
611 p4part = dauMuGen->
p4();
615 if (partId1 == ipart) {
618 if (dauMuGen->
pdgId() == ipart && dauMuGen->
status() == 1) {
619 p4part = dauMuGen->
p4();
623 if (partId2 == ipart) {
627 p4part = dauMuGen->
p4();