Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: writeFloat for seeding performance in SeedingPerformanceWriter.cpp #2654

Merged
merged 14 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include <utility>

#include <TFile.h>
#include <TVectorFfwd.h>
#include <TVectorT.h>

namespace ActsExamples {
struct AlgorithmContext;
Expand Down Expand Up @@ -110,9 +108,8 @@ ActsExamples::ProcessCode ActsExamples::CKFPerformanceWriter::finalize() {
"Duplicate rate with particles (nDuplicateParticles/nTrueParticles) = "
<< duplicationRate_particle);

auto write_float = [&](float f, const char* name) {
TVectorF v(1);
v[0] = f;
auto writeFloat = [&](float f, const char* name) {
std::vector<float> v{f};
m_outputFile->WriteObject(&v, name);
};

Expand All @@ -122,12 +119,12 @@ ActsExamples::ProcessCode ActsExamples::CKFPerformanceWriter::finalize() {
m_fakeRatePlotTool.write(m_fakeRatePlotCache);
m_duplicationPlotTool.write(m_duplicationPlotCache);
m_trackSummaryPlotTool.write(m_trackSummaryPlotCache);
write_float(eff_tracks, "eff_tracks");
write_float(fakeRate_tracks, "fakerate_tracks");
write_float(duplicationRate_tracks, "duplicaterate_tracks");
write_float(eff_particle, "eff_particles");
write_float(fakeRate_particle, "fakerate_particles");
write_float(duplicationRate_particle, "duplicaterate_particles");
writeFloat(eff_tracks, "eff_tracks");
writeFloat(fakeRate_tracks, "fakerate_tracks");
writeFloat(duplicationRate_tracks, "duplicaterate_tracks");
writeFloat(eff_particle, "eff_particles");
writeFloat(fakeRate_particle, "fakerate_particles");
writeFloat(duplicationRate_particle, "duplicaterate_particles");
ACTS_INFO("Wrote performance plots to '" << m_outputFile->GetPath() << "'");
}
return ProcessCode::SUCCESS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,19 @@ ActsExamples::ProcessCode ActsExamples::SeedingPerformanceWriter::finalize() {
"/ nMatchedParticles) = "
<< aveNDuplicatedSeeds);

auto writeFloat = [&](float f, const char* name) {
std::vector<float> v{f};
m_outputFile->WriteObject(&v, name);
};

if (m_outputFile != nullptr) {
m_outputFile->cd();
m_effPlotTool.write(m_effPlotCache);
m_duplicationPlotTool.write(m_duplicationPlotCache);
writeFloat(eff, "eff_seeds");
writeFloat(fakeRate, "fakerate_seeds");
writeFloat(duplicationRate, "duplicaterate_seeds");
writeFloat(totalSeedPurity, "purity_seeds");
ACTS_INFO("Wrote performance plots to '" << m_outputFile->GetPath() << "'");
}
return ProcessCode::SUCCESS;
Expand Down
Loading