File indexing completed on 2025-01-18 09:12:08
0001
0002 import pathlib, acts, acts.examples, acts.examples.itk
0003 from acts.examples.simulation import (
0004 addParticleGun,
0005 MomentumConfig,
0006 EtaConfig,
0007 ParticleConfig,
0008 ParticleSelectorConfig,
0009 addPythia8,
0010 addFatras,
0011 ParticleSelectorConfig,
0012 addDigitization,
0013 )
0014 from acts.examples.reconstruction import (
0015 addSeeding,
0016 SeedingAlgorithm,
0017 addCKFTracks,
0018 TrackSelectorConfig,
0019 )
0020
0021 ttbar_pu200 = False
0022 u = acts.UnitConstants
0023 geo_dir = pathlib.Path("acts-itk")
0024 outputDir = pathlib.Path.cwd() / "itk_output"
0025
0026
0027 detector, trackingGeometry, decorators = acts.examples.itk.buildITkGeometry(geo_dir)
0028 field = acts.examples.MagneticFieldMapXyz(str(geo_dir / "bfield/ATLAS-BField-xyz.root"))
0029 rnd = acts.examples.RandomNumbers(seed=42)
0030
0031 s = acts.examples.Sequencer(events=100, numThreads=1, outputDir=str(outputDir))
0032
0033 if not ttbar_pu200:
0034 addParticleGun(
0035 s,
0036 MomentumConfig(1.0 * u.GeV, 10.0 * u.GeV, transverse=True),
0037 EtaConfig(-4.0, 4.0, uniform=True),
0038 ParticleConfig(2, acts.PdgParticle.eMuon, randomizeCharge=True),
0039 rnd=rnd,
0040 )
0041 else:
0042 addPythia8(
0043 s,
0044 hardProcess=["Top:qqbar2ttbar=on"],
0045 npileup=200,
0046 vtxGen=acts.examples.GaussianVertexGenerator(
0047 stddev=acts.Vector4(0.0125 * u.mm, 0.0125 * u.mm, 55.5 * u.mm, 5.0 * u.ns),
0048 mean=acts.Vector4(0, 0, 0, 0),
0049 ),
0050 rnd=rnd,
0051 outputDirRoot=outputDir,
0052 )
0053
0054 addFatras(
0055 s,
0056 trackingGeometry,
0057 field,
0058 rnd=rnd,
0059 preSelectParticles=(
0060 ParticleSelectorConfig(
0061 rho=(0.0 * u.mm, 28.0 * u.mm),
0062 absZ=(0.0 * u.mm, 1.0 * u.m),
0063 eta=(-4.0, 4.0),
0064 pt=(150 * u.MeV, None),
0065 )
0066 if ttbar_pu200
0067 else ParticleSelectorConfig()
0068 ),
0069 postSelectParticles=ParticleSelectorConfig(
0070 pt=(1.0 * u.GeV, None),
0071 eta=(-4.0, 4.0),
0072 hits=(9, None),
0073 removeNeutral=True,
0074 ),
0075 outputDirRoot=outputDir,
0076 )
0077
0078 addDigitization(
0079 s,
0080 trackingGeometry,
0081 field,
0082 digiConfigFile=geo_dir
0083 / "itk-hgtd/itk-smearing-config.json",
0084 outputDirRoot=outputDir,
0085 rnd=rnd,
0086 )
0087
0088 addSeeding(
0089 s,
0090 trackingGeometry,
0091 field,
0092 seedingAlgorithm=SeedingAlgorithm.Gbts,
0093 *acts.examples.itk.itkSeedingAlgConfig(
0094 acts.examples.itk.InputSpacePointsType.PixelSpacePoints
0095 ),
0096 geoSelectionConfigFile=geo_dir / "itk-hgtd/geoSelection-ITk.json",
0097 layerMappingConfigFile=geo_dir / "itk-hgtd/ACTS_FTF_mapinput.csv",
0098 connector_inputConfigFile=geo_dir / "itk-hgtd/binTables_ITK_RUN4.txt",
0099 outputDirRoot=outputDir,
0100 )
0101
0102 addCKFTracks(
0103 s,
0104 trackingGeometry,
0105 field,
0106 TrackSelectorConfig(
0107 pt=(1.0 * u.GeV if ttbar_pu200 else 0.0, None),
0108 absEta=(None, 4.0),
0109 nMeasurementsMin=6,
0110 ),
0111 outputDirRoot=outputDir,
0112 )
0113
0114
0115 s.run()