Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-08 09:23:12

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