Inizialize parameters for histo binning.
587 edm::LogInfo(
"MuonRecoAnalyzer") <<
"Error: Can't get the beamspot" << endl;
592 edm::LogInfo(
"MuonRecoAnalyzer") <<
"Error: Can't get the vertex collection" << endl;
599 bool fillBadLumi =
false;
601 for (
auto const& dcsStatusItr : *dcsStatus) {
652 float res = 0, pull = 0;
653 if (!
muons.isValid())
671 refPoint =
vertex->at(pvIndex).position();
676 edm::LogInfo(
"MuonRecoAnalyzer") <<
"ERROR: No beam sport found!" << endl;
714 if (
muon->isGlobalMuon()) {
715 LogTrace(
metname) <<
"[MuonRecoAnalyzer] The mu is global - filling the histos";
716 if (
muon->isTrackerMuon() &&
muon->isStandAloneMuon())
718 if (!(
muon->isTrackerMuon()) &&
muon->isStandAloneMuon())
720 if (!
muon->isStandAloneMuon())
721 LogTrace(
metname) <<
"[MuonRecoAnalyzer] ERROR: the mu is global but not standalone!";
733 phiVsetaGlbTrack[0]->Fill(recoCombinedGlbTrack->eta(), recoCombinedGlbTrack->phi());
743 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"eta",
res, pull);
745 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"eta",
res, pull);
747 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"eta",
res, pull);
750 etaResolution[3]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta() - recoCombinedGlbTrack->eta());
751 etaResolution[4]->Fill(recoCombinedGlbTrack->eta(), -recoStaGlbTrack->eta() + recoCombinedGlbTrack->eta());
752 etaResolution[5]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta() - recoStaGlbTrack->eta());
757 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"theta",
res, pull);
759 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"theta",
res, pull);
762 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"theta",
res, pull);
765 thetaResolution[3]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta() - recoCombinedGlbTrack->theta());
767 -recoStaGlbTrack->theta() + recoCombinedGlbTrack->theta());
768 thetaResolution[5]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta() - recoStaGlbTrack->theta());
773 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"phi",
res, pull);
775 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"phi",
res, pull);
777 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"phi",
res, pull);
780 phiResolution[3]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi() - recoCombinedGlbTrack->phi());
781 phiResolution[4]->Fill(recoCombinedGlbTrack->phi(), -recoStaGlbTrack->phi() + recoCombinedGlbTrack->phi());
782 phiResolution[5]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi() - recoStaGlbTrack->phi());
790 probchi2GlbTrack[0]->Fill(TMath::Prob(recoCombinedGlbTrack->chi2(), recoCombinedGlbTrack->ndof()));
791 probchi2GlbTrack[1]->Fill(TMath::Prob(recoTkGlbTrack->chi2(), recoTkGlbTrack->ndof()));
792 probchi2GlbTrack[2]->Fill(TMath::Prob(recoStaGlbTrack->chi2(), recoStaGlbTrack->ndof()));
796 pGlbTrack[0]->Fill(recoCombinedGlbTrack->p());
798 pGlbTrack[2]->Fill(recoStaGlbTrack->p());
800 ptGlbTrack[0]->Fill(recoCombinedGlbTrack->pt());
804 qGlbTrack[0]->Fill(recoCombinedGlbTrack->charge());
805 qGlbTrack[1]->Fill(recoTkGlbTrack->charge());
806 qGlbTrack[2]->Fill(recoStaGlbTrack->charge());
807 if (recoCombinedGlbTrack->charge() == recoStaGlbTrack->charge())
811 if (recoCombinedGlbTrack->charge() == recoTkGlbTrack->charge())
815 if (recoStaGlbTrack->charge() == recoTkGlbTrack->charge())
819 if (recoCombinedGlbTrack->charge() != recoStaGlbTrack->charge() &&
820 recoCombinedGlbTrack->charge() != recoTkGlbTrack->charge())
822 if (recoCombinedGlbTrack->charge() == recoStaGlbTrack->charge() &&
823 recoCombinedGlbTrack->charge() == recoTkGlbTrack->charge())
826 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverp",
res, pull);
828 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverp",
res, pull);
830 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverp",
res, pull);
834 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverp",
res, pull);
836 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverp",
res, pull);
838 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverp",
res, pull);
842 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverpt",
res, pull);
844 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverpt",
res, pull);
846 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverpt",
res, pull);
850 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverpt",
res, pull);
852 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverpt",
res, pull);
854 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverpt",
res, pull);
864 double bestTrackPt = recoBestTrack->pt();
866 double tunePBestTrackPt = recoTunePBestTrack->pt();
868 double tunePBestTrackRes = (bestTrackPt - tunePBestTrackPt) / bestTrackPt;
873 (1 / recoTkGlbTrack->pt()) - (1 / recoCombinedGlbTrack->pt()));
875 -(1 / recoStaGlbTrack->pt()) + (1 / recoCombinedGlbTrack->pt()));
877 (1 / recoTkGlbTrack->pt()) - (1 / recoStaGlbTrack->pt()));
879 (1 / recoTkGlbTrack->pt()) - (1 / recoCombinedGlbTrack->pt()));
881 -(1 / recoStaGlbTrack->pt()) + (1 / recoCombinedGlbTrack->pt()));
883 (1 / recoTkGlbTrack->pt()) - (1 / recoStaGlbTrack->pt()));
885 (1 / recoTkGlbTrack->pt()) - (1 / recoCombinedGlbTrack->pt()));
887 -(1 / recoStaGlbTrack->pt()) + (1 / recoCombinedGlbTrack->pt()));
889 (1 / recoTkGlbTrack->pt()) - (1 / recoStaGlbTrack->pt()));
893 double rhGlb = recoCombinedGlbTrack->found();
895 double rhGlb_StaProvenance = 0;
897 double rhGlb_TkProvenance = 0;
900 recHit != recoCombinedGlbTrack->recHitsEnd();
902 if ((*recHit)->isValid()) {
903 DetId id = (*recHit)->geographicalId();
905 rhGlb_StaProvenance++;
907 rhGlb_TkProvenance++;
911 double rhStaGlb = recoStaGlbTrack->recHitsSize();
913 double rhTkGlb = recoTkGlbTrack->found();
915 double rhTkGlb_notValid = recoTkGlbTrack->lost();
918 rhAnalysis[0]->Fill(rhGlb_StaProvenance / rhGlb);
919 rhAnalysis[1]->Fill(rhGlb_TkProvenance / rhGlb);
920 rhAnalysis[2]->Fill(rhGlb_StaProvenance / rhStaGlb);
921 rhAnalysis[3]->Fill(rhGlb_TkProvenance / rhTkGlb);
922 rhAnalysis[4]->Fill(rhGlb / (rhStaGlb + rhTkGlb));
923 rhAnalysis[5]->Fill(rhTkGlb_notValid / rhGlb);
926 if (recoCombinedGlbTrack->charge() > 0)
929 muVStkSytemRotation[1]->Fill(recoCombinedGlbTrack->pt(), recoTkGlbTrack->pt() / recoCombinedGlbTrack->pt());
932 if (
muon->isTrackerMuon() && !(
muon->isGlobalMuon())) {
933 LogTrace(
metname) <<
"[MuonRecoAnalyzer] The mu is tracker only - filling the histos";
934 if (
muon->isStandAloneMuon())
936 if (!(
muon->isStandAloneMuon()))
952 if (
muon->isStandAloneMuon() && !(
muon->isGlobalMuon())) {
953 LogTrace(
metname) <<
"[MuonRecoAnalyzer] The mu is STA only - filling the histos";
954 if (!(
muon->isTrackerMuon()))
970 if (
muon->isCaloMuon() && !(
muon->isGlobalMuon()) && !(
muon->isTrackerMuon()) && !(
muon->isStandAloneMuon()))
978 if (
muon->isStandAloneMuon()) {
982 if (
muon->isStandAloneMuon() &&
muon->isGlobalMuon()) {