Skip to content

Commit

Permalink
refactor: physmon vertexing (#1688)
Browse files Browse the repository at this point in the history
rearranges vertexing code in physmon a little
  • Loading branch information
andiwand authored Jan 24, 2023
1 parent 7a3761d commit 03498c5
Showing 1 changed file with 23 additions and 28 deletions.
51 changes: 23 additions & 28 deletions CI/physmon/physmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from acts.examples.odd import getOpenDataDetector
from acts.examples.simulation import (
addParticleGun,
MomentumConfig,
EtaConfig,
PhiConfig,
ParticleConfig,
Expand Down Expand Up @@ -121,27 +122,27 @@ def truth_tracking_gsf():


def run_ckf_tracking(truthSmearedSeeded, truthEstimatedSeeded, label):
s = acts.examples.Sequencer(events=500, numThreads=-1, logLevel=acts.logging.INFO)

with tempfile.TemporaryDirectory() as temp:
s = acts.examples.Sequencer(
events=500, numThreads=-1, logLevel=acts.logging.INFO
)

tp = Path(temp)

for d in decorators:
s.addContextDecorator(d)

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

vtxGen = acts.examples.GaussianVertexGenerator(
stddev=acts.Vector4(10 * u.um, 10 * u.um, 50 * u.mm, 0),
mean=acts.Vector4(0, 0, 0, 0),
)

addParticleGun(
s,
EtaConfig(-4.0, 4.0),
ParticleConfig(4, acts.PdgParticle.eMuon, True),
PhiConfig(0.0, 360.0 * u.degree),
vtxGen=vtxGen,
vtxGen=acts.examples.GaussianVertexGenerator(
stddev=acts.Vector4(10 * u.um, 10 * u.um, 50 * u.mm, 0),
mean=acts.Vector4(0, 0, 0, 0),
),
multiplicity=50,
rnd=rnd,
)
Expand Down Expand Up @@ -205,7 +206,6 @@ def run_ckf_tracking(truthSmearedSeeded, truthEstimatedSeeded, label):
pt=(500 * u.MeV, None),
),
outputDirRoot=tp,
outputDirCsv=None,
)

if label in ["seeded", "orthogonal"]:
Expand Down Expand Up @@ -242,29 +242,27 @@ def run_ckf_tracking(truthSmearedSeeded, truthEstimatedSeeded, label):


def run_vertexing(fitter, mu, events):
s = acts.examples.Sequencer(
events=events, numThreads=-1, logLevel=acts.logging.INFO
)

with tempfile.TemporaryDirectory() as temp:
s = acts.examples.Sequencer(
events=events, numThreads=-1, logLevel=acts.logging.INFO
)

tp = Path(temp)

for d in decorators:
s.addContextDecorator(d)

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

vtxGen = acts.examples.GaussianVertexGenerator(
stddev=acts.Vector4(10 * u.um, 10 * u.um, 50 * u.mm, 0),
mean=acts.Vector4(0, 0, 0, 0),
)

addParticleGun(
s,
EtaConfig(-4.0, 4.0),
ParticleConfig(4, acts.PdgParticle.eMuon, True),
PhiConfig(0.0, 360.0 * u.degree),
vtxGen=vtxGen,
MomentumConfig(1.0 * u.GeV, 10.0 * u.GeV, transverse=True),
EtaConfig(-3.0, 3.0),
ParticleConfig(4, acts.PdgParticle.eMuon, randomizeCharge=True),
vtxGen=acts.examples.GaussianVertexGenerator(
stddev=acts.Vector4(10 * u.um, 10 * u.um, 50 * u.mm, 0),
mean=acts.Vector4(0, 0, 0, 0),
),
multiplicity=mu,
rnd=rnd,
)
Expand Down Expand Up @@ -308,7 +306,6 @@ def run_vertexing(fitter, mu, events):
seedingAlgorithm=SeedingAlgorithm.Default,
geoSelectionConfigFile=geoSel,
rnd=rnd, # only used by SeedingAlgorithm.TruthSmeared
outputDirRoot=None,
)

addCKFTracks(
Expand All @@ -317,19 +314,17 @@ def run_vertexing(fitter, mu, events):
field,
CKFPerformanceConfig(ptMin=400.0 * u.MeV, nMeasurementsMin=6),
TrackSelectorRanges(
removeNeutral=True,
loc0=(None, 4.0 * u.mm),
pt=(500 * u.MeV, None),
loc0=(-4.0 * u.mm, 4.0 * u.mm),
absEta=(None, 3.0),
removeNeutral=True,
),
outputDirRoot=None,
outputDirCsv=None,
)

addAmbiguityResolution(
s,
AmbiguityResolutionConfig(maximumSharedHits=3),
CKFPerformanceConfig(ptMin=400.0 * u.MeV, nMeasurementsMin=6),
outputDirRoot=None,
)

addVertexFitting(
Expand Down

0 comments on commit 03498c5

Please sign in to comment.