Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
physmon_common.py
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file physmon_common.py
1 import collections
2 import argparse
3 from pathlib import Path
4 
5 import acts
6 
7 from common import getOpenDataDetectorDirectory
8 from acts.examples.odd import getOpenDataDetector
9 
10 PhysmonSetup = collections.namedtuple(
11  "Setup",
12  [
13  "detector",
14  "trackingGeometry",
15  "decorators",
16  "field",
17  "digiConfig",
18  "geoSel",
19  "outdir",
20  ],
21 )
22 
23 
24 def makeSetup() -> PhysmonSetup:
25  u = acts.UnitConstants
26  srcdir = Path(__file__).resolve().parent.parent.parent
27 
28  parser = argparse.ArgumentParser()
29  parser.add_argument("outdir")
30 
31  args = parser.parse_args()
32 
33  matDeco = acts.IMaterialDecorator.fromFile(
34  srcdir / "thirdparty/OpenDataDetector/data/odd-material-maps.root",
35  level=acts.logging.INFO,
36  )
37 
38  detector, trackingGeometry, decorators = getOpenDataDetector(
40  )
41  setup = PhysmonSetup(
42  detector=detector,
43  trackingGeometry=trackingGeometry,
44  decorators=decorators,
45  digiConfig=srcdir
46  / "thirdparty/OpenDataDetector/config/odd-digi-smearing-config.json",
47  geoSel=srcdir / "thirdparty/OpenDataDetector/config/odd-seeding-config.json",
48  field=acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T)),
49  outdir=Path(args.outdir),
50  )
51 
52  setup.outdir.mkdir(exist_ok=True)
53 
54  return setup