@@ -69,6 +69,7 @@ void GloFwdAssessment::reset()
6969 mChargeMatchEff ->SetPassedHistogram (*hC, " " );
7070
7171 mPairingEtaPt ->Reset ();
72+ mTruePairingEtaPt ->Reset ();
7273 for (auto & h : mTH3Histos ) {
7374 h->Reset ();
7475 }
@@ -389,6 +390,7 @@ void GloFwdAssessment::processRecoAndTrueTracks()
389390 mTH3Histos [kTH3GMTrackReducedChi2PtEta ]->Fill (ptGen, etaGen, Chi2_Rec / (2 * nMFTClusters - 5 ));
390391 mTH3Histos [kTH3GMTruePtEtaChi2 ]->Fill (pt_Rec, eta_Rec, matchChi2);
391392 mTH3Histos [kTH3GMTruePtEtaMatchScore ]->Fill (pt_Rec, eta_Rec, matchMatchScore);
393+ mTH3Histos [kTH3GMTruePtEtaMatchScore_MC ]->Fill (ptGen, etaGen, matchMatchScore);
392394 }
393395 trkId++;
394396 }
@@ -458,6 +460,7 @@ void GloFwdAssessment::getHistos(TObjArray& objar)
458460
459461 objar.Add (mChargeMatchEff .get ());
460462 objar.Add (mPairingEtaPt .get ());
463+ objar.Add (mTruePairingEtaPt .get ());
461464
462465 if (mFinalizeAnalysis ) {
463466 for (int slicedCanvas = 0 ; slicedCanvas < kNSlicedTH3 ; slicedCanvas++) {
@@ -576,15 +579,22 @@ void GloFwdAssessment::finalizeRecoAndPairables()
576579
577580 auto & Reco = mTH3Histos [kTH3GMTrackPtEtaMatchScore ];
578581 auto & hTrue = mTH3Histos [kTH3GMTruePtEtaMatchScore ];
582+ auto & hTrue_MC = mTH3Histos [kTH3GMTruePtEtaMatchScore_MC ];
579583 auto & hPairable = mTH3Histos [kTH3GMPairablePtEtaZ ];
580584
581585 auto RecoEtaPt = (TH2D *)Reco->Project3D (" xy COLZ" );
586+ auto TrueEtaPt_MC = (TH2D *)hTrue_MC->Project3D (" xy COLZ" );
582587 auto PairableEtaPt = (TH2D *)hPairable->Project3D (" xy COLZ" );
583588
584589 mPairingEtaPt = (std::unique_ptr<TH2D >)static_cast <TH2D *>(RecoEtaPt->Clone ());
585590 mPairingEtaPt ->Divide (PairableEtaPt);
586591 mPairingEtaPt ->SetNameTitle (" GMTrackPairingEffEtaPt" , " PairingEffEtaPt" );
587592 mPairingEtaPt ->SetOption (" COLZ" );
593+
594+ mTruePairingEtaPt = (std::unique_ptr<TH2D >)static_cast <TH2D *>(TrueEtaPt_MC->Clone ());
595+ mTruePairingEtaPt ->Divide (PairableEtaPt);
596+ mTruePairingEtaPt ->SetNameTitle (" GMTrackTruePairingEffEtaPt" , " TruePairingEffEtaPt" );
597+ mTruePairingEtaPt ->SetOption (" COLZ" );
588598 }
589599}
590600
@@ -599,6 +609,7 @@ void GloFwdAssessment::finalizePurityAndEff()
599609
600610 auto & Reco = mTH3Histos [kTH3GMTrackPtEtaMatchScore ];
601611 auto & hTrue = mTH3Histos [kTH3GMTruePtEtaMatchScore ];
612+ auto & hTrue_MC = mTH3Histos [kTH3GMTruePtEtaMatchScore_MC ];
602613 auto & hPairable = mTH3Histos [kTH3GMPairablePtEtaZ ];
603614
604615 // Inner pseudorapidity
@@ -609,6 +620,8 @@ void GloFwdAssessment::finalizePurityAndEff()
609620 auto PairablePtProjOuter = (TH1 *)hPairable->ProjectionX (" PairableOuter" , minBin, midBin);
610621
611622 auto RecoEtaPt = (TH2D *)Reco->Project3D (" xy COLZ" );
623+ auto TrueEtaPt = (TH2D *)hTrue->Project3D (" xy COLZ" );
624+ auto TrueEtaPt_MC = (TH2D *)hTrue_MC->Project3D (" xy COLZ" );
612625 auto PairableEtaPt = (TH2D *)hPairable->Project3D (" xy COLZ" );
613626 auto PairablePt = (TH1D *)hPairable->Project3D (" x" );
614627
@@ -618,11 +631,13 @@ void GloFwdAssessment::finalizePurityAndEff()
618631
619632 auto RecoPtProj = (TH1 *)Reco->ProjectionX (Form (" _RecoPtProj%.2f" , scoreCut));
620633 auto TruePtProj = (TH1 *)hTrue->ProjectionX (Form (" _TruePtProj%.2f" , scoreCut));
634+ auto TruePtProj_MC = (TH1 *)hTrue_MC->ProjectionX (Form (" _TruePtProj_MC%.2f" , scoreCut));
621635
622636 // Inner pseudorapidity
623637 auto maxScoreBin = Reco->GetZaxis ()->FindBin (scoreCut);
624638 auto RecoPtProjInner = (TH1 *)Reco->ProjectionX (Form (" _InnerRecoCut_%.2f" , scoreCut), midBin, maxBin, 0 , maxScoreBin);
625639 auto TruePtProjInner = (TH1 *)hTrue->ProjectionX (Form (" _InnerTrueCut_%.2f" , scoreCut), midBin, maxBin, 0 , maxScoreBin);
640+ auto TruePtProjInner_MC = (TH1 *)hTrue_MC->ProjectionX (Form (" _InnerTrueCut_MC_%.2f" , scoreCut), midBin, maxBin, 0 , maxScoreBin);
626641
627642 auto & hPurityInner = mPurityPtInnerVecTH2 .emplace_back ((std::unique_ptr<TH2D >)static_cast <TH2D *>(TruePtProjInner->Clone ()));
628643 hPurityInner->Divide (RecoPtProjInner); // Global Pairing Purity = N_true / N_reco
@@ -642,9 +657,19 @@ void GloFwdAssessment::finalizePurityAndEff()
642657 hPairingEffInner->SetMinimum (0.0 );
643658 hPairingEffInner->SetMaximum (1.8 );
644659
660+ auto & hTruePairingEffInner = mTruePairingPtInnerVecTH1 .emplace_back ((std::unique_ptr<TH1D >)static_cast <TH1D *>(TruePtProjInner_MC->Clone ()));
661+ hTruePairingEffInner->Divide (PairablePtProjInner);
662+ hTruePairingEffInner->SetNameTitle (Form (" GMTrackTruePairingEffInnerPtCut_%.2f" , scoreCut), Form (" %.2f cut" , scoreCut));
663+ hTruePairingEffInner->GetYaxis ()->SetTitle (" True Pairing Efficiency [ N_{True} / N_{pairable}]" );
664+ hTruePairingEffInner->SetOption (" COLZ" );
665+ hTruePairingEffInner->SetMarkerStyle (kFullCircle );
666+ hTruePairingEffInner->SetMinimum (0.0 );
667+ hTruePairingEffInner->SetMaximum (1.2 );
668+
645669 // Outer pseudorapidity
646670 auto RecoPtProjOuter = (TH1 *)Reco->ProjectionX (Form (" _OuterRecoCut_%.2f" , scoreCut), minBin, midBin, 0 , maxScoreBin);
647671 auto TruePtProjOuter = (TH1 *)hTrue->ProjectionX (Form (" _OuterTrueCut_%.2f" , scoreCut), minBin, midBin, 0 , maxScoreBin);
672+ auto TruePtProjOuter_MC = (TH1 *)hTrue_MC->ProjectionX (Form (" _OuterTrueCut_MC_%.2f" , scoreCut), minBin, midBin, 0 , maxScoreBin);
648673
649674 auto & hPurityOuter = mPurityPtOuterVecTH2 .emplace_back ((std::unique_ptr<TH2D >)static_cast <TH2D *>(TruePtProjOuter->Clone ()));
650675 hPurityOuter->Divide (RecoPtProjOuter); // Global Pairing Purity = N_true / N_reco
@@ -664,10 +689,24 @@ void GloFwdAssessment::finalizePurityAndEff()
664689 hPairingEffOuter->SetMinimum (0.0 );
665690 hPairingEffOuter->SetMaximum (1.8 );
666691
692+ auto & hTruePairingEffOuter = mTruePairingPtOuterVecTH1 .emplace_back ((std::unique_ptr<TH1D >)static_cast <TH1D *>(TruePtProjOuter_MC->Clone ()));
693+ hTruePairingEffOuter->Divide (PairablePtProjOuter);
694+ hTruePairingEffOuter->SetNameTitle (Form (" GMTrackTruePairingEffOuterPtCut_%.2f" , scoreCut), Form (" %.2f cut" , scoreCut));
695+ hTruePairingEffOuter->GetYaxis ()->SetTitle (" True Pairing Efficiency [ N_{True} / N_{pairable}]" );
696+ hTruePairingEffOuter->SetOption (" COLZ" );
697+ hTruePairingEffOuter->SetMarkerStyle (kFullTriangleUp );
698+ hTruePairingEffOuter->SetMinimum (0.0 );
699+ hTruePairingEffOuter->SetMaximum (1.2 );
700+
667701 mPairingEtaPtVec .emplace_back ((std::unique_ptr<TH2D >)static_cast <TH2D *>(RecoEtaPt->Clone ()));
668702 mPairingEtaPtVec .back ()->Divide (PairableEtaPt); // Pairing Efficiency = N_reco / N_Pairable
669703 mPairingEtaPtVec .back ()->SetNameTitle (Form (" GMTrackPairingEffEtaPtCut_%.2f" , scoreCut), Form (" %.2f" , scoreCut));
670704 mPairingEtaPtVec .back ()->SetOption (" COLZ" );
705+
706+ mTruePairingEtaPtVec .emplace_back ((std::unique_ptr<TH2D >)static_cast <TH2D *>(TrueEtaPt_MC->Clone ()));
707+ mTruePairingEtaPtVec .back ()->Divide (PairableEtaPt);
708+ mTruePairingEtaPtVec .back ()->SetNameTitle (Form (" GMTrackTruePairingEffEtaPtCut_%.2f" , scoreCut), Form (" %.2f" , scoreCut));
709+ mTruePairingEtaPtVec .back ()->SetOption (" COLZ" );
671710 }
672711
673712 auto nCanvas = kPurityPtOuter ;
@@ -682,14 +721,20 @@ void GloFwdAssessment::finalizePurityAndEff()
682721 std::vector<float > verylowPtInnerPurity;
683722 std::vector<float > verylowPtOuterEff;
684723 std::vector<float > verylowPtInnerEff;
724+ std::vector<float > veryLowPtOuterTrueEff;
725+ std::vector<float > veryLowPtInnerTrueEff;
685726 std::vector<float > lowPtOuterPurity;
686727 std::vector<float > lowPtInnerPurity;
687728 std::vector<float > lowPtOuterEff;
688729 std::vector<float > lowPtInnerEff;
730+ std::vector<float > lowPtOuterTrueEff;
731+ std::vector<float > lowPtInnerTrueEff;
689732 std::vector<float > highPtOuterPurity;
690733 std::vector<float > highPtInnerPurity;
691734 std::vector<float > highPtOuterEff;
692735 std::vector<float > highPtInnerEff;
736+ std::vector<float > highPtOuterTrueEff;
737+ std::vector<float > highPtInnerTrueEff;
693738
694739 auto veryLowptBin = mPurityPtOuterVecTH2 .front ()->GetXaxis ()->FindBin (0.25 );
695740 auto lowptBin = mPurityPtOuterVecTH2 .front ()->GetXaxis ()->FindBin (0.75 );
@@ -806,6 +851,64 @@ void GloFwdAssessment::finalizePurityAndEff()
806851 mAssessmentCanvas [nCanvas]->SetTicky ();
807852 mAssessmentCanvas [nCanvas]->SetGridy ();
808853
854+ nCanvas = kTruePairingEffPtOuter ;
855+ canvasName = GMAssesmentNames[nCanvas];
856+ mAssessmentCanvas [nCanvas] = new TCanvas (canvasName, canvasName, 1080 , 800 );
857+ mAssessmentCanvas [nCanvas]->UseCurrentStyle ();
858+ mAssessmentCanvas [nCanvas]->cd ();
859+ first = true ;
860+
861+ for (auto & th2 : mTruePairingPtOuterVecTH1 ) {
862+ if (first) {
863+ option = " hist P PMC" ;
864+ } else {
865+ option = " hist SAME P PMC" ;
866+ }
867+ first = false ;
868+ veryLowPtOuterTrueEff.push_back (th2->GetBinContent (veryLowptBin));
869+ lowPtOuterTrueEff.push_back (th2->GetBinContent (lowptBin));
870+ highPtOuterTrueEff.push_back (th2->GetBinContent (highptBin));
871+ th2->Draw (option.c_str ());
872+ }
873+ t = new TPaveText (0.2223748 , 0.9069355 , 0.7776252 , 0.965 , " brNDC" );
874+ t->SetBorderSize (0 );
875+ t->SetFillColor (gStyle ->GetTitleFillColor ());
876+ t->AddText (" Global Muon Track True Pairing Efficiency (2.4 < #eta < 3.0)" );
877+ t->Draw ();
878+
879+ mAssessmentCanvas [nCanvas]->BuildLegend (.8 , .15 , .96 , .87 );
880+ mAssessmentCanvas [nCanvas]->SetTicky ();
881+ mAssessmentCanvas [nCanvas]->SetGridy ();
882+
883+ nCanvas = kTruePairingEffPtInner ;
884+ canvasName = GMAssesmentNames[nCanvas];
885+ mAssessmentCanvas [nCanvas] = new TCanvas (canvasName, canvasName, 1080 , 800 );
886+ mAssessmentCanvas [nCanvas]->UseCurrentStyle ();
887+ mAssessmentCanvas [nCanvas]->cd ();
888+ first = true ;
889+
890+ for (auto & th2 : mTruePairingPtInnerVecTH1 ) {
891+ if (first) {
892+ option = " hist P PMC" ;
893+ } else {
894+ option = " hist SAME P PMC" ;
895+ }
896+ first = false ;
897+ veryLowPtInnerTrueEff.push_back (th2->GetBinContent (veryLowptBin));
898+ lowPtInnerTrueEff.push_back (th2->GetBinContent (lowptBin));
899+ highPtInnerTrueEff.push_back (th2->GetBinContent (highptBin));
900+ th2->Draw (option.c_str ());
901+ }
902+ t = new TPaveText (0.2223748 , 0.9069355 , 0.7776252 , 0.965 , " brNDC" );
903+ t->SetBorderSize (0 );
904+ t->SetFillColor (gStyle ->GetTitleFillColor ());
905+ t->AddText (" Global Muon Track True Pairing Efficiency (3.0 < #eta < 3.6 )" );
906+ t->Draw ();
907+
908+ mAssessmentCanvas [nCanvas]->BuildLegend (.8 , .15 , .96 , .87 );
909+ mAssessmentCanvas [nCanvas]->SetTicky ();
910+ mAssessmentCanvas [nCanvas]->SetGridy ();
911+
809912 nCanvas = kPurityVsEfficiency ;
810913 canvasName = GMAssesmentNames[nCanvas];
811914 mAssessmentCanvas [nCanvas] = new TCanvas (canvasName, canvasName, 1080 , 800 );
@@ -849,6 +952,50 @@ void GloFwdAssessment::finalizePurityAndEff()
849952 mAssessmentCanvas [nCanvas]->BuildLegend ();
850953 mAssessmentCanvas [nCanvas]->SetTicky ();
851954 mAssessmentCanvas [nCanvas]->SetGridy ();
955+
956+ nCanvas = kPurityVsTrueEfficiency ;
957+ canvasName = GMAssesmentNames[nCanvas];
958+ mAssessmentCanvas [nCanvas] = new TCanvas (canvasName, canvasName, 1080 , 800 );
959+
960+ TGraph* gr2 = new TGraph (highPtInnerTrueEff.size (), &highPtInnerTrueEff[0 ], &highPtInnerPurity[0 ]);
961+ gr2->SetMinimum (0 );
962+ gr2->SetMaximum (1.01 );
963+
964+ gr2->SetMarkerStyle (kFullCircle );
965+ gr2->Draw (" A P PMC" );
966+ gr2->GetXaxis ()->SetTitle (" Global Muon True Pairing Efficiency [ N_{True} / N_{pairable}]" );
967+ gr2->GetXaxis ()->SetLimits (0 .f , 1.01 );
968+ gr2->GetYaxis ()->SetTitle (" Pairing Purity [ N_{True} / N_{Rec}]" );
969+ gr2->SetTitle (" p_{t} = 2.25 || (3.0 < #eta < 3.6 )" );
970+
971+ gr2 = new TGraph (highPtOuterTrueEff.size (), &highPtOuterTrueEff[0 ], &highPtOuterPurity[0 ]);
972+ gr2->Draw (" P PMC SAME" );
973+ gr2->SetMarkerStyle (kFullTriangleUp );
974+
975+ gr2->SetTitle (" p_{t} = 2.25 || (2.4 < #eta < 3.0)" );
976+
977+ gr2 = new TGraph (lowPtInnerTrueEff.size (), &lowPtInnerTrueEff[0 ], &lowPtInnerPurity[0 ]);
978+ gr2->Draw (" P PMC SAME" );
979+ gr2->SetTitle (" p_{t} = 0.75 || (3.0 < #eta < 3.6 )" );
980+
981+ gr2 = new TGraph (lowPtOuterTrueEff.size (), &lowPtOuterTrueEff[0 ], &lowPtOuterPurity[0 ]);
982+ gr2->Draw (" P PMC SAME" );
983+ gr2->SetMarkerStyle (kFullTriangleUp );
984+ gr2->SetTitle (" p_{t} = 0.75 || (2.4 < #eta < 3.0)" );
985+
986+ gr2 = new TGraph (veryLowPtInnerTrueEff.size (), &veryLowPtInnerTrueEff[0 ], &verylowPtInnerPurity[0 ]);
987+ gr2->Draw (" P PMC SAME" );
988+ gr2->SetTitle (" p_{t} = 0.25 || (3.0 < #eta < 3.6)" );
989+
990+ gr2 = new TGraph (veryLowPtOuterTrueEff.size (), &veryLowPtOuterTrueEff[0 ], &verylowPtOuterPurity[0 ]);
991+ gr2->Draw (" P PMC SAME" );
992+ gr2->SetMarkerStyle (kFullTriangleUp );
993+
994+ gr2->SetTitle (" p_{t} = 0.25 || (2.4 < #eta < 3.0)" );
995+
996+ mAssessmentCanvas [nCanvas]->BuildLegend ();
997+ mAssessmentCanvas [nCanvas]->SetTicky ();
998+ mAssessmentCanvas [nCanvas]->SetGridy ();
852999}
8531000
8541001// __________________________________________________________
0 commit comments