Inizialize parameters for histo binning.
597 edm::LogInfo(
"MuonRecoAnalyzer") <<
"Error: Can't get the beamspot" << endl;
602 edm::LogInfo(
"MuonRecoAnalyzer") <<
"Error: Can't get the vertex collection" << endl;
609 bool fillBadLumi =
false;
611 for (
auto const& dcsStatusItr : *dcsStatus) {
662 float res = 0, pull = 0;
663 if (!
muons.isValid())
681 refPoint =
vertex->at(pvIndex).position();
686 edm::LogInfo(
"MuonRecoAnalyzer") <<
"ERROR: No beam sport found!" << endl;
727 if (
muon->isGlobalMuon()) {
728 LogTrace(
metname) <<
"[MuonRecoAnalyzer] The mu is global - filling the histos";
729 if (
muon->isTrackerMuon() &&
muon->isStandAloneMuon())
731 if (!(
muon->isTrackerMuon()) &&
muon->isStandAloneMuon())
733 if (!
muon->isStandAloneMuon())
734 LogTrace(
metname) <<
"[MuonRecoAnalyzer] ERROR: the mu is global but not standalone!";
746 phiVsetaGlbTrack[0]->Fill(recoCombinedGlbTrack->eta(), recoCombinedGlbTrack->phi());
756 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"eta",
res, pull);
758 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"eta",
res, pull);
760 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"eta",
res, pull);
763 etaResolution[3]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta() - recoCombinedGlbTrack->eta());
764 etaResolution[4]->Fill(recoCombinedGlbTrack->eta(), -recoStaGlbTrack->eta() + recoCombinedGlbTrack->eta());
765 etaResolution[5]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta() - recoStaGlbTrack->eta());
770 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"theta",
res, pull);
772 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"theta",
res, pull);
775 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"theta",
res, pull);
778 thetaResolution[3]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta() - recoCombinedGlbTrack->theta());
780 -recoStaGlbTrack->theta() + recoCombinedGlbTrack->theta());
781 thetaResolution[5]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta() - recoStaGlbTrack->theta());
786 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"phi",
res, pull);
788 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"phi",
res, pull);
790 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"phi",
res, pull);
793 phiResolution[3]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi() - recoCombinedGlbTrack->phi());
794 phiResolution[4]->Fill(recoCombinedGlbTrack->phi(), -recoStaGlbTrack->phi() + recoCombinedGlbTrack->phi());
795 phiResolution[5]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi() - recoStaGlbTrack->phi());
803 probchi2GlbTrack[0]->Fill(TMath::Prob(recoCombinedGlbTrack->chi2(), recoCombinedGlbTrack->ndof()));
804 probchi2GlbTrack[1]->Fill(TMath::Prob(recoTkGlbTrack->chi2(), recoTkGlbTrack->ndof()));
805 probchi2GlbTrack[2]->Fill(TMath::Prob(recoStaGlbTrack->chi2(), recoStaGlbTrack->ndof()));
809 pGlbTrack[0]->Fill(recoCombinedGlbTrack->p());
811 pGlbTrack[2]->Fill(recoStaGlbTrack->p());
813 ptGlbTrack[0]->Fill(recoCombinedGlbTrack->pt());
817 qGlbTrack[0]->Fill(recoCombinedGlbTrack->charge());
818 qGlbTrack[1]->Fill(recoTkGlbTrack->charge());
819 qGlbTrack[2]->Fill(recoStaGlbTrack->charge());
820 if (recoCombinedGlbTrack->charge() == recoStaGlbTrack->charge())
824 if (recoCombinedGlbTrack->charge() == recoTkGlbTrack->charge())
828 if (recoStaGlbTrack->charge() == recoTkGlbTrack->charge())
832 if (recoCombinedGlbTrack->charge() != recoStaGlbTrack->charge() &&
833 recoCombinedGlbTrack->charge() != recoTkGlbTrack->charge())
835 if (recoCombinedGlbTrack->charge() == recoStaGlbTrack->charge() &&
836 recoCombinedGlbTrack->charge() == recoTkGlbTrack->charge())
839 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverp",
res, pull);
841 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverp",
res, pull);
843 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverp",
res, pull);
847 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverp",
res, pull);
849 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverp",
res, pull);
851 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverp",
res, pull);
855 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverpt",
res, pull);
857 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverpt",
res, pull);
859 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverpt",
res, pull);
863 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverpt",
res, pull);
865 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverpt",
res, pull);
867 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverpt",
res, pull);
877 double bestTrackPt = recoBestTrack->pt();
879 double tunePBestTrackPt = recoTunePBestTrack->pt();
881 double tunePBestTrackRes = (bestTrackPt - tunePBestTrackPt) / bestTrackPt;
886 (1 / recoTkGlbTrack->pt()) - (1 / recoCombinedGlbTrack->pt()));
888 -(1 / recoStaGlbTrack->pt()) + (1 / recoCombinedGlbTrack->pt()));
890 (1 / recoTkGlbTrack->pt()) - (1 / recoStaGlbTrack->pt()));
892 (1 / recoTkGlbTrack->pt()) - (1 / recoCombinedGlbTrack->pt()));
894 -(1 / recoStaGlbTrack->pt()) + (1 / recoCombinedGlbTrack->pt()));
896 (1 / recoTkGlbTrack->pt()) - (1 / recoStaGlbTrack->pt()));
898 (1 / recoTkGlbTrack->pt()) - (1 / recoCombinedGlbTrack->pt()));
900 -(1 / recoStaGlbTrack->pt()) + (1 / recoCombinedGlbTrack->pt()));
902 (1 / recoTkGlbTrack->pt()) - (1 / recoStaGlbTrack->pt()));
906 double rhGlb = recoCombinedGlbTrack->found();
908 double rhGlb_StaProvenance = 0;
910 double rhGlb_TkProvenance = 0;
913 recHit != recoCombinedGlbTrack->recHitsEnd();
915 if ((*recHit)->isValid()) {
916 DetId id = (*recHit)->geographicalId();
918 rhGlb_StaProvenance++;
920 rhGlb_TkProvenance++;
924 double rhStaGlb = recoStaGlbTrack->recHitsSize();
926 double rhTkGlb = recoTkGlbTrack->found();
928 double rhTkGlb_notValid = recoTkGlbTrack->lost();
931 rhAnalysis[0]->Fill(rhGlb_StaProvenance / rhGlb);
932 rhAnalysis[1]->Fill(rhGlb_TkProvenance / rhGlb);
933 rhAnalysis[2]->Fill(rhGlb_StaProvenance / rhStaGlb);
934 rhAnalysis[3]->Fill(rhGlb_TkProvenance / rhTkGlb);
935 rhAnalysis[4]->Fill(rhGlb / (rhStaGlb + rhTkGlb));
936 rhAnalysis[5]->Fill(rhTkGlb_notValid / rhGlb);
939 if (recoCombinedGlbTrack->charge() > 0)
942 muVStkSytemRotation[1]->Fill(recoCombinedGlbTrack->pt(), recoTkGlbTrack->pt() / recoCombinedGlbTrack->pt());
945 if (
muon->isTrackerMuon() && !(
muon->isGlobalMuon())) {
946 LogTrace(
metname) <<
"[MuonRecoAnalyzer] The mu is tracker only - filling the histos";
947 if (
muon->isStandAloneMuon())
949 if (!(
muon->isStandAloneMuon()))
965 if (
muon->isStandAloneMuon() && !(
muon->isGlobalMuon())) {
966 LogTrace(
metname) <<
"[MuonRecoAnalyzer] The mu is STA only - filling the histos";
967 if (!(
muon->isTrackerMuon()))
983 if (
muon->isCaloMuon() && !(
muon->isGlobalMuon()) && !(
muon->isTrackerMuon()) && !(
muon->isStandAloneMuon()))
991 if (
muon->isStandAloneMuon()) {
995 if (
muon->isStandAloneMuon() &&
muon->isGlobalMuon()) {
float chi2LocalPosition
chi2 value for the STA-TK matching of local position
MonitorElement * NTrkVHitsSoftMuonMVA
int numberOfValidPixelHits() const
std::vector< MonitorElement * > oneOverpResolution
MonitorElement * deltaRSoftMuonMVA
MonitorElement * trkRelChi2SoftMuonMVA
MonitorElement * qOverptPull
int numberOfValidMuonRPCHits() const
std::vector< MonitorElement * > ptGlbTrack
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
float glbKink
value of the kink algorithm applied to the global track
MonitorElement * iValFracSoftMuonMVA
int trackerLayersWithMeasurement() const
int numberOfValidMuonDTHits() const
MonitorElement * outerChi2SoftMuonMVA
MonitorElement * etaStaTrack
float glbTrackProbability
the tail probability (-ln(P)) of the global fit
MonitorElement * vGEMhitsSoftMuonMVA
bool isNonnull() const
Checks for non-null.
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
MonitorElement * vMuHitsSoftMuonMVA
float trkRelChi2
chi2 value for the inner track stub with respect to the global track
MonitorElement * phiStaTrack
MonitorElement * vDThitsSoftMuonMVA
MonitorElement * qOverpPull
std::vector< MonitorElement * > phiEfficiency
MonitorElement * mNuStationsSoftMuonMVA
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
int numberOfValidMuonGEMHits() const
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
int numberOfValidMuonHits() const
void GetRes(reco::TrackRef t1, reco::TrackRef t2, std::string par, float &res, float &pull)
MonitorElement * staRelChi2SoftMuonMVA
MonitorElement * thetaStaTrack
Log< level::Info, false > LogInfo
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 numberOfValidMuonCSCHits() const
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
MonitorElement * QprodSoftMuonMVA
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
MonitorElement * probchi2StaTrack
MonitorElement * ptStaTrack
std::vector< MonitorElement * > rhAnalysis
MonitorElement * pStaTrack
MonitorElement * thetaTrack
std::vector< MonitorElement * > thetaResolution
MonitorElement * glbTrackTailProbSoftMuonMVA
int numberOfValidTrackerHits() const
MonitorElement * thetaPull
MonitorElement * qStaTrack
edm::EDGetTokenT< reco::VertexCollection > theVertexLabel_