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();
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();
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();
EDGetTokenT< GenParticleMatch > zMuTrackMatchMapToken_
TH1D * h_zmumuSele_muon_d0signed_respectToPV
TH1D * h_zmumuNotIsoSele_muonNotIso_d0signed
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
float getParticlePt(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
TH1D * h_zmustaSele_sta_d0signed
EDGetTokenT< GenParticleMatch > zMuStandAloneMatchMapToken_
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
TH1D * h_zmumuNotIsoSele_muonIso_d0signed
bool check_ifZmumu(const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
TH1D * h_zmutrackSele_track_vz_respectToPV
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
TH1D * h_zmumuNotIsoSele_dimuon_vz
float getParticleEta(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
std::vector< Vertex > VertexCollection
collection of Vertex objects
EDGetTokenT< GenParticleCollection > genParticlesToken_
T * make(const Args &...args) const
make new ROOT object
TH1D * h_zmustaSele_muon_vz
reco::TrackRef track() const override
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
TH1D * h_zmumuSele_dimuon_vz
TH1D * h_zmustaSele_muon_vz_respectToPV
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
TH1D * h_zmutrackSele_track_d0signed
TH1D * h_zmutrackSele_muon_d0signed
TH1D * h_zmumuNotIsoSele_muonIso_vz
RefToBase< value_type > refAt(size_type i) const
virtual int status() const =0
status word
TH1D * h_zmutrackSele_track_d0signed_respectToPV
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) ...
TH1D * h_zmumuNotIsoSele_muonNotIso_d0signed_respectToPV
TH1D * h_zmumuSele_muon_vz_respectToPV
EDGetTokenT< GenParticleMatch > zMuMuMatchMapToken_
TH1D * h_zmumuSele_muon_d0signed
#define DEFINE_FWK_MODULE(type)
TH1D * h_muon_vz_respectToPV
bool isGlobalMuon() const override
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
virtual int pdgId() const =0
PDG identifier.
TH1D * h_zmumuNotIsoSele_muonIso_d0signed_respectToPV
TH1D * h_zmustaSele_muon_d0signed
EDGetTokenT< CandidateView > zMuMuToken_
TH1D * h_zmustaSele_sta_d0signed_respectToPV
edm::ValueMap< float > IsolationCollection
TH1D * h_zmutrackSele_muon_vz_respectToPV
Abs< T >::type abs(const T &t)
Particle::LorentzVector getParticleP4(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
TH1D * h_zmumuNotIsoSele_muonNotIso_vz_respectToPV
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
TH1D * h_zmustaSele_sta_vz_respectToPV
double vz() const override
z coordinate of vertex position
TH1D * h_zmumuNotIsoSele_muonNotIso_vz
virtual const CandidateBaseRef & masterClone() const =0
zMuMu
zMuMu vector of PSet is common to all categories except zMuTrk category
virtual double eta() const =0
momentum pseudorapidity
reco::CandidateBaseRef trackMuonCandRef_
virtual double pt() const =0
transverse momentum
reco::TrackRef track() const override
TH1D * h_zmustaSele_muon_d0signed_respectToPV
virtual double mass() const =0
mass
EDGetTokenT< CandidateView > tracksToken_
EDGetTokenT< VertexCollection > primaryVerticesToken_
ZMuMu_vtxAnalyzer(const edm::ParameterSet &pset)
EDGetTokenT< CandidateView > muonsToken_
TH1D * h_zmumuNotIsoSele_muonIso_vz_respectToPV
TH1D * h_muon_d0signed_respectToPV
lep1
print 'MRbb(1b)',event.mr_bb
EDGetTokenT< CandidateView > zMuStandAloneToken_
TH1D * h_zmustaSele_sta_vz
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
TH1D * h_zmutrackSele_muon_d0signed_respectToPV
virtual size_type numberOfDaughters() const =0
number of daughters
EDGetTokenT< CandidateView > zMuTrackToken_
virtual double phi() const =0
momentum azimuthal angle
float getParticlePhi(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
Analysis-level muon class.
TH1D * h_zmumuSele_muon_vz
math::PtEtaPhiELorentzVectorF LorentzVector
TH1D * h_zmutrackSele_track_vz
TH1D * h_zmutrackSele_muon_vz