Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:13: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 = 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
0044         / "thirdparty/OpenDataDetector/config/odd-digi-smearing-config.json",
0045         geoSel=srcdir / "thirdparty/OpenDataDetector/config/odd-seeding-config.json",
0046         field=acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T)),
0047         outdir=Path(args.outdir),
0048     )
0049 
0050     setup.outdir.mkdir(exist_ok=True)
0051 
0052     return setup