Skip to content

Commit

Permalink
Merge branch 'main' into cmake/cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Feb 18, 2025
2 parents f1b7a02 + 83a9f63 commit 8438e42
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ variables:

.ccache_base:
cache:
- key: ccache-${CI_JOB_NAME}-${CCACHE_KEY_SUFFIX}-${CLONE_URL}_${HEAD_REF}
- key: ccache-${CI_JOB_NAME}-${CCACHE_KEY_SUFFIX}-${REPO_SLUG}_${HEAD_REF}
fallback_keys:
- ccache-${CI_JOB_NAME}-${CCACHE_KEY_SUFFIX}-https://github.com/acts-project/acts.git-main
when: always
Expand Down
4 changes: 2 additions & 2 deletions Core/include/Acts/Geometry/GeometryObject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class GeometryObject {
}

/// @return the geometry id by reference
const GeometryIdentifier& geometryId() const;
GeometryIdentifier geometryId() const;

/// Force a binning position method
///
Expand Down Expand Up @@ -77,7 +77,7 @@ class GeometryObject {
GeometryIdentifier m_geometryId;
};

inline const GeometryIdentifier& GeometryObject::geometryId() const {
inline GeometryIdentifier GeometryObject::geometryId() const {
return m_geometryId;
}

Expand Down
8 changes: 4 additions & 4 deletions Examples/Python/python/acts/examples/odd.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ def getOpenDataDetector(

def geoid_hook(geoid, surface):
gctx = acts.GeometryContext()
if geoid.volume() in volumeRadiusCutsMap:
if geoid.volume in volumeRadiusCutsMap:
r = math.sqrt(surface.center(gctx)[0] ** 2 + surface.center(gctx)[1] ** 2)

geoid.setExtra(1)
for cut in volumeRadiusCutsMap[geoid.volume()]:
geoid.extra = 1
for cut in volumeRadiusCutsMap[geoid.volume]:
if r > cut:
geoid.setExtra(geoid.extra() + 1)
geoid.extra += 1

return geoid

Expand Down
36 changes: 19 additions & 17 deletions Examples/Python/src/Geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,20 @@ void addGeometry(Context& ctx) {
py::class_<Acts::GeometryIdentifier>(m, "GeometryIdentifier")
.def(py::init<>())
.def(py::init<Acts::GeometryIdentifier::Value>())
.def("setVolume", &Acts::GeometryIdentifier::setVolume)
.def("setLayer", &Acts::GeometryIdentifier::setLayer)
.def("setBoundary", &Acts::GeometryIdentifier::setBoundary)
.def("setApproach", &Acts::GeometryIdentifier::setApproach)
.def("setSensitive", &Acts::GeometryIdentifier::setSensitive)
.def("setExtra", &Acts::GeometryIdentifier::setExtra)
.def("volume", &Acts::GeometryIdentifier::volume)
.def("layer", &Acts::GeometryIdentifier::layer)
.def("boundary", &Acts::GeometryIdentifier::boundary)
.def("approach", &Acts::GeometryIdentifier::approach)
.def("sensitive", &Acts::GeometryIdentifier::sensitive)
.def("extra", &Acts::GeometryIdentifier::extra)
.def("value", &Acts::GeometryIdentifier::value)

.def_property("volume", &Acts::GeometryIdentifier::volume,
&Acts::GeometryIdentifier::setVolume)
.def_property("layer", &Acts::GeometryIdentifier::layer,
&Acts::GeometryIdentifier::setLayer)
.def_property("boundary", &Acts::GeometryIdentifier::boundary,
&Acts::GeometryIdentifier::setBoundary)
.def_property("approach", &Acts::GeometryIdentifier::approach,
&Acts::GeometryIdentifier::setApproach)
.def_property("sensitive", &Acts::GeometryIdentifier::sensitive,
&Acts::GeometryIdentifier::setSensitive)
.def_property("extra", &Acts::GeometryIdentifier::extra,
&Acts::GeometryIdentifier::setExtra)
.def_property_readonly("value", &Acts::GeometryIdentifier::value)
.def("__str__", [](const Acts::GeometryIdentifier& self) {
std::stringstream ss;
ss << self;
Expand All @@ -126,12 +127,13 @@ void addGeometry(Context& ctx) {
{
py::class_<Acts::Surface, std::shared_ptr<Acts::Surface>>(m, "Surface")
// Can't bind directly because GeometryObject is virtual base of Surface
.def("geometryId",
[](const Surface& self) { return self.geometryId(); })
.def_property_readonly(
"geometryId", [](const Surface& self) { return self.geometryId(); })
.def("center", &Surface::center)
.def("type", &Surface::type)
.def_property_readonly("type", &Surface::type)
.def("visualize", &Surface::visualize)
.def("surfaceMaterial", &Acts::Surface::surfaceMaterialSharedPtr);
.def_property_readonly("surfaceMaterial",
&Acts::Surface::surfaceMaterialSharedPtr);
}

{
Expand Down
6 changes: 3 additions & 3 deletions Examples/Python/tests/test_detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def visit(srf):


def check_extra_odd(srf):
if srf.geometryId().volume() in [28, 30, 23, 25, 16, 18]:
assert srf.geometryId().extra() != 0
if srf.geometryId.volume in [28, 30, 23, 25, 16, 18]:
assert srf.geometryId.extra != 0
return


Expand Down Expand Up @@ -183,7 +183,7 @@ def test_coordinate_converter(trk_geo):

def test_surface(surface):
gctx = acts.GeometryContext()
geo_id = surface.geometryId().value()
geo_id = surface.geometryId.value
geo_center = surface.center(gctx)
x, y, z = geo_center[0], geo_center[1], geo_center[2]

Expand Down
2 changes: 1 addition & 1 deletion Examples/Scripts/Python/detector_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
viewConfig.nSegments = 100
for vol in detector.volumePtrs():
for surf in vol.surfacePtrs():
if surf.geometryId().sensitive() > 0:
if surf.geometryId.sensitive > 0:
surfaces.append(surf)
acts.examples.writeSurfacesObj(surfaces, geoContext, viewConfig, "odd-surfaces.obj")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def estimateLookup(trackingGeometry, numEvents, outputPath):
# Set up the track estimation algorithm
surfaces = list(trackingGeometry.geoIdSurfaceMap().values())
refSurface = surfaces[0]
refGeometryId = refSurface.geometryId()
refGeometryId = refSurface.geometryId

trackEstConfig = acts.examples.TrackParamsLookupEstimation.Config(
refLayers={refGeometryId: refSurface},
Expand Down

0 comments on commit 8438e42

Please sign in to comment.