4 from pathlib
import Path
19 outputName=
"propagation-material",
20 dumpPropagationSteps=
False,
23 s = s
or Sequencer(events=1000, numThreads=-1)
25 for decorator
in decorators:
26 s.addContextDecorator(decorator)
29 trackingGeometry=trackingGeometry,
30 resolveSensitive=
True,
36 stepper = acts.EigenStepper(field)
40 alg = acts.examples.PropagationAlgorithm(
42 level=acts.logging.INFO,
43 randomNumberSvc=acts.examples.RandomNumbers(),
46 recordMaterialInteractions=
True,
54 RootMaterialTrackWriter(
55 level=acts.logging.INFO,
56 collection=alg.config.propagationMaterialCollection,
57 filePath=os.path.join(outputDir, (outputName +
".root")),
63 if dumpPropagationSteps:
65 acts.examples.RootPropagationStepsWriter(
66 level=acts.logging.INFO,
67 collection=alg.config.propagationStepCollection,
68 filePath=outputDir +
"/propagation_steps.root",
75 if "__main__" == __name__:
76 p = argparse.ArgumentParser(
77 description=
"Script to run material validation on ITk geometry"
81 help=
"Input directory containing the ITk standalone geometry. Get in touch if you don't have this.",
83 p.add_argument(
"--material", type=str, default=
"", help=
"Material file")
87 geo_example_dir = Path(args.geo_dir)
88 assert geo_example_dir.exists(),
"Detector example input directory missing"
89 assert os.path.exists(
91 ),
"Invalid file path/name in --material. Please check your input!"
96 geo_example_dir, customMaterialFile=args.material
99 field = acts.ConstantBField(acts.Vector3(0, 0, 2 * acts.UnitConstants.T))
102 trackingGeometry, decorators, field, outputDir=os.getcwd()