-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add measurement emplace functions (#3627)
Recently, the measurement EDM was replaced by a memory-optimal bulk storage, but this makes it a bit harder to add new measurements to a collection. This commit adds two new emplace functions which variadically allow users to add measurements, similar to how they might use `std::vector::emplace_back`.
- Loading branch information
1 parent
0bf2465
commit a129eeb
Showing
5 changed files
with
127 additions
and
16 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
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
25 changes: 25 additions & 0 deletions
25
Examples/Framework/include/ActsExamples/EventData/MeasurementConcept.hpp
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,25 @@ | ||
// 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/SourceLink.hpp" | ||
|
||
#include <concepts> | ||
|
||
namespace ActsExamples { | ||
|
||
template <typename T> | ||
concept MeasurementConcept = requires(const T& m) { | ||
{ m.size() } -> std::integral; | ||
{ m.sourceLink() } -> Acts::Concepts::decayed_same_as<Acts::SourceLink>; | ||
{ m.subspaceIndexVector() }; | ||
{ m.parameters() }; | ||
{ m.covariance() }; | ||
}; | ||
} // namespace ActsExamples |
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