Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
particle_gun.py
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file particle_gun.py
1 #!/usr/bin/env python3
2 from pathlib import Path
3 
4 import acts
5 from acts.examples import Sequencer
6 from acts.examples.simulation import addParticleGun, EtaConfig, ParticleConfig
7 
8 
9 def runParticleGun(outputDir, s=None):
10  s = s or Sequencer(events=10, numThreads=-1)
11  s.config.logLevel = acts.logging.INFO
12  outputDir = Path(outputDir)
14  s,
15  EtaConfig(-4.0, 4.0),
16  ParticleConfig(2),
17  outputDirCsv=outputDir / "csv",
18  outputDirRoot=outputDir,
19  printParticles=True,
20  )
21  return s
22 
23 
24 if "__main__" == __name__:
25  runParticleGun(Path.cwd()).run()