250 unsigned int muonCollectionSize = muonCollection->size();
260 unsigned int nmuonsForZ1 = 0;
261 unsigned int nmuonsForZ2 = 0;
263 for (
unsigned int i = 0;
i < muonCollectionSize;
i++) {
264 const Muon&
mu = muonCollection->at(
i);
268 double dxy = mu.
innerTrack()->dxy(beamSpotHandle->position());
280 for (
unsigned int j =
i + 1;
j < muonCollectionSize;
j++) {
281 const Muon& mu2 = muonCollection->at(
j);
284 mu.
px() + mu2.
px(), mu.
py() + mu2.
py(), mu.
pz() + mu2.
pz(), mu.
p() + mu2.
p());
306 const MET&
met = metCollection->at(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 !!!";
317 unsigned int vertexCollectionSize = vertexCollection->size();
320 for (
unsigned int i = 0;
i < vertexCollectionSize;
i++) {
321 const Vertex& vertex = vertexCollection->at(
i);
369 if (prescaleSet == -1) {
370 LogTrace(
"") <<
"Failed to determine prescaleSet\n";
424 unsigned int jetCollectionSize = jetCollection->size();
428 for (
unsigned int i = 0;
i < jetCollectionSize;
i++) {
429 const Jet&
jet = jetCollection->at(
i);
430 double minDistance = 99999;
431 for (
unsigned int j = 0;
j < muonCollectionSize;
j++) {
432 const Muon& mu = muonCollection->at(
j);
435 if (minDistance > distance)
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;
455 const Jet& leadJet = jetCollection->at(LEADJET);
458 lead_jet_pt = leadJet.
pt();
459 lead_jet_eta = leadJet.
eta();
467 unsigned int ngam = 0;
469 for (
unsigned int i = 0;
i < photonCollection->size();
i++) {
470 const Photon& ph = photonCollection->at(
i);
471 double photonPt = ph.
pt();
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) {
512 const Muon& mu = muonCollection->at(
i);
520 LogTrace(
"") <<
"> Wsel: processing muon number " <<
i <<
"...";
527 LogTrace(
"") <<
"\t... pt, eta: " << pt <<
" [GeV], " <<
eta;
537 double dxy = gm->dxy(beamSpotHandle->position());
539 double trackerHits = tk->hitPattern().numberOfValidTrackerHits();
540 int pixelHits = tk->hitPattern().numberOfValidPixelHits();
541 int muonHits = gm->hitPattern().numberOfValidMuonHits();
544 LogTrace(
"") <<
"\t... dxy, normalizedChi2, trackerHits, isTrackerMuon?: " << dxy <<
" [cm], " << normalizedChi2
566 number_of_goodMuons++;
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];
698 const Muon& mu2 = muonCollection->at(
j);
701 if (mu2.
charge() * charge != -1)
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_
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
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_
uint32_t const *__restrict__ Quality * quality
MonitorElement * muoncharge_before_
Base class for all types of Jets.
bool isValid() const
Tells whether the vertex is valid.
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_
double py() const final
y coordinate of momentum vector
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_
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexTag_
double normalizedChi2Cut_
MonitorElement * pt_after_
MonitorElement * iso_after_
MonitorElement * eta1_afterZ_
MonitorElement * ptDiffPM_before_
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
MonitorElement * pt1_afterZ_
double et() const final
transverse energy
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
MonitorElement * dxy_after_
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_
bool isGlobalMuon() const override
edm::EDGetTokenT< edm::View< reco::Photon > > phoTag_
MonitorElement * dimuonmass_before_
const MuonIsolation & isolationR03() const
int charge() const final
electric charge
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
MonitorElement * leadingjet_pt_afterZ_
MonitorElement * acop_after_
double eta() const final
momentum pseudorapidity