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

ci: Pull more config into physmon script, extend PG eta range to +-4 #1320

Merged
merged 4 commits into from
Jul 12, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 83 additions & 12 deletions CI/physmon/physmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,19 @@
acts.logging.setFailureThreshold(acts.logging.FATAL)

from truth_tracking_kalman import runTruthTrackingKalman
from ckf_tracks import runCKFTracks
from ckf_tracks import addCKFTracks, CKFPerformanceConfig
from fatras import addFatras
from digitization import addDigitization
from particle_gun import addParticleGun, EtaConfig, PhiConfig, ParticleConfig
from seeding import (
addSeeding,
TruthSeedRanges,
ParticleSmearingSigmas,
SeedfinderConfigArg,
SeedingAlgorithm,
TrackParamsEstimationConfig,
)

from common import getOpenDataDetector

parser = argparse.ArgumentParser()
Expand Down Expand Up @@ -71,7 +83,9 @@
shutil.copy(perf_file, outdir / "performance_truth_tracking.root")


for truthSmeared, truthEstimated, label in [
### CKF track finding variations

for truthSmearedSeeded, truthEstimatedSeeded, label in [
(True, False, "truth_smeared"), # if first is true, second is ignored
(False, True, "truth_estimated"),
(False, False, "seeded"),
Expand All @@ -82,17 +96,74 @@

with tempfile.TemporaryDirectory() as temp:
tp = Path(temp)
runCKFTracks(

for d in decorators:
s.addContextDecorator(d)

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

s = addParticleGun(
andiwand marked this conversation as resolved.
Show resolved Hide resolved
s,
EtaConfig(-4.0, 4.0),
ParticleConfig(4, acts.PdgParticle.eMuon, True),
PhiConfig(0.0, 360.0 * u.degree),
multiplicity=2,
rnd=rnd,
)

s = addFatras(
s,
trackingGeometry,
decorators=decorators,
field=field,
field,
rnd=rnd,
)

s = addDigitization(
s,
trackingGeometry,
field,
digiConfigFile=digiConfig,
geometrySelection=geoSel,
outputDir=tp,
outputCsv=False,
truthSmearedSeeded=truthSmeared,
truthEstimatedSeeded=truthEstimated,
s=s,
rnd=rnd,
)

s = addSeeding(
s,
trackingGeometry,
field,
TruthSeedRanges(pt=(500.0 * u.MeV, None), nHits=(9, None)),
ParticleSmearingSigmas(
pRel=0.01
), # only used by SeedingAlgorithm.TruthSmeared
SeedfinderConfigArg(
r=(None, 200 * u.mm), # rMin=default, 33mm
deltaR=(1 * u.mm, 60 * u.mm),
collisionRegion=(-250 * u.mm, 250 * u.mm),
z=(-2000 * u.mm, 2000 * u.mm),
maxSeedsPerSpM=1,
sigmaScattering=50,
radLengthPerSeed=0.1,
minPt=500 * u.MeV,
bFieldInZ=1.99724 * u.T,
impactMax=3 * u.mm,
),
TrackParamsEstimationConfig(deltaR=(10.0 * u.mm, None)),
seedingAlgorithm=SeedingAlgorithm.TruthSmeared
if truthSmearedSeeded
else SeedingAlgorithm.TruthEstimated
if truthEstimatedSeeded
else SeedingAlgorithm.Default,
geoSelectionConfigFile=geoSel,
outputDirRoot=tp,
rnd=rnd, # only used by SeedingAlgorithm.TruthSmeared
)

s = addCKFTracks(
s,
trackingGeometry,
field,
CKFPerformanceConfig(ptMin=400.0 * u.MeV, nMeasurementsMin=6),
outputDirRoot=tp,
outputDirCsv=None,
)

s.run()
Expand All @@ -102,7 +173,7 @@
assert perf_file.exists(), "Performance file not found"
shutil.copy(perf_file, outdir / f"performance_ckf_tracks_{label}.root")

if not truthSmeared and not truthEstimated:
if not truthSmearedSeeded and not truthEstimatedSeeded:
residual_app = srcdir / "build/bin/ActsAnalysisResidualsAndPulls"
# @TODO: Add try/except
subprocess.check_call(
Expand Down