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

fix: Output correct track objects in GSF refitting #3999

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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 @@ -33,6 +33,8 @@ class RefittingAlgorithm final : public IAlgorithm {
std::shared_ptr<TrackFitterFunction> fit;
/// Pick a single track for debugging (-1 process all tracks)
int pickTrack = -1;
/// Inflate initial covariance.
std::array<double, 6> initialVarInflation = {1., 1., 1., 1., 1., 1.};
};

/// Constructor of the fitting algorithm
Expand Down
7 changes: 6 additions & 1 deletion Examples/Algorithms/TrackFitting/src/RefittingAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,15 @@ ActsExamples::ProcessCode ActsExamples::RefittingAlgorithm::execute(
Acts::PropagatorPlainOptions(ctx.geoContext, ctx.magFieldContext)};
options.doRefit = true;

const Acts::BoundTrackParameters initialParams(
Acts::BoundTrackParameters initialParams(
track.referenceSurface().getSharedPtr(), track.parameters(),
track.covariance(), track.particleHypothesis());

// Inflate covariance
for (auto i = 0ul; i < m_cfg.initialVarInflation.size(); ++i) {
initialParams.covariance().value() *= m_cfg.initialVarInflation.at(i);
}
benjaminhuth marked this conversation as resolved.
Show resolved Hide resolved

trackSourceLinks.clear();
surfSequence.clear();

Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/src/TrackFitting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void addTrackFitting(Context& ctx) {

ACTS_PYTHON_DECLARE_ALGORITHM(ActsExamples::RefittingAlgorithm, mex,
"RefittingAlgorithm", inputTracks, outputTracks,
fit, pickTrack);
fit, pickTrack, initialVarInflation);

{
py::class_<TrackFitterFunction, std::shared_ptr<TrackFitterFunction>>(
Expand Down
7 changes: 4 additions & 3 deletions Examples/Scripts/Python/truth_tracking_gsf_refitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def runRefittingGsf(
acts.logging.INFO,
inputTracks="kf_tracks",
outputTracks="gsf_refit_tracks",
initialVarInflation=[100.0] * 6,
fit=acts.examples.makeGsfFitterFunction(
trackingGeometry, field, **gsfOptions
),
Expand Down Expand Up @@ -76,7 +77,7 @@ def runRefittingGsf(
s.addWriter(
acts.examples.RootTrackSummaryWriter(
level=acts.logging.INFO,
inputTracks="tracks",
inputTracks="gsf_refit_tracks",
inputParticles="particles_selected",
inputTrackParticleMatching="refit_track_particle_matching",
filePath=str(outputDir / "tracksummary_gsf_refit.root"),
Expand All @@ -86,9 +87,9 @@ def runRefittingGsf(
s.addWriter(
acts.examples.TrackFitterPerformanceWriter(
level=acts.logging.INFO,
inputTracks="tracks",
inputTracks="gsf_refit_tracks",
inputParticles="particles_selected",
inputTrackParticleMatching="track_particle_matching",
inputTrackParticleMatching="refit_track_particle_matching",
filePath=str(outputDir / "performance_gsf_refit.root"),
)
)
Expand Down
1 change: 1 addition & 0 deletions Examples/Scripts/Python/truth_tracking_kalman_refitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def runRefittingKf(
level=acts.logging.INFO,
inputTracks="kf_tracks",
outputTracks="kf_refit_tracks",
initialVarInflation=[100.0] * 6,
fit=acts.examples.makeKalmanFitterFunction(
trackingGeometry, field, **kalmanOptions
),
Expand Down
Loading