Skip to content

Commit

Permalink
refactor: Tweak full_chain_odd.py (acts-project#3035)
Browse files Browse the repository at this point in the history
- shuffle imports
- shuffle constants
- output directory argparse parameter
  • Loading branch information
andiwand authored and dimitra97 committed Mar 19, 2024
1 parent e41f5e2 commit 298e3ab
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions Examples/Scripts/Python/full_chain_odd.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env python3
import os, argparse, pathlib, acts, acts.examples

import os
import argparse
import pathlib

import acts
import acts.examples
from acts.examples.simulation import (
addParticleGun,
MomentumConfig,
Expand Down Expand Up @@ -29,12 +35,20 @@
)
from common import getOpenDataDetectorDirectory
from acts.examples.odd import getOpenDataDetector
import acts.examples.edm4hep

parser = argparse.ArgumentParser(description="Full chain with the OpenDataDetector")

parser.add_argument("--events", "-n", help="Number of events", type=int, default=100)
u = acts.UnitConstants


parser = argparse.ArgumentParser(description="Full chain with the OpenDataDetector")
parser.add_argument(
"--output",
"-o",
help="Output directory",
type=pathlib.Path,
default=pathlib.Path.cwd() / "odd_output",
)
parser.add_argument("--events", "-n", help="Number of events", type=int, default=100)
parser.add_argument("--skip", "-s", help="Number of events", type=int, default=0)
parser.add_argument("--edm4hep", help="Use edm4hep inputs", type=pathlib.Path)
parser.add_argument(
Expand All @@ -58,13 +72,12 @@

args = vars(parser.parse_args())

outputDir = args["output"]
ttbar = args["ttbar"]
g4_simulation = args["geant4"]
ambiguity_MLSolver = args["MLSolver"]
seedFilter_ML = args["MLSeedFilter"]
u = acts.UnitConstants
geoDir = getOpenDataDetectorDirectory()
outputDir = pathlib.Path.cwd() / "odd_output"
# acts.examples.dump_args_calls(locals()) # show python binding calls

oddMaterialMap = geoDir / "data/odd-material-maps.root"
Expand All @@ -86,6 +99,8 @@
)

if args["edm4hep"]:
import acts.examples.edm4hep

edm4hepReader = acts.examples.edm4hep.EDM4hepReader(
inputPath=str(args["edm4hep"]),
inputSimHits=[
Expand Down

0 comments on commit 298e3ab

Please sign in to comment.