Skip to content
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

refactor: physmon: *almost* same settings for GX2F and KF #3248

Merged
merged 20 commits into from
Jun 7, 2024
Merged
Binary file modified CI/physmon/reference/performance_gx2f.root
Binary file not shown.
2 changes: 1 addition & 1 deletion CI/physmon/workflows/physmon_truth_tracking_gx2f.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
runTruthTrackingGx2f(
trackingGeometry=setup.trackingGeometry,
field=setup.field,
outputDir=tp,
digiConfigFile=setup.digiConfig,
outputDir=tp,
s=s,
)

Expand Down
6 changes: 3 additions & 3 deletions CI/physmon/workflows/physmon_truth_tracking_kalman.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

tp = Path(temp)
runTruthTrackingKalman(
setup.trackingGeometry,
setup.field,
setup.digiConfig,
trackingGeometry=setup.trackingGeometry,
field=setup.field,
digiConfigFile=setup.digiConfig,
outputDir=tp,
s=s,
)
Expand Down
44 changes: 30 additions & 14 deletions Examples/Scripts/Python/truth_tracking_gx2f.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@
def runTruthTrackingGx2f(
trackingGeometry: acts.TrackingGeometry,
field: acts.MagneticFieldProvider,
outputDir: Path,
digiConfigFile: Path,
s: acts.examples.Sequencer = None,
outputDir: Path,
inputParticlePath: Optional[Path] = None,
s: acts.examples.Sequencer = None,
):
from acts.examples.simulation import (
addParticleGun,
MomentumConfig,
EtaConfig,
ParticleConfig,
EtaConfig,
PhiConfig,
MomentumConfig,
addFatras,
addDigitization,
)
Expand All @@ -33,18 +34,23 @@ def runTruthTrackingGx2f(
)

s = s or acts.examples.Sequencer(
events=10000, numThreads=-1, logLevel=acts.logging.INFO
events=100, numThreads=-1, logLevel=acts.logging.INFO
)

rnd = acts.examples.RandomNumbers()
rnd = acts.examples.RandomNumbers(seed=42)
outputDir = Path(outputDir)

if inputParticlePath is None:
addParticleGun(
s,
ParticleConfig(num=1, pdg=acts.PdgParticle.eMuon, randomizeCharge=True),
EtaConfig(-2.5, 2.5, uniform=True),
MomentumConfig(100.0 * u.GeV, 100.0 * u.GeV, transverse=True),
AJPfleger marked this conversation as resolved.
Show resolved Hide resolved
EtaConfig(-2.0, 2.0),
ParticleConfig(2, acts.PdgParticle.eMuon, False),
PhiConfig(0.0, 360.0 * u.degree),
vtxGen=acts.examples.GaussianVertexGenerator(
mean=acts.Vector4(0, 0, 0, 0),
stddev=acts.Vector4(0, 0, 0, 0),
),
multiplicity=1,
rnd=rnd,
outputDirRoot=outputDir,
Expand Down Expand Up @@ -82,11 +88,13 @@ def runTruthTrackingGx2f(
s,
trackingGeometry,
field,
seedingAlgorithm=SeedingAlgorithm.TruthSmeared,
rnd=rnd,
inputParticles="particles_input",
seedingAlgorithm=SeedingAlgorithm.TruthSmeared,
particleHypothesis=acts.ParticleHypothesis.muon,
truthSeedRanges=TruthSeedRanges(
pt=(1 * u.GeV, None),
nHits=(9, None),
nHits=(7, None),
),
)

Expand All @@ -98,7 +106,18 @@ def runTruthTrackingGx2f(
relChi2changeCutOff=1e-7,
)

# Output
s.addAlgorithm(
acts.examples.TrackSelectorAlgorithm(
level=acts.logging.INFO,
inputTracks="tracks",
outputTracks="selected-tracks",
selectorConfig=acts.TrackSelector.Config(
minMeasurements=7,
),
)
)
s.addWhiteboardAlias("tracks", "selected-tracks")

s.addWriter(
acts.examples.RootTrackStatesWriter(
level=acts.logging.INFO,
Expand Down Expand Up @@ -145,12 +164,9 @@ def runTruthTrackingGx2f(

runTruthTrackingGx2f(
trackingGeometry=trackingGeometry,
# decorators=decorators,
field=field,
digiConfigFile=srcdir
/ "Examples/Algorithms/Digitization/share/default-smearing-config-generic.json",
# "thirdparty/OpenDataDetector/config/odd-digi-smearing-config.json",
# outputCsv=True,
# inputParticlePath=inputParticlePath,
outputDir=Path.cwd(),
).run()
4 changes: 2 additions & 2 deletions Examples/Scripts/Python/truth_tracking_kalman.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ def runTruthTrackingKalman(
field = acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T))

runTruthTrackingKalman(
trackingGeometry,
field,
trackingGeometry=trackingGeometry,
field=field,
digiConfigFile=srcdir
/ "Examples/Algorithms/Digitization/share/default-smearing-config-generic.json",
# "thirdparty/OpenDataDetector/config/odd-digi-smearing-config.json",
Expand Down
Loading