322 unsigned int muonCollectionSize = muonCollection->size();
332 unsigned int nmuonsForZ1 = 0;
333 unsigned int nmuonsForZ2 = 0;
335 for (
unsigned int i = 0;
i < muonCollectionSize;
i++) {
336 const Muon&
mu = muonCollection->at(
i);
349 for (
unsigned int j =
i + 1; j < muonCollectionSize; j++) {
350 const Muon& mu2 = muonCollection->at(j);
353 mu.
px() + mu2.
px(), mu.
py() + mu2.
py(), mu.
pz() + mu2.
pz(),
367 <<
" [GeV]: " << nmuonsForZ1;
369 <<
" [GeV]: " << nmuonsForZ2;
377 const MET&
met = metCollection->at(0);
378 double met_et = met.
pt();
379 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met.
px()
380 <<
", " << met.
py() <<
" [GeV]";
386 LogError(
"") <<
">>> Vertex collection does not exist !!!";
389 unsigned int vertexCollectionSize = vertexCollection->size();
392 for (
unsigned int i = 0;
i < vertexCollectionSize;
i++) {
393 const Vertex& vertex = vertexCollection->at(
i);
394 if (vertex.
isValid()) nvvertex++;
399 bool trigger_fired =
false;
440 if (prescaleSet == -1) {
441 LogTrace(
"") <<
"Failed to determine prescaleSet\n";
447 for (
unsigned int i = 0;
448 (
i < triggerResults->
size()) && (trigger_fired ==
false);
i++) {
450 if (!triggerResults->
accept(
i))
continue;
455 for (
unsigned int index = 0;
459 if (!found)
continue;
462 if (prescaleSet != -1) {
463 if (hltConfigProvider.
prescaleValue(prescaleSet, trigName) != 1)
469 for (
unsigned int ps = 0;
470 !prescaled && (ps < hltConfigProvider.
prescaleSize()); ++ps) {
483 trigger_fired =
true;
495 unsigned int jetCollectionSize = jetCollection->size();
499 for (
unsigned int i = 0;
i < jetCollectionSize;
i++) {
500 const Jet&
jet = jetCollection->at(
i);
501 double minDistance = 99999;
502 for (
unsigned int j = 0; j < muonCollectionSize; j++) {
503 const Muon& mu = muonCollection->at(j);
506 if (minDistance > distance) minDistance =
distance;
508 if (minDistance < 0.3)
510 if (jet.
et() > max_pt) {
519 LogTrace(
"") <<
">>> Total number of jets: " << jetCollectionSize;
521 <<
" [GeV]: " << njets;
523 double lead_jet_pt = -1;
524 double lead_jet_eta = -100;
526 const Jet& leadJet = jetCollection->at(LEADJET);
529 lead_jet_pt = leadJet.
pt();
530 lead_jet_eta = leadJet.
eta();
538 unsigned int ngam = 0;
540 for (
unsigned int i = 0;
i < photonCollection->size();
i++) {
541 const Photon& ph = photonCollection->at(
i);
542 double photonPt = ph.
pt();
550 LogTrace(
"") <<
" >>> N photons " << ngam << std::endl;
558 bool hlt_hist_done =
false;
559 bool zhlt_hist_done =
false;
560 bool zjets_hist_done =
false;
561 bool zfullsel_hist_done =
false;
562 bool met_hist_done =
false;
563 bool njets_hist_done =
false;
564 bool wfullsel_hist_done =
false;
567 const int NFLAGS = 11;
568 bool muon_sel[NFLAGS];
569 const int NFLAGSZ = 13;
570 bool zmuon_sel[NFLAGSZ];
573 double number_of_muons = 0;
574 double number_of_goodMuons = 0;
576 for (
unsigned int i = 0;
i < muonCollectionSize;
i++) {
577 for (
int j = 0; j < NFLAGS; ++j) {
583 const Muon& mu = muonCollection->at(
i);
588 LogTrace(
"") <<
"> Wsel: processing muon number " <<
i <<
"...";
595 LogTrace(
"") <<
"\t... pt, eta: " << pt <<
" [GeV], " <<
eta;
597 if (pt >
ptCut_) muon_sel[0] =
true;
598 if (fabs(eta) <
etaCut_) muon_sel[1] =
true;
603 double dxy = gm->dxy(beamSpotHandle->
position());
604 double normalizedChi2 = gm->normalizedChi2();
605 double trackerHits = tk->hitPattern().numberOfValidTrackerHits();
606 int pixelHits = tk->hitPattern().numberOfValidPixelHits();
607 int muonHits = gm->hitPattern().numberOfValidMuonHits();
610 LogTrace(
"") <<
"\t... dxy, normalizedChi2, trackerHits, isTrackerMuon?: " 611 << dxy <<
" [cm], " << normalizedChi2 <<
", " << trackerHits
613 if (fabs(dxy) <
dxyCut_) muon_sel[2] =
true;
625 if (quality) number_of_goodMuons++;
646 if (isovar <
isoCut03_) muon_sel[4] =
true;
648 LogTrace(
"") <<
"\t... isolation value" << isovar <<
", isolated? " 653 if (trigger_fired) muon_sel[5] =
true;
657 quality && trigger_fired && isovar <
isoCut03_) {
662 double w_et = met_et + mu.
pt();
663 double w_px = met.
px() + mu.
px();
664 double w_py = met.
py() + mu.
py();
666 double massT = w_et * w_et - w_px * w_px - w_py * w_py;
667 massT = (massT > 0) ?
sqrt(massT) : 0;
669 LogTrace(
"") <<
"\t... W mass, W_et, W_px, W_py: " << massT <<
", " << w_et
670 <<
", " << w_px <<
", " << w_py <<
" [GeV]";
671 if (massT >
mtMin_ && massT <
mtMax_) muon_sel[6] =
true;
677 double acop = deltaphi.value();
678 if (acop < 0) acop = -acop;
680 LogTrace(
"") <<
"\t... acoplanarity: " << acop;
681 if (acop <
acopCut_) muon_sel[8] =
true;
685 if (nmuonsForZ1 < 1 || nmuonsForZ2 < 2) muon_sel[9] =
true;
686 if (njets <=
nJetMax_) muon_sel[10] =
true;
689 int flags_passed = 0;
690 for (
int j = 0; j < NFLAGS; ++j) {
691 if (muon_sel[j]) flags_passed += 1;
695 if (flags_passed >= (NFLAGS - 1)) {
696 if (!muon_sel[0] || flags_passed == NFLAGS)
pt_after_->
Fill(pt);
697 if (!muon_sel[1] || flags_passed == NFLAGS)
eta_after_->
Fill(eta);
698 if (!muon_sel[2] || flags_passed == NFLAGS)
dxy_after_->
Fill(dxy);
699 if (!muon_sel[3] || flags_passed == NFLAGS)
701 if (!muon_sel[4] || flags_passed == NFLAGS)
iso_after_->
Fill(isovar);
702 if (!muon_sel[5] || flags_passed == NFLAGS)
704 hlt_hist_done =
true;
705 if (!muon_sel[6] || flags_passed == NFLAGS)
mt_after_->
Fill(massT);
706 if (!muon_sel[7] || flags_passed == NFLAGS)
708 met_hist_done =
true;
711 if (!muon_sel[10] || flags_passed == NFLAGS) {
712 if (!njets_hist_done) {
717 njets_hist_done =
true;
719 if (flags_passed == NFLAGS) {
720 if (!wfullsel_hist_done) {
726 wfullsel_hist_done =
true;
732 if (muon4Z && !muon_sel[9]) {
735 for (
unsigned int j =
i + 1; j < muonCollectionSize; j++) {
737 for (
int ij = 0; ij < NFLAGSZ; ++ij) {
738 zmuon_sel[ij] =
false;
741 for (
int ji = 0; ji < 5; ++ji) {
742 zmuon_sel[ji] = muon_sel[ji];
745 const Muon& mu2 = muonCollection->at(j);
747 if (mu2.
charge() * charge != -1)
continue;
750 double pt2 = mu2.
pt();
752 double eta2 = mu2.
eta();
753 if (fabs(eta2) <
etaCut_) zmuon_sel[6] =
true;
754 double dxy2 = gm2->dxy(beamSpotHandle->
position());
755 if (fabs(dxy2) <
dxyCut_) zmuon_sel[7] =
true;
756 double normalizedChi22 = gm2->normalizedChi2();
757 double trackerHits2 = tk2->hitPattern().numberOfValidTrackerHits();
758 int pixelHits2 = tk2->hitPattern().numberOfValidPixelHits();
759 int muonHits2 = gm2->hitPattern().numberOfValidMuonHits();
761 bool quality2 =
true;
768 zmuon_sel[8] = quality2;
775 if (isovar2 <
isoCut03_) zmuon_sel[9] =
true;
776 if (trigger_fired) zmuon_sel[10] =
true;
778 mu.
px() + mu2.
px(), mu.
py() + mu2.
py(), mu.
pz() + mu2.
pz(),
782 zmuon_sel[11] =
true;
785 if (njets <=
nJetMax_) zmuon_sel[12] =
true;
788 int flags_passed_z = 0;
790 for (
int jj = 0;
jj < NFLAGSZ; ++
jj) {
791 if (zmuon_sel[
jj]) ++flags_passed_z;
794 if (flags_passed_z >= (NFLAGSZ - 1)) {
795 if (!zmuon_sel[0] || flags_passed_z == NFLAGSZ) {
798 if (!zmuon_sel[1] || flags_passed_z == NFLAGSZ) {
801 if (!zmuon_sel[2] || flags_passed_z == NFLAGSZ) {
804 if (!zmuon_sel[3] || flags_passed_z == NFLAGSZ) {
807 if (!zmuon_sel[4] || flags_passed_z == NFLAGSZ) {
810 if (!zmuon_sel[5] || flags_passed_z == NFLAGSZ) {
813 if (!zmuon_sel[6] || flags_passed_z == NFLAGSZ) {
816 if (!zmuon_sel[7] || flags_passed_z == NFLAGSZ) {
819 if (!zmuon_sel[8] || flags_passed_z == NFLAGSZ) {
822 if (!zmuon_sel[9] || flags_passed_z == NFLAGSZ) {
825 if (!zmuon_sel[10] || flags_passed_z == NFLAGSZ) {
827 zhlt_hist_done =
true;
829 if (!zmuon_sel[11] || flags_passed_z == NFLAGSZ) {
832 if (!zmuon_sel[12] || flags_passed_z == NFLAGSZ) {
833 if (!zjets_hist_done) {
838 zjets_hist_done =
true;
840 if (flags_passed_z == NFLAGSZ) {
842 if (!zfullsel_hist_done) {
855 zfullsel_hist_done =
true;
862 if (zfullsel_hist_done) {
MonitorElement * met_before_
virtual double pt() const final
transverse momentum
MonitorElement * ptDiffPM_afterZ_
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
MonitorElement * dimuonmass_afterZ_
float sumPt
sum-pt of tracks
MonitorElement * njets_afterZ_
MonitorElement * iso2_afterZ_
virtual double eta() const final
momentum pseudorapidity
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 * ztrig_afterZ_
MonitorElement * trig_before_
MonitorElement * trig_after_
MonitorElement * leadingjet_eta_afterZ_
bool isTrackerMuon() const
MonitorElement * muoncharge_before_
bool isValid() const
Tells whether the vertex is valid.
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
bool accept() const
Has at least one path accepted the event?
MonitorElement * eta2_afterZ_
edm::EDGetTokenT< edm::TriggerResults > trigTag_
MonitorElement * npvs_afterZ_
bool isGlobalMuon() const
MonitorElement * leadingjet_eta_before_
std::vector< std::string > trigPathNames_
MonitorElement * acop_before_
MonitorElement * leadingjet_pt_after_
MonitorElement * goodewkmuon_before_
MonitorElement * eta_after_
MonitorElement * muoncharge_afterZ_
MonitorElement * pt_before_
MonitorElement * dxy2_afterZ_
MonitorElement * leadingjet_pt_before_
MonitorElement * goodewkmuon1_afterZ_
virtual double phi() const final
momentum azimuthal angle
MonitorElement * iso_before_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual int charge() const final
electric charge
virtual double et() const final
transverse energy
MonitorElement * npvs_after_
MonitorElement * goodewkmuon2_afterZ_
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
MonitorElement * njets_after_
MonitorElement * ngoodmuons_
MonitorElement * n_zselPt2thr_
MonitorElement * pt2_afterZ_
virtual double px() const final
x coordinate of momentum vector
unsigned int size() const
Get number of paths stored.
MonitorElement * met_afterZ_
MonitorElement * leadingjet_eta_after_
virtual double p() const final
magnitude of momentum vector
static std::string const triggerResults
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)
virtual double pz() const final
z coordinate of momentum vector
HLTPrescaleProvider hltPrescaleProvider_
static const char *const trigNames[]
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexTag_
double normalizedChi2Cut_
MonitorElement * pt_after_
MonitorElement * iso_after_
std::string const & triggerName(unsigned int index) const
MonitorElement * eta1_afterZ_
MonitorElement * ptDiffPM_before_
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
MonitorElement * pt1_afterZ_
HLTConfigProvider const & hltConfigProvider() const
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
MonitorElement * dxy_after_
unsigned int prescaleSize() const
const Point & position() const
position
MonitorElement * met_after_
edm::EDGetTokenT< edm::View< reco::Muon > > muonTag_
MonitorElement * n_zselPt1thr_
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
virtual double py() const final
y coordinate of momentum vector
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_