-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR enhances the visitor pattern for the Acts geometry. It adds a non-const visitor pattern which will allow to also use the visitor pattern to set the material to the new detector geometry and will replace this `IMaterialProvider` mechanism and will rely on the same recursive visiting. The unit tests show how this can be used to assign material to a pre-built geometry instance. Note: The new `visitSurfaces` method of the `TrackingGeometry` will now visit all reachable surfaces, and not only the sensitive ones. This allows it to e.g. extract material surfaces and will remove a lot of duplicated code in `SurfaceMaterialMapper` and `VolumeMaterialMapper` that manually walk through the `TrackingGeometry` hierarchy.
- Loading branch information
1 parent
6aeeeda
commit 5166de1
Showing
12 changed files
with
476 additions
and
60 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
32 changes: 32 additions & 0 deletions
32
Core/include/Acts/Detector/DetectorVolumeVisitorConcept.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,32 @@ | ||
// This file is part of the Acts project. | ||
// | ||
// Copyright (C) 2024 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 | ||
|
||
#if defined(__cpp_concepts) | ||
#include <concepts> | ||
|
||
namespace Acts { | ||
|
||
namespace Experimental { | ||
class DetectorVolume; | ||
} | ||
|
||
template <typename T> | ||
concept DetectorVolumeVisitor = requires(T v) { | ||
{v(std::declval<const Experimental::DetectorVolume*>())}; | ||
}; | ||
|
||
template <typename T> | ||
concept MutableDetectorVolumeVisitor = requires(T v) { | ||
{v(std::declval<Experimental::DetectorVolume*>())}; | ||
}; | ||
|
||
} // namespace Acts | ||
|
||
#endif |
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.