File indexing completed on 2025-12-16 09:22:12
0001 import collections
0002 import argparse
0003 from pathlib import Path
0004
0005 import acts
0006 from acts.examples.odd import getOpenDataDetector, getOpenDataDetectorDirectory
0007
0008 PhysmonSetup = collections.namedtuple(
0009 "Setup",
0010 [
0011 "detector",
0012 "trackingGeometry",
0013 "decorators",
0014 "field",
0015 "digiConfig",
0016 "geoSel",
0017 "outdir",
0018 ],
0019 )
0020
0021
0022 def makeSetup() -> PhysmonSetup:
0023 u = acts.UnitConstants
0024 srcdir = Path(__file__).resolve().parent.parent.parent
0025 odd_dir = getOpenDataDetectorDirectory()
0026
0027 parser = argparse.ArgumentParser()
0028 parser.add_argument("outdir")
0029
0030 args = parser.parse_args()
0031
0032 matDeco = acts.IMaterialDecorator.fromFile(
0033 odd_dir / "data/odd-material-maps.root", level=acts.logging.INFO
0034 )
0035
0036 detector = getOpenDataDetector(matDeco)
0037 trackingGeometry = detector.trackingGeometry()
0038 decorators = detector.contextDecorators()
0039 setup = PhysmonSetup(
0040 detector=detector,
0041 trackingGeometry=trackingGeometry,
0042 decorators=decorators,
0043 digiConfig=srcdir / "Examples/Configs/odd-digi-smearing-config.json",
0044 geoSel=srcdir / "Examples/Configs/odd-seeding-config.json",
0045 field=acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T)),
0046 outdir=Path(args.outdir),
0047 )
0048
0049 setup.outdir.mkdir(exist_ok=True)
0050
0051 return setup