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

refactor: Rename VertexPerformanceWriter to VertexNTupleWriter #3745

Merged
merged 3 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
23 changes: 0 additions & 23 deletions Examples/Io/Performance/CMakeLists.txt
AJPfleger marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

2 changes: 1 addition & 1 deletion Examples/Io/Root/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ add_library(
src/SeedingPerformanceWriter.cpp
src/TrackFinderPerformanceWriter.cpp
src/TrackFitterPerformanceWriter.cpp
src/VertexPerformanceWriter.cpp
src/VertexNTupleWriter.cpp
)
target_include_directories(
ActsExamplesIoRoot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,14 @@ enum class RecoVertexClassification {
Split,
};

/// @class VertexPerformanceWriter
/// @class VertexNTupleWriter
///
/// Writes out the number of reconstructed primary vertices along with
/// the number of primary vertices in detector acceptance as well as
/// reconstructable primary vertices after track fitting.
/// Additionally it matches the reco vertices to their truth vertices
/// and write out the difference in x,y and z position.
class VertexPerformanceWriter final
: public WriterT<std::vector<Acts::Vertex>> {
class VertexNTupleWriter final : public WriterT<std::vector<Acts::Vertex>> {
public:
struct Config {
/// Input vertex collection.
Expand Down Expand Up @@ -90,9 +89,9 @@ class VertexPerformanceWriter final
///
/// @param config Configuration struct
/// @param level Message level declaration
VertexPerformanceWriter(const Config& config, Acts::Logging::Level level);
VertexNTupleWriter(const Config& config, Acts::Logging::Level level);

~VertexPerformanceWriter() override;
~VertexNTupleWriter() override;

/// End-of-run hook
ProcessCode finalize() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#include "ActsExamples/Io/Root/VertexPerformanceWriter.hpp"
#include "ActsExamples/Io/Root/VertexNTupleWriter.hpp"

#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Definitions/TrackParametrization.hpp"
Expand Down Expand Up @@ -106,9 +106,9 @@ std::uint32_t getNumberOfTruePriVertices(

} // namespace

VertexPerformanceWriter::VertexPerformanceWriter(
const VertexPerformanceWriter::Config& config, Acts::Logging::Level level)
: WriterT(config.inputVertices, "VertexPerformanceWriter", level),
VertexNTupleWriter::VertexNTupleWriter(const VertexNTupleWriter::Config& config,
Acts::Logging::Level level)
: WriterT(config.inputVertices, "VertexNTupleWriter", level),
m_cfg(config) {
if (m_cfg.filePath.empty()) {
throw std::invalid_argument("Missing output filename");
Expand Down Expand Up @@ -253,21 +253,21 @@ VertexPerformanceWriter::VertexPerformanceWriter(
m_outputTree->Branch("trk_pullQOverPFitted", &m_pullQOverPFitted);
}

VertexPerformanceWriter::~VertexPerformanceWriter() {
VertexNTupleWriter::~VertexNTupleWriter() {
if (m_outputFile != nullptr) {
m_outputFile->Close();
}
}

ProcessCode VertexPerformanceWriter::finalize() {
ProcessCode VertexNTupleWriter::finalize() {
m_outputFile->cd();
m_outputTree->Write();
m_outputFile->Close();

return ProcessCode::SUCCESS;
}

ProcessCode VertexPerformanceWriter::writeT(
ProcessCode VertexNTupleWriter::writeT(
const AlgorithmContext& ctx, const std::vector<Acts::Vertex>& vertices) {
const double nan = std::numeric_limits<double>::quiet_NaN();

Expand Down
8 changes: 4 additions & 4 deletions Examples/Python/python/acts/examples/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,7 @@ def addVertexFitting(
VertexFitterAlgorithm,
IterativeVertexFinderAlgorithm,
AdaptiveMultiVertexFinderAlgorithm,
VertexPerformanceWriter,
VertexNTupleWriter,
)

customLogLevel = acts.examples.defaultLogging(s, logLevel)
Expand Down Expand Up @@ -2204,7 +2204,7 @@ def addVertexFitting(
if not outputDirRoot.exists():
outputDirRoot.mkdir()
s.addWriter(
VertexPerformanceWriter(
VertexNTupleWriter(
level=customLogLevel(),
inputVertices=outputVertices,
inputTracks=tracks,
Expand All @@ -2230,7 +2230,7 @@ def addSingleSeedVertexFinding(
) -> None:
from acts.examples import (
SingleSeedVertexFinderAlgorithm,
VertexPerformanceWriter,
VertexNTupleWriter,
)

customLogLevel = acts.examples.defaultLogging(s, logLevel)
Expand All @@ -2251,7 +2251,7 @@ def addSingleSeedVertexFinding(
outputDirRoot.mkdir()

s.addWriter(
VertexPerformanceWriter(
VertexNTupleWriter(
level=customLogLevel(),
inputAllTruthParticles=inputParticles,
inputSelectedTruthParticles=selectedParticles,
Expand Down
4 changes: 2 additions & 2 deletions Examples/Python/src/Output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include "ActsExamples/Io/Root/SeedingPerformanceWriter.hpp"
#include "ActsExamples/Io/Root/TrackFinderPerformanceWriter.hpp"
#include "ActsExamples/Io/Root/TrackFitterPerformanceWriter.hpp"
#include "ActsExamples/Io/Root/VertexPerformanceWriter.hpp"
#include "ActsExamples/Io/Root/VertexNTupleWriter.hpp"
#include "ActsExamples/MaterialMapping/IMaterialWriter.hpp"
#include "ActsExamples/Plugins/Obj/ObjPropagationStepsWriter.hpp"
#include "ActsExamples/Plugins/Obj/ObjTrackingGeometryWriter.hpp"
Expand Down Expand Up @@ -353,7 +353,7 @@ void addOutput(Context& ctx) {
treeName, fileMode, writeCovMat, writeGsfSpecific, writeGx2fSpecific);

ACTS_PYTHON_DECLARE_WRITER(
ActsExamples::VertexPerformanceWriter, mex, "VertexPerformanceWriter",
ActsExamples::VertexNTupleWriter, mex, "VertexNTupleWriter",
inputVertices, inputTracks, inputTruthVertices, inputParticles,
inputSelectedParticles, inputTrackParticleMatching, bField, filePath,
treeName, fileMode, vertexMatchThreshold, trackMatchThreshold, useTracks);
Expand Down
4 changes: 2 additions & 2 deletions Examples/Python/tests/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
RootSimHitWriter,
RootTrackStatesWriter,
RootTrackSummaryWriter,
VertexPerformanceWriter,
VertexNTupleWriter,
RootMeasurementWriter,
CsvParticleWriter,
CsvSimHitWriter,
Expand Down Expand Up @@ -259,7 +259,7 @@ def test_csv_simhits_writer(tmp_path, fatras, conf_const):
RootSimHitWriter,
RootTrackStatesWriter,
RootTrackSummaryWriter,
VertexPerformanceWriter,
VertexNTupleWriter,
SeedingPerformanceWriter,
],
)
Expand Down
Loading