-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Physmon for event simulation (#2232)
All our physics monitors depend on the simulation which is not directly monitored at the moment. In this PR I add a first monitoring version for Fatras and Geant4. The monitoring is not optimal yet but should be sufficient if something changes or breaks for simulation. Possible improvements: - record deltas for momenta / eta / phi and so on instead of initial and final Blocked by - #2241 - #2260 - #2262 - #2263 - #2264 - #2265 - #2266
- Loading branch information
Showing
16 changed files
with
320 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,3 @@ checks: | |
threshold: 3 | ||
IntegralCheck: | ||
threshold: 3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
histograms: | ||
"vx|vy": | ||
nbins: 100 | ||
min: -2000.0 | ||
max: 2000.0 | ||
|
||
vz: | ||
nbins: 100 | ||
min: -5000.0 | ||
max: 5000.0 | ||
|
||
vt: | ||
nbins: 100 | ||
min: -30.0 | ||
max: 30.0 | ||
|
||
"p|pt": | ||
nbins: 100 | ||
min: 0 | ||
max: 200.0 | ||
|
||
"px|py|pz": | ||
nbins: 100 | ||
min: -200.0 | ||
max: 200.0 | ||
|
||
eta: | ||
nbins: 100 | ||
min: -3.0 | ||
max: 3.0 | ||
|
||
phi: | ||
nbins: 100 | ||
min: -4.0 | ||
max: 4.0 | ||
|
||
q: | ||
nbins: 100 | ||
min: -2.0 | ||
max: 2.0 | ||
|
||
m: | ||
nbins: 100 | ||
min: 0.0 | ||
max: 0.15 | ||
|
||
exclude: | ||
- event_id | ||
- particle_id | ||
- particle_type | ||
- process | ||
- vertex_primary | ||
- vertex_secondary | ||
- particle | ||
- generation | ||
- sub_particle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
histograms: | ||
"vx|vy|vz": | ||
nbins: 100 | ||
min: -0.1 | ||
max: 0.1 | ||
|
||
vz: | ||
nbins: 100 | ||
min: -200.0 | ||
max: 200.0 | ||
|
||
vt: | ||
nbins: 100 | ||
min: -4.0 | ||
max: 4.0 | ||
|
||
"p|pt": | ||
nbins: 100 | ||
min: 0 | ||
max: 200.0 | ||
|
||
"px|py|pz": | ||
nbins: 100 | ||
min: -200.0 | ||
max: 200.0 | ||
|
||
eta: | ||
nbins: 100 | ||
min: -3.0 | ||
max: 3.0 | ||
|
||
phi: | ||
nbins: 100 | ||
min: -4.0 | ||
max: 4.0 | ||
|
||
q: | ||
nbins: 100 | ||
min: -2.0 | ||
max: 2.0 | ||
|
||
m: | ||
nbins: 100 | ||
min: 0.0 | ||
max: 0.15 | ||
|
||
exclude: | ||
- event_id | ||
- particle_id | ||
- particle_type | ||
- process | ||
- vertex_primary | ||
- vertex_secondary | ||
- particle | ||
- generation | ||
- sub_particle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,6 +168,3 @@ exclude: | |
- majorityParticleId | ||
- multiTraj_nr | ||
- subTraj_nr | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,6 @@ checks: | |
IntegralCheck: | ||
threshold: 3 | ||
|
||
|
||
|
||
|
||
"nStates_*": | ||
KolmogorovTest: null | ||
"nMeasurements_*": | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import tempfile | ||
from pathlib import Path | ||
import shutil | ||
|
||
import acts | ||
from acts.examples.simulation import ( | ||
addFatras, | ||
addGeant4, | ||
ParticleSelectorConfig, | ||
) | ||
|
||
from physmon_common import makeSetup | ||
|
||
u = acts.UnitConstants | ||
|
||
setup = makeSetup() | ||
|
||
|
||
with tempfile.TemporaryDirectory() as temp: | ||
tp = Path(temp) | ||
|
||
rnd = acts.examples.RandomNumbers(seed=42) | ||
|
||
s = acts.examples.Sequencer( | ||
events=1000, | ||
numThreads=1, | ||
logLevel=acts.logging.INFO, | ||
fpeMasks=acts.examples.Sequencer.FpeMask.fromFile( | ||
Path(__file__).parent.parent / "fpe_masks.yml" | ||
), | ||
) | ||
|
||
for d in setup.decorators: | ||
s.addContextDecorator(d) | ||
|
||
s.addReader( | ||
acts.examples.EventGenerator( | ||
level=acts.logging.INFO, | ||
generators=[ | ||
acts.examples.EventGenerator.Generator( | ||
multiplicity=acts.examples.FixedMultiplicityGenerator(n=1), | ||
vertex=acts.examples.GaussianVertexGenerator( | ||
mean=acts.Vector4(0, 0, 0, 0), | ||
stddev=acts.Vector4(10 * u.um, 10 * u.um, 50 * u.mm, 1 * u.ns), | ||
), | ||
particles=acts.examples.ParametricParticleGenerator( | ||
p=(1 * u.GeV, 100 * u.GeV), | ||
pTransverse=True, | ||
eta=(-3.0, 3.0), | ||
phi=(0.0 * u.degree, 360.0 * u.degree), | ||
pdg=pdg, | ||
randomizeCharge=True, | ||
), | ||
) | ||
for pdg in [ | ||
acts.PdgParticle.eMuon, | ||
acts.PdgParticle.ePionPlus, | ||
acts.PdgParticle.eElectron, | ||
] | ||
], | ||
outputParticles="particles_input", | ||
randomNumbers=rnd, | ||
) | ||
) | ||
|
||
addFatras( | ||
s, | ||
setup.trackingGeometry, | ||
setup.field, | ||
rnd, | ||
enableInteractions=True, | ||
preSelectParticles=None, | ||
postSelectParticles=ParticleSelectorConfig(removeSecondaries=True), | ||
inputParticles="particles_input", | ||
outputParticlesInitial="particles_initial_fatras", | ||
outputParticlesFinal="particles_final_fatras", | ||
outputSimHits="simhits_fatras", | ||
outputDirRoot=tp / "fatras", | ||
) | ||
|
||
addGeant4( | ||
s, | ||
setup.detector, | ||
setup.trackingGeometry, | ||
setup.field, | ||
rnd, | ||
preSelectParticles=None, | ||
postSelectParticles=ParticleSelectorConfig(removeSecondaries=True), | ||
killVolume=setup.trackingGeometry.worldVolume, | ||
killAfterTime=25 * u.ns, | ||
killSecondaries=True, | ||
inputParticles="particles_input", | ||
outputParticlesInitial="particles_initial_geant4", | ||
outputParticlesFinal="particles_final_geant4", | ||
outputSimHits="simhits_geant4", | ||
outputDirRoot=tp / "geant4", | ||
) | ||
|
||
s.run() | ||
del s | ||
|
||
for file, name in [ | ||
(tp / "fatras" / "particles_initial.root", "particles_initial_fatras.root"), | ||
(tp / "fatras" / "particles_final.root", "particles_final_fatras.root"), | ||
(tp / "geant4" / "particles_initial.root", "particles_initial_geant4.root"), | ||
(tp / "geant4" / "particles_final.root", "particles_final_geant4.root"), | ||
]: | ||
assert file.exists(), "file not found" | ||
shutil.copy(file, setup.outdir / name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.