Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AJPfleger committed Oct 18, 2023
1 parent 7c923b8 commit d7b990c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,14 @@ std::shared_ptr<TrackFitterFunction> makeGsfFitterFunction(
bool abortOnError, bool disableAllMaterialHandling,
const Acts::Logger& logger);

// TODO finish description
/// Makes a fitter function object for the Global Chi Square Fitter (GX2F)
///
/// \param trackingGeometry the trackingGeometry for the propagator
/// \param magneticField the magnetic field for the propagator
/// \param multipleScattering
/// \param energyLoss
/// \param freeToBoundCorrection
/// \param logger
/// \return
/// @param trackingGeometry the trackingGeometry for the propagator
/// @param magneticField the magnetic field for the propagator
/// @param multipleScattering bool
/// @param energyLoss bool
/// @param freeToBoundCorrection bool
/// @param logger a logger instance
std::shared_ptr<TrackFitterFunction> makeGlobalChiSquareFitterFunction(
std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry,
std::shared_ptr<const Acts::MagneticFieldProvider> magneticField,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// TODO We still use some Kalman Fitter functionalities. Check for replacement

#include "Acts/Definitions/Direction.hpp"
#include "Acts/Definitions/TrackParametrization.hpp"
#include "Acts/EventData/MultiTrajectory.hpp"
Expand All @@ -20,7 +22,7 @@
#include "Acts/Propagator/Navigator.hpp"
#include "Acts/Propagator/Propagator.hpp"
#include "Acts/TrackFitting/GlobalChiSquareFitter.hpp"
#include "Acts/TrackFitting/KalmanFitter.hpp" /// removable?
#include "Acts/TrackFitting/KalmanFitter.hpp"
#include "Acts/Utilities/Delegate.hpp"
#include "Acts/Utilities/Logger.hpp"
#include "ActsExamples/EventData/IndexSourceLink.hpp"
Expand Down Expand Up @@ -104,7 +106,8 @@ struct GlobalChiSquareFitterFunctionImpl final : public TrackFitterFunction {
gx2fOptions, tracks);
}

// TODO create directNavigator
// TODO create operator() for directNavigator
// We need a placeholder for the directNavigator overload, to safely compile.
TrackFitterResult operator()(
const std::vector<Acts::SourceLink>& sourceLinks,
const TrackParameters& initialParameters,
Expand Down
4 changes: 2 additions & 2 deletions Examples/Python/python/acts/examples/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ def addGx2fTracks(
inputProtoTracks=inputProtoTracks,
inputInitialTrackParameters="estimatedparameters",
inputClusters=clusters if clusters is not None else "",
outputTracks="kfTracks",
outputTracks="gx2fTracks",
pickTrack=-1,
fit=acts.examples.makeGlobalChiSquareFitterFunction(
trackingGeometry, field, **gx2fOptions
Expand All @@ -1091,7 +1091,7 @@ def addGx2fTracks(
trackConverter = acts.examples.TracksToTrajectories(
level=customLogLevel(),
inputTracks=fitAlg.config.outputTracks,
outputTrajectories="kfTrajectories",
outputTrajectories="gx2fTrajectories",
)
s.addAlgorithm(trackConverter)
s.addWhiteboardAlias("trajectories", trackConverter.config.outputTrajectories)
Expand Down
50 changes: 27 additions & 23 deletions Examples/Scripts/Python/truth_tracking_gx2f.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def runTruthTrackingGx2f(
):
from acts.examples.simulation import (
addParticleGun,
MomentumConfig,
EtaConfig,
ParticleConfig,
addFatras,
Expand All @@ -33,7 +34,7 @@ def runTruthTrackingGx2f(
)

s = s or acts.examples.Sequencer(
events=100, numThreads=-1, logLevel=acts.logging.INFO
events=10000, numThreads=-1, logLevel=acts.logging.INFO
)

rnd = acts.examples.RandomNumbers()
Expand All @@ -42,6 +43,7 @@ def runTruthTrackingGx2f(
if inputParticlePath is None:
addParticleGun(
s,
MomentumConfig(100.0 * u.GeV, 100.0 * u.GeV, transverse=True),
EtaConfig(-2.0, 2.0),
ParticleConfig(2, acts.PdgParticle.eMuon, False),
multiplicity=1,
Expand Down Expand Up @@ -85,7 +87,7 @@ def runTruthTrackingGx2f(
seedingAlgorithm=SeedingAlgorithm.TruthSmeared,
rnd=rnd,
truthSeedRanges=TruthSeedRanges(
pt=(500 * u.MeV, None),
pt=(1 * u.GeV, None),
nHits=(9, None),
),
)
Expand Down Expand Up @@ -120,27 +122,29 @@ def runTruthTrackingGx2f(
)
)

s.addWriter(
acts.examples.TrackFinderPerformanceWriter(
level=acts.logging.INFO,
inputProtoTracks="sorted_truth_particle_tracks"
if directNavigation
else "truth_particle_tracks",
inputParticles="truth_seeds_selected",
inputMeasurementParticlesMap="measurement_particles_map",
filePath=str(outputDir / "performance_track_finder.root"),
)
)

s.addWriter(
acts.examples.TrackFitterPerformanceWriter(
level=acts.logging.INFO,
inputTrajectories="trajectories",
inputParticles="truth_seeds_selected",
inputMeasurementParticlesMap="measurement_particles_map",
filePath=str(outputDir / "performance_track_fitter.root"),
)
)
# s.addWriter(
# acts.examples.TrackFinderPerformanceWriter(
# level=acts.logging.INFO,
# inputProtoTracks=
# # "sorted_truth_particle_tracks"
# # if directNavigation
# # else
# "truth_particle_tracks",
# inputParticles="truth_seeds_selected",
# inputMeasurementParticlesMap="measurement_particles_map",
# filePath=str(outputDir / "performance_track_finder.root"),
# )
# )
#
# s.addWriter(
# acts.examples.TrackFitterPerformanceWriter(
# level=acts.logging.INFO,
# inputTrajectories="trajectories",
# inputParticles="truth_seeds_selected",
# inputMeasurementParticlesMap="measurement_particles_map",
# filePath=str(outputDir / "performance_track_fitter.root"),
# )
# )

return s

Expand Down

0 comments on commit d7b990c

Please sign in to comment.