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()) {