252 unsigned int muonCollectionSize = muonCollection->size();
262 unsigned int nmuonsForZ1 = 0;
263 unsigned int nmuonsForZ2 = 0;
265 for (
unsigned int i = 0;
i < muonCollectionSize;
i++) {
266 const Muon&
mu = muonCollection->at(
i);
282 for (
unsigned int j =
i + 1;
j < muonCollectionSize;
j++) {
283 const Muon& mu2 = muonCollection->at(
j);
286 mu.
px() + mu2.
px(), mu.
py() + mu2.
py(), mu.
pz() + mu2.
pz(), mu.
p() + mu2.
p());
308 const MET&
met = metCollection->at(0);
309 double met_et = met.
pt();
310 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met.
px() <<
", " << met.
py() <<
" [GeV]";
316 LogError(
"") <<
">>> Vertex collection does not exist !!!";
319 unsigned int vertexCollectionSize = vertexCollection->size();
322 for (
unsigned int i = 0;
i < vertexCollectionSize;
i++) {
371 if (prescaleSet == -1) {
372 LogTrace(
"") <<
"Failed to determine prescaleSet\n";
426 unsigned int jetCollectionSize = jetCollection->size();
430 for (
unsigned int i = 0;
i < jetCollectionSize;
i++) {
431 const Jet&
jet = jetCollection->at(
i);
432 double minDistance = 99999;
433 for (
unsigned int j = 0;
j < muonCollectionSize;
j++) {
434 const Muon& mu = muonCollection->at(
j);
437 if (minDistance > distance)
440 if (minDistance < 0.3)
442 if (jet.
et() > max_pt) {
451 LogTrace(
"") <<
">>> Total number of jets: " << jetCollectionSize;
454 double lead_jet_pt = -1;
455 double lead_jet_eta = -100;
457 const Jet& leadJet = jetCollection->at(LEADJET);
460 lead_jet_pt = leadJet.
pt();
461 lead_jet_eta = leadJet.
eta();
469 unsigned int ngam = 0;
471 for (
unsigned int i = 0;
i < photonCollection->size();
i++) {
472 const Photon& ph = photonCollection->at(
i);
481 LogTrace(
"") <<
" >>> N photons " << ngam << std::endl;
491 bool zjets_hist_done =
false;
492 bool zfullsel_hist_done =
false;
493 bool met_hist_done =
false;
494 bool njets_hist_done =
false;
495 bool wfullsel_hist_done =
false;
498 const int NFLAGS = 10;
499 bool muon_sel[NFLAGS];
500 const int NFLAGSZ = 12;
501 bool zmuon_sel[NFLAGSZ];
504 double number_of_muons = 0;
505 double number_of_goodMuons = 0;
507 for (
unsigned int i = 0;
i < muonCollectionSize;
i++) {
508 for (
int j = 0;
j < NFLAGS; ++
j) {
514 const Muon& mu = muonCollection->at(
i);
522 LogTrace(
"") <<
"> Wsel: processing muon number " <<
i <<
"...";
529 LogTrace(
"") <<
"\t... pt, eta: " << pt <<
" [GeV], " <<
eta;
539 double dxy = gm->dxy(beamSpotHandle->
position());
541 double trackerHits = tk->hitPattern().numberOfValidTrackerHits();
542 int pixelHits = tk->hitPattern().numberOfValidPixelHits();
543 int muonHits = gm->hitPattern().numberOfValidMuonHits();
546 LogTrace(
"") <<
"\t... dxy, normalizedChi2, trackerHits, isTrackerMuon?: " << dxy <<
" [cm], " << normalizedChi2
568 number_of_goodMuons++;
593 LogTrace(
"") <<
"\t... isolation value" << isovar <<
", isolated? " << muon_sel[6];
605 double w_et = met_et + mu.
pt();
606 double w_px = met.
px() + mu.
px();
607 double w_py = met.
py() + mu.
py();
609 double massT = w_et * w_et - w_px * w_px - w_py * w_py;
610 massT = (massT > 0) ?
sqrt(massT) : 0;
612 LogTrace(
"") <<
"\t... W mass, W_et, W_px, W_py: " << massT <<
", " << w_et <<
", " << w_px <<
", " << w_py
622 double acop = deltaphi.value();
626 LogTrace(
"") <<
"\t... acoplanarity: " << acop;
632 if (nmuonsForZ1 < 1 || nmuonsForZ2 < 2)
638 int flags_passed = 0;
639 for (
int j = 0;
j < NFLAGS; ++
j) {
645 if (flags_passed >= (NFLAGS - 1)) {
646 if (!muon_sel[0] || flags_passed == NFLAGS)
648 if (!muon_sel[1] || flags_passed == NFLAGS)
650 if (!muon_sel[2] || flags_passed == NFLAGS)
652 if (!muon_sel[3] || flags_passed == NFLAGS)
654 if (!muon_sel[4] || flags_passed == NFLAGS)
659 if (!muon_sel[5] || flags_passed == NFLAGS)
661 if (!muon_sel[6] || flags_passed == NFLAGS)
664 met_hist_done =
true;
665 if (!muon_sel[7] || flags_passed == NFLAGS)
668 if (!muon_sel[9] || flags_passed == NFLAGS) {
669 if (!njets_hist_done) {
674 njets_hist_done =
true;
676 if (flags_passed == NFLAGS) {
677 if (!wfullsel_hist_done) {
683 wfullsel_hist_done =
true;
689 if (muon4Z && !muon_sel[8]) {
691 for (
unsigned int j =
i + 1;
j < muonCollectionSize;
j++) {
692 for (
int ij = 0; ij < NFLAGSZ; ++ij) {
693 zmuon_sel[ij] =
false;
696 for (
int ji = 0; ji < 5; ++ji) {
697 zmuon_sel[ji] = muon_sel[ji];
700 const Muon& mu2 = muonCollection->at(
j);
703 if (mu2.
charge() * charge != -1)
707 double pt2 = mu2.
pt();
713 double dxy2 = gm2->dxy(beamSpotHandle->
position());
716 double normalizedChi22 = gm2->normalizedChi2();
717 double trackerHits2 = tk2->hitPattern().numberOfValidTrackerHits();
718 int pixelHits2 = tk2->hitPattern().numberOfValidPixelHits();
719 int muonHits2 = gm2->hitPattern().numberOfValidMuonHits();
721 bool quality2 =
true;
734 zmuon_sel[8] = quality2;
746 mu.
px() + mu2.
px(), mu.
py() + mu2.
py(), mu.
pz() + mu2.
pz(), mu.
p() + mu2.
p());
748 zmuon_sel[10] =
true;
752 zmuon_sel[11] =
true;
755 int flags_passed_z = 0;
757 for (
int jj = 0;
jj < NFLAGSZ; ++
jj) {
762 if (flags_passed_z >= (NFLAGSZ - 1)) {
763 if (!zmuon_sel[0] || flags_passed_z == NFLAGSZ) {
766 if (!zmuon_sel[1] || flags_passed_z == NFLAGSZ) {
769 if (!zmuon_sel[2] || flags_passed_z == NFLAGSZ) {
772 if (!zmuon_sel[3] || flags_passed_z == NFLAGSZ) {
775 if (!zmuon_sel[4] || flags_passed_z == NFLAGSZ) {
778 if (!zmuon_sel[5] || flags_passed_z == NFLAGSZ) {
781 if (!zmuon_sel[6] || flags_passed_z == NFLAGSZ) {
784 if (!zmuon_sel[7] || flags_passed_z == NFLAGSZ) {
787 if (!zmuon_sel[8] || flags_passed_z == NFLAGSZ) {
790 if (!zmuon_sel[9] || flags_passed_z == NFLAGSZ) {
797 if (!zmuon_sel[10] || flags_passed_z == NFLAGSZ) {
800 if (!zmuon_sel[11] || flags_passed_z == NFLAGSZ) {
801 if (!zjets_hist_done) {
806 zjets_hist_done =
true;
808 if (flags_passed_z == NFLAGSZ) {
810 if (!zfullsel_hist_done) {
823 zfullsel_hist_done =
true;
830 if (zfullsel_hist_done) {
MonitorElement * met_before_
MonitorElement * ptDiffPM_afterZ_
MonitorElement * dimuonmass_afterZ_
double eta() const final
momentum pseudorapidity
float sumPt
sum-pt of tracks
MonitorElement * njets_afterZ_
MonitorElement * iso2_afterZ_
MonitorElement * npvs_before_
virtual TrackRef innerTrack() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * dxy1_afterZ_
MonitorElement * njets_before_
MonitorElement * dxy_before_
MonitorElement * leadingjet_eta_afterZ_
MonitorElement * muoncharge_before_
bool isValid() const
Tells whether the vertex is valid.
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
double px() const final
x coordinate of momentum vector
MonitorElement * eta2_afterZ_
MonitorElement * npvs_afterZ_
MonitorElement * leadingjet_eta_before_
double pt() const final
transverse momentum
int charge() const final
electric charge
MonitorElement * acop_before_
MonitorElement * leadingjet_pt_after_
MonitorElement * goodewkmuon_before_
MonitorElement * eta_after_
MonitorElement * muoncharge_afterZ_
MonitorElement * pt_before_
MonitorElement * dxy2_afterZ_
bool isTrackerMuon() const override
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_
MonitorElement * njets_after_
MonitorElement * ngoodmuons_
MonitorElement * n_zselPt2thr_
MonitorElement * pt2_afterZ_
double et() const final
transverse energy
bool isGlobalMuon() const override
double pz() const final
z coordinate of momentum vector
MonitorElement * met_afterZ_
MonitorElement * leadingjet_eta_after_
MonitorElement * mt_after_
MonitorElement * goodewkmuon_after_
MonitorElement * muoncharge_after_
MonitorElement * mt_before_
bool isNull() const
Checks for null.
MonitorElement * eta_before_
MonitorElement * iso1_afterZ_
int prescaleSet(const edm::Event &iEvent, const edm::EventSetup &iSetup)
HLTPrescaleProvider hltPrescaleProvider_
double p() const final
magnitude of momentum vector
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexTag_
double normalizedChi2Cut_
MonitorElement * pt_after_
MonitorElement * iso_after_
MonitorElement * eta1_afterZ_
double py() const final
y coordinate of momentum vector
MonitorElement * ptDiffPM_before_
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
MonitorElement * pt1_afterZ_
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
MonitorElement * dxy_after_
const Point & position() const
position
MonitorElement * met_after_
edm::EDGetTokenT< edm::View< reco::Muon > > muonTag_
MonitorElement * n_zselPt1thr_
double phi() const final
momentum azimuthal angle
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
edm::EDGetTokenT< edm::View< reco::Photon > > phoTag_
MonitorElement * dimuonmass_before_
const MuonIsolation & isolationR03() const
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
MonitorElement * leadingjet_pt_afterZ_
MonitorElement * acop_after_