Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
full_chain_itk_FTF.py
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file full_chain_itk_FTF.py
1 #!/usr/bin/env python3
2 import pathlib, acts, acts.examples, acts.examples.itk
3 from acts.examples.simulation import (
4  addParticleGun,
5  MomentumConfig,
6  EtaConfig,
7  ParticleConfig,
8  addPythia8,
9  addFatras,
10  ParticleSelectorConfig,
11  addDigitization,
12 )
13 from acts.examples.reconstruction import (
14  addSeeding,
15  SeedingAlgorithm,
16  TruthSeedRanges,
17  addCKFTracks,
18  TrackSelectorConfig,
19  addAmbiguityResolution,
20  AmbiguityResolutionConfig,
21  addVertexFitting,
22  VertexFinder,
23 )
24 
25 ttbar_pu200 = False
26 u = acts.UnitConstants
27 geo_dir = pathlib.Path("acts-itk")
28 outputDir = pathlib.Path.cwd() / "itk_output"
29 # acts.examples.dump_args_calls(locals()) # show acts.examples python binding calls
30 
31 detector, trackingGeometry, decorators = acts.examples.itk.buildITkGeometry(geo_dir)
32 field = acts.examples.MagneticFieldMapXyz(str(geo_dir / "bfield/ATLAS-BField-xyz.root"))
33 rnd = acts.examples.RandomNumbers(seed=42)
34 
35 s = acts.examples.Sequencer(events=100, numThreads=1, outputDir=str(outputDir))
36 
37 if not ttbar_pu200:
39  s,
40  MomentumConfig(1.0 * u.GeV, 10.0 * u.GeV, transverse=True),
41  EtaConfig(-4.0, 4.0, uniform=True),
42  ParticleConfig(2, acts.PdgParticle.eMuon, randomizeCharge=True),
43  rnd=rnd,
44  )
45 else:
46  addPythia8(
47  s,
48  hardProcess=["Top:qqbar2ttbar=on"],
49  npileup=200,
50  vtxGen=acts.examples.GaussianVertexGenerator(
51  stddev=acts.Vector4(0.0125 * u.mm, 0.0125 * u.mm, 55.5 * u.mm, 5.0 * u.ns),
52  mean=acts.Vector4(0, 0, 0, 0),
53  ),
54  rnd=rnd,
55  outputDirRoot=outputDir,
56  )
57 
58 addFatras(
59  s,
60  trackingGeometry,
61  field,
62  rnd=rnd,
63  preSelectParticles=ParticleSelectorConfig(
64  rho=(0.0 * u.mm, 28.0 * u.mm),
65  absZ=(0.0 * u.mm, 1.0 * u.m),
66  eta=(-4.0, 4.0),
67  pt=(150 * u.MeV, None),
68  removeNeutral=True,
69  )
70  if ttbar_pu200
72  outputDirRoot=outputDir,
73 )
74 
76  s,
77  trackingGeometry,
78  field,
79  digiConfigFile=geo_dir
80  / "itk-hgtd/itk-smearing-config.json", # change this file to make it do digitization
81  outputDirRoot=outputDir,
82  rnd=rnd,
83 )
84 
86  s,
87  trackingGeometry,
88  field,
89  TruthSeedRanges(pt=(1.0 * u.GeV, None), eta=(-4.0, 4.0), nHits=(9, None))
90  if ttbar_pu200
91  else TruthSeedRanges(),
92  seedingAlgorithm=SeedingAlgorithm.FTF,
94  acts.examples.itk.InputSpacePointsType.PixelSpacePoints
95  ),
96  geoSelectionConfigFile=geo_dir / "itk-hgtd/geoSelection-ITk.json",
97  layerMappingConfigFile=geo_dir / "itk-hgtd/ACTS_FTF_mapinput.csv",
98  fastrack_inputConfigFile=geo_dir / "itk-hgtd/binTables_ITK_RUN4.txt",
99  outputDirRoot=outputDir,
100 )
101 
102 s.run()