262 unsigned int muonCollectionSize = muonCollection->size();
273 unsigned int nmuonsForZ1 = 0;
274 unsigned int nmuonsForZ2 = 0;
276 for (
unsigned int i=0;
i<muonCollectionSize;
i++) {
277 const Muon&
mu = muonCollection->at(
i);
280 double dxy = mu.
innerTrack()->dxy(beamSpotHandle->position());
282 if (fabs(dxy)>1) { cosmic=
true;
break;}
287 for (
unsigned int j=
i+1;
j<muonCollectionSize;
j++) {
288 const Muon& mu2 = muonCollection->at(
j);
312 const MET&
met = metCollection->at(0);
313 double met_et = met.
pt();
314 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met.
px() <<
", " << met.
py() <<
" [GeV]";
320 LogError(
"") <<
">>> Vertex collection does not exist !!!";
323 unsigned int vertexCollectionSize = vertexCollection->size();
328 for (
unsigned int i=0;
i<vertexCollectionSize;
i++) {
329 const Vertex& vertex = vertexCollection->at(
i);
330 if (vertex.
isValid()) nvvertex++;
335 bool trigger_fired =
false;
345 for (
unsigned int i=0;
i<triggerResults->size();
i++)
352 if (trigPath==0) found=
true;
354 if(!found) {
continue;}
356 bool prescaled=
false;
359 if (prescaleValue != 1) prescaled =
true;
362 if( triggerResults->accept(
i) && !prescaled){ trigger_fired=
true;}
373 unsigned int jetCollectionSize = jetCollection->size();
374 int njets = 0;
int LEADJET=-1;
double max_pt=0;
375 for (
unsigned int i=0;
i<jetCollectionSize;
i++) {
376 const Jet&
jet = jetCollection->at(
i);
377 double minDistance=99999;
378 for (
unsigned int j=0;
j<muonCollectionSize;
j++) {
379 const Muon& mu = muonCollection->at(
j);
381 if (minDistance>distance) minDistance=distance;
383 if (minDistance<0.3)
continue;
384 if(jet.
et()>max_pt) { LEADJET=
i; max_pt=jet.
et();}
389 LogTrace(
"") <<
">>> Total number of jets: " << jetCollectionSize;
390 LogTrace(
"") <<
">>> Number of jets above " <<
eJetMin_ <<
" [GeV]: " << njets;
392 double lead_jet_pt=-1;
393 double lead_jet_eta=-100;
395 const Jet& leadJet = jetCollection->at(LEADJET);
398 lead_jet_pt=leadJet.
pt();
399 lead_jet_eta=leadJet.
eta();
409 for (
unsigned int i=0;
i<photonCollection->size();
i++){
410 const Photon &ph = photonCollection->at(
i);
411 double photonPt = ph.
pt();
419 LogTrace(
"") <<
" >>> N photons " << ngam << std::endl;
445 bool hlt_hist_done =
false;
446 bool zhlt_hist_done =
false;
447 bool zjets_hist_done =
false;
448 bool zfullsel_hist_done =
false;
449 bool met_hist_done =
false;
450 bool njets_hist_done =
false;
451 bool wfullsel_hist_done =
false;
454 const int NFLAGS = 11;
455 bool muon_sel[NFLAGS];
456 const int NFLAGSZ = 13;
457 bool zmuon_sel[NFLAGSZ];
460 double number_of_muons=0;
461 double number_of_goodMuons=0;
464 for (
unsigned int i=0;
i<muonCollectionSize;
i++) {
465 for (
int j=0;
j<NFLAGS; ++
j) {
471 const Muon& mu = muonCollection->at(
i);
476 LogTrace(
"") <<
"> Wsel: processing muon number " <<
i <<
"...";
483 LogTrace(
"") <<
"\t... pt, eta: " << pt <<
" [GeV], " <<
eta;;
484 if (pt>
ptCut_) muon_sel[0] =
true;
485 if (fabs(eta)<
etaCut_) muon_sel[1] =
true;
490 double dxy = gm->dxy(beamSpotHandle->position());
491 double normalizedChi2 = gm->normalizedChi2();
492 double trackerHits = tk->hitPattern().numberOfValidTrackerHits();
493 int pixelHits = tk->hitPattern().numberOfValidPixelHits();
494 int muonHits = gm->hitPattern().numberOfValidMuonHits();
497 LogTrace(
"") <<
"\t... dxy, normalizedChi2, trackerHits, isTrackerMuon?: " << dxy <<
" [cm], " << normalizedChi2 <<
", " << trackerHits <<
", " << mu.
isTrackerMuon();
498 if (fabs(dxy)<
dxyCut_) muon_sel[2] =
true;
509 if(quality) number_of_goodMuons++;
531 if (isovar<
isoCut03_) muon_sel[4] =
true;
533 LogTrace(
"") <<
"\t... isolation value" << isovar <<
", isolated? " << muon_sel[6];
538 if (trigger_fired) muon_sel[5] =
true;
545 double w_et = met_et+mu.
pt();
546 double w_px = met.
px()+mu.
px();
547 double w_py = met.
py()+mu.
py();
549 double massT = w_et*w_et - w_px*w_px - w_py*w_py;
550 massT = (massT>0) ?
sqrt(massT) : 0;
552 LogTrace(
"") <<
"\t... W mass, W_et, W_px, W_py: " << massT <<
", " << w_et <<
", " << w_px <<
", " << w_py <<
" [GeV]";
559 double acop = deltaphi.value();
560 if (acop<0) acop = - acop;
562 LogTrace(
"") <<
"\t... acoplanarity: " << acop;
563 if (acop<
acopCut_) muon_sel[8] =
true;
567 if (nmuonsForZ1<1 || nmuonsForZ2<2) muon_sel[9] =
true;
568 if (njets<=
nJetMax_) muon_sel[10] =
true;
571 int flags_passed = 0;
572 for (
int j=0;
j<NFLAGS; ++
j) {
573 if (muon_sel[
j]) flags_passed += 1;
577 if (flags_passed >= (NFLAGS-1)) {
578 if (!muon_sel[0] || flags_passed==NFLAGS)
580 if (!muon_sel[1] || flags_passed==NFLAGS)
582 if (!muon_sel[2] || flags_passed==NFLAGS)
584 if (!muon_sel[3] || flags_passed==NFLAGS)
586 if (!muon_sel[4] || flags_passed==NFLAGS)
588 if (!muon_sel[5] || flags_passed==NFLAGS)
590 hlt_hist_done =
true;
591 if (!muon_sel[6] || flags_passed==NFLAGS)
593 if (!muon_sel[7] || flags_passed==NFLAGS)
595 met_hist_done =
true;
596 if (!muon_sel[8] || flags_passed==NFLAGS)
599 if (!muon_sel[10] || flags_passed==NFLAGS) {
600 if (!njets_hist_done) {
605 njets_hist_done =
true;
607 if( flags_passed==NFLAGS ) {
608 if (!wfullsel_hist_done){
614 wfullsel_hist_done=
true;
620 if ( muon4Z && !muon_sel[9]){
623 for (
unsigned int j=
i+1;
j<muonCollectionSize;
j++) {
625 for (
int ij=0; ij<NFLAGSZ; ++ij) {
626 zmuon_sel[ij] =
false;
629 for (
int ji=0; ji<5; ++ji ) {
630 zmuon_sel[ji] = muon_sel[ji];
633 const Muon& mu2 = muonCollection->at(
j);
635 if (mu2.
charge() * charge != -1 )
continue;
638 double pt2 = mu2.
pt();
if (pt2>
ptThrForZ2_) zmuon_sel[5] =
true;
639 double eta2=mu2.
eta();
if (fabs(eta2)<
etaCut_) zmuon_sel[6] =
true;
640 double dxy2 = gm2->dxy(beamSpotHandle->position());
if (fabs(dxy2)<
dxyCut_) zmuon_sel[7] =
true;
641 double normalizedChi22 = gm2->normalizedChi2();
642 double trackerHits2 = tk2->hitPattern().numberOfValidTrackerHits();
643 int pixelHits2 = tk2->hitPattern().numberOfValidPixelHits();
644 int muonHits2 = gm2->hitPattern().numberOfValidMuonHits();
653 zmuon_sel[8]=quality2;
660 if (isovar2<
isoCut03_) zmuon_sel[9] =
true;
661 if (trigger_fired) zmuon_sel[10] =
true;
666 if (njets <=
nJetMax_) zmuon_sel[12] =
true;
669 int flags_passed_z = 0;
671 for (
int jj=0;
jj<NFLAGSZ; ++
jj) {
672 if (zmuon_sel[
jj]) ++flags_passed_z ;
675 if (flags_passed_z >= (NFLAGSZ-1)) {
676 if (!zmuon_sel[0] || flags_passed_z==NFLAGSZ) {
pt1_afterZ_->
Fill(pt); }
680 if (!zmuon_sel[4] || flags_passed_z==NFLAGSZ) {
iso1_afterZ_->
Fill(isovar); }
681 if (!zmuon_sel[5] || flags_passed_z==NFLAGSZ) {
pt2_afterZ_->
Fill(pt2); }
685 if (!zmuon_sel[9] || flags_passed_z==NFLAGSZ) {
iso2_afterZ_->
Fill(isovar2); }
686 if (!zmuon_sel[10] || flags_passed_z==NFLAGSZ) {
688 zhlt_hist_done =
true;
691 if (!zmuon_sel[12] || flags_passed_z==NFLAGSZ ){
692 if(!zjets_hist_done){
697 zjets_hist_done=
true;
699 if(flags_passed_z==NFLAGSZ) {
701 if(!zfullsel_hist_done){
715 zfullsel_hist_done=
true;
722 if (zfullsel_hist_done) {
MonitorElement * met_before_
virtual double p() const
magnitude of momentum vector
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 et() const
transverse energy
MonitorElement * npvs_before_
virtual TrackRef innerTrack() 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_
Base class for all types of Jets.
bool isValid() const
Tells whether the vertex is valid.
MonitorElement * eta2_afterZ_
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_
virtual double eta() const
momentum pseudorapidity
MonitorElement * eta_after_
MonitorElement * muoncharge_afterZ_
MonitorElement * pt_before_
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_
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_
bool isNull() const
Checks for null.
MonitorElement * ngoodmuons_
MonitorElement * n_zselPt2thr_
MonitorElement * pt2_afterZ_
HLTConfigProvider hltConfigProvider_
MonitorElement * met_afterZ_
virtual int charge() const
electric charge
MonitorElement * leadingjet_eta_after_
MonitorElement * mt_after_
MonitorElement * goodewkmuon_after_
MonitorElement * muoncharge_after_
MonitorElement * mt_before_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * eta_before_
MonitorElement * iso1_afterZ_
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
static const char *const trigNames[]
double normalizedChi2Cut_
MonitorElement * pt_after_
MonitorElement * iso_after_
virtual double px() const
x coordinate of momentum vector
virtual double pt() const
transverse momentum
std::string const & triggerName(unsigned int index) const
MonitorElement * eta1_afterZ_
MonitorElement * ptDiffPM_before_
virtual double pz() const
z coordinate of momentum vector
MonitorElement * pt1_afterZ_
MonitorElement * dxy_after_
unsigned int prescaleSize() const
MonitorElement * met_after_
MonitorElement * n_zselPt1thr_
virtual double phi() const
momentum azimuthal angle
virtual double py() const
y coordinate of momentum vector
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_