File indexing completed on 2025-08-03 08:09:26
0001 import collections
0002 import argparse
0003 from pathlib import Path
0004
0005 import acts
0006 from acts.examples.odd import getOpenDataDetector
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
0026 parser = argparse.ArgumentParser()
0027 parser.add_argument("outdir")
0028
0029 args = parser.parse_args()
0030
0031 matDeco = acts.IMaterialDecorator.fromFile(
0032 srcdir / "thirdparty/OpenDataDetector/data/odd-material-maps.root",
0033 level=acts.logging.INFO,
0034 )
0035
0036 detector, trackingGeometry, decorators = getOpenDataDetector(matDeco)
0037 setup = PhysmonSetup(
0038 detector=detector,
0039 trackingGeometry=trackingGeometry,
0040 decorators=decorators,
0041 digiConfig=srcdir
0042 / "thirdparty/OpenDataDetector/config/odd-digi-smearing-config.json",
0043 geoSel=srcdir / "thirdparty/OpenDataDetector/config/odd-seeding-config.json",
0044 field=acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T)),
0045 outdir=Path(args.outdir),
0046 )
0047
0048 setup.outdir.mkdir(exist_ok=True)
0049
0050 return setup