Skip to content

Commit

Permalink
fix: Fix material decorator wiring in Python Examples (#4110)
Browse files Browse the repository at this point in the history
Fix naming of material decorator for ITk example. Now, `materialDecorator` is used for `TGeoDetector`. Variable `mdecorator` exists only in `getOpenDataDetector()` function, not used by ITk.


<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Expanded detector configuration options for enhanced setup flexibility.
- **Refactor**
  - Updated configuration parameter naming for improved clarity and consistency without altering functionality.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
pbalek authored Feb 27, 2025
1 parent c542ea3 commit 5c7de7a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Examples/Python/python/acts/examples/itk.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def buildITkGeometry(
surfaceLogLevel=customLogLevel(),
layerLogLevel=customLogLevel(),
volumeLogLevel=customLogLevel(),
mdecorator=matDeco,
materialDecorator=matDeco,
)

Volume = TGeoDetector.Config.Volume
Expand All @@ -85,7 +85,7 @@ def buildITkGeometry(
# This specification should be kept in sync with `itk-hgtd/tgeo-atlas-itk-hgtd.json`.
return TGeoDetector(
fileName=str(tgeo_fileName),
mdecorator=matDeco,
materialDecorator=matDeco,
buildBeamPipe=True,
unitScalor=1.0, # explicit units
beamPipeRadius=23.934 * u.mm,
Expand Down
1 change: 1 addition & 0 deletions Examples/Python/src/Detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ void addDetector(Context& ctx) {
ACTS_PYTHON_MEMBER(beamPipeEnvelopeR);
ACTS_PYTHON_MEMBER(layerEnvelopeR);
ACTS_PYTHON_MEMBER(unitScalor);
ACTS_PYTHON_MEMBER(materialDecorator);
ACTS_PYTHON_MEMBER(volumes);
ACTS_PYTHON_STRUCT_END();

Expand Down
2 changes: 1 addition & 1 deletion Examples/Scripts/Python/propagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def runPropagation(trackingGeometry, field, outputDir, s=None, decorators=[]):
# matDeco = acts.IMaterialDecorator.fromFile("material.root")

## Generic detector: Default
detector = GenericDetector(mdecorator=matDeco)
detector = GenericDetector(materialDecorator=matDeco)

## Alternative: Aligned detector in a couple of modes
# detector = AlignedDetector(
Expand Down

0 comments on commit 5c7de7a

Please sign in to comment.