Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fatras.py
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file fatras.py
1 #!/usr/bin/env python3
2 from pathlib import Path
3 
4 import acts
5 import acts.examples
6 from acts.examples.simulation import addParticleGun, addFatras, EtaConfig
7 
8 u = acts.UnitConstants
9 
10 
11 def runFatras(trackingGeometry, field, outputDir, s: acts.examples.Sequencer = None):
12  s = s or acts.examples.Sequencer(events=100, numThreads=-1)
13  s.config.logLevel = acts.logging.INFO
14  rnd = acts.examples.RandomNumbers()
16  s,
17  EtaConfig(-2.0, 2.0),
18  rnd=rnd,
19  )
20  outputDir = Path(outputDir)
21  addFatras(
22  s,
23  trackingGeometry,
24  field,
25  outputDirCsv=outputDir / "csv",
26  outputDirRoot=outputDir,
27  rnd=rnd,
28  )
29  return s
30 
31 
32 if "__main__" == __name__:
33  gdc = acts.examples.GenericDetector.Config()
34  detector = acts.examples.GenericDetector()
35  trackingGeometry, contextDecorators = detector.finalize(gdc, None)
36 
37  field = acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T))
38 
39  runFatras(trackingGeometry, field, Path.cwd()).run()