forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Fitters calculate track quantities
Adds a central helper function that calculates number of holes, outliers, measurements and shared hits based on the type flags, and stores them in the track.
- Loading branch information
1 parent
2235f82
commit 83aa3e9
Showing
8 changed files
with
115 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// This file is part of the Acts project. | ||
// | ||
// Copyright (C) 2023 CERN for the benefit of the Acts project | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// 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/. | ||
#pragma once | ||
|
||
#include "Acts/EventData/MultiTrajectory.hpp" | ||
#include "Acts/EventData/TrackContainer.hpp" | ||
|
||
namespace Acts { | ||
template <typename track_container_t, typename track_state_container_t, | ||
template <typename> class holder_t> | ||
void calculateTrackQuantities( | ||
Acts::TrackProxy<track_container_t, track_state_container_t, holder_t, | ||
false> | ||
track) { | ||
track.chi2() = 0; | ||
track.nDoF() = 0; | ||
|
||
track.nHoles() = 0; | ||
track.nMeasurements() = 0; | ||
track.nSharedHits() = 0; | ||
track.nOutliers() = 0; | ||
|
||
for (const auto& trackState : track.trackStates()) { | ||
auto typeFlags = trackState.typeFlags(); | ||
|
||
if (typeFlags.test(Acts::TrackStateFlag::MeasurementFlag)) { | ||
if (typeFlags.test(Acts::TrackStateFlag::SharedHitFlag)) { | ||
track.nSharedHits()++; | ||
} | ||
|
||
track.nMeasurements()++; | ||
track.chi2() += trackState.chi2(); | ||
track.nDoF() += trackState.calibratedSize(); | ||
} else if (typeFlags.test(Acts::TrackStateFlag::OutlierFlag)) { | ||
track.nOutliers()++; | ||
} else if (typeFlags.test(Acts::TrackStateFlag::HoleFlag)) { | ||
track.nHoles()++; | ||
} | ||
} | ||
} | ||
} // namespace Acts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters