Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:12:08

0001 #!/usr/bin/env python3
0002 from pathlib import Path
0003 
0004 import acts
0005 import acts.examples
0006 from acts.examples.simulation import addParticleGun, addFatras, EtaConfig
0007 
0008 u = acts.UnitConstants
0009 
0010 
0011 def runFatras(trackingGeometry, field, outputDir, s: acts.examples.Sequencer = None):
0012     s = s or acts.examples.Sequencer(events=100, numThreads=-1)
0013     s.config.logLevel = acts.logging.INFO
0014     rnd = acts.examples.RandomNumbers()
0015     addParticleGun(
0016         s,
0017         EtaConfig(-2.0, 2.0),
0018         rnd=rnd,
0019     )
0020     outputDir = Path(outputDir)
0021     addFatras(
0022         s,
0023         trackingGeometry,
0024         field,
0025         outputDirCsv=outputDir / "csv",
0026         outputDirRoot=outputDir,
0027         rnd=rnd,
0028     )
0029     return s
0030 
0031 
0032 if "__main__" == __name__:
0033     gdc = acts.examples.GenericDetector.Config()
0034     gd = acts.examples.GenericDetector(gdc)
0035     trackingGeometry, decorators, _ = gd.trackingGeometry()
0036 
0037     field = acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T))
0038 
0039     runFatras(trackingGeometry, field, Path.cwd()).run()