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_goodMuons = 0;
504 for (
unsigned int i = 0;
i < muonCollectionSize;
i++) {
505 for (
int j = 0;
j < NFLAGS; ++
j) {
510 if (!
mu.isGlobalMuon())
512 if (
mu.globalTrack().isNull())
514 if (
mu.innerTrack().isNull())
517 LogTrace(
"") <<
"> Wsel: processing muon number " <<
i <<
"...";
523 double eta =
mu.eta();
524 LogTrace(
"") <<
"\t... pt, eta: " <<
pt <<
" [GeV], " <<
eta;
536 double trackerHits = tk->hitPattern().numberOfValidTrackerHits();
537 int pixelHits = tk->hitPattern().numberOfValidPixelHits();
538 int muonHits = gm->hitPattern().numberOfValidMuonHits();
539 int nMatches =
mu.numberOfMatches();
557 if (!
mu.isTrackerMuon())
563 number_of_goodMuons++;
578 double isovar =
mu.isolationR03().sumPt;
580 isovar +=
mu.isolationR03().emEt;
581 isovar +=
mu.isolationR03().hadEt;
588 LogTrace(
"") <<
"\t... isolation value" << isovar <<
", isolated? " << muon_sel[6];
600 double w_et = met_et +
mu.pt();
601 double w_px =
met.px() +
mu.px();
602 double w_py =
met.py() +
mu.py();
604 double massT = w_et * w_et - w_px * w_px - w_py * w_py;
605 massT = (massT > 0) ?
sqrt(massT) : 0;
607 LogTrace(
"") <<
"\t... W mass, W_et, W_px, W_py: " << massT <<
", " << w_et <<
", " << w_px <<
", " << w_py
617 double acop = deltaphi.value();
621 LogTrace(
"") <<
"\t... acoplanarity: " << acop;
627 if (nmuonsForZ1 < 1 || nmuonsForZ2 < 2)
633 int flags_passed = 0;
634 for (
int j = 0;
j < NFLAGS; ++
j) {
640 if (flags_passed >= (NFLAGS - 1)) {
641 if (!muon_sel[0] || flags_passed == NFLAGS)
643 if (!muon_sel[1] || flags_passed == NFLAGS)
645 if (!muon_sel[2] || flags_passed == NFLAGS)
647 if (!muon_sel[3] || flags_passed == NFLAGS)
649 if (!muon_sel[4] || flags_passed == NFLAGS)
654 if (!muon_sel[5] || flags_passed == NFLAGS)
656 if (!muon_sel[6] || flags_passed == NFLAGS)
659 met_hist_done =
true;
660 if (!muon_sel[7] || flags_passed == NFLAGS)
663 if (!muon_sel[9] || flags_passed == NFLAGS) {
664 if (!njets_hist_done) {
669 njets_hist_done =
true;
671 if (flags_passed == NFLAGS) {
672 if (!wfullsel_hist_done) {
678 wfullsel_hist_done =
true;
684 if (muon4Z && !muon_sel[8]) {
686 for (
unsigned int j =
i + 1;
j < muonCollectionSize;
j++) {
687 for (
int ij = 0; ij < NFLAGSZ; ++ij) {
688 zmuon_sel[ij] =
false;
691 for (
int ji = 0; ji < 5; ++ji) {
692 zmuon_sel[ji] = muon_sel[ji];
702 double pt2 = mu2.
pt();
708 double dxy2 = gm2->dxy(beamSpotHandle->
position());
711 double normalizedChi22 = gm2->normalizedChi2();
712 double trackerHits2 = tk2->hitPattern().numberOfValidTrackerHits();
713 int pixelHits2 = tk2->hitPattern().numberOfValidPixelHits();
714 int muonHits2 = gm2->hitPattern().numberOfValidMuonHits();
716 bool quality2 =
true;
729 zmuon_sel[8] = quality2;
741 mu.px() + mu2.
px(),
mu.py() + mu2.
py(),
mu.pz() + mu2.
pz(),
mu.p() + mu2.
p());
743 zmuon_sel[10] =
true;
747 zmuon_sel[11] =
true;
750 int flags_passed_z = 0;
752 for (
int jj = 0;
jj < NFLAGSZ; ++
jj) {
757 if (flags_passed_z >= (NFLAGSZ - 1)) {
758 if (!zmuon_sel[0] || flags_passed_z == NFLAGSZ) {
761 if (!zmuon_sel[1] || flags_passed_z == NFLAGSZ) {
764 if (!zmuon_sel[2] || flags_passed_z == NFLAGSZ) {
767 if (!zmuon_sel[3] || flags_passed_z == NFLAGSZ) {
770 if (!zmuon_sel[4] || flags_passed_z == NFLAGSZ) {
773 if (!zmuon_sel[5] || flags_passed_z == NFLAGSZ) {
776 if (!zmuon_sel[6] || flags_passed_z == NFLAGSZ) {
779 if (!zmuon_sel[7] || flags_passed_z == NFLAGSZ) {
782 if (!zmuon_sel[8] || flags_passed_z == NFLAGSZ) {
785 if (!zmuon_sel[9] || flags_passed_z == NFLAGSZ) {
792 if (!zmuon_sel[10] || flags_passed_z == NFLAGSZ) {
795 if (!zmuon_sel[11] || flags_passed_z == NFLAGSZ) {
796 if (!zjets_hist_done) {
801 zjets_hist_done =
true;
803 if (flags_passed_z == NFLAGSZ) {
805 if (!zfullsel_hist_done) {
818 zfullsel_hist_done =
true;
825 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_
MPlex< T, D1, D2, N > atan2(const MPlex< T, D1, D2, N > &y, const MPlex< T, D1, D2, N > &x)
MonitorElement * acop_after_
double eta() const final
momentum pseudorapidity