From ab1137bd3aed27aca9bacb9f19a8c9b486753b9f Mon Sep 17 00:00:00 2001 From: Doga Elitez <108287101+delitez@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:48:50 +0100 Subject: [PATCH 1/4] Add efficiency VS prodR into EffPlotTool --- .../include/ActsExamples/Validation/EffPlotTool.hpp | 4 +++- Examples/Framework/src/Validation/EffPlotTool.cpp | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Examples/Framework/include/ActsExamples/Validation/EffPlotTool.hpp b/Examples/Framework/include/ActsExamples/Validation/EffPlotTool.hpp index d6fcd57bad3..255c1a0e5cf 100644 --- a/Examples/Framework/include/ActsExamples/Validation/EffPlotTool.hpp +++ b/Examples/Framework/include/ActsExamples/Validation/EffPlotTool.hpp @@ -35,7 +35,8 @@ class EffPlotTool { {"Phi", PlotHelpers::Binning("#phi", 100, -3.15, 3.15)}, {"Pt", PlotHelpers::Binning("pT [GeV/c]", 40, 0, 100)}, {"Z0", PlotHelpers::Binning("z_0 [mm]", 50, -200, 200)}, - {"DeltaR", PlotHelpers::Binning("#Delta R", 100, 0, 0.3)}}; + {"DeltaR", PlotHelpers::Binning("#Delta R", 100, 0, 0.3)}, + {"prodR", PlotHelpers::Binning("prod_R [mm]", 100, 0, 900)}}; }; /// @brief Nested Cache struct @@ -47,6 +48,7 @@ class EffPlotTool { TEfficiency* trackEff_vs_DeltaR{ nullptr}; ///< Tracking efficiency vs distance to the closest truth ///< particle + TEfficiency* trackEff_vs_prodR{nullptr}; ///< Tracking efficiency vs production radius }; /// Constructor diff --git a/Examples/Framework/src/Validation/EffPlotTool.cpp b/Examples/Framework/src/Validation/EffPlotTool.cpp index 17e3bb7034e..361d56ec5e1 100644 --- a/Examples/Framework/src/Validation/EffPlotTool.cpp +++ b/Examples/Framework/src/Validation/EffPlotTool.cpp @@ -28,6 +28,8 @@ void ActsExamples::EffPlotTool::book( PlotHelpers::Binning bPt = m_cfg.varBinning.at("Pt"); PlotHelpers::Binning bDeltaR = m_cfg.varBinning.at("DeltaR"); PlotHelpers::Binning bZ0 = m_cfg.varBinning.at("Z0"); + PlotHelpers::Binning bProdR = m_cfg.varBinning.at("prodR"); + ACTS_DEBUG("Initialize the histograms for efficiency plots"); // efficiency vs pT effPlotCache.trackEff_vs_pT = PlotHelpers::bookEff( @@ -45,6 +47,9 @@ void ActsExamples::EffPlotTool::book( effPlotCache.trackEff_vs_DeltaR = PlotHelpers::bookEff( "trackeff_vs_DeltaR", "Tracking efficiency;Closest track #Delta R;Efficiency", bDeltaR); + effPlotCache.trackEff_vs_prodR = PlotHelpers::bookEff( + "trackeff_vs_prodR", + "Tracking efficiency;Production radius [mm];Efficiency", bProdR); } void ActsExamples::EffPlotTool::clear(EffPlotCache& effPlotCache) const { @@ -53,6 +58,7 @@ void ActsExamples::EffPlotTool::clear(EffPlotCache& effPlotCache) const { delete effPlotCache.trackEff_vs_phi; delete effPlotCache.trackEff_vs_z0; delete effPlotCache.trackEff_vs_DeltaR; + delete effPlotCache.trackEff_vs_prodR; } void ActsExamples::EffPlotTool::write( @@ -63,6 +69,7 @@ void ActsExamples::EffPlotTool::write( effPlotCache.trackEff_vs_phi->Write(); effPlotCache.trackEff_vs_z0->Write(); effPlotCache.trackEff_vs_DeltaR->Write(); + effPlotCache.trackEff_vs_prodR->Write(); } void ActsExamples::EffPlotTool::fill(EffPlotTool::EffPlotCache& effPlotCache, @@ -73,10 +80,12 @@ void ActsExamples::EffPlotTool::fill(EffPlotTool::EffPlotCache& effPlotCache, const auto t_pT = truthParticle.transverseMomentum(); const auto t_z0 = truthParticle.position().z(); const auto t_deltaR = deltaR; + const auto t_prodR = std::sqrt(vx * vx + vy * vy); PlotHelpers::fillEff(effPlotCache.trackEff_vs_pT, t_pT, status); PlotHelpers::fillEff(effPlotCache.trackEff_vs_eta, t_eta, status); PlotHelpers::fillEff(effPlotCache.trackEff_vs_phi, t_phi, status); PlotHelpers::fillEff(effPlotCache.trackEff_vs_z0, t_z0, status); PlotHelpers::fillEff(effPlotCache.trackEff_vs_DeltaR, t_deltaR, status); + PlotHelpers::fillEff(effPlotCache.trackEff_vs_prodR, t_prodR, status); } From e9bc538fbbfb7f0e7084db6351b73fa2d0e6d7ba Mon Sep 17 00:00:00 2001 From: Doga Elitez <108287101+delitez@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:26:58 +0100 Subject: [PATCH 2/4] Add prodR to track summary writer and fix definition in EffPlotTool --- Examples/Framework/src/Validation/EffPlotTool.cpp | 5 ++++- .../include/ActsExamples/Io/Root/RootTrackSummaryWriter.hpp | 2 ++ Examples/Io/Root/src/RootTrackSummaryWriter.cpp | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Examples/Framework/src/Validation/EffPlotTool.cpp b/Examples/Framework/src/Validation/EffPlotTool.cpp index 361d56ec5e1..4495bbf12f2 100644 --- a/Examples/Framework/src/Validation/EffPlotTool.cpp +++ b/Examples/Framework/src/Validation/EffPlotTool.cpp @@ -80,7 +80,10 @@ void ActsExamples::EffPlotTool::fill(EffPlotTool::EffPlotCache& effPlotCache, const auto t_pT = truthParticle.transverseMomentum(); const auto t_z0 = truthParticle.position().z(); const auto t_deltaR = deltaR; - const auto t_prodR = std::sqrt(vx * vx + vy * vy); + const auto t_prodR = std::sqrt(truthParticle.position().x() * + truthParticle.position().x() + + truthParticle.position().y() * + truthParticle.position().y()); PlotHelpers::fillEff(effPlotCache.trackEff_vs_pT, t_pT, status); PlotHelpers::fillEff(effPlotCache.trackEff_vs_eta, t_eta, status); diff --git a/Examples/Io/Root/include/ActsExamples/Io/Root/RootTrackSummaryWriter.hpp b/Examples/Io/Root/include/ActsExamples/Io/Root/RootTrackSummaryWriter.hpp index 9f23300be06..0fe40a5efe6 100644 --- a/Examples/Io/Root/include/ActsExamples/Io/Root/RootTrackSummaryWriter.hpp +++ b/Examples/Io/Root/include/ActsExamples/Io/Root/RootTrackSummaryWriter.hpp @@ -170,6 +170,8 @@ class RootTrackSummaryWriter final : public WriterT { std::vector m_t_d0; /// The extrapolated truth longitudinal impact parameter std::vector m_t_z0; + /// Production radius of majority particle + std::vector m_t_prodR; /// If the track has fitted parameter std::vector m_hasFittedParams; diff --git a/Examples/Io/Root/src/RootTrackSummaryWriter.cpp b/Examples/Io/Root/src/RootTrackSummaryWriter.cpp index de6753ce3bf..bf4ab859c64 100644 --- a/Examples/Io/Root/src/RootTrackSummaryWriter.cpp +++ b/Examples/Io/Root/src/RootTrackSummaryWriter.cpp @@ -112,6 +112,7 @@ RootTrackSummaryWriter::RootTrackSummaryWriter( m_outputTree->Branch("t_pT", &m_t_pT); m_outputTree->Branch("t_d0", &m_t_d0); m_outputTree->Branch("t_z0", &m_t_z0); + m_outputTree->Branch("t_prodR", &m_t_prodR); m_outputTree->Branch("hasFittedParams", &m_hasFittedParams); m_outputTree->Branch("eLOC0_fit", &m_eLOC0_fit); @@ -299,6 +300,7 @@ ProcessCode RootTrackSummaryWriter::writeT(const AlgorithmContext& ctx, float t_d0 = NaNfloat; float t_z0 = NaNfloat; float t_qop = NaNfloat; + float t_prodR = NaNfloat; // Get the perigee surface const Acts::Surface* pSurface = @@ -339,6 +341,7 @@ ProcessCode RootTrackSummaryWriter::writeT(const AlgorithmContext& ctx, t_eta = eta(particle.direction()); t_pT = t_p * perp(particle.direction()); t_qop = particle.qOverP(); + t_prodR = std::sqrt(t_vx * t_vx + t_vy * t_vy); if (pSurface != nullptr) { auto intersection = @@ -390,6 +393,8 @@ ProcessCode RootTrackSummaryWriter::writeT(const AlgorithmContext& ctx, m_t_pT.push_back(t_pT); m_t_d0.push_back(t_d0); m_t_z0.push_back(t_z0); + m_t_prodR.push_back(t_prodR); + // Initialize the fitted track parameters info std::array param = {NaNfloat, NaNfloat, NaNfloat, @@ -575,6 +580,7 @@ ProcessCode RootTrackSummaryWriter::writeT(const AlgorithmContext& ctx, m_t_eta.clear(); m_t_d0.clear(); m_t_z0.clear(); + m_t_prodR.clear(); m_hasFittedParams.clear(); m_eLOC0_fit.clear(); From 04870608847eec26500264e98d8ad9a709b5cbe1 Mon Sep 17 00:00:00 2001 From: Doga Elitez <108287101+delitez@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:23:39 +0100 Subject: [PATCH 3/4] Rebinning of Trackeff_vs_prodR --- .../Framework/include/ActsExamples/Validation/EffPlotTool.hpp | 2 +- Examples/Scripts/Python/full_chain_odd_LRT.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Examples/Framework/include/ActsExamples/Validation/EffPlotTool.hpp b/Examples/Framework/include/ActsExamples/Validation/EffPlotTool.hpp index 255c1a0e5cf..a0c59026f59 100644 --- a/Examples/Framework/include/ActsExamples/Validation/EffPlotTool.hpp +++ b/Examples/Framework/include/ActsExamples/Validation/EffPlotTool.hpp @@ -36,7 +36,7 @@ class EffPlotTool { {"Pt", PlotHelpers::Binning("pT [GeV/c]", 40, 0, 100)}, {"Z0", PlotHelpers::Binning("z_0 [mm]", 50, -200, 200)}, {"DeltaR", PlotHelpers::Binning("#Delta R", 100, 0, 0.3)}, - {"prodR", PlotHelpers::Binning("prod_R [mm]", 100, 0, 900)}}; + {"prodR", PlotHelpers::Binning("prod_R [mm]", 100, 0, 200)}}; }; /// @brief Nested Cache struct diff --git a/Examples/Scripts/Python/full_chain_odd_LRT.py b/Examples/Scripts/Python/full_chain_odd_LRT.py index 9c1f57074f6..0d26d78cf56 100644 --- a/Examples/Scripts/Python/full_chain_odd_LRT.py +++ b/Examples/Scripts/Python/full_chain_odd_LRT.py @@ -233,8 +233,8 @@ args.gun_particles, acts.PdgParticle.eMuon, randomizeCharge=True ), vtxGen=acts.examples.GaussianDisplacedVertexPositionGenerator( - rMean=2, - rStdDev=0.0125 * u.mm, + rMean=50, + rStdDev=50 * u.mm, zMean=2, zStdDev=55.5 * u.mm, tMean=0, From 10f2db506df6cd58795a4e688093a3c2f90c8811 Mon Sep 17 00:00:00 2001 From: Doga Elitez <108287101+delitez@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:32:06 +0100 Subject: [PATCH 4/4] Clang fixes --- .../include/ActsExamples/Validation/EffPlotTool.hpp | 3 ++- Examples/Framework/src/Validation/EffPlotTool.cpp | 7 +++---- Examples/Io/Root/src/RootTrackSummaryWriter.cpp | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Examples/Framework/include/ActsExamples/Validation/EffPlotTool.hpp b/Examples/Framework/include/ActsExamples/Validation/EffPlotTool.hpp index a0c59026f59..9fd4c3b368f 100644 --- a/Examples/Framework/include/ActsExamples/Validation/EffPlotTool.hpp +++ b/Examples/Framework/include/ActsExamples/Validation/EffPlotTool.hpp @@ -48,7 +48,8 @@ class EffPlotTool { TEfficiency* trackEff_vs_DeltaR{ nullptr}; ///< Tracking efficiency vs distance to the closest truth ///< particle - TEfficiency* trackEff_vs_prodR{nullptr}; ///< Tracking efficiency vs production radius + TEfficiency* trackEff_vs_prodR{ + nullptr}; ///< Tracking efficiency vs production radius }; /// Constructor diff --git a/Examples/Framework/src/Validation/EffPlotTool.cpp b/Examples/Framework/src/Validation/EffPlotTool.cpp index 4495bbf12f2..fc9c1f56661 100644 --- a/Examples/Framework/src/Validation/EffPlotTool.cpp +++ b/Examples/Framework/src/Validation/EffPlotTool.cpp @@ -80,10 +80,9 @@ void ActsExamples::EffPlotTool::fill(EffPlotTool::EffPlotCache& effPlotCache, const auto t_pT = truthParticle.transverseMomentum(); const auto t_z0 = truthParticle.position().z(); const auto t_deltaR = deltaR; - const auto t_prodR = std::sqrt(truthParticle.position().x() * - truthParticle.position().x() + - truthParticle.position().y() * - truthParticle.position().y()); + const auto t_prodR = + std::sqrt(truthParticle.position().x() * truthParticle.position().x() + + truthParticle.position().y() * truthParticle.position().y()); PlotHelpers::fillEff(effPlotCache.trackEff_vs_pT, t_pT, status); PlotHelpers::fillEff(effPlotCache.trackEff_vs_eta, t_eta, status); diff --git a/Examples/Io/Root/src/RootTrackSummaryWriter.cpp b/Examples/Io/Root/src/RootTrackSummaryWriter.cpp index bf4ab859c64..325bb3aa45c 100644 --- a/Examples/Io/Root/src/RootTrackSummaryWriter.cpp +++ b/Examples/Io/Root/src/RootTrackSummaryWriter.cpp @@ -394,7 +394,6 @@ ProcessCode RootTrackSummaryWriter::writeT(const AlgorithmContext& ctx, m_t_d0.push_back(t_d0); m_t_z0.push_back(t_z0); m_t_prodR.push_back(t_prodR); - // Initialize the fitted track parameters info std::array param = {NaNfloat, NaNfloat, NaNfloat,