Skip to content

Commit

Permalink
refactor: Remove pythia8 prefix from root files in Examples (#3798)
Browse files Browse the repository at this point in the history
I don't think this is useful and I always have to deal with this downstream
  • Loading branch information
andiwand authored Nov 1, 2024
1 parent 37f541d commit 4893a20
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
13 changes: 11 additions & 2 deletions CI/physmon/workflows/physmon_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@
)
)

s.addWriter(
acts.examples.RootParticleWriter(
level=acts.logging.INFO,
inputParticles="particles_input",
filePath=tp / "particles.root",
)
)

addFatras(
s,
setup.trackingGeometry,
Expand Down Expand Up @@ -100,6 +108,7 @@
s.run()

for file, name in [
(tp / "particles.root", "particles_gun.root"),
(tp / "fatras" / "particles_simulation.root", "particles_fatras.root"),
(tp / "geant4" / "particles_simulation.root", "particles_geant4.root"),
]:
Expand Down Expand Up @@ -135,8 +144,8 @@
s.run()

for file, name in [
(tp / "pythia8_particles.root", "particles_ttbar.root"),
(tp / "pythia8_vertices.root", "vertices_ttbar.root"),
(tp / "particles.root", "particles_ttbar.root"),
(tp / "vertices.root", "vertices_ttbar.root"),
]:
assert file.exists(), "file not found"
shutil.copy(file, setup.outdir / name)
4 changes: 2 additions & 2 deletions Examples/Python/python/acts/examples/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,15 +335,15 @@ def addPythia8(
acts.examples.RootParticleWriter(
level=customLogLevel(),
inputParticles=evGen.config.outputParticles,
filePath=str(outputDirRoot / "pythia8_particles.root"),
filePath=str(outputDirRoot / "particles.root"),
)
)

s.addWriter(
acts.examples.RootVertexWriter(
level=customLogLevel(),
inputVertices=evGen.config.outputVertices,
filePath=str(outputDirRoot / "pythia8_vertices.root"),
filePath=str(outputDirRoot / "vertices.root"),
)
)

Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/tests/root_file_hashes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
test_pythia8__pythia8_particles.root: 91c852f3e0e20bcd382c616a7b643985d092decd42bdd653deae67ed8652e8d8
test_pythia8__particles.root: 91c852f3e0e20bcd382c616a7b643985d092decd42bdd653deae67ed8652e8d8
test_fatras__particles_simulation.root: bc970873fef0c2efd86ed5413623802353d2cd04abea72de14e8cdfc0e40076f
test_fatras__hits.root: 6e4beb045fa1712c4d14c280ba33c3fa13e4aff9de88d55c3e32f62ad226f724
test_geant4__particles_simulation.root: 49926c71a9b54e13aa1cc7596d3302baf3c87d8e2c1d0267cb4523f6abdc0ac2
Expand Down
4 changes: 2 additions & 2 deletions Examples/Python/tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ def test_pythia8(tmp_path, seq, assert_root_hash):

(tmp_path / "csv").mkdir()

assert not (tmp_path / "pythia8_particles.root").exists()
assert not (tmp_path / "particles.root").exists()
assert len(list((tmp_path / "csv").iterdir())) == 0

events = seq.config.events

runPythia8(str(tmp_path), outputRoot=True, outputCsv=True, s=seq).run()

fp = tmp_path / "pythia8_particles.root"
fp = tmp_path / "particles.root"
assert fp.exists()
assert fp.stat().st_size > 2**10 * 50
assert_entries(fp, "particles", events)
Expand Down
2 changes: 1 addition & 1 deletion Examples/Scripts/Optimization/ckf.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def runCKFTracks(

field = acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T))

inputParticlePath = Path(Inputdir) / "pythia8_particles.root"
inputParticlePath = Path(Inputdir) / "particles.root"
if not inputParticlePath.exists():
inputParticlePath = None

Expand Down

0 comments on commit 4893a20

Please sign in to comment.