File indexing completed on 2025-08-05 08:10:07
0001 import pytest
0002
0003 from acts.examples import (
0004 AdaptiveMultiVertexFinderAlgorithm,
0005 VertexFitterAlgorithm,
0006 IterativeVertexFinderAlgorithm,
0007 SpacePointMaker,
0008 TrackFindingAlgorithm,
0009 SeedingAlgorithm,
0010 TrackParamsEstimationAlgorithm,
0011 EventGenerator,
0012 FatrasSimulation,
0013 MaterialMapping,
0014 TruthSeedSelector,
0015 TruthTrackFinder,
0016 ParticleSelector,
0017 TruthVertexFinder,
0018 ParticleSmearing,
0019 TrackSelectorAlgorithm,
0020 TrackFittingAlgorithm,
0021 SurfaceSortingAlgorithm,
0022 ParticlesPrinter,
0023 HitsPrinter,
0024 TrackParametersPrinter,
0025 PropagationAlgorithm,
0026 DigitizationAlgorithm,
0027 PlanarSteppingAlgorithm,
0028 )
0029
0030
0031 from helpers import geant4Enabled, hepmc3Enabled
0032
0033
0034 @pytest.mark.parametrize(
0035 "alg",
0036 [
0037 AdaptiveMultiVertexFinderAlgorithm,
0038 VertexFitterAlgorithm,
0039 IterativeVertexFinderAlgorithm,
0040 SpacePointMaker,
0041 TrackFindingAlgorithm,
0042 SeedingAlgorithm,
0043 TrackParamsEstimationAlgorithm,
0044 EventGenerator,
0045 FatrasSimulation,
0046 MaterialMapping,
0047 TruthSeedSelector,
0048 TruthTrackFinder,
0049 ParticleSelector,
0050 TruthVertexFinder,
0051 ParticleSmearing,
0052 TrackSelectorAlgorithm,
0053 TrackFittingAlgorithm,
0054 SurfaceSortingAlgorithm,
0055 ParticlesPrinter,
0056 HitsPrinter,
0057 TrackParametersPrinter,
0058 PropagationAlgorithm,
0059
0060 PlanarSteppingAlgorithm,
0061
0062 ],
0063 )
0064 def test_algorithm_interface(alg):
0065 assert hasattr(alg, "Config")
0066
0067
0068 @pytest.mark.skipif(not geant4Enabled, reason="Geant4 not set up")
0069 @pytest.mark.skipif(not hepmc3Enabled, reason="HepMC3 not set up")
0070 def test_g4_algorithms():
0071 from acts.examples.geant4.hepmc3 import EventRecording
0072 from acts.examples.geant4 import Geant4Simulation
0073
0074 for alg in (EventRecording, Geant4Simulation):
0075 assert hasattr(alg, "Config")
0076
0077
0078 @pytest.mark.skipif(not hepmc3Enabled, reason="HepMC3 not set up")
0079 def test_hepmc_algorithms():
0080 from acts.examples.hepmc3 import HepMCProcessExtractor
0081
0082 assert hasattr(HepMCProcessExtractor, "Config")
0083
0084
0085 def test_special_algorithm_interfaces():
0086
0087 assert DigitizationAlgorithm