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

feat: Track parameters json converter #3724

Merged

Conversation

ssdetlab
Copy link
Contributor

Adding json converter for the different track parameters types. The converter follows the pattern outlined in nlohmann::json documentation, rather than the one present in the codebase due to the a) track parameters types not being default constructible, b) use cases connected to the grid-of-of-track-parameters conversion.

To keep the converter to one implementation of the json serializer, the liberty was taken to add one more constructor to the FreeTrackParameters. The GridJsonConverter code was modified a bit to be able to handle non-default constructible types.

Header for the track parameters json converter in GridJsonConverter.hpp is required for the grid-of-of-track-parameters conversion to be possible by the nlohmann::json standard. As a side note, all the types in the framework that have to_json/from_json overloaded can have grid-of-type json conversion implemented for free, if the respective headers are added to the GridJsonConverter.hpp.

@github-actions github-actions bot added Component - Core Affects the Core module Component - Plugins Affects one or more Plugins Event Data Model labels Oct 11, 2024
Copy link

github-actions bot commented Oct 11, 2024

📊: Physics performance monitoring for 6e9c706

Full contents

physmon summary

@paulgessinger paulgessinger added this to the next milestone Oct 17, 2024
Copy link
Member

@paulgessinger paulgessinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this! I agree that we should try to do as much as possible with the conventional pattern used by nlohmann::json.

Copy link

@paulgessinger paulgessinger merged commit c06a60a into acts-project:main Oct 18, 2024
42 checks passed
@acts-project-service
Copy link
Collaborator

🔴 Athena integration test results [c06a60a]

Build job with this PR failed!

Please investigate the build job for the pipeline!

@acts-project-service acts-project-service added the Breaks Athena build This PR breaks the Athena build label Oct 18, 2024
@paulgessinger paulgessinger modified the milestones: next, v37.2.0 Oct 24, 2024
Rosie-Hasan pushed a commit to Rosie-Hasan/acts that referenced this pull request Nov 13, 2024
Adding json converter for the different track parameters types. The
converter follows the pattern outlined in [nlohmann::json
documentation](https://json.nlohmann.me/features/arbitrary_types/#how-can-i-use-get-for-non-default-constructiblenon-copyable-types),
rather than the one present in the codebase due to the a) track
parameters types not being default constructible, b) use cases connected
to the grid-of-of-track-parameters conversion.

To keep the converter to one implementation of the json serializer, the
liberty was taken to add one more constructor to the
`FreeTrackParameters`. The `GridJsonConverter` code was modified a bit
to be able to handle non-default constructible types.

Header for the track parameters json converter in
`GridJsonConverter.hpp` is required for the grid-of-of-track-parameters
conversion to be possible by the `nlohmann::json` standard. As a side
note, all the types in the framework that have `to_json`/`from_json`
overloaded can have grid-of-type json conversion implemented for free,
if the respective headers are added to the `GridJsonConverter.hpp`.

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaks Athena build This PR breaks the Athena build Component - Core Affects the Core module Component - Plugins Affects one or more Plugins Event Data Model
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants