2 from pathlib
import Path
3 from typing
import Optional, Union
7 from acts
import UnitConstants
as u
10 if "__main__" == __name__:
13 from digitization
import runDigitization
16 backend = ExaTrkXBackend.Torch
18 if "onnx" in sys.argv:
19 backend = ExaTrkXBackend.Onnx
20 if "torch" in sys.argv:
21 backend = ExaTrkXBackend.Torch
23 srcdir = Path(__file__).resolve().parent.parent.parent.parent
25 detector, trackingGeometry, decorators = acts.examples.GenericDetector.create()
27 field = acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T))
29 inputParticlePath = Path(
"particles.root")
30 if not inputParticlePath.exists():
31 inputParticlePath =
None
33 srcdir = Path(__file__).resolve().parent.parent.parent.parent
37 /
"Examples/Algorithms/TrackFinding/share/geoSelection-genericDetector.json"
39 assert geometrySelection.exists()
43 /
"Examples/Algorithms/Digitization/share/default-smearing-config-generic.json"
45 assert digiConfigFile.exists()
47 if backend == ExaTrkXBackend.Torch:
48 modelDir = Path.cwd() /
"torchscript_models"
49 assert (modelDir /
"embed.pt").
exists()
50 assert (modelDir /
"filter.pt").
exists()
51 assert (modelDir /
"gnn.pt").
exists()
53 modelDir = Path.cwd() /
"onnx_models"
54 assert (modelDir /
"embedding.onnx").
exists()
55 assert (modelDir /
"filtering.onnx").
exists()
56 assert (modelDir /
"gnn.onnx").
exists()
59 s.config.logLevel = acts.logging.INFO
61 rnd = acts.examples.RandomNumbers()
62 outputDir = Path(os.getcwd())
68 digiConfigFile=digiConfigFile,
69 particlesInput=inputParticlePath,