Skip to content

Commit

Permalink
refactor!: Unify floating point type for chi2 in Track(State) (acts-p…
Browse files Browse the repository at this point in the history
…roject#2562)

This was previously (not really intentionally) different.
  • Loading branch information
paulgessinger authored Nov 16, 2023
1 parent 6517c35 commit 040a896
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions Core/include/Acts/EventData/MultiTrajectory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -908,15 +908,15 @@ class TrackStateProxy {
/// @note this overload is only enabled in case the proxy is not read-only
/// @return Mutable reference to the chi2 value
template <bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
double& chi2() {
return component<double, hashString("chi2")>();
float& chi2() {
return component<float, hashString("chi2")>();
}

/// Getter for the chi2 value associated with the track state.
/// This overload returns a copy of the chi2 value, and thus does not allow
/// modification of the value in the backing storage.
/// @return the chi2 value of the track state
double chi2() const { return component<double, hashString("chi2")>(); }
float chi2() const { return component<float, hashString("chi2")>(); }

/// Getter for the path length associated with the track state.
/// This overloaded is only enabled if not read-only, and returns a mutable
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/EventData/TrackStateProxyConcept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ concept TrackStateProxyConcept =
{ cv.calibratedSize() } -> std::same_as<TrackIndexType>;
{ v.calibratedSize() } -> std::same_as<TrackIndexType>;

{ cv.chi2() } -> std::same_as<double>;
{ cv.chi2() } -> std::same_as<float>;

{ cv.pathLength() } -> std::same_as<double>;

Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/EventData/VectorMultiTrajectory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class VectorMultiTrajectoryBase {
IndexType ijacobian = kInvalid;
IndexType iprojector = kInvalid;

double chi2 = 0;
float chi2 = 0;
double pathLength = 0;
TrackStateType::raw_type typeFlags{};

Expand Down
28 changes: 14 additions & 14 deletions Examples/Python/tests/root_file_hashes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ test_itk_seeding__particles_initial.root: 88315e93ed4cb5d40a8721502048a9d1fc100e
test_propagation__propagation_steps.root: 174301b25784dbb881196b658f2d7f99c0a2ea688a0129e6110fc19aa5cf8e54
test_material_recording__geant4_material_tracks.root: e411152d370775463c22b19a351dfc7bfe40b51985e10a7c1a010aebde80715d
test_truth_tracking_kalman[generic-0.0]__trackstates_fitter.root: 9e3a3dbbb94b78a557e7879a03ca8f760205eff218eaae598a3e4c5fe936f696
test_truth_tracking_kalman[generic-0.0]__tracksummary_fitter.root: ff8e16b9e6d46f6a97b2c53a29dc568bd008912b58f9d5d6e30bfc43bc5913f4
test_truth_tracking_kalman[generic-0.0]__tracksummary_fitter.root: 496467c8305c52ef76f855f6eef00033f4428f785c6099b5ba60c1f3cae19dc3
test_truth_tracking_kalman[generic-0.0]__performance_track_finder.root: ada9cda2ec3c648b144bdaa081d6eff923c80f3d484c4196006e847428cf67a8
test_truth_tracking_kalman[generic-1000.0]__trackstates_fitter.root: b16504d942945a86e0f879b1c4b7f6a41361e34556c8c84e6cd98e34674979f3
test_truth_tracking_kalman[generic-1000.0]__tracksummary_fitter.root: 43298268a329e24a988e2fdd4c133d1fc183d0518750324d0ee43a0f3041e53b
test_truth_tracking_kalman[generic-1000.0]__tracksummary_fitter.root: c8bdd0ccddeda38867517dd86665804bac2f3ab4bbb11a02a82dc725ee65e771
test_truth_tracking_kalman[generic-1000.0]__performance_track_finder.root: ada9cda2ec3c648b144bdaa081d6eff923c80f3d484c4196006e847428cf67a8
test_truth_tracking_kalman[odd-0.0]__trackstates_fitter.root: 74532cccf8fd1ceffd434ac1143721dd54b7169561f0fa9bafdafc7ddfedfe6c
test_truth_tracking_kalman[odd-0.0]__tracksummary_fitter.root: 4cef9eaa470cd627d4a2ed6a089d745a1c986c41fd8158e6f9ac80085a7ad977
test_truth_tracking_kalman[odd-0.0]__tracksummary_fitter.root: 3802b1bc849fe47bfa7ae72fb13d6bd592e0a82a97277bad12a8ceef59c00f64
test_truth_tracking_kalman[odd-0.0]__performance_track_finder.root: 39aec6316cceb90e314e16b02947faa691c18f57c3a851a25e547a8fc05a4593
test_truth_tracking_kalman[odd-1000.0]__trackstates_fitter.root: f616b2234db239b496ad69b9ecb709f9da12fbd4d14e7af1a588ae7ab597cfbf
test_truth_tracking_kalman[odd-1000.0]__tracksummary_fitter.root: 46aab1241b0bf797191f1f3ed74ca38bcff1c31e758a1a4f82183880b44143eb
test_truth_tracking_kalman[odd-1000.0]__tracksummary_fitter.root: a53253b509b5779a5d856f8c09d76a499b217b55ba4b0e52d9076ffad726463f
test_truth_tracking_kalman[odd-1000.0]__performance_track_finder.root: 39aec6316cceb90e314e16b02947faa691c18f57c3a851a25e547a8fc05a4593
test_truth_tracking_gsf[generic]__trackstates_gsf.root: 412f5ee8aa9ed234fd3d20c1a7a839f6003ede5c4d1802757b77645eb9ecf8ce
test_truth_tracking_gsf[generic]__tracksummary_gsf.root: c21f576eeba7d61b50286049c745da99ce6ad8c4aa2f77b3a3cdec68a419c22f
test_truth_tracking_gsf[odd]__trackstates_gsf.root: 30009f489ecb8b65fbd1f8246fab5e51c4a1019e4050a645802a7288936779e2
test_truth_tracking_gsf[odd]__tracksummary_gsf.root: 9528eca4aa8c87b0e666e8820eacc4313500cd514e0eca24c7deddcc813eeebc
test_truth_tracking_gsf[generic]__trackstates_gsf.root: 8422ad83843d69aac7d1e37d6d3e4019b1abfaf854d9246c1fb8a4fc5d6c3f13
test_truth_tracking_gsf[generic]__tracksummary_gsf.root: 2177fea2639cf07d962ed9a6b2fa0dd984dafb085d8a26c65a1ebabc5ec27b4a
test_truth_tracking_gsf[odd]__trackstates_gsf.root: 9e1c0acaf1aed2347992c0a4c076ca27ce71d770521b33680f30f9734dd8494e
test_truth_tracking_gsf[odd]__tracksummary_gsf.root: e541e499057f46a2f4742b4100be712d6e7ab0886fe0310f9a19cf17d38437b4
test_particle_gun__particles.root: 8549ba6e20338004ab8ba299fc65e1ee5071985b46df8f77f887cb6fef56a8ec
test_material_mapping__material-map_tracks.root: 2deac7a48ff1185ba3889cfd4cc0bd0a6de57293048dfd6766f3c3907232e45e
test_material_mapping__propagation-material.root: 84b04ebd5721550867f0f193b5eb4e9f3f205df542cb46090d320be6bff565c5
Expand All @@ -50,21 +50,21 @@ test_digitization_example_input[smeared]__measurements.root: 2e4fd9d3e6244e53486
test_digitization_example_input[geometric]__particles.root: 8549ba6e20338004ab8ba299fc65e1ee5071985b46df8f77f887cb6fef56a8ec
test_digitization_example_input[geometric]__measurements.root: 20128357c9238926d628d18b3b91a0a73947b2b5682762bf5d8fd94342faf976
test_ckf_tracks_example[generic-full_seeding]__trackstates_ckf.root: 5ddcc228073553ba14205897451951ea475541643bb677e7718bd3369b484bcd
test_ckf_tracks_example[generic-full_seeding]__tracksummary_ckf.root: 317d50baa6c25d02accf4280c4c689a5a65aa8aa4269ee987dd4fb00d3b2a40d
test_ckf_tracks_example[generic-full_seeding]__tracksummary_ckf.root: 6ccdd72caf4d645debea57fc823d5ceedb74c70b9832b3a906ae4a06ac8fe796
test_ckf_tracks_example[generic-full_seeding]__performance_seeding_trees.root: 0e0676ffafdb27112fbda50d1cf627859fa745760f98073261dcf6db3f2f991e
test_ckf_tracks_example[generic-truth_estimated]__trackstates_ckf.root: 10ecbc093239670b0a116fad5a25caf941f2a401a03892a6853652d20ee98a67
test_ckf_tracks_example[generic-truth_estimated]__tracksummary_ckf.root: ebb323a75d589d5821a5ff08ea3b45d6da08eacac7dc535198f38a6fe5a9f012
test_ckf_tracks_example[generic-truth_estimated]__tracksummary_ckf.root: 068c236fd9f52801eb39e72498c7ec37857523a617d77b5987db4bfb736c6f88
test_ckf_tracks_example[generic-truth_estimated]__performance_seeding.root: 1facb05c066221f6361b61f015cdf0918e94d9f3fce2269ec7b6a4dffeb2bc7e
test_ckf_tracks_example[generic-truth_smeared]__trackstates_ckf.root: 4c081f8d984b7a9eb680ddc870d03ada2f3bbbb6fb0e41877720e449b82b87d8
test_ckf_tracks_example[generic-truth_smeared]__tracksummary_ckf.root: 5c71952ab6937a5977bd6b21657185eaab073f8f342417143aa4c0d6918d198d
test_ckf_tracks_example[generic-truth_smeared]__tracksummary_ckf.root: 3ac06b38c59d673099dd4474320423932c84eea47b226fad887ed1c2c83d18c1
test_ckf_tracks_example[odd-full_seeding]__trackstates_ckf.root: f8511a029465842e39894bbb6054bc330747e0948e686787aa9f90fea2e59102
test_ckf_tracks_example[odd-full_seeding]__tracksummary_ckf.root: 83fcc373bc5ccf3bdf4390a5a1b4c5aaf4a7ec9365fddc844810cec207f3f47b
test_ckf_tracks_example[odd-full_seeding]__tracksummary_ckf.root: 24eea0bc0c0c2a790fbf8038e0bd84c62325bccc9c9bc580f66c27e7a35654c3
test_ckf_tracks_example[odd-full_seeding]__performance_seeding_trees.root: 43c58577aafe07645e5660c4f43904efadf91d8cda45c5c04c248bbe0f59814f
test_ckf_tracks_example[odd-truth_estimated]__trackstates_ckf.root: f244ea1201fedaec0619d595945d33d976fc1e09e8d218e16ea0737f35debe0f
test_ckf_tracks_example[odd-truth_estimated]__tracksummary_ckf.root: 8559611313bf5d2ae6c2113722c26830b3caff13e8dba72ffef47feb09b48dc6
test_ckf_tracks_example[odd-truth_estimated]__tracksummary_ckf.root: f7b683c6c0c8a57dd61bd3ba2965bf5f689a6eb9c2e8c8e8e13a7907ea7411a3
test_ckf_tracks_example[odd-truth_estimated]__performance_seeding.root: 1a36b7017e59f1c08602ef3c2cb0483c51df248f112e3780c66594110719c575
test_ckf_tracks_example[odd-truth_smeared]__trackstates_ckf.root: cee2ef40dbc341861a9abac8e4d2503240c5522d9fef6edf30fa163129f17cef
test_ckf_tracks_example[odd-truth_smeared]__tracksummary_ckf.root: c4c1839a45827e3cbe7b726c52d1908344654a770132688d9e9d55c09f1643fd
test_ckf_tracks_example[odd-truth_smeared]__tracksummary_ckf.root: 6a8e6ef7c5a2b17b58d3c551e951a4cfb894c795e5c91df8b4499b5688020ee1
test_vertex_fitting_reading[Truth-False-100]__performance_vertexing.root: 76ef6084d758dfdfc0151ddec2170e12d73394424e3dac4ffe46f0f339ec8293
test_vertex_fitting_reading[Iterative-False-100]__performance_vertexing.root: 60372210c830a04f95ceb78c6c68a9b0de217746ff59e8e73053750c837b57eb
test_vertex_fitting_reading[Iterative-True-100]__performance_vertexing.root: e34f217d524a5051dbb04a811d3407df3ebe2cc4bb7f54f6bda0847dbd7b52c3
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Podio/edm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ components:
- uint64_t projector
- bool hasProjector

- double chi2
- float chi2
- double pathLength
- uint64_t typeFlags

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ class MultiTrajectoryTestsCommon {
BOOST_CHECK_EQUAL(ts.jacobian(), pc.jacobian);
BOOST_CHECK_EQUAL(ts.pathLength(), pc.pathLength);
// check that chi2 is set
BOOST_CHECK_EQUAL(ts.chi2(), pc.chi2);
BOOST_CHECK_EQUAL(ts.chi2(), static_cast<float>(pc.chi2));

// check that the uncalibratedSourceLink source link is set
BOOST_CHECK_EQUAL(
Expand Down

0 comments on commit 040a896

Please sign in to comment.