File indexing completed on 2025-01-30 09:14:56
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 TruthTrackFinder,
0015 ParticleSelector,
0016 TruthVertexFinder,
0017 TrackParameterSmearing,
0018 TrackSelectorAlgorithm,
0019 TrackFittingAlgorithm,
0020 ParticlesPrinter,
0021 TrackParametersPrinter,
0022 PropagationAlgorithm,
0023 DigitizationAlgorithm,
0024 )
0025
0026
0027 from helpers import geant4Enabled, hepmc3Enabled
0028
0029
0030 @pytest.mark.parametrize(
0031 "alg",
0032 [
0033 AdaptiveMultiVertexFinderAlgorithm,
0034 VertexFitterAlgorithm,
0035 IterativeVertexFinderAlgorithm,
0036 SpacePointMaker,
0037 TrackFindingAlgorithm,
0038 SeedingAlgorithm,
0039 TrackParamsEstimationAlgorithm,
0040 EventGenerator,
0041 FatrasSimulation,
0042 MaterialMapping,
0043 TruthTrackFinder,
0044 ParticleSelector,
0045 TruthVertexFinder,
0046 TrackParameterSmearing,
0047 TrackSelectorAlgorithm,
0048 TrackFittingAlgorithm,
0049 ParticlesPrinter,
0050 TrackParametersPrinter,
0051 PropagationAlgorithm,
0052
0053
0054 ],
0055 )
0056 def test_algorithm_interface(alg):
0057 assert hasattr(alg, "Config")
0058
0059
0060 @pytest.mark.skipif(not geant4Enabled, reason="Geant4 not set up")
0061 @pytest.mark.skipif(not hepmc3Enabled, reason="HepMC3 not set up")
0062 def test_g4_algorithms():
0063 from acts.examples.geant4.hepmc3 import EventRecording
0064 from acts.examples.geant4 import Geant4Simulation
0065
0066 for alg in (EventRecording, Geant4Simulation):
0067 assert hasattr(alg, "Config")
0068
0069
0070 @pytest.mark.skipif(not hepmc3Enabled, reason="HepMC3 not set up")
0071 def test_hepmc_algorithms():
0072 from acts.examples.hepmc3 import HepMCProcessExtractor
0073
0074 assert hasattr(HepMCProcessExtractor, "Config")
0075
0076
0077 def test_special_algorithm_interfaces():
0078
0079 assert DigitizationAlgorithm