Inizialize parameters for histo binning.
399 if(!beamSpot.
isValid()) {
edm::LogInfo(
"MuonRecoAnalyzer") <<
"Error: Can't get the beamspot" << endl;
doMVA =
false;}
401 if(!vertex.
isValid()) {
edm::LogInfo(
"MuonRecoAnalyzer") <<
"Error: Can't get the vertex collection" << endl;
doMVA =
false;}
406 bool fillBadLumi =
false;
408 for (
auto const & dcsStatusItr : *dcsStatus) {
456 refPoint = vertex->at(pvIndex).position();
461 edm::LogInfo(
"MuonRecoAnalyzer") <<
"ERROR: No beam sport found!" << endl;
499 if(
muon->isGlobalMuon()) {
500 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is global - filling the histos";
501 if(
muon->isTrackerMuon() &&
muon->isStandAloneMuon())
503 if(!(
muon->isTrackerMuon()) &&
muon->isStandAloneMuon())
505 if(!
muon->isStandAloneMuon())
506 LogTrace(
metname)<<
"[MuonRecoAnalyzer] ERROR: the mu is global but not standalone!";
518 phiVsetaGlbTrack[0]->Fill(recoCombinedGlbTrack->eta(), recoCombinedGlbTrack->phi());
528 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"eta", res, pull);
530 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"eta", res, pull);
532 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"eta", res, pull);
535 etaResolution[3]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta()-recoCombinedGlbTrack->eta());
536 etaResolution[4]->Fill(recoCombinedGlbTrack->eta(), -recoStaGlbTrack->eta()+recoCombinedGlbTrack->eta());
537 etaResolution[5]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta()-recoStaGlbTrack->eta());
542 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"theta", res, pull);
544 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"theta", res, pull);
547 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"theta", res, pull);
550 thetaResolution[3]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta()-recoCombinedGlbTrack->theta());
551 thetaResolution[4]->Fill(recoCombinedGlbTrack->theta(), -recoStaGlbTrack->theta()+recoCombinedGlbTrack->theta());
552 thetaResolution[5]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta()-recoStaGlbTrack->theta());
557 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"phi", res, pull);
559 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"phi", res, pull);
561 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"phi", res, pull);
564 phiResolution[3]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi()-recoCombinedGlbTrack->phi());
565 phiResolution[4]->Fill(recoCombinedGlbTrack->phi(), -recoStaGlbTrack->phi()+recoCombinedGlbTrack->phi());
566 phiResolution[5]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi()-recoStaGlbTrack->phi());
574 probchi2GlbTrack[0]->Fill(TMath::Prob(recoCombinedGlbTrack->chi2(),recoCombinedGlbTrack->ndof()));
575 probchi2GlbTrack[1]->Fill(TMath::Prob(recoTkGlbTrack->chi2(),recoTkGlbTrack->ndof()));
576 probchi2GlbTrack[2]->Fill(TMath::Prob(recoStaGlbTrack->chi2(),recoStaGlbTrack->ndof()));
580 pGlbTrack[0]->Fill(recoCombinedGlbTrack->p());
582 pGlbTrack[2]->Fill(recoStaGlbTrack->p());
584 ptGlbTrack[0]->Fill(recoCombinedGlbTrack->pt());
588 qGlbTrack[0]->Fill(recoCombinedGlbTrack->charge());
589 qGlbTrack[1]->Fill(recoTkGlbTrack->charge());
590 qGlbTrack[2]->Fill(recoStaGlbTrack->charge());
591 if(recoCombinedGlbTrack->charge()==recoStaGlbTrack->charge())
qGlbTrack[3]->
Fill(1);
593 if(recoCombinedGlbTrack->charge()==recoTkGlbTrack->charge())
qGlbTrack[3]->
Fill(3);
595 if(recoStaGlbTrack->charge()==recoTkGlbTrack->charge())
qGlbTrack[3]->
Fill(5);
597 if(recoCombinedGlbTrack->charge()!=recoStaGlbTrack->charge() && recoCombinedGlbTrack->charge()!=recoTkGlbTrack->charge())
qGlbTrack[3]->
Fill(7);
598 if(recoCombinedGlbTrack->charge()==recoStaGlbTrack->charge() && recoCombinedGlbTrack->charge()==recoTkGlbTrack->charge())
qGlbTrack[3]->
Fill(8);
600 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverp", res, pull);
602 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverp", res, pull);
604 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverp", res, pull);
609 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverp", res, pull);
611 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverp", res, pull);
613 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverp", res, pull);
618 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverpt", res, pull);
620 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverpt", res, pull);
622 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverpt", res, pull);
626 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverpt", res, pull);
628 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverpt", res, pull);
630 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverpt", res, pull);
641 double bestTrackPt = recoBestTrack->pt();
643 double tunePBestTrackPt = recoTunePBestTrack->pt();
645 double tunePBestTrackRes = (bestTrackPt - tunePBestTrackPt) / bestTrackPt;
649 oneOverptResolution[3]->Fill(recoCombinedGlbTrack->eta(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
650 oneOverptResolution[4]->Fill(recoCombinedGlbTrack->eta(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
651 oneOverptResolution[5]->Fill(recoCombinedGlbTrack->eta(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
652 oneOverptResolution[6]->Fill(recoCombinedGlbTrack->phi(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
653 oneOverptResolution[7]->Fill(recoCombinedGlbTrack->phi(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
654 oneOverptResolution[8]->Fill(recoCombinedGlbTrack->phi(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
655 oneOverptResolution[9]->Fill(recoCombinedGlbTrack->pt(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
656 oneOverptResolution[10]->Fill(recoCombinedGlbTrack->pt(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
657 oneOverptResolution[11]->Fill(recoCombinedGlbTrack->pt(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
662 double rhGlb = recoCombinedGlbTrack->found();
664 double rhGlb_StaProvenance=0;
666 double rhGlb_TkProvenance=0;
673 if((*recHit)->isValid()){
674 DetId id = (*recHit)->geographicalId();
676 rhGlb_StaProvenance++;
678 rhGlb_TkProvenance++;
682 double rhStaGlb = recoStaGlbTrack->recHitsSize();
684 double rhTkGlb = recoTkGlbTrack->found();
686 double rhTkGlb_notValid = recoTkGlbTrack->lost();
689 rhAnalysis[0]->Fill(rhGlb_StaProvenance/rhGlb);
690 rhAnalysis[1]->Fill(rhGlb_TkProvenance/rhGlb);
691 rhAnalysis[2]->Fill(rhGlb_StaProvenance/rhStaGlb);
692 rhAnalysis[3]->Fill(rhGlb_TkProvenance/rhTkGlb);
693 rhAnalysis[4]->Fill(rhGlb/(rhStaGlb+rhTkGlb));
697 if(recoCombinedGlbTrack->charge()>0)
700 muVStkSytemRotation[1]->Fill(recoCombinedGlbTrack->pt(),recoTkGlbTrack->pt()/recoCombinedGlbTrack->pt());
705 if(
muon->isTrackerMuon() && !(
muon->isGlobalMuon())) {
706 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is tracker only - filling the histos";
707 if(
muon->isStandAloneMuon())
709 if(!(
muon->isStandAloneMuon()))
726 if(
muon->isStandAloneMuon() && !(
muon->isGlobalMuon())) {
727 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is STA only - filling the histos";
728 if(!(
muon->isTrackerMuon()))
745 if(
muon->isCaloMuon() && !(
muon->isGlobalMuon()) && !(
muon->isTrackerMuon()) && !(
muon->isStandAloneMuon()))
753 if(
muon->isStandAloneMuon()){
757 if(
muon->isStandAloneMuon() &&
muon->isGlobalMuon()){
float chi2LocalPosition
chi2 value for the STA-TK matching of local position
MonitorElement * NTrkVHitsSoftMuonMVA
std::vector< MonitorElement * > oneOverpResolution
MonitorElement * deltaRSoftMuonMVA
MonitorElement * trkRelChi2SoftMuonMVA
MonitorElement * qOverptPull
std::vector< MonitorElement * > ptGlbTrack
bool isNonnull() const
Checks for non-null.
std::vector< MonitorElement * > chi2OvDFGlbTrack
float chi2LocalMomentum
chi2 value for the STA-TK matching of local momentum
std::vector< MonitorElement * > phiVsetaGlbTrack_badlumi
MonitorElement * gNchi2SoftMuonMVA
std::vector< MonitorElement * > phiVsetaGlbTrack
bool getByToken(EDGetToken token, Handle< PROD > &result) const
float glbKink
value of the kink algorithm applied to the global track
MonitorElement * iValFracSoftMuonMVA
MonitorElement * outerChi2SoftMuonMVA
MonitorElement * etaStaTrack
float glbTrackProbability
the tail probability (-ln(P)) of the global fit
MonitorElement * vRPChitsSoftMuonMVA
float trkKink
value of the kink algorithm applied to the inner track stub
MonitorElement * dzRefSoftMuonMVA
edm::EDGetTokenT< DcsStatusCollection > dcsStatusCollection_
std::vector< MonitorElement * > phiGlbTrack
MonitorElement * LWHSoftMuonMVA
MonitorElement * chi2OvDFStaTrack
MuonServiceProxy * theService
MonitorElement * vMuHitsSoftMuonMVA
float trkRelChi2
chi2 value for the inner track stub with respect to the global track
MonitorElement * phiStaTrack
MonitorElement * vDThitsSoftMuonMVA
int trackerLayersWithMeasurement() const
MonitorElement * qOverpPull
int numberOfValidMuonCSCHits() const
std::vector< MonitorElement * > phiEfficiency
MonitorElement * mNuStationsSoftMuonMVA
int numberOfValidMuonRPCHits() const
MonitorElement * etaTrack
MonitorElement * innerChi2SoftMuonMVA
double getDeltaR(reco::Track track1, reco::Track track2)
MonitorElement * chi2OvDFTrack
std::vector< MonitorElement * > qOverptResolution
std::vector< MonitorElement * > etaGlbTrack
std::vector< MonitorElement * > pGlbTrack
std::vector< MonitorElement * > qOverpResolution
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * timeAtIpInOutSoftMuonMVA
MonitorElement * oneOverpPull
MonitorElement * valPixHitsSoftMuonMVA
std::vector< MonitorElement * > qGlbTrack
MonitorElement * timeAtIpInOutErrSoftMuonMVA
std::vector< MonitorElement * > probchi2GlbTrack
std::vector< MonitorElement * > etaResolution
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
MonitorElement * ptSoftMuonMVA
MonitorElement * oneOverptPull
MonitorElement * tunePResolution
float globalDeltaEtaPhi
global delta-Eta-Phi of STA-TK matching
MonitorElement * glbKinkFinderLogSoftMuonMVA
std::vector< MonitorElement * > etaEfficiency
MonitorElement * dxyRefSoftMuonMVA
void GetRes(reco::TrackRef t1, reco::TrackRef t2, std::string par, float &res, float &pull)
MonitorElement * staRelChi2SoftMuonMVA
MonitorElement * thetaStaTrack
edm::EDGetTokenT< edm::View< reco::Muon > > theMuonCollectionLabel_
float staRelChi2
chi2 value for the outer track stub with respect to the global track
std::vector< MonitorElement * > phiResolution
MonitorElement * chi2LocMomSoftMuonMVA
std::vector< MonitorElement * > thetaGlbTrack
int getPv(int tidx, const reco::VertexCollection *vc)
XYZPointD XYZPoint
point in space with cartesian internal representation
MonitorElement * phiTrack
MonitorElement * vCSChitsSoftMuonMVA
std::vector< MonitorElement * > oneOverptResolution
MonitorElement * probchi2Track
std::vector< MonitorElement * > muVStkSytemRotation
MonitorElement * kinkFinderSoftMuonMVA
MonitorElement * glbKinkFinderSoftMuonMVA
MonitorElement * chi2LocPosSoftMuonMVA
MonitorElement * glbDeltaEtaPhiSoftMuonMVA
int numberOfValidTrackerHits() const
MonitorElement * QprodSoftMuonMVA
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
MonitorElement * probchi2StaTrack
MonitorElement * ptStaTrack
int numberOfValidMuonDTHits() const
std::vector< MonitorElement * > rhAnalysis
int numberOfValidPixelHits() const
const Point & position() const
position
int numberOfValidMuonHits() const
MonitorElement * pStaTrack
MonitorElement * thetaTrack
std::vector< MonitorElement * > thetaResolution
MonitorElement * glbTrackTailProbSoftMuonMVA
MonitorElement * thetaPull
MonitorElement * qStaTrack
edm::EDGetTokenT< reco::VertexCollection > theVertexLabel_