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: Track level improvements (acts-project#2012) -- squash
commit 98355e0 Author: Paul Gessinger <[email protected]> Date: Tue Apr 4 15:04:58 2023 +0200 doxygen commit a162b2d Author: Paul Gessinger <[email protected]> Date: Mon Apr 3 16:25:25 2023 +0200 fix wrong function commit 6021ea2 Author: Paul Gessinger <[email protected]> Date: Mon Apr 3 16:13:33 2023 +0200 unit test, append track state functionality commit 9a25c0a Author: Paul Gessinger <[email protected]> Date: Mon Apr 3 15:58:43 2023 +0200 some basic unit testing commit 83aa3e9 Author: Paul Gessinger <[email protected]> Date: Mon Apr 3 14:35:38 2023 +0200 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. commit 2235f82 Author: Paul Gessinger <[email protected]> Date: Mon Apr 3 14:21:25 2023 +0200 refactor: Changce TrackProxy chi2 method name commit aa6bc1d Author: Paul Gessinger <[email protected]> Date: Fri Mar 31 14:31:08 2023 +0200 add ndf and chi2 to track container
- Loading branch information
1 parent
8e0554b
commit 27f680e
Showing
9 changed files
with
254 additions
and
1 deletion.
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,53 @@ | ||
// 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 { | ||
|
||
/// Helper function to calculate a number of track level quantities and store | ||
/// them on the track itself | ||
/// @tparam track_container_t the track container backend | ||
/// @tparam track_state_container_t the track state container backend | ||
/// @tparam holder_t the holder type for the track container backends | ||
/// @param track A track proxy to operate on | ||
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
Oops, something went wrong.