From 3041bdc70067f34c491934e8db370da8e4d686d2 Mon Sep 17 00:00:00 2001 From: Ren Ejima <74614598+RenEjima@users.noreply.github.com> Date: Tue, 15 Feb 2022 01:29:58 +0900 Subject: [PATCH 1/4] enable to use True Pairing Eff --- .../src/MatchGlobalFwdAssessment.cxx | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) diff --git a/Detectors/GlobalTracking/src/MatchGlobalFwdAssessment.cxx b/Detectors/GlobalTracking/src/MatchGlobalFwdAssessment.cxx index 7798aad638f90..d520887f0468f 100644 --- a/Detectors/GlobalTracking/src/MatchGlobalFwdAssessment.cxx +++ b/Detectors/GlobalTracking/src/MatchGlobalFwdAssessment.cxx @@ -69,6 +69,7 @@ void GloFwdAssessment::reset() mChargeMatchEff->SetPassedHistogram(*hC, ""); mPairingEtaPt->Reset(); + mTruePairingEtaPt->Reset(); for (auto& h : mTH3Histos) { h->Reset(); } @@ -389,6 +390,7 @@ void GloFwdAssessment::processRecoAndTrueTracks() mTH3Histos[kTH3GMTrackReducedChi2PtEta]->Fill(ptGen, etaGen, Chi2_Rec / (2 * nMFTClusters - 5)); mTH3Histos[kTH3GMTruePtEtaChi2]->Fill(pt_Rec, eta_Rec, matchChi2); mTH3Histos[kTH3GMTruePtEtaMatchScore]->Fill(pt_Rec, eta_Rec, matchMatchScore); + mTH3Histos[kTH3GMTruePtEtaMatchScore_MC]->Fill(ptGen, etaGen, matchMatchScore); } trkId++; } @@ -458,6 +460,7 @@ void GloFwdAssessment::getHistos(TObjArray& objar) objar.Add(mChargeMatchEff.get()); objar.Add(mPairingEtaPt.get()); + objar.Add(mTruePairingEtaPt.get()); if (mFinalizeAnalysis) { for (int slicedCanvas = 0; slicedCanvas < kNSlicedTH3; slicedCanvas++) { @@ -576,15 +579,22 @@ void GloFwdAssessment::finalizeRecoAndPairables() auto& Reco = mTH3Histos[kTH3GMTrackPtEtaMatchScore]; auto& hTrue = mTH3Histos[kTH3GMTruePtEtaMatchScore]; + auto& hTrue_MC = mTH3Histos[kTH3GMTruePtEtaMatchScore_MC]; auto& hPairable = mTH3Histos[kTH3GMPairablePtEtaZ]; auto RecoEtaPt = (TH2D*)Reco->Project3D("xy COLZ"); + auto TrueEtaPt_MC = (TH2D*)hTrue_MC->Project3D("xy COLZ"); auto PairableEtaPt = (TH2D*)hPairable->Project3D("xy COLZ"); mPairingEtaPt = (std::unique_ptr)static_cast(RecoEtaPt->Clone()); mPairingEtaPt->Divide(PairableEtaPt); mPairingEtaPt->SetNameTitle("GMTrackPairingEffEtaPt", "PairingEffEtaPt"); mPairingEtaPt->SetOption("COLZ"); + + mTruePairingEtaPt = (std::unique_ptr)static_cast(TrueEtaPt_MC->Clone()); + mTruePairingEtaPt->Divide(PairableEtaPt); + mTruePairingEtaPt->SetNameTitle("GMTrackTruePairingEffEtaPt", "TruePairingEffEtaPt"); + mTruePairingEtaPt->SetOption("COLZ"); } } @@ -599,6 +609,7 @@ void GloFwdAssessment::finalizePurityAndEff() auto& Reco = mTH3Histos[kTH3GMTrackPtEtaMatchScore]; auto& hTrue = mTH3Histos[kTH3GMTruePtEtaMatchScore]; + auto& hTrue_MC = mTH3Histos[kTH3GMTruePtEtaMatchScore_MC]; auto& hPairable = mTH3Histos[kTH3GMPairablePtEtaZ]; // Inner pseudorapidity @@ -609,6 +620,8 @@ void GloFwdAssessment::finalizePurityAndEff() auto PairablePtProjOuter = (TH1*)hPairable->ProjectionX("PairableOuter", minBin, midBin); auto RecoEtaPt = (TH2D*)Reco->Project3D("xy COLZ"); + auto TrueEtaPt = (TH2D *)hTrue->Project3D("xy COLZ"); + auto TrueEtaPt_MC = (TH2D *)hTrue_MC->Project3D("xy COLZ"); auto PairableEtaPt = (TH2D*)hPairable->Project3D("xy COLZ"); auto PairablePt = (TH1D*)hPairable->Project3D("x"); @@ -618,11 +631,13 @@ void GloFwdAssessment::finalizePurityAndEff() auto RecoPtProj = (TH1*)Reco->ProjectionX(Form("_RecoPtProj%.2f", scoreCut)); auto TruePtProj = (TH1*)hTrue->ProjectionX(Form("_TruePtProj%.2f", scoreCut)); + auto TruePtProj_MC = (TH1 *)hTrue_MC->ProjectionX(Form("_TruePtProj_MC%.2f", scoreCut)); // Inner pseudorapidity auto maxScoreBin = Reco->GetZaxis()->FindBin(scoreCut); auto RecoPtProjInner = (TH1*)Reco->ProjectionX(Form("_InnerRecoCut_%.2f", scoreCut), midBin, maxBin, 0, maxScoreBin); auto TruePtProjInner = (TH1*)hTrue->ProjectionX(Form("_InnerTrueCut_%.2f", scoreCut), midBin, maxBin, 0, maxScoreBin); + auto TruePtProjInner_MC = (TH1 *)hTrue_MC->ProjectionX(Form("_InnerTrueCut_MC_%.2f", scoreCut), midBin, maxBin, 0, maxScoreBin); auto& hPurityInner = mPurityPtInnerVecTH2.emplace_back((std::unique_ptr)static_cast(TruePtProjInner->Clone())); hPurityInner->Divide(RecoPtProjInner); // Global Pairing Purity = N_true / N_reco @@ -642,9 +657,19 @@ void GloFwdAssessment::finalizePurityAndEff() hPairingEffInner->SetMinimum(0.0); hPairingEffInner->SetMaximum(1.8); + auto &hTruePairingEffInner = mTruePairingPtInnerVecTH1.emplace_back((std::unique_ptr)static_cast(TruePtProjInner_MC->Clone())); + hTruePairingEffInner->Divide(PairablePtProjInner); + hTruePairingEffInner->SetNameTitle(Form("GMTrackTruePairingEffInnerPtCut_%.2f", scoreCut), Form("%.2f cut", scoreCut)); + hTruePairingEffInner->GetYaxis()->SetTitle("True Pairing Efficiency [ N_{True} / N_{pairable}]"); + hTruePairingEffInner->SetOption("COLZ"); + hTruePairingEffInner->SetMarkerStyle(kFullCircle); + hTruePairingEffInner->SetMinimum(0.0); + hTruePairingEffInner->SetMaximum(1.2); + // Outer pseudorapidity auto RecoPtProjOuter = (TH1*)Reco->ProjectionX(Form("_OuterRecoCut_%.2f", scoreCut), minBin, midBin, 0, maxScoreBin); auto TruePtProjOuter = (TH1*)hTrue->ProjectionX(Form("_OuterTrueCut_%.2f", scoreCut), minBin, midBin, 0, maxScoreBin); + auto TruePtProjOuter_MC = (TH1 *)hTrue_MC->ProjectionX(Form("_OuterTrueCut_MC_%.2f", scoreCut), minBin, midBin, 0, maxScoreBin); auto& hPurityOuter = mPurityPtOuterVecTH2.emplace_back((std::unique_ptr)static_cast(TruePtProjOuter->Clone())); hPurityOuter->Divide(RecoPtProjOuter); // Global Pairing Purity = N_true / N_reco @@ -664,10 +689,24 @@ void GloFwdAssessment::finalizePurityAndEff() hPairingEffOuter->SetMinimum(0.0); hPairingEffOuter->SetMaximum(1.8); + auto &hTruePairingEffOuter = mTruePairingPtOuterVecTH1.emplace_back((std::unique_ptr)static_cast(TruePtProjOuter_MC->Clone())); + hTruePairingEffOuter->Divide(PairablePtProjOuter); + hTruePairingEffOuter->SetNameTitle(Form("GMTrackTruePairingEffOuterPtCut_%.2f", scoreCut), Form("%.2f cut", scoreCut)); + hTruePairingEffOuter->GetYaxis()->SetTitle("True Pairing Efficiency [ N_{True} / N_{pairable}]"); + hTruePairingEffOuter->SetOption("COLZ"); + hTruePairingEffOuter->SetMarkerStyle(kFullTriangleUp); + hTruePairingEffOuter->SetMinimum(0.0); + hTruePairingEffOuter->SetMaximum(1.2); + mPairingEtaPtVec.emplace_back((std::unique_ptr)static_cast(RecoEtaPt->Clone())); mPairingEtaPtVec.back()->Divide(PairableEtaPt); // Pairing Efficiency = N_reco / N_Pairable mPairingEtaPtVec.back()->SetNameTitle(Form("GMTrackPairingEffEtaPtCut_%.2f", scoreCut), Form("%.2f", scoreCut)); mPairingEtaPtVec.back()->SetOption("COLZ"); + + mTruePairingEtaPtVec.emplace_back((std::unique_ptr)static_cast(TrueEtaPt_MC->Clone())); + mTruePairingEtaPtVec.back()->Divide(PairableEtaPt); + mTruePairingEtaPtVec.back()->SetNameTitle(Form("GMTrackTruePairingEffEtaPtCut_%.2f", scoreCut), Form("%.2f", scoreCut)); + mTruePairingEtaPtVec.back()->SetOption("COLZ"); } auto nCanvas = kPurityPtOuter; @@ -682,14 +721,20 @@ void GloFwdAssessment::finalizePurityAndEff() std::vector verylowPtInnerPurity; std::vector verylowPtOuterEff; std::vector verylowPtInnerEff; + std::vector veryLowPtOuterTrueEff; + std::vector veryLowPtInnerTrueEff; std::vector lowPtOuterPurity; std::vector lowPtInnerPurity; std::vector lowPtOuterEff; std::vector lowPtInnerEff; + std::vector lowPtOuterTrueEff; + std::vector lowPtInnerTrueEff; std::vector highPtOuterPurity; std::vector highPtInnerPurity; std::vector highPtOuterEff; std::vector highPtInnerEff; + std::vector highPtOuterTrueEff; + std::vector highPtInnerTrueEff; auto veryLowptBin = mPurityPtOuterVecTH2.front()->GetXaxis()->FindBin(0.25); auto lowptBin = mPurityPtOuterVecTH2.front()->GetXaxis()->FindBin(0.75); @@ -806,6 +851,64 @@ void GloFwdAssessment::finalizePurityAndEff() mAssessmentCanvas[nCanvas]->SetTicky(); mAssessmentCanvas[nCanvas]->SetGridy(); + nCanvas = kTruePairingEffPtOuter; + canvasName = GMAssesmentNames[nCanvas]; + mAssessmentCanvas[nCanvas] = new TCanvas(canvasName, canvasName, 1080, 800); + mAssessmentCanvas[nCanvas]->UseCurrentStyle(); + mAssessmentCanvas[nCanvas]->cd(); + first = true; + + for (auto &th2 : mTruePairingPtOuterVecTH1){ + if (first){ + option = "hist P PMC"; + }else{ + option = "hist SAME P PMC"; + } + first = false; + veryLowPtOuterTrueEff.push_back(th2->GetBinContent(veryLowptBin)); + lowPtOuterTrueEff.push_back(th2->GetBinContent(lowptBin)); + highPtOuterTrueEff.push_back(th2->GetBinContent(highptBin)); + th2->Draw(option.c_str()); + } + t = new TPaveText(0.2223748, 0.9069355, 0.7776252, 0.965, "brNDC"); + t->SetBorderSize(0); + t->SetFillColor(gStyle->GetTitleFillColor()); + t->AddText("Global Muon Track True Pairing Efficiency (2.4 < #eta < 3.0)"); + t->Draw(); + + mAssessmentCanvas[nCanvas]->BuildLegend(.8, .15, .96, .87); + mAssessmentCanvas[nCanvas]->SetTicky(); + mAssessmentCanvas[nCanvas]->SetGridy(); + + nCanvas = kTruePairingEffPtInner; + canvasName = GMAssesmentNames[nCanvas]; + mAssessmentCanvas[nCanvas] = new TCanvas(canvasName, canvasName, 1080, 800); + mAssessmentCanvas[nCanvas]->UseCurrentStyle(); + mAssessmentCanvas[nCanvas]->cd(); + first = true; + + for (auto &th2 : mTruePairingPtInnerVecTH1){ + if (first){ + option = "hist P PMC"; + }else{ + option = "hist SAME P PMC"; + } + first = false; + veryLowPtInnerTrueEff.push_back(th2->GetBinContent(veryLowptBin)); + lowPtInnerTrueEff.push_back(th2->GetBinContent(lowptBin)); + highPtInnerTrueEff.push_back(th2->GetBinContent(highptBin)); + th2->Draw(option.c_str()); + } + t = new TPaveText(0.2223748, 0.9069355, 0.7776252, 0.965, "brNDC"); + t->SetBorderSize(0); + t->SetFillColor(gStyle->GetTitleFillColor()); + t->AddText("Global Muon Track True Pairing Efficiency (3.0 < #eta < 3.6 )"); + t->Draw(); + + mAssessmentCanvas[nCanvas]->BuildLegend(.8, .15, .96, .87); + mAssessmentCanvas[nCanvas]->SetTicky(); + mAssessmentCanvas[nCanvas]->SetGridy(); + nCanvas = kPurityVsEfficiency; canvasName = GMAssesmentNames[nCanvas]; mAssessmentCanvas[nCanvas] = new TCanvas(canvasName, canvasName, 1080, 800); @@ -849,6 +952,50 @@ void GloFwdAssessment::finalizePurityAndEff() mAssessmentCanvas[nCanvas]->BuildLegend(); mAssessmentCanvas[nCanvas]->SetTicky(); mAssessmentCanvas[nCanvas]->SetGridy(); + + nCanvas = kPurityVsTrueEfficiency; + canvasName = GMAssesmentNames[nCanvas]; + mAssessmentCanvas[nCanvas] = new TCanvas(canvasName, canvasName, 1080, 800); + + TGraph *gr2 = new TGraph(highPtInnerTrueEff.size(), &highPtInnerTrueEff[0], &highPtInnerPurity[0]); + gr2->SetMinimum(0); + gr2->SetMaximum(1.01); + + gr2->SetMarkerStyle(kFullCircle); + gr2->Draw("A P PMC"); + gr2->GetXaxis()->SetTitle("Global Muon True Pairing Efficiency [ N_{True} / N_{pairable}]"); + gr2->GetXaxis()->SetLimits(0.f, 1.01); + gr2->GetYaxis()->SetTitle("Pairing Purity [ N_{True} / N_{Rec}]"); + gr2->SetTitle("p_{t} = 2.25 || (3.0 < #eta < 3.6 )"); + + gr2 = new TGraph(highPtOuterTrueEff.size(), &highPtOuterTrueEff[0], &highPtOuterPurity[0]); + gr2->Draw("P PMC SAME"); + gr2->SetMarkerStyle(kFullTriangleUp); + + gr2->SetTitle("p_{t} = 2.25 || (2.4 < #eta < 3.0)"); + + gr2 = new TGraph(lowPtInnerTrueEff.size(), &lowPtInnerTrueEff[0], &lowPtInnerPurity[0]); + gr2->Draw("P PMC SAME"); + gr2->SetTitle("p_{t} = 0.75 || (3.0 < #eta < 3.6 )"); + + gr2 = new TGraph(lowPtOuterTrueEff.size(), &lowPtOuterTrueEff[0], &lowPtOuterPurity[0]); + gr2->Draw("P PMC SAME"); + gr2->SetMarkerStyle(kFullTriangleUp); + gr2->SetTitle("p_{t} = 0.75 || (2.4 < #eta < 3.0)"); + + gr2 = new TGraph(veryLowPtInnerTrueEff.size(), &veryLowPtInnerTrueEff[0], &verylowPtInnerPurity[0]); + gr2->Draw("P PMC SAME"); + gr2->SetTitle("p_{t} = 0.25 || (3.0 < #eta < 3.6)"); + + gr2 = new TGraph(veryLowPtOuterTrueEff.size(), &veryLowPtOuterTrueEff[0], &verylowPtOuterPurity[0]); + gr2->Draw("P PMC SAME"); + gr2->SetMarkerStyle(kFullTriangleUp); + + gr2->SetTitle("p_{t} = 0.25 || (2.4 < #eta < 3.0)"); + + mAssessmentCanvas[nCanvas]->BuildLegend(); + mAssessmentCanvas[nCanvas]->SetTicky(); + mAssessmentCanvas[nCanvas]->SetGridy(); } //__________________________________________________________ From 2b65bb641ad40b1b2a066a2056b5ba9c6030f402 Mon Sep 17 00:00:00 2001 From: Ren Ejima <74614598+RenEjima@users.noreply.github.com> Date: Tue, 15 Feb 2022 01:31:36 +0900 Subject: [PATCH 2/4] enable to use True Pairing Eff --- .../GlobalTracking/MatchGlobalFwdAssessment.h | 43 +++++++++++++------ 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdAssessment.h b/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdAssessment.h index 5344d5bd54860..abc32abeca287 100644 --- a/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdAssessment.h +++ b/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdAssessment.h @@ -138,12 +138,16 @@ class GloFwdAssessment std::unique_ptr mChargeMatchEff = nullptr; std::unique_ptr mPairingEtaPt = nullptr; + std::unique_ptr mTruePairingEtaPt = nullptr; std::vector> mPurityPtInnerVecTH2; std::vector> mPurityPtOuterVecTH2; std::vector> mPairingPtInnerVecTH1; std::vector> mPairingPtOuterVecTH1; + std::vector> mTruePairingPtInnerVecTH1; + std::vector> mTruePairingPtOuterVecTH1; std::vector> mPairingEtaPtVec; + std::vector> mTruePairingEtaPtVec; enum TH3HistosCodes { kTH3GMTrackDeltaXDeltaYEta, @@ -162,6 +166,7 @@ class GloFwdAssessment kTH3GMTrackPtEtaMatchScore, kTH3GMTruePtEtaChi2, kTH3GMTruePtEtaMatchScore, + kTH3GMTruePtEtaMatchScore_MC, kTH3GMCloseMatchPtEtaChi2, kTH3GMCloseMatchPtEtaMatchScore, kTH3GMPairablePtEtaZ, @@ -187,7 +192,8 @@ class GloFwdAssessment {kTH3GMTrackPtEtaChi2, "TH3GMTrackPtEtaChi2"}, {kTH3GMTrackPtEtaMatchScore, "TH3GMTrackPtEtaMatchScore"}, {kTH3GMTruePtEtaChi2, "TH3GMTruePtEtaChi2"}, - {kTH3GMTruePtEtaMatchScore, "TH3GMTruePtEtaMatchScore"}}; + {kTH3GMTruePtEtaMatchScore, "TH3GMTruePtEtaMatchScore"}, + {kTH3GMTruePtEtaMatchScore_MC, "TH3GMTruePtEtaMatchScore_MC"}}; std::map TH3Titles{ {kTH3GMTrackDeltaXDeltaYEta, "TH3GMTrackDeltaXDeltaYEta"}, @@ -208,7 +214,8 @@ class GloFwdAssessment {kTH3GMTrackPtEtaChi2, "TH3GMTrackPtEtaChi2"}, {kTH3GMTrackPtEtaMatchScore, "TH3GMTrackPtEtaMatchScore"}, {kTH3GMTruePtEtaChi2, "TH3GMTruePtEtaChi2"}, - {kTH3GMTruePtEtaMatchScore, "TH3GMTruePtEtaMatchScore"}}; + {kTH3GMTruePtEtaMatchScore, "TH3GMTruePtEtaMatchScore"}, + {kTH3GMTruePtEtaMatchScore_MC, "TH3GMTruePtEtaMatchScore_MC"}}; std::map> TH3Binning{ {kTH3GMTrackDeltaXDeltaYEta, {16, 2.2, 3.8, 1000, -1000, 1000, 1000, -1000, 1000}}, @@ -229,7 +236,8 @@ class GloFwdAssessment {kTH3GMTrackPtEtaChi2, {40, 0, 20, 16, 2.2, 3.8, 1000, 0, 100}}, {kTH3GMTrackPtEtaMatchScore, {40, 0, 20, 16, 2.2, 3.8, 2000, 0, 20.0}}, {kTH3GMTruePtEtaChi2, {40, 0, 20, 16, 2.2, 3.8, 1000, 0, 100}}, - {kTH3GMTruePtEtaMatchScore, {40, 0, 20, 16, 2.2, 3.8, 2000, 0, 20.0}}}; + {kTH3GMTruePtEtaMatchScore, {40, 0, 20, 16, 2.2, 3.8, 2000, 0, 20.0}}, + {kTH3GMTruePtEtaMatchScore_MC, {40, 0, 20, 16, 2.2, 3.8, 2000, 0, 20.0}}}; std::map TH3XaxisTitles{ {kTH3GMTrackDeltaXDeltaYEta, R"(\\eta_{MC})"}, @@ -244,13 +252,14 @@ class GloFwdAssessment {kTH3GMTrackTanlPullPtEta, R"(p_{t}_{MC})"}, {kTH3GMTrackInvQPtPullPtEta, R"(p_{t}_{MC})"}, {kTH3GMTrackReducedChi2PtEta, R"(p_{t}_{MC})"}, - {kTH3GMCloseMatchPtEtaChi2, R"(p_{t}_{Fit}_{MC})"}, - {kTH3GMCloseMatchPtEtaMatchScore, R"(p_{t}_{Fit}_{MC})"}, - {kTH3GMPairablePtEtaZ, R"(p_{t}_{Fit}_{MC})"}, - {kTH3GMTrackPtEtaChi2, R"(p_{t}_{Fit}_{MC})"}, - {kTH3GMTrackPtEtaMatchScore, R"(p_{t}_{Fit}_{MC})"}, - {kTH3GMTruePtEtaChi2, R"(p_{t}_{Fit}_{MC})"}, - {kTH3GMTruePtEtaMatchScore, R"(p_{t}_{Fit}_{MC})"}}; + {kTH3GMCloseMatchPtEtaChi2, R"(p_{t}_{Fit})"}, + {kTH3GMCloseMatchPtEtaMatchScore, R"(p_{t}_{Fit})"}, + {kTH3GMPairablePtEtaZ, R"(p_{t}_{MC})"}, + {kTH3GMTrackPtEtaChi2, R"(p_{t}_{Fit})"}, + {kTH3GMTrackPtEtaMatchScore, R"(p_{t}_{Fit})"}, + {kTH3GMTruePtEtaChi2, R"(p_{t}_{Fit})"}, + {kTH3GMTruePtEtaMatchScore, R"(p_{t}_{Fit})"}, + {kTH3GMTruePtEtaMatchScore_MC, R"(p_{t}_{MC})"},}; std::map TH3YaxisTitles{ {kTH3GMTrackDeltaXDeltaYEta, R"(X_{residual \rightarrow vtx} (\mu m))"}, @@ -271,7 +280,8 @@ class GloFwdAssessment {kTH3GMTrackPtEtaChi2, R"(\eta_{Fit})"}, {kTH3GMTrackPtEtaMatchScore, R"(\eta_{Fit})"}, {kTH3GMTruePtEtaChi2, R"(\eta_{Fit})"}, - {kTH3GMTruePtEtaMatchScore, R"(\eta_{Fit})"}}; + {kTH3GMTruePtEtaMatchScore, R"(\eta_{Fit})"}, + {kTH3GMTruePtEtaMatchScore_MC, R"(\eta_{MC})"}}; std::map TH3ZaxisTitles{ {kTH3GMTrackDeltaXDeltaYEta, R"(Y_{residual \rightarrow vtx} (\mu m))"}, @@ -292,7 +302,8 @@ class GloFwdAssessment {kTH3GMTrackPtEtaChi2, R"(Match \chi^2)"}, {kTH3GMTrackPtEtaMatchScore, R"(Matching Score)"}, {kTH3GMTruePtEtaChi2, R"(Match \chi^2)"}, - {kTH3GMTruePtEtaMatchScore, R"(Matching Score)"}}; + {kTH3GMTruePtEtaMatchScore, R"(Matching Score)"}, + {kTH3GMTruePtEtaMatchScore_MC, R"(Matching Score)"}}; enum TH3SlicedCodes { kDeltaXVertexVsEta, @@ -368,6 +379,9 @@ class GloFwdAssessment kPairingEffPtOuter, kPairingEffPtInner, kPurityVsEfficiency, + kTruePairingEffPtOuter, + kTruePairingEffPtInner, + kPurityVsTrueEfficiency, kNGMAssesmentCanvases }; @@ -376,7 +390,10 @@ class GloFwdAssessment {kPurityPtInner, "PurityPtInner"}, {kPairingEffPtOuter, "PairingEffPtOuter"}, {kPairingEffPtInner, "PairingEffPtInner"}, - {kPurityVsEfficiency, "PurityVsEfficiency"}}; + {kTruePairingEffPtOuter, "TruePairingEffPtOuter"}, + {kTruePairingEffPtInner, "TruePairingEffPtInner"}, + {kPurityVsEfficiency, "PurityVsEfficiency"}, + {kPurityVsTrueEfficiency, "PurityVsTrueEfficiency"}}; std::array mAssessmentCanvas; From 02e238362d26aa8e540a3de4e0d604d4ebd74fff Mon Sep 17 00:00:00 2001 From: Ren Ejima <74614598+RenEjima@users.noreply.github.com> Date: Tue, 15 Feb 2022 18:54:20 +0900 Subject: [PATCH 3/4] Remove unnecessary comma --- .../include/GlobalTracking/MatchGlobalFwdAssessment.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdAssessment.h b/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdAssessment.h index abc32abeca287..f943de9d43493 100644 --- a/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdAssessment.h +++ b/Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdAssessment.h @@ -259,7 +259,7 @@ class GloFwdAssessment {kTH3GMTrackPtEtaMatchScore, R"(p_{t}_{Fit})"}, {kTH3GMTruePtEtaChi2, R"(p_{t}_{Fit})"}, {kTH3GMTruePtEtaMatchScore, R"(p_{t}_{Fit})"}, - {kTH3GMTruePtEtaMatchScore_MC, R"(p_{t}_{MC})"},}; + {kTH3GMTruePtEtaMatchScore_MC, R"(p_{t}_{MC})"}}; std::map TH3YaxisTitles{ {kTH3GMTrackDeltaXDeltaYEta, R"(X_{residual \rightarrow vtx} (\mu m))"}, From 9d6cbfd8f803719b7e7dae3629ed1e7cd87a4391 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 15 Feb 2022 09:55:18 +0000 Subject: [PATCH 4/4] Please consider the following formatting changes --- .../src/MatchGlobalFwdAssessment.cxx | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Detectors/GlobalTracking/src/MatchGlobalFwdAssessment.cxx b/Detectors/GlobalTracking/src/MatchGlobalFwdAssessment.cxx index d520887f0468f..112de8fd872da 100644 --- a/Detectors/GlobalTracking/src/MatchGlobalFwdAssessment.cxx +++ b/Detectors/GlobalTracking/src/MatchGlobalFwdAssessment.cxx @@ -620,8 +620,8 @@ void GloFwdAssessment::finalizePurityAndEff() auto PairablePtProjOuter = (TH1*)hPairable->ProjectionX("PairableOuter", minBin, midBin); auto RecoEtaPt = (TH2D*)Reco->Project3D("xy COLZ"); - auto TrueEtaPt = (TH2D *)hTrue->Project3D("xy COLZ"); - auto TrueEtaPt_MC = (TH2D *)hTrue_MC->Project3D("xy COLZ"); + auto TrueEtaPt = (TH2D*)hTrue->Project3D("xy COLZ"); + auto TrueEtaPt_MC = (TH2D*)hTrue_MC->Project3D("xy COLZ"); auto PairableEtaPt = (TH2D*)hPairable->Project3D("xy COLZ"); auto PairablePt = (TH1D*)hPairable->Project3D("x"); @@ -631,13 +631,13 @@ void GloFwdAssessment::finalizePurityAndEff() auto RecoPtProj = (TH1*)Reco->ProjectionX(Form("_RecoPtProj%.2f", scoreCut)); auto TruePtProj = (TH1*)hTrue->ProjectionX(Form("_TruePtProj%.2f", scoreCut)); - auto TruePtProj_MC = (TH1 *)hTrue_MC->ProjectionX(Form("_TruePtProj_MC%.2f", scoreCut)); + auto TruePtProj_MC = (TH1*)hTrue_MC->ProjectionX(Form("_TruePtProj_MC%.2f", scoreCut)); // Inner pseudorapidity auto maxScoreBin = Reco->GetZaxis()->FindBin(scoreCut); auto RecoPtProjInner = (TH1*)Reco->ProjectionX(Form("_InnerRecoCut_%.2f", scoreCut), midBin, maxBin, 0, maxScoreBin); auto TruePtProjInner = (TH1*)hTrue->ProjectionX(Form("_InnerTrueCut_%.2f", scoreCut), midBin, maxBin, 0, maxScoreBin); - auto TruePtProjInner_MC = (TH1 *)hTrue_MC->ProjectionX(Form("_InnerTrueCut_MC_%.2f", scoreCut), midBin, maxBin, 0, maxScoreBin); + auto TruePtProjInner_MC = (TH1*)hTrue_MC->ProjectionX(Form("_InnerTrueCut_MC_%.2f", scoreCut), midBin, maxBin, 0, maxScoreBin); auto& hPurityInner = mPurityPtInnerVecTH2.emplace_back((std::unique_ptr)static_cast(TruePtProjInner->Clone())); hPurityInner->Divide(RecoPtProjInner); // Global Pairing Purity = N_true / N_reco @@ -657,7 +657,7 @@ void GloFwdAssessment::finalizePurityAndEff() hPairingEffInner->SetMinimum(0.0); hPairingEffInner->SetMaximum(1.8); - auto &hTruePairingEffInner = mTruePairingPtInnerVecTH1.emplace_back((std::unique_ptr)static_cast(TruePtProjInner_MC->Clone())); + auto& hTruePairingEffInner = mTruePairingPtInnerVecTH1.emplace_back((std::unique_ptr)static_cast(TruePtProjInner_MC->Clone())); hTruePairingEffInner->Divide(PairablePtProjInner); hTruePairingEffInner->SetNameTitle(Form("GMTrackTruePairingEffInnerPtCut_%.2f", scoreCut), Form("%.2f cut", scoreCut)); hTruePairingEffInner->GetYaxis()->SetTitle("True Pairing Efficiency [ N_{True} / N_{pairable}]"); @@ -669,7 +669,7 @@ void GloFwdAssessment::finalizePurityAndEff() // Outer pseudorapidity auto RecoPtProjOuter = (TH1*)Reco->ProjectionX(Form("_OuterRecoCut_%.2f", scoreCut), minBin, midBin, 0, maxScoreBin); auto TruePtProjOuter = (TH1*)hTrue->ProjectionX(Form("_OuterTrueCut_%.2f", scoreCut), minBin, midBin, 0, maxScoreBin); - auto TruePtProjOuter_MC = (TH1 *)hTrue_MC->ProjectionX(Form("_OuterTrueCut_MC_%.2f", scoreCut), minBin, midBin, 0, maxScoreBin); + auto TruePtProjOuter_MC = (TH1*)hTrue_MC->ProjectionX(Form("_OuterTrueCut_MC_%.2f", scoreCut), minBin, midBin, 0, maxScoreBin); auto& hPurityOuter = mPurityPtOuterVecTH2.emplace_back((std::unique_ptr)static_cast(TruePtProjOuter->Clone())); hPurityOuter->Divide(RecoPtProjOuter); // Global Pairing Purity = N_true / N_reco @@ -689,7 +689,7 @@ void GloFwdAssessment::finalizePurityAndEff() hPairingEffOuter->SetMinimum(0.0); hPairingEffOuter->SetMaximum(1.8); - auto &hTruePairingEffOuter = mTruePairingPtOuterVecTH1.emplace_back((std::unique_ptr)static_cast(TruePtProjOuter_MC->Clone())); + auto& hTruePairingEffOuter = mTruePairingPtOuterVecTH1.emplace_back((std::unique_ptr)static_cast(TruePtProjOuter_MC->Clone())); hTruePairingEffOuter->Divide(PairablePtProjOuter); hTruePairingEffOuter->SetNameTitle(Form("GMTrackTruePairingEffOuterPtCut_%.2f", scoreCut), Form("%.2f cut", scoreCut)); hTruePairingEffOuter->GetYaxis()->SetTitle("True Pairing Efficiency [ N_{True} / N_{pairable}]"); @@ -703,7 +703,7 @@ void GloFwdAssessment::finalizePurityAndEff() mPairingEtaPtVec.back()->SetNameTitle(Form("GMTrackPairingEffEtaPtCut_%.2f", scoreCut), Form("%.2f", scoreCut)); mPairingEtaPtVec.back()->SetOption("COLZ"); - mTruePairingEtaPtVec.emplace_back((std::unique_ptr)static_cast(TrueEtaPt_MC->Clone())); + mTruePairingEtaPtVec.emplace_back((std::unique_ptr)static_cast(TrueEtaPt_MC->Clone())); mTruePairingEtaPtVec.back()->Divide(PairableEtaPt); mTruePairingEtaPtVec.back()->SetNameTitle(Form("GMTrackTruePairingEffEtaPtCut_%.2f", scoreCut), Form("%.2f", scoreCut)); mTruePairingEtaPtVec.back()->SetOption("COLZ"); @@ -858,10 +858,10 @@ void GloFwdAssessment::finalizePurityAndEff() mAssessmentCanvas[nCanvas]->cd(); first = true; - for (auto &th2 : mTruePairingPtOuterVecTH1){ - if (first){ + for (auto& th2 : mTruePairingPtOuterVecTH1) { + if (first) { option = "hist P PMC"; - }else{ + } else { option = "hist SAME P PMC"; } first = false; @@ -887,10 +887,10 @@ void GloFwdAssessment::finalizePurityAndEff() mAssessmentCanvas[nCanvas]->cd(); first = true; - for (auto &th2 : mTruePairingPtInnerVecTH1){ - if (first){ + for (auto& th2 : mTruePairingPtInnerVecTH1) { + if (first) { option = "hist P PMC"; - }else{ + } else { option = "hist SAME P PMC"; } first = false; @@ -957,7 +957,7 @@ void GloFwdAssessment::finalizePurityAndEff() canvasName = GMAssesmentNames[nCanvas]; mAssessmentCanvas[nCanvas] = new TCanvas(canvasName, canvasName, 1080, 800); - TGraph *gr2 = new TGraph(highPtInnerTrueEff.size(), &highPtInnerTrueEff[0], &highPtInnerPurity[0]); + TGraph* gr2 = new TGraph(highPtInnerTrueEff.size(), &highPtInnerTrueEff[0], &highPtInnerPurity[0]); gr2->SetMinimum(0); gr2->SetMaximum(1.01);