Skip to content

Commit

Permalink
feat: Make CKF branching configurable from python (#2486)
Browse files Browse the repository at this point in the history
Currently we hardcode the branching config in python which makes it hard to find the default and unchangeable for the user. With this PR I add a struct `TrackFindingConfig` which defines the branching params and lower the defaults in hope to spare some resources with ttbar events.
  • Loading branch information
andiwand authored Sep 29, 2023
1 parent 20fa776 commit 363d111
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Examples/Python/python/acts/examples/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@
defaults=[(None, None)] * 7 + [None],
)

CkfConfig = namedtuple(
"CkfConfig",
["chi2CutOff", "numMeasurementsCutOff"],
defaults=[15.0, 10],
)

AmbiguityResolutionConfig = namedtuple(
"AmbiguityResolutionConfig",
["maximumSharedHits", "nMeasurementsMin", "maximumIterations"],
Expand Down Expand Up @@ -919,12 +925,14 @@ def addTruthTrackingGsf(

@acts.examples.NamedTypeArgs(
trackSelectorConfig=TrackSelectorConfig,
ckfConfig=CkfConfig,
)
def addCKFTracks(
s: acts.examples.Sequencer,
trackingGeometry: acts.TrackingGeometry,
field: acts.MagneticFieldProvider,
trackSelectorConfig: Optional[TrackSelectorConfig] = None,
ckfConfig: CkfConfig = CkfConfig(),
outputDirCsv: Optional[Union[Path, str]] = None,
outputDirRoot: Optional[Union[Path, str]] = None,
writeTrajectories: bool = True,
Expand Down Expand Up @@ -958,7 +966,16 @@ def addCKFTracks(
trackFinder = acts.examples.TrackFindingAlgorithm(
level=customLogLevel(),
measurementSelectorCfg=acts.MeasurementSelector.Config(
[(acts.GeometryIdentifier(), ([], [15.0], [10]))]
[
(
acts.GeometryIdentifier(),
(
[],
[ckfConfig.chi2CutOff],
[ckfConfig.numMeasurementsCutOff],
),
)
]
),
trackSelectorCfg=acts.TrackSelector.Config(
**acts.examples.defaultKWArgs(
Expand Down

0 comments on commit 363d111

Please sign in to comment.