-
Notifications
You must be signed in to change notification settings - Fork 280
feat(detray): perigee extrapolator #6084
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
Open
zovelsanj
wants to merge
3
commits into
acts-project:main
Choose a base branch
from
zovelsanj:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,10 @@ | ||
| # This file was autogenerated by uv via the following command: | ||
| # uv pip compile --universal --python-version 3.11 Detray/codegen/detray-sympy/pyproject.toml -o Detray/codegen/detray-sympy/requirements.txt | ||
| mpmath==1.3.0 | ||
| # via sympy | ||
| numpy==2.4.6 ; python_full_version < '3.12' | ||
| # via detray-sympy (Detray/codegen/detray-sympy/pyproject.toml) | ||
| numpy==2.5.3 ; python_full_version >= '3.12' | ||
| # via detray-sympy (Detray/codegen/detray-sympy/pyproject.toml) | ||
| sympy==1.14.0 | ||
| # via detray-sympy (Detray/codegen/detray-sympy/pyproject.toml) | ||
This file contains hidden or 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
194 changes: 194 additions & 0 deletions
194
Detray/core/include/detray/navigation/external_surface.hpp
This file contains hidden or 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,194 @@ | ||
| // This file is part of the ACTS project. | ||
| // | ||
| // Copyright (C) 2016 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 https://mozilla.org/MPL/2.0/. | ||
|
|
||
| /** Detray library, part of the ACTS project (R&D line) | ||
| * | ||
| * (c) 2025 CERN for the benefit of the ACTS project | ||
| * | ||
| * Mozilla Public License Version 2.0 | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| // Project include(s) | ||
| #include "detray/definitions/detail/qualifiers.hpp" | ||
| #include "detray/definitions/geometry.hpp" | ||
| #include "detray/definitions/indexing.hpp" | ||
| #include "detray/definitions/units.hpp" | ||
| #include "detray/geometry/identifier.hpp" | ||
| #include "detray/geometry/mask.hpp" | ||
|
|
||
| namespace detray { | ||
|
|
||
| template <typename algebra_t, typename shape_t, typename material_t, | ||
| typename nav_link_t> | ||
| class external_surface { | ||
| public: | ||
| using transform3_type = dtransform3D<algebra_t>; | ||
| using mask_type = detray::mask<shape_t, algebra_t, nav_link_t>; | ||
| using material_type = material_t; | ||
| /// Link type of the mask to a volume. | ||
| using navigation_link = nav_link_t; | ||
|
|
||
| /// Default constructor | ||
| constexpr external_surface() = default; | ||
|
|
||
| /// Constructor with full arguments | ||
| /// | ||
| /// @param trf the transform for positioning and 3D local frame | ||
| /// @param mask the surface mask | ||
| /// @param material the surface material | ||
| /// @param volume the volume this surface belongs to | ||
| /// @param sf_id remember whether this is a portal or not | ||
| DETRAY_HOST_DEVICE | ||
| constexpr external_surface(const transform3_type& trf, const mask_type& mask, | ||
| const material_type& material, const dindex volume, | ||
| const surface_id sf_id) | ||
| : m_transform{trf}, | ||
| m_mask(mask), | ||
| m_material(material), | ||
| m_barcode{geometry::identifier{}.set_volume(volume).set_id(sf_id)} {} | ||
|
|
||
| /// Constructor with full arguments - move semantics | ||
| /// | ||
| /// @param trf the transform for positioning and 3D local frame | ||
| /// @param mask the surface mask | ||
| /// @param material the surface material | ||
| /// @param volume the volume this surface belongs to | ||
| /// @param sf_id remember whether this is a portal or not | ||
| DETRAY_HOST_DEVICE | ||
| constexpr external_surface(transform3_type&& trf, mask_type&& mask, | ||
| material_type&& material, const dindex volume, | ||
| const surface_id sf_id) | ||
| : m_transform{std::move(trf)}, | ||
| m_mask(std::move(mask)), | ||
| m_material(std::move(material)), | ||
| m_barcode{geometry::identifier{}.set_volume(volume).set_id(sf_id)} {} | ||
|
|
||
| /// Equality operator | ||
| /// | ||
| /// @param rhs is the right hand side to be compared to | ||
| DETRAY_HOST_DEVICE | ||
| constexpr auto operator==(const external_surface& rhs) const -> bool { | ||
| return (m_barcode == rhs.m_barcode); | ||
| } | ||
|
|
||
| /// Sets a new surface barcode | ||
| DETRAY_HOST_DEVICE | ||
| auto set_barcode(const geometry::identifier bcd) -> void { m_barcode = bcd; } | ||
|
|
||
| /// @returns the surface barcode | ||
| DETRAY_HOST_DEVICE | ||
| constexpr auto barcode() const -> geometry::identifier { return m_barcode; } | ||
|
|
||
| /// @returns the surface identifier (identifier-era naming) | ||
| DETRAY_HOST_DEVICE | ||
| constexpr auto identifier() const -> geometry::identifier { | ||
| return m_barcode; | ||
| } | ||
|
|
||
| /// Implicit conversion for APIs that take geometry::identifier. | ||
| DETRAY_HOST_DEVICE | ||
| constexpr operator geometry::identifier() const { return m_barcode; } | ||
|
Check failure on line 97 in Detray/core/include/detray/navigation/external_surface.hpp
|
||
|
|
||
| /// Sets a new surface id (portal/passive/sensitive) | ||
| DETRAY_HOST_DEVICE | ||
| auto set_id(const surface_id new_id) -> void { m_barcode.set_id(new_id); } | ||
|
|
||
| /// @returns the surface id (sensitive, passive or portal) | ||
| DETRAY_HOST_DEVICE | ||
| constexpr auto id() const -> surface_id { return m_barcode.id(); } | ||
|
|
||
| /// Sets a new volume link (index in volume collection of detector) | ||
| DETRAY_HOST_DEVICE | ||
| auto set_volume(const dindex new_idx) -> void { | ||
| m_barcode.set_volume(new_idx); | ||
| } | ||
|
|
||
| /// @returns the surface id (sensitive, passive or portal) | ||
| DETRAY_HOST_DEVICE | ||
| constexpr auto volume() const -> dindex { return m_barcode.volume(); } | ||
|
|
||
| /// Sets a new surface index (index in surface collection of surface store) | ||
| DETRAY_HOST_DEVICE | ||
| auto set_index(const dindex new_idx) -> void { m_barcode.set_index(new_idx); } | ||
|
|
||
| /// @returns the surface id (sensitive, passive or portal) | ||
| DETRAY_HOST_DEVICE | ||
| constexpr auto index() const -> dindex { return m_barcode.index(); } | ||
|
|
||
| /// Update the transform index | ||
| /// | ||
| /// @param offset update the position when move into new collection | ||
| DETRAY_HOST_DEVICE | ||
| void set_transform(const transform3_type& trf) { m_transform = trf; } | ||
|
|
||
| /// @return the transform index | ||
| DETRAY_HOST_DEVICE | ||
| constexpr auto transform() const -> const transform3_type& { | ||
| return m_transform; | ||
| } | ||
|
|
||
| /// Update the mask link | ||
| /// | ||
| /// @param offset update the position when move into new collection | ||
| DETRAY_HOST_DEVICE | ||
| void set_mask(const mask_type m) { m_mask = m; } | ||
|
|
||
| /// @return the mask - const | ||
| DETRAY_HOST_DEVICE | ||
| constexpr auto mask() const -> const mask_type& { return m_mask; } | ||
|
|
||
| /// Update the material link | ||
| /// | ||
| /// @param offset update the position when move into new collection | ||
| DETRAY_HOST_DEVICE | ||
| void set_material(const material_type& offset) { m_material.shift(offset); } | ||
|
|
||
| /// Access to the material | ||
| DETRAY_HOST_DEVICE | ||
| constexpr auto material() -> material_type& { return m_material; } | ||
|
|
||
| /// @return the material link | ||
| DETRAY_HOST_DEVICE | ||
| constexpr auto material() const -> const material_type& { return m_material; } | ||
|
|
||
| /// @returns true if the surface descriptor has a valid material link | ||
| DETRAY_HOST_DEVICE | ||
| constexpr auto has_material() const -> bool { return false; } | ||
|
|
||
| /// @returns true if the surface is a sensitive detector module. | ||
| DETRAY_HOST_DEVICE | ||
| constexpr auto is_sensitive() const -> bool { | ||
| return m_barcode.id() == surface_id::e_sensitive; | ||
| } | ||
|
|
||
| /// @returns true if the surface is a portal. | ||
| DETRAY_HOST_DEVICE | ||
| constexpr auto is_portal() const -> bool { | ||
| return m_barcode.id() == surface_id::e_portal; | ||
| } | ||
|
|
||
| /// @returns true if the surface is a passive detector element. | ||
| DETRAY_HOST_DEVICE | ||
| constexpr auto is_passive() const -> bool { | ||
| return m_barcode.id() == surface_id::e_passive; | ||
| } | ||
|
|
||
| private: | ||
| /// Surface placement transform and its inverse | ||
| transform3_type m_transform{}; | ||
| /// Surface mask | ||
| mask_type m_mask{}; | ||
| /// Surface material | ||
| material_type m_material{}; | ||
| /// Surface hash | ||
| geometry::identifier m_barcode{}; | ||
| }; | ||
|
|
||
| } // namespace detray | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should not be commited