Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
test_algorithms.py
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file test_algorithms.py
1 import pytest
2 
3 from acts.examples import (
4  TutorialVertexFinderAlgorithm,
5  AdaptiveMultiVertexFinderAlgorithm,
6  VertexFitterAlgorithm,
7  IterativeVertexFinderAlgorithm,
8  SpacePointMaker,
9  TrackFindingAlgorithm,
10  SeedingAlgorithm,
11  TrackParamsEstimationAlgorithm,
12  EventGenerator,
13  FatrasSimulation,
14  MaterialMapping,
15  TruthSeedSelector,
16  TruthTrackFinder,
17  ParticleSelector,
18  TruthVertexFinder,
19  ParticleSmearing,
20  TrackSelectorAlgorithm,
21  TrackFittingAlgorithm,
22  SurfaceSortingAlgorithm,
23  ParticlesPrinter,
24  HitsPrinter,
25  TrackParametersPrinter,
26  PropagationAlgorithm,
27  DigitizationAlgorithm,
28  PlanarSteppingAlgorithm,
29 )
30 
31 
32 from helpers import geant4Enabled, hepmc3Enabled
33 
34 
35 @pytest.mark.parametrize(
36  "alg",
37  [
38  TutorialVertexFinderAlgorithm,
39  AdaptiveMultiVertexFinderAlgorithm,
40  VertexFitterAlgorithm,
41  IterativeVertexFinderAlgorithm,
42  SpacePointMaker,
43  TrackFindingAlgorithm,
44  SeedingAlgorithm,
45  TrackParamsEstimationAlgorithm,
46  EventGenerator,
47  FatrasSimulation,
48  MaterialMapping,
49  TruthSeedSelector,
50  TruthTrackFinder,
51  ParticleSelector,
52  TruthVertexFinder,
53  ParticleSmearing,
54  TrackSelectorAlgorithm,
55  TrackFittingAlgorithm,
56  SurfaceSortingAlgorithm,
57  ParticlesPrinter,
58  HitsPrinter,
59  TrackParametersPrinter,
60  PropagationAlgorithm,
61  # GeantinoRecording,
62  PlanarSteppingAlgorithm,
63  # EventRecording,
64  ],
65 )
67  assert hasattr(alg, "Config")
68 
69 
70 @pytest.mark.skipif(not geant4Enabled, reason="Geant4 not set up")
71 @pytest.mark.skipif(not hepmc3Enabled, reason="HepMC3 not set up")
73  from acts.examples.geant4.hepmc3 import EventRecording
74  from acts.examples.geant4 import Geant4Simulation
75 
76  for alg in (EventRecording, Geant4Simulation):
77  assert hasattr(alg, "Config")
78 
79 
80 @pytest.mark.skipif(not hepmc3Enabled, reason="HepMC3 not set up")
82  from acts.examples.hepmc3 import HepMCProcessExtractor
83 
84  assert hasattr(HepMCProcessExtractor, "Config")
85 
86 
88  # just assert they exists
89  assert DigitizationAlgorithm