Skip to content

Commit

Permalink
Add prodR to track summary writer and fix definition in EffPlotTool
Browse files Browse the repository at this point in the history
  • Loading branch information
delitez committed Dec 12, 2024
1 parent ab1137b commit e9bc538
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Examples/Framework/src/Validation/EffPlotTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ class RootTrackSummaryWriter final : public WriterT<ConstTrackContainer> {
std::vector<float> m_t_d0;
/// The extrapolated truth longitudinal impact parameter
std::vector<float> m_t_z0;
/// Production radius of majority particle
std::vector<float> m_t_prodR;

/// If the track has fitted parameter
std::vector<bool> m_hasFittedParams;
Expand Down
6 changes: 6 additions & 0 deletions Examples/Io/Root/src/RootTrackSummaryWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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<float, Acts::eBoundSize> param = {NaNfloat, NaNfloat, NaNfloat,
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit e9bc538

Please sign in to comment.