260 unsigned int nmuonsForZ1 = 0;
261 unsigned int nmuonsForZ2 = 0;
263 for (
unsigned int i = 0;
i < muonCollectionSize;
i++) {
265 if (!
mu.isGlobalMuon())
268 double dxy =
mu.innerTrack()->dxy(beamSpotHandle->
position());
280 for (
unsigned int j =
i + 1;
j < muonCollectionSize;
j++) {
284 mu.px() + mu2.
px(),
mu.py() + mu2.
py(),
mu.pz() + mu2.
pz(),
mu.p() + mu2.
p());
286 if (
mu.charge() > 0) {
307 double met_et =
met.pt();
308 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " <<
met.px() <<
", " <<
met.py() <<
" [GeV]";
314 LogError(
"") <<
">>> Vertex collection does not exist !!!";
320 for (
unsigned int i = 0;
i < vertexCollectionSize;
i++) {
369 if (prescaleSet == -1) {
370 LogTrace(
"") <<
"Failed to determine prescaleSet\n";
428 for (
unsigned int i = 0;
i < jetCollectionSize;
i++) {
430 double minDistance = 99999;
431 for (
unsigned int j = 0;
j < muonCollectionSize;
j++) {
438 if (minDistance < 0.3)
440 if (
jet.et() > max_pt) {
449 LogTrace(
"") <<
">>> Total number of jets: " << jetCollectionSize;
452 double lead_jet_pt = -1;
453 double lead_jet_eta = -100;
458 lead_jet_pt = leadJet.
pt();
459 lead_jet_eta = leadJet.
eta();
467 unsigned int ngam = 0;
479 LogTrace(
"") <<
" >>> N photons " << ngam << std::endl;
489 bool zjets_hist_done =
false;
490 bool zfullsel_hist_done =
false;
491 bool met_hist_done =
false;
492 bool njets_hist_done =
false;
493 bool wfullsel_hist_done =
false;
496 const int NFLAGS = 10;
497 bool muon_sel[NFLAGS];
498 const int NFLAGSZ = 12;
499 bool zmuon_sel[NFLAGSZ];
502 double number_of_muons = 0;
503 double number_of_goodMuons = 0;
505 for (
unsigned int i = 0;
i < muonCollectionSize;
i++) {
506 for (
int j = 0;
j < NFLAGS; ++
j) {
513 if (!
mu.isGlobalMuon())
515 if (
mu.globalTrack().isNull())
517 if (
mu.innerTrack().isNull())
520 LogTrace(
"") <<
"> Wsel: processing muon number " <<
i <<
"...";
526 double eta =
mu.eta();
527 LogTrace(
"") <<
"\t... pt, eta: " <<
pt <<
" [GeV], " <<
eta;
539 double trackerHits = tk->hitPattern().numberOfValidTrackerHits();
540 int pixelHits = tk->hitPattern().numberOfValidPixelHits();
541 int muonHits = gm->hitPattern().numberOfValidMuonHits();
542 int nMatches =
mu.numberOfMatches();
560 if (!
mu.isTrackerMuon())
566 number_of_goodMuons++;
581 double isovar =
mu.isolationR03().sumPt;
583 isovar +=
mu.isolationR03().emEt;
584 isovar +=
mu.isolationR03().hadEt;
591 LogTrace(
"") <<
"\t... isolation value" << isovar <<
", isolated? " << muon_sel[6];
603 double w_et = met_et +
mu.pt();
604 double w_px =
met.px() +
mu.px();
605 double w_py =
met.py() +
mu.py();
607 double massT = w_et * w_et - w_px * w_px - w_py * w_py;
608 massT = (massT > 0) ?
sqrt(massT) : 0;
610 LogTrace(
"") <<
"\t... W mass, W_et, W_px, W_py: " << massT <<
", " << w_et <<
", " << w_px <<
", " << w_py
620 double acop = deltaphi.value();
624 LogTrace(
"") <<
"\t... acoplanarity: " << acop;
630 if (nmuonsForZ1 < 1 || nmuonsForZ2 < 2)
636 int flags_passed = 0;
637 for (
int j = 0;
j < NFLAGS; ++
j) {
643 if (flags_passed >= (NFLAGS - 1)) {
644 if (!muon_sel[0] || flags_passed == NFLAGS)
646 if (!muon_sel[1] || flags_passed == NFLAGS)
648 if (!muon_sel[2] || flags_passed == NFLAGS)
650 if (!muon_sel[3] || flags_passed == NFLAGS)
652 if (!muon_sel[4] || flags_passed == NFLAGS)
657 if (!muon_sel[5] || flags_passed == NFLAGS)
659 if (!muon_sel[6] || flags_passed == NFLAGS)
662 met_hist_done =
true;
663 if (!muon_sel[7] || flags_passed == NFLAGS)
666 if (!muon_sel[9] || flags_passed == NFLAGS) {
667 if (!njets_hist_done) {
672 njets_hist_done =
true;
674 if (flags_passed == NFLAGS) {
675 if (!wfullsel_hist_done) {
681 wfullsel_hist_done =
true;
687 if (muon4Z && !muon_sel[8]) {
689 for (
unsigned int j =
i + 1;
j < muonCollectionSize;
j++) {
690 for (
int ij = 0; ij < NFLAGSZ; ++ij) {
691 zmuon_sel[ij] =
false;
694 for (
int ji = 0; ji < 5; ++ji) {
695 zmuon_sel[ji] = muon_sel[ji];
705 double pt2 = mu2.
pt();
711 double dxy2 = gm2->dxy(beamSpotHandle->
position());
714 double normalizedChi22 = gm2->normalizedChi2();
715 double trackerHits2 = tk2->hitPattern().numberOfValidTrackerHits();
716 int pixelHits2 = tk2->hitPattern().numberOfValidPixelHits();
717 int muonHits2 = gm2->hitPattern().numberOfValidMuonHits();
719 bool quality2 =
true;
732 zmuon_sel[8] = quality2;
744 mu.px() + mu2.
px(),
mu.py() + mu2.
py(),
mu.pz() + mu2.
pz(),
mu.p() + mu2.
p());
746 zmuon_sel[10] =
true;
750 zmuon_sel[11] =
true;
753 int flags_passed_z = 0;
755 for (
int jj = 0;
jj < NFLAGSZ; ++
jj) {
760 if (flags_passed_z >= (NFLAGSZ - 1)) {
761 if (!zmuon_sel[0] || flags_passed_z == NFLAGSZ) {
764 if (!zmuon_sel[1] || flags_passed_z == NFLAGSZ) {
767 if (!zmuon_sel[2] || flags_passed_z == NFLAGSZ) {
770 if (!zmuon_sel[3] || flags_passed_z == NFLAGSZ) {
773 if (!zmuon_sel[4] || flags_passed_z == NFLAGSZ) {
776 if (!zmuon_sel[5] || flags_passed_z == NFLAGSZ) {
779 if (!zmuon_sel[6] || flags_passed_z == NFLAGSZ) {
782 if (!zmuon_sel[7] || flags_passed_z == NFLAGSZ) {
785 if (!zmuon_sel[8] || flags_passed_z == NFLAGSZ) {
788 if (!zmuon_sel[9] || flags_passed_z == NFLAGSZ) {
795 if (!zmuon_sel[10] || flags_passed_z == NFLAGSZ) {
798 if (!zmuon_sel[11] || flags_passed_z == NFLAGSZ) {
799 if (!zjets_hist_done) {
804 zjets_hist_done =
true;
806 if (flags_passed_z == NFLAGSZ) {
808 if (!zfullsel_hist_done) {
821 zfullsel_hist_done =
true;
828 if (zfullsel_hist_done) {
MonitorElement * met_before_
const MuonIsolation & isolationR03() const
MonitorElement * ptDiffPM_afterZ_
MonitorElement * dimuonmass_afterZ_
double pz() const final
z coordinate of momentum vector
float sumPt
sum-pt of tracks
MonitorElement * njets_afterZ_
double pt() const final
transverse momentum
const Point & position() const
position
MonitorElement * iso2_afterZ_
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
MonitorElement * npvs_before_
MonitorElement * dxy1_afterZ_
MonitorElement * njets_before_
MonitorElement * dxy_before_
MonitorElement * leadingjet_eta_afterZ_
MonitorElement * muoncharge_before_
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
MonitorElement * eta2_afterZ_
MonitorElement * npvs_afterZ_
MonitorElement * leadingjet_eta_before_
Log< level::Error, false > LogError
MonitorElement * acop_before_
MonitorElement * leadingjet_pt_after_
MonitorElement * goodewkmuon_before_
MonitorElement * eta_after_
MonitorElement * muoncharge_afterZ_
MonitorElement * pt_before_
bool isTrackerMuon() const override
MonitorElement * dxy2_afterZ_
MonitorElement * leadingjet_pt_before_
MonitorElement * goodewkmuon1_afterZ_
MonitorElement * iso_before_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
MonitorElement * npvs_after_
MonitorElement * goodewkmuon2_afterZ_
double px() const final
x coordinate of momentum vector
MonitorElement * njets_after_
double p() const final
magnitude of momentum vector
MonitorElement * ngoodmuons_
MonitorElement * n_zselPt2thr_
MonitorElement * pt2_afterZ_
MonitorElement * met_afterZ_
MonitorElement * leadingjet_eta_after_
virtual TrackRef innerTrack() const
double py() const final
y coordinate of momentum vector
MonitorElement * mt_after_
MonitorElement * goodewkmuon_after_
MonitorElement * muoncharge_after_
MonitorElement * mt_before_
MonitorElement * eta_before_
MonitorElement * iso1_afterZ_
int prescaleSet(const edm::Event &iEvent, const edm::EventSetup &iSetup)
HLTPrescaleProvider hltPrescaleProvider_
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexTag_
double normalizedChi2Cut_
MonitorElement * pt_after_
MonitorElement * iso_after_
MonitorElement * eta1_afterZ_
MonitorElement * ptDiffPM_before_
MonitorElement * pt1_afterZ_
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
MonitorElement * dxy_after_
MonitorElement * met_after_
edm::EDGetTokenT< edm::View< reco::Muon > > muonTag_
MonitorElement * n_zselPt1thr_
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
bool isGlobalMuon() const override
edm::EDGetTokenT< edm::View< reco::Photon > > phoTag_
MonitorElement * dimuonmass_before_
int charge() const final
electric charge
MonitorElement * leadingjet_pt_afterZ_
MonitorElement * acop_after_
double eta() const final
momentum pseudorapidity