From a5b3864a5024c30897883eafebfecf3819599ec4 Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Mon, 12 Feb 2024 23:02:14 +0100 Subject: [PATCH] refactor: Delete the examples binaries (#2685) This PR deletes the Examples binaries --- .github/workflows/builds.yml | 9 - CI/run_examples.sh | 132 ------- CMakeLists.txt | 9 +- Examples/CMakeLists.txt | 3 +- Examples/{Run => }/HelloWorld/CMakeLists.txt | 2 +- Examples/{Run => }/HelloWorld/HelloData.hpp | 0 .../HelloWorld/HelloLoggerAlgorithm.cpp | 0 .../HelloWorld/HelloLoggerAlgorithm.hpp | 0 .../HelloWorld/HelloRandomAlgorithm.cpp | 0 .../HelloWorld/HelloRandomAlgorithm.hpp | 0 .../HelloWorld/HelloWhiteBoardAlgorithm.cpp | 0 .../HelloWorld/HelloWhiteBoardAlgorithm.hpp | 0 Examples/{Run => }/HelloWorld/HelloWorld.cpp | 27 +- Examples/Run/Alignment/CMakeLists.txt | 20 - Examples/Run/Alignment/Common/CMakeLists.txt | 19 - .../Alignment/Common/DetectorAlignment.cpp | 237 ------------ .../Alignment/Common/DetectorAlignment.hpp | 41 --- .../Run/Alignment/ContextualAlignment.cpp | 62 ---- Examples/Run/CMakeLists.txt | 22 -- Examples/Run/Common/CMakeLists.txt | 57 --- .../Detector/AlignedDetectorWithOptions.hpp | 32 -- .../ActsExamples/Detector/EmptyDetector.hpp | 24 -- .../Detector/GenericDetectorWithOptions.hpp | 27 -- .../ActsExamples/Detector/IBaseDetector.hpp | 41 --- .../Detector/TGeoDetectorWithOptions.hpp | 26 -- .../Detector/TelescopeDetectorWithOptions.hpp | 26 -- .../ActsExamples/Geometry/CommonGeometry.hpp | 41 --- .../Geometry/GeometryExampleBase.hpp | 18 - .../ActsExamples/Geometry/MaterialWiper.hpp | 43 --- .../MaterialMapping/CommonMaterialMapping.hpp | 23 -- .../MaterialValidationBase.hpp | 22 -- .../ActsExamples/Options/CommonOptions.hpp | 84 ----- .../ActsExamples/Options/CsvOptionsReader.hpp | 45 --- .../ActsExamples/Options/CsvOptionsWriter.hpp | 45 --- .../Options/DigitizationOptions.hpp | 23 -- .../Options/EmptyDetectorOptions.hpp | 36 -- .../Options/GenericDetectorOptions.hpp | 38 -- .../Options/JsonOptionsWriter.hpp | 25 -- .../Options/MagneticFieldOptions.hpp | 32 -- .../Options/NuclearInteractionOptions.hpp | 67 ---- .../Options/ParticleGunOptions.hpp | 24 -- .../Options/ParticleSelectorOptions.hpp | 25 -- .../Options/ParticleSmearingOptions.hpp | 31 -- .../Options/SpacePointMakerOptions.hpp | 28 -- .../Options/TrackFindingOptions.hpp | 30 -- .../Options/TrackFittingOptions.hpp | 20 - .../Options/TruthSeedSelectorOptions.hpp | 23 -- .../ActsExamples/Options/VertexingOptions.hpp | 21 -- .../Propagation/PropagationExampleBase.hpp | 22 -- .../Reconstruction/ReconstructionBase.hpp | 86 ----- .../Simulation/CommonSimulation.hpp | 50 --- .../Common/src/AlignedDetectorWithOptions.cpp | 105 ------ Examples/Run/Common/src/CommonGeometry.cpp | 67 ---- .../Run/Common/src/CommonMaterialMapping.cpp | 227 ------------ Examples/Run/Common/src/CommonOptions.cpp | 229 ------------ Examples/Run/Common/src/CommonSimulation.cpp | 142 -------- Examples/Run/Common/src/CsvOptionsReader.cpp | 56 --- Examples/Run/Common/src/CsvOptionsWriter.cpp | 79 ---- .../Run/Common/src/DigitizationOptions.cpp | 38 -- Examples/Run/Common/src/EmptyDetector.cpp | 52 --- .../Common/src/GenericDetectorWithOptions.cpp | 42 --- .../Run/Common/src/GeometryExampleBase.cpp | 190 ---------- Examples/Run/Common/src/JsonOptionsWriter.cpp | 48 --- .../Run/Common/src/MagneticFieldOptions.cpp | 231 ------------ .../Run/Common/src/MaterialValidationBase.cpp | 206 ----------- .../Common/src/NuclearInteractionOptions.cpp | 239 ------------ .../Run/Common/src/ParticleGunOptions.cpp | 110 ------ .../Common/src/ParticleSelectorOptions.cpp | 72 ---- .../Common/src/ParticleSmearingOptions.cpp | 58 --- .../Run/Common/src/PropagationExampleBase.cpp | 143 -------- .../Run/Common/src/ReconstructionBase.cpp | 138 ------- .../Run/Common/src/SpacePointMakerOptions.cpp | 35 -- .../Common/src/TGeoDetectorWithOptions.cpp | 123 ------- .../src/TelescopeDetectorWithOptions.cpp | 78 ---- .../Run/Common/src/TrackFindingOptions.cpp | 56 --- .../Run/Common/src/TrackFittingOptions.cpp | 35 -- .../Common/src/TruthSeedSelectorOptions.cpp | 67 ---- Examples/Run/Common/src/VertexingOptions.cpp | 33 -- Examples/Run/DD4hep/CMakeLists.txt | 16 - .../Detector/DD4hepDetectorOptions.hpp | 76 ---- .../Detector/DD4hepDetectorWithOptions.hpp | 28 -- .../DD4hep/src/DD4hepDetectorWithOptions.cpp | 32 -- Examples/Run/Digitization/CMakeLists.txt | 66 ---- .../Run/Digitization/Common/CMakeLists.txt | 21 -- .../Common/DigitizationConfigExample.cpp | 74 ---- .../Common/DigitizationConfigExample.hpp | 22 -- .../Common/DigitizationExample.cpp | 156 -------- .../Common/DigitizationExample.hpp | 22 -- .../Digitization/Common/DigitizationInput.cpp | 50 --- .../Digitization/Common/DigitizationInput.hpp | 40 -- .../Run/Digitization/DD4hep/CMakeLists.txt | 28 -- .../DD4hepDigitizationConfigExample.cpp | 16 - .../DD4hep/DD4hepDigitizationExample.cpp | 16 - .../GenericDigitizationConfigExample.cpp | 16 - .../GenericDigitizationExample.cpp | 16 - .../TGeoDigitizationConfigExample.cpp | 16 - .../Digitization/TGeoDigitizationExample.cpp | 16 - Examples/Run/Fatras/AlignedFatrasExample.cpp | 15 - Examples/Run/Fatras/CMakeLists.txt | 44 --- Examples/Run/Fatras/Common/CMakeLists.txt | 19 - .../ActsExamples/Fatras/FatrasCommon.hpp | 23 -- .../ActsExamples/Options/FatrasOptions.hpp | 23 -- .../Run/Fatras/Common/src/FatrasCommon.cpp | 107 ------ .../Run/Fatras/Common/src/FatrasOptions.cpp | 79 ---- Examples/Run/Fatras/DD4hep/CMakeLists.txt | 10 - .../Run/Fatras/DD4hep/DD4hepFatrasExample.cpp | 15 - Examples/Run/Fatras/GenericFatrasExample.cpp | 15 - Examples/Run/Fatras/TGeoFatrasExample.cpp | 15 - .../Run/Fatras/TelescopeFatrasExample.cpp | 16 - Examples/Run/Geant4/CMakeLists.txt | 39 -- Examples/Run/Geant4/Common/CMakeLists.txt | 24 -- .../ActsExamples/Geant4/Geant4Common.hpp | 83 ----- .../ActsExamples/Options/Geant4Options.hpp | 25 -- .../Run/Geant4/Common/src/Geant4Common.cpp | 164 --------- .../Run/Geant4/Common/src/Geant4Options.cpp | 32 -- Examples/Run/Geant4/DD4hep/CMakeLists.txt | 35 -- .../Geant4/DD4hep/DD4hepGeant4Simulation.cpp | 51 --- .../Geant4/DD4hep/DD4hepMaterialRecording.cpp | 45 --- Examples/Run/Geant4/GdmlMaterialRecording.cpp | 41 --- Examples/Run/Geant4/HepMC/CMakeLists.txt | 18 - .../Geant4/HepMC/EventRecordingExample.cpp | 87 ----- Examples/Run/Geant4/TestMockupBuilder.cpp | 89 ----- Examples/Run/Generators/CMakeLists.txt | 14 - Examples/Run/Generators/ParticleGun.cpp | 77 ---- .../Run/Generators/Pythia8/CMakeLists.txt | 28 -- .../ActsExamples/Options/Pythia8Options.hpp | 28 -- .../Pythia8/Options/src/Pythia8Options.cpp | 104 ------ Examples/Run/Generators/Pythia8/Pythia8.cpp | 79 ---- .../Run/Geometry/AlignedGeometryExample.cpp | 22 -- Examples/Run/Geometry/CMakeLists.txt | 59 --- Examples/Run/Geometry/DD4hep/CMakeLists.txt | 10 - .../Geometry/DD4hep/DD4hepGeometryExample.cpp | 21 -- .../Run/Geometry/EmptyGeometryExample.cpp | 21 -- .../Run/Geometry/GenericGeometryExample.cpp | 21 -- Examples/Run/Geometry/TGeoGeometryExample.cpp | 22 -- .../Run/Geometry/TelescopeGeometryExample.cpp | 21 -- Examples/Run/HepMC3/CMakeLists.txt | 37 -- Examples/Run/HepMC3/HepMC3Example.cpp | 145 -------- .../Run/HepMC3/HepMC3HistogramExample.cpp | 59 --- .../ActsExamples/Options/HepMC3Options.hpp | 43 --- .../Run/HepMC3/Options/src/HepMC3Options.cpp | 55 --- Examples/Run/HepMC3/test.hepmc3 | 55 --- .../Run/MagneticField/BFieldAccessExample.cpp | 176 --------- Examples/Run/MagneticField/BFieldExample.cpp | 111 ------ Examples/Run/MagneticField/CMakeLists.txt | 24 -- Examples/Run/MaterialMapping/CMakeLists.txt | 30 -- .../Run/MaterialMapping/DD4hep/CMakeLists.txt | 23 -- .../DD4hep/DD4hepMaterialMapping.cpp | 21 -- .../DD4hep/DD4hepMaterialValidation.cpp | 21 -- .../GenericMaterialMapping.cpp | 21 -- .../GenericMaterialValidation.cpp | 21 -- .../Run/MaterialMapping/TGeo/CMakeLists.txt | 23 -- .../TGeo/TGeoMaterialMapping.cpp | 21 -- .../TGeo/TGeoMaterialValidation.cpp | 21 -- Examples/Run/Misc/CMakeLists.txt | 11 - Examples/Run/Misc/TabulateEnergyLoss.cpp | 115 ------ .../Propagation/AlignedPropagationExample.cpp | 22 -- Examples/Run/Propagation/CMakeLists.txt | 52 --- .../Run/Propagation/DD4hep/CMakeLists.txt | 10 - .../DD4hep/DD4hepPropagationExample.cpp | 22 -- .../EmptyDetectorPropagationExample.cpp | 22 -- .../Propagation/GenericPropagationExample.cpp | 22 -- .../Propagation/TGeoPropagationExample.cpp | 22 -- Examples/Run/Reconstruction/CMakeLists.txt | 146 -------- .../Run/Reconstruction/Common/CMakeLists.txt | 29 -- .../Reconstruction/Common/HoughExample.cpp | 209 ----------- .../Reconstruction/Common/HoughExample.hpp | 26 -- .../Common/MLAmbiguityResolutionDemo.onnx | 27 -- .../Common/MeasurementsToSpacepoints.cpp | 118 ------ .../Common/MeasurementsToSpacepoints.hpp | 18 - .../Reconstruction/Common/RecCKFTracks.cpp | 344 ------------------ .../Reconstruction/Common/RecCKFTracks.hpp | 31 -- .../Reconstruction/Common/RecTruthTracks.cpp | 194 ---------- .../Reconstruction/Common/RecTruthTracks.hpp | 24 -- .../Reconstruction/Common/SeedingExample.cpp | 223 ------------ .../Reconstruction/Common/SeedingExample.hpp | 24 -- .../Run/Reconstruction/DD4hep/CMakeLists.txt | 33 -- .../DD4hep/DD4hepRecCKFTracks.cpp | 16 - .../DD4hep/DD4hepRecTruthTracks.cpp | 16 - .../DD4hep/DD4hepSeedingExample.cpp | 16 - .../Reconstruction/GenericRecCKFTracks.cpp | 16 - .../Reconstruction/GenericRecTruthTracks.cpp | 16 - .../Reconstruction/GenericSeedingExample.cpp | 17 - Examples/Run/Reconstruction/HoughExample.cpp | 17 - .../MeasurementsToSPGeneric.cpp | 16 - .../Reconstruction/MeasurementsToSPTGeo.cpp | 16 - .../Run/Reconstruction/TGeoRecCKFTracks.cpp | 16 - .../Run/Reconstruction/TGeoRecTruthTracks.cpp | 16 - .../Run/Reconstruction/TGeoSeedingExample.cpp | 16 - .../Reconstruction/TelescopeRecCKFTracks.cpp | 17 - .../TelescopeRecTruthTracks.cpp | 17 - Examples/Run/Show/CMakeLists.txt | 22 -- Examples/Run/Show/ShowFatrasGeneric.cpp | 107 ------ Examples/Run/Show/ShowParticles.cpp | 72 ---- Examples/Run/Vertexing/CMakeLists.txt | 28 -- .../ParticleReaderVertexingExample.cpp | 99 ----- .../AdaptiveMultiVertexFinderExample.cpp | 84 ----- Examples/Run/Vertexing/Pythia8/CMakeLists.txt | 35 -- .../Pythia8/IterativeVertexFinderExample.cpp | 83 ----- .../Vertexing/Pythia8/VertexFitterExample.cpp | 92 ----- ...eaderVertexingPerformanceWriterExample.cpp | 118 ------ docs/getting_started.md | 9 +- 202 files changed, 19 insertions(+), 10594 deletions(-) delete mode 100755 CI/run_examples.sh rename Examples/{Run => }/HelloWorld/CMakeLists.txt (86%) rename Examples/{Run => }/HelloWorld/HelloData.hpp (100%) rename Examples/{Run => }/HelloWorld/HelloLoggerAlgorithm.cpp (100%) rename Examples/{Run => }/HelloWorld/HelloLoggerAlgorithm.hpp (100%) rename Examples/{Run => }/HelloWorld/HelloRandomAlgorithm.cpp (100%) rename Examples/{Run => }/HelloWorld/HelloRandomAlgorithm.hpp (100%) rename Examples/{Run => }/HelloWorld/HelloWhiteBoardAlgorithm.cpp (100%) rename Examples/{Run => }/HelloWorld/HelloWhiteBoardAlgorithm.hpp (100%) rename Examples/{Run => }/HelloWorld/HelloWorld.cpp (72%) delete mode 100644 Examples/Run/Alignment/CMakeLists.txt delete mode 100644 Examples/Run/Alignment/Common/CMakeLists.txt delete mode 100644 Examples/Run/Alignment/Common/DetectorAlignment.cpp delete mode 100644 Examples/Run/Alignment/Common/DetectorAlignment.hpp delete mode 100644 Examples/Run/Alignment/ContextualAlignment.cpp delete mode 100644 Examples/Run/CMakeLists.txt delete mode 100644 Examples/Run/Common/CMakeLists.txt delete mode 100644 Examples/Run/Common/include/ActsExamples/Detector/AlignedDetectorWithOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Detector/EmptyDetector.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Detector/GenericDetectorWithOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Detector/IBaseDetector.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Detector/TGeoDetectorWithOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Detector/TelescopeDetectorWithOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Geometry/CommonGeometry.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Geometry/GeometryExampleBase.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Geometry/MaterialWiper.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/MaterialMapping/CommonMaterialMapping.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/MaterialMapping/MaterialValidationBase.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/CommonOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/CsvOptionsReader.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/CsvOptionsWriter.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/DigitizationOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/EmptyDetectorOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/GenericDetectorOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/JsonOptionsWriter.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/MagneticFieldOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/NuclearInteractionOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/ParticleGunOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/ParticleSelectorOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/ParticleSmearingOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/SpacePointMakerOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/TrackFindingOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/TrackFittingOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/TruthSeedSelectorOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Options/VertexingOptions.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Propagation/PropagationExampleBase.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Reconstruction/ReconstructionBase.hpp delete mode 100644 Examples/Run/Common/include/ActsExamples/Simulation/CommonSimulation.hpp delete mode 100644 Examples/Run/Common/src/AlignedDetectorWithOptions.cpp delete mode 100644 Examples/Run/Common/src/CommonGeometry.cpp delete mode 100644 Examples/Run/Common/src/CommonMaterialMapping.cpp delete mode 100644 Examples/Run/Common/src/CommonOptions.cpp delete mode 100644 Examples/Run/Common/src/CommonSimulation.cpp delete mode 100644 Examples/Run/Common/src/CsvOptionsReader.cpp delete mode 100644 Examples/Run/Common/src/CsvOptionsWriter.cpp delete mode 100644 Examples/Run/Common/src/DigitizationOptions.cpp delete mode 100644 Examples/Run/Common/src/EmptyDetector.cpp delete mode 100644 Examples/Run/Common/src/GenericDetectorWithOptions.cpp delete mode 100644 Examples/Run/Common/src/GeometryExampleBase.cpp delete mode 100644 Examples/Run/Common/src/JsonOptionsWriter.cpp delete mode 100644 Examples/Run/Common/src/MagneticFieldOptions.cpp delete mode 100644 Examples/Run/Common/src/MaterialValidationBase.cpp delete mode 100644 Examples/Run/Common/src/NuclearInteractionOptions.cpp delete mode 100644 Examples/Run/Common/src/ParticleGunOptions.cpp delete mode 100644 Examples/Run/Common/src/ParticleSelectorOptions.cpp delete mode 100644 Examples/Run/Common/src/ParticleSmearingOptions.cpp delete mode 100644 Examples/Run/Common/src/PropagationExampleBase.cpp delete mode 100644 Examples/Run/Common/src/ReconstructionBase.cpp delete mode 100644 Examples/Run/Common/src/SpacePointMakerOptions.cpp delete mode 100644 Examples/Run/Common/src/TGeoDetectorWithOptions.cpp delete mode 100644 Examples/Run/Common/src/TelescopeDetectorWithOptions.cpp delete mode 100644 Examples/Run/Common/src/TrackFindingOptions.cpp delete mode 100644 Examples/Run/Common/src/TrackFittingOptions.cpp delete mode 100644 Examples/Run/Common/src/TruthSeedSelectorOptions.cpp delete mode 100644 Examples/Run/Common/src/VertexingOptions.cpp delete mode 100644 Examples/Run/DD4hep/CMakeLists.txt delete mode 100644 Examples/Run/DD4hep/include/ActsExamples/Detector/DD4hepDetectorOptions.hpp delete mode 100644 Examples/Run/DD4hep/include/ActsExamples/Detector/DD4hepDetectorWithOptions.hpp delete mode 100644 Examples/Run/DD4hep/src/DD4hepDetectorWithOptions.cpp delete mode 100644 Examples/Run/Digitization/CMakeLists.txt delete mode 100644 Examples/Run/Digitization/Common/CMakeLists.txt delete mode 100644 Examples/Run/Digitization/Common/DigitizationConfigExample.cpp delete mode 100644 Examples/Run/Digitization/Common/DigitizationConfigExample.hpp delete mode 100644 Examples/Run/Digitization/Common/DigitizationExample.cpp delete mode 100644 Examples/Run/Digitization/Common/DigitizationExample.hpp delete mode 100644 Examples/Run/Digitization/Common/DigitizationInput.cpp delete mode 100644 Examples/Run/Digitization/Common/DigitizationInput.hpp delete mode 100644 Examples/Run/Digitization/DD4hep/CMakeLists.txt delete mode 100644 Examples/Run/Digitization/DD4hep/DD4hepDigitizationConfigExample.cpp delete mode 100644 Examples/Run/Digitization/DD4hep/DD4hepDigitizationExample.cpp delete mode 100644 Examples/Run/Digitization/GenericDigitizationConfigExample.cpp delete mode 100644 Examples/Run/Digitization/GenericDigitizationExample.cpp delete mode 100644 Examples/Run/Digitization/TGeoDigitizationConfigExample.cpp delete mode 100644 Examples/Run/Digitization/TGeoDigitizationExample.cpp delete mode 100644 Examples/Run/Fatras/AlignedFatrasExample.cpp delete mode 100644 Examples/Run/Fatras/CMakeLists.txt delete mode 100644 Examples/Run/Fatras/Common/CMakeLists.txt delete mode 100644 Examples/Run/Fatras/Common/include/ActsExamples/Fatras/FatrasCommon.hpp delete mode 100644 Examples/Run/Fatras/Common/include/ActsExamples/Options/FatrasOptions.hpp delete mode 100644 Examples/Run/Fatras/Common/src/FatrasCommon.cpp delete mode 100644 Examples/Run/Fatras/Common/src/FatrasOptions.cpp delete mode 100644 Examples/Run/Fatras/DD4hep/CMakeLists.txt delete mode 100644 Examples/Run/Fatras/DD4hep/DD4hepFatrasExample.cpp delete mode 100644 Examples/Run/Fatras/GenericFatrasExample.cpp delete mode 100644 Examples/Run/Fatras/TGeoFatrasExample.cpp delete mode 100644 Examples/Run/Fatras/TelescopeFatrasExample.cpp delete mode 100644 Examples/Run/Geant4/CMakeLists.txt delete mode 100644 Examples/Run/Geant4/Common/CMakeLists.txt delete mode 100644 Examples/Run/Geant4/Common/include/ActsExamples/Geant4/Geant4Common.hpp delete mode 100644 Examples/Run/Geant4/Common/include/ActsExamples/Options/Geant4Options.hpp delete mode 100644 Examples/Run/Geant4/Common/src/Geant4Common.cpp delete mode 100644 Examples/Run/Geant4/Common/src/Geant4Options.cpp delete mode 100644 Examples/Run/Geant4/DD4hep/CMakeLists.txt delete mode 100644 Examples/Run/Geant4/DD4hep/DD4hepGeant4Simulation.cpp delete mode 100644 Examples/Run/Geant4/DD4hep/DD4hepMaterialRecording.cpp delete mode 100644 Examples/Run/Geant4/GdmlMaterialRecording.cpp delete mode 100644 Examples/Run/Geant4/HepMC/CMakeLists.txt delete mode 100644 Examples/Run/Geant4/HepMC/EventRecordingExample.cpp delete mode 100644 Examples/Run/Geant4/TestMockupBuilder.cpp delete mode 100644 Examples/Run/Generators/CMakeLists.txt delete mode 100644 Examples/Run/Generators/ParticleGun.cpp delete mode 100644 Examples/Run/Generators/Pythia8/CMakeLists.txt delete mode 100644 Examples/Run/Generators/Pythia8/Options/include/ActsExamples/Options/Pythia8Options.hpp delete mode 100644 Examples/Run/Generators/Pythia8/Options/src/Pythia8Options.cpp delete mode 100644 Examples/Run/Generators/Pythia8/Pythia8.cpp delete mode 100644 Examples/Run/Geometry/AlignedGeometryExample.cpp delete mode 100644 Examples/Run/Geometry/CMakeLists.txt delete mode 100644 Examples/Run/Geometry/DD4hep/CMakeLists.txt delete mode 100644 Examples/Run/Geometry/DD4hep/DD4hepGeometryExample.cpp delete mode 100644 Examples/Run/Geometry/EmptyGeometryExample.cpp delete mode 100644 Examples/Run/Geometry/GenericGeometryExample.cpp delete mode 100644 Examples/Run/Geometry/TGeoGeometryExample.cpp delete mode 100644 Examples/Run/Geometry/TelescopeGeometryExample.cpp delete mode 100644 Examples/Run/HepMC3/CMakeLists.txt delete mode 100644 Examples/Run/HepMC3/HepMC3Example.cpp delete mode 100644 Examples/Run/HepMC3/HepMC3HistogramExample.cpp delete mode 100644 Examples/Run/HepMC3/Options/include/ActsExamples/Options/HepMC3Options.hpp delete mode 100644 Examples/Run/HepMC3/Options/src/HepMC3Options.cpp delete mode 100644 Examples/Run/HepMC3/test.hepmc3 delete mode 100644 Examples/Run/MagneticField/BFieldAccessExample.cpp delete mode 100644 Examples/Run/MagneticField/BFieldExample.cpp delete mode 100644 Examples/Run/MagneticField/CMakeLists.txt delete mode 100644 Examples/Run/MaterialMapping/CMakeLists.txt delete mode 100644 Examples/Run/MaterialMapping/DD4hep/CMakeLists.txt delete mode 100644 Examples/Run/MaterialMapping/DD4hep/DD4hepMaterialMapping.cpp delete mode 100644 Examples/Run/MaterialMapping/DD4hep/DD4hepMaterialValidation.cpp delete mode 100644 Examples/Run/MaterialMapping/GenericMaterialMapping.cpp delete mode 100644 Examples/Run/MaterialMapping/GenericMaterialValidation.cpp delete mode 100644 Examples/Run/MaterialMapping/TGeo/CMakeLists.txt delete mode 100644 Examples/Run/MaterialMapping/TGeo/TGeoMaterialMapping.cpp delete mode 100644 Examples/Run/MaterialMapping/TGeo/TGeoMaterialValidation.cpp delete mode 100644 Examples/Run/Misc/CMakeLists.txt delete mode 100644 Examples/Run/Misc/TabulateEnergyLoss.cpp delete mode 100644 Examples/Run/Propagation/AlignedPropagationExample.cpp delete mode 100644 Examples/Run/Propagation/CMakeLists.txt delete mode 100644 Examples/Run/Propagation/DD4hep/CMakeLists.txt delete mode 100644 Examples/Run/Propagation/DD4hep/DD4hepPropagationExample.cpp delete mode 100644 Examples/Run/Propagation/EmptyDetectorPropagationExample.cpp delete mode 100644 Examples/Run/Propagation/GenericPropagationExample.cpp delete mode 100644 Examples/Run/Propagation/TGeoPropagationExample.cpp delete mode 100644 Examples/Run/Reconstruction/CMakeLists.txt delete mode 100644 Examples/Run/Reconstruction/Common/CMakeLists.txt delete mode 100644 Examples/Run/Reconstruction/Common/HoughExample.cpp delete mode 100644 Examples/Run/Reconstruction/Common/HoughExample.hpp delete mode 100644 Examples/Run/Reconstruction/Common/MLAmbiguityResolutionDemo.onnx delete mode 100644 Examples/Run/Reconstruction/Common/MeasurementsToSpacepoints.cpp delete mode 100644 Examples/Run/Reconstruction/Common/MeasurementsToSpacepoints.hpp delete mode 100644 Examples/Run/Reconstruction/Common/RecCKFTracks.cpp delete mode 100644 Examples/Run/Reconstruction/Common/RecCKFTracks.hpp delete mode 100644 Examples/Run/Reconstruction/Common/RecTruthTracks.cpp delete mode 100644 Examples/Run/Reconstruction/Common/RecTruthTracks.hpp delete mode 100644 Examples/Run/Reconstruction/Common/SeedingExample.cpp delete mode 100644 Examples/Run/Reconstruction/Common/SeedingExample.hpp delete mode 100644 Examples/Run/Reconstruction/DD4hep/CMakeLists.txt delete mode 100644 Examples/Run/Reconstruction/DD4hep/DD4hepRecCKFTracks.cpp delete mode 100644 Examples/Run/Reconstruction/DD4hep/DD4hepRecTruthTracks.cpp delete mode 100644 Examples/Run/Reconstruction/DD4hep/DD4hepSeedingExample.cpp delete mode 100644 Examples/Run/Reconstruction/GenericRecCKFTracks.cpp delete mode 100644 Examples/Run/Reconstruction/GenericRecTruthTracks.cpp delete mode 100644 Examples/Run/Reconstruction/GenericSeedingExample.cpp delete mode 100644 Examples/Run/Reconstruction/HoughExample.cpp delete mode 100644 Examples/Run/Reconstruction/MeasurementsToSPGeneric.cpp delete mode 100644 Examples/Run/Reconstruction/MeasurementsToSPTGeo.cpp delete mode 100644 Examples/Run/Reconstruction/TGeoRecCKFTracks.cpp delete mode 100644 Examples/Run/Reconstruction/TGeoRecTruthTracks.cpp delete mode 100644 Examples/Run/Reconstruction/TGeoSeedingExample.cpp delete mode 100644 Examples/Run/Reconstruction/TelescopeRecCKFTracks.cpp delete mode 100644 Examples/Run/Reconstruction/TelescopeRecTruthTracks.cpp delete mode 100644 Examples/Run/Show/CMakeLists.txt delete mode 100644 Examples/Run/Show/ShowFatrasGeneric.cpp delete mode 100644 Examples/Run/Show/ShowParticles.cpp delete mode 100644 Examples/Run/Vertexing/CMakeLists.txt delete mode 100644 Examples/Run/Vertexing/ParticleReaderVertexingExample.cpp delete mode 100644 Examples/Run/Vertexing/Pythia8/AdaptiveMultiVertexFinderExample.cpp delete mode 100644 Examples/Run/Vertexing/Pythia8/CMakeLists.txt delete mode 100644 Examples/Run/Vertexing/Pythia8/IterativeVertexFinderExample.cpp delete mode 100644 Examples/Run/Vertexing/Pythia8/VertexFitterExample.cpp delete mode 100644 Examples/Run/Vertexing/TrackReaderVertexingPerformanceWriterExample.cpp diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index af5645db84e..831b511b4ee 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -63,7 +63,6 @@ jobs: -DACTS_BUILD_EVERYTHING=ON -DACTS_BUILD_ODD=ON -DACTS_BUILD_EXAMPLES_PYTHON_BINDINGS=ON - -DACTS_BUILD_EXAMPLES_BINARIES=ON -DACTS_BUILD_EXAMPLES_EDM4HEP=ON -DACTS_FORCE_ASSERTIONS=ON -DACTS_BUILD_ANALYSIS_APPS=ON @@ -139,13 +138,6 @@ jobs: - name: Unpack build run: mkdir build && tar xf build.tar.gz -C build - - name: Examples - shell: bash - run: > - export LD_LIBRARY_PATH=$PWD/build/thirdparty/OpenDataDetector/factory:$LD_LIBRARY_PATH - && source /usr/local/bin/thisdd4hep_only.sh - && ./CI/run_examples.sh - - name: Python level tests shell: bash env: @@ -422,7 +414,6 @@ jobs: -DCMAKE_CXX_FLAGS=-Werror -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" -DACTS_LOG_FAILURE_THRESHOLD=WARNING - -DACTS_BUILD_EXAMPLES_BINARIES=ON -DACTS_FORCE_ASSERTIONS=ON -DACTS_USE_SYSTEM_BOOST=OFF -DACTS_USE_SYSTEM_EIGEN3=OFF diff --git a/CI/run_examples.sh b/CI/run_examples.sh deleted file mode 100755 index 02e2ee9017e..00000000000 --- a/CI/run_examples.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Run a reasonably large subset of the Acts examples - -# Force bash to catch more errors -set -euo pipefail - -# Common setup -NUM_EVENTS=100 -SRC_DIR=`pwd` -BUILD_DIR=`pwd`/build -DD4HEP_INPUT="--dd4hep-input file:${SRC_DIR}/thirdparty/OpenDataDetector/xml/OpenDataDetector.xml" -timed_run() { - echo "" - echo "=== Running $* ===" - echo "" - time ${BUILD_DIR}/bin/$* -} -run_example() { - timed_run $* -n ${NUM_EVENTS} -} - -# Data for Geant4-based examples -G4_DATA_URL=https://acts.web.cern.ch/ACTS/ci/G4/G4.data.tar.xz -G4_DATA_DIR=/tmp/G4 -# -curl $G4_DATA_URL \ - -O \ - -C - \ - --retry 5 -# -mkdir -p $G4_DATA_DIR -tar xf G4.data.tar.xz --strip-components 1 -C $G4_DATA_DIR -rm G4.data.tar.xz -# -export G4ENSDFSTATEDATA=$G4_DATA_DIR/G4ENSDFSTATE -export G4LEVELGAMMADATA=$G4_DATA_DIR/G4LEVELGAMMA -export G4LEDATA=$G4_DATA_DIR/G4LE -export G4PARTICLEXSDATA=$G4_DATA_DIR/G4PARTICLESXS - -# Run hello world example -run_example ActsExampleHelloWorld - -# Run geometry examples for all geometries, in the configuration suggested by -# the material mapping tutorial -# -# We must try to avoid running examples for all geometries because -# that results in a combinatorial explosion of CI running time. But -# these examples are fast enough. -# -run_geometry_example() { - timed_run ActsExampleGeometry$* \ - -n1 \ - -j1 \ - --mat-output-file geometry-map-$1 \ - --output-json \ - --mat-output-allmaterial true \ - --mat-output-sensitives false -} -run_geometry_example Aligned --align-mode internal -run_geometry_example Aligned --align-mode external -run_geometry_example DD4hep ${DD4HEP_INPUT} -run_geometry_example Empty -run_geometry_example Generic -run_geometry_example Telescope -# TODO: Add TGeo geometry example (needs an input file + knowhow) - -# Run propagation examples for all geometries -# -# In addition to the geometry examples, we also need one slightly more -# complex example to run with all geometries because geometries with -# conditions have code paths that are only exercised when the -# Sequencer actually runs. -# -run_example ActsExamplePropagationAligned --align-mode internal -run_example ActsExamplePropagationDD4hep ${DD4HEP_INPUT} -# FIXME: Disabled because of issue #710 -# run_example ActsExamplePropagationEmpty -run_example ActsExamplePropagationGeneric -run_example ActsExamplePropagationAligned --align-mode external -# TODO: Add TGeo propagation example (needs an input file + knowhow) - -# Run event generation examples as suggested by the Fatras tutorial -run_example ActsExampleParticleGun \ - --output-dir=data/gen/four_muons \ - --output-csv \ - --gen-phi-degree=0:90 \ - --gen-eta=-2:2 \ - --gen-mom-gev=1:5 \ - --gen-pdg=13 \ - --gen-randomize-charge \ - --gen-nparticles=4 -run_example ActsExamplePythia8 \ - --output-dir=data/gen/ttbar_mu140 \ - --output-csv \ - --rnd-seed=42 \ - --gen-cms-energy-gev=14000 \ - --gen-hard-process=Top:qqbar2ttbar=on \ - --gen-npileup=140 - -# Run Material recording example, as in the material mapping tutorial (but with -# 10x less events to keep CI running times reasonable) -# -# FIXME: Currently only works in single-threaded mode, even though it -# should theoretically be thread-safe as Geant4 usage is -# protected by a mutex. What most likely happens is that some -# thread-unsafe Geant4 code is accidentally run outside of the -# mutex-protected region of the code. See issue #207 . -# -run_material_example() { - timed_run ActsExampleMaterialRecording$* \ - -n1000 \ - -j1 \ - --output-root -} -run_material_example DD4hep ${DD4HEP_INPUT} -# TODO: Add GDML version (needs an input file + knowhow) - -# Run material validation example (generic-only, see above) -run_example ActsExampleMaterialValidationGeneric - -# TODO: Run CKF examples (needs some setup, documented in Acts howto?) -# TODO: Run EventRecording example (requires CSV input, source to be found. Fatras?) -# TODO: Run Fatras examples (needs some setup, documented in Acts howto?) -# TODO: Run HepMC3 examples (needs input files + knowhow) -# TODO: Run MagneticField examples (needs input files + knowhow) -# TODO: Run MaterialMapping examples (needs input files + knowhow) -# TODO: Run Seeding examples (needs input files + knowhow) -# TODO: Run Show(FatrasGeneric|Particles) examples (needs input files + knowhow) -# TODO: Run TruthTracks examples (needs input files + knowhow) -# TODO: Run (AdaptiveMulti|Iterative)?Vertex(Finder|Fitter) examples (currently broken, not ready for CI) - -# TODO: Bring back multi-threaded output reproducibility tests diff --git a/CMakeLists.txt b/CMakeLists.txt index abed31eef38..26e3183f8bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,6 @@ option(ACTS_BUILD_EXAMPLES_GEANT4 "Build Geant4-based code in the examples" OFF) option(ACTS_BUILD_EXAMPLES_HEPMC3 "Build HepMC3-based code in the examples" OFF) option(ACTS_BUILD_EXAMPLES_PYTHIA8 "Build Pythia8-based code in the examples" OFF) option(ACTS_BUILD_EXAMPLES_PYTHON_BINDINGS "Build python bindings for the examples" OFF) -option(ACTS_BUILD_EXAMPLES_BINARIES "Build the examples binaries (deprecated)" OFF) option(ACTS_USE_SYSTEM_PYBIND11 "Use a system installation of pybind11" ${ACTS_USE_SYSTEM_LIBS} ) option(ACTS_USE_EXAMPLES_TBB "Use Threading Building Blocks library in the examples" ON) option(ACTS_BUILD_ANALYSIS_APPS "Build Analysis applications in the examples" OFF) @@ -131,7 +130,7 @@ set_option_if( ACTS_BUILD_EVERYTHING) set_option_if( ACTS_BUILD_PLUGIN_GEANT4 - ACTS_BUILD_EXAMPLES_GEANT4 OR ACTS_BUILD_EVERYTHING) + ACTS_BUILD_EXAMPLES_GEANT4 OR ACTS_BUILD_EVERYTHING) set_option_if( ACTS_BUILD_PLUGIN_TGEO ACTS_BUILD_PLUGIN_DD4HEP OR ACTS_BUILD_EXAMPLES OR ACTS_BUILD_EVERYTHING) @@ -146,7 +145,7 @@ set_option_if( ACTS_BUILD_EXAMPLES OR ACTS_BUILD_EVERYTHING) set_option_if(ACTS_BUILD_PLUGIN_LEGACY ACTS_BUILD_EVERYTHING) set_option_if(ACTS_BUILD_PLUGIN_EXATRKX ACTS_BUILD_EXAMPLES_EXATRKX) -set_option_if(ACTS_BUILD_PLUGIN_FPEMON +set_option_if(ACTS_BUILD_PLUGIN_FPEMON ACTS_BUILD_EXAMPLES OR ACTS_BUILD_EVERYTHING) # feature tests @@ -317,7 +316,7 @@ if(ACTS_BUILD_PLUGIN_EXATRKX) message(WARNING "CUDA not found, build Exa.TrkX plugin only for CPU") endif() if(NOT (ACTS_EXATRKX_ENABLE_ONNX OR ACTS_EXATRKX_ENABLE_TORCH)) - message(FATAL_ERROR + message(FATAL_ERROR "When building the Exa.TrkX plugin, at least one of ACTS_EXATRKX_ENABLE_ONNX \ and ACTS_EXATRKX_ENABLE_TORCHSCRIPT must be enabled." ) @@ -354,7 +353,7 @@ if(ACTS_BUILD_EXAMPLES) endif() if(ACTS_BUILD_EXAMPLES_PYTHON_BINDINGS) find_package(Python 3.8 REQUIRED COMPONENTS Interpreter Development) - if(ACTS_USE_SYSTEM_PYBIND11) + if(ACTS_USE_SYSTEM_PYBIND11) find_package(pybind11 CONFIG REQUIRED) else() add_subdirectory(thirdparty/pybind11) diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt index 37b07153684..ba5e88f4062 100644 --- a/Examples/CMakeLists.txt +++ b/Examples/CMakeLists.txt @@ -2,6 +2,7 @@ add_subdirectory(Algorithms) add_subdirectory(Detectors) add_subdirectory(Framework) add_subdirectory(Io) -add_subdirectory_if(Run ACTS_BUILD_EXAMPLES_BINARIES) add_subdirectory_if(Python ACTS_BUILD_EXAMPLES_PYTHON_BINDINGS) add_subdirectory_if(Scripts ACTS_BUILD_ANALYSIS_APPS) + +add_subdirectory(HelloWorld) diff --git a/Examples/Run/HelloWorld/CMakeLists.txt b/Examples/HelloWorld/CMakeLists.txt similarity index 86% rename from Examples/Run/HelloWorld/CMakeLists.txt rename to Examples/HelloWorld/CMakeLists.txt index 0193ba7dbc7..ab8a087463c 100644 --- a/Examples/Run/HelloWorld/CMakeLists.txt +++ b/Examples/HelloWorld/CMakeLists.txt @@ -8,7 +8,7 @@ target_link_libraries( ActsExampleHelloWorld PRIVATE ActsCore - ActsExamplesFramework ActsExamplesCommon) + ActsExamplesFramework) install( TARGETS ActsExampleHelloWorld diff --git a/Examples/Run/HelloWorld/HelloData.hpp b/Examples/HelloWorld/HelloData.hpp similarity index 100% rename from Examples/Run/HelloWorld/HelloData.hpp rename to Examples/HelloWorld/HelloData.hpp diff --git a/Examples/Run/HelloWorld/HelloLoggerAlgorithm.cpp b/Examples/HelloWorld/HelloLoggerAlgorithm.cpp similarity index 100% rename from Examples/Run/HelloWorld/HelloLoggerAlgorithm.cpp rename to Examples/HelloWorld/HelloLoggerAlgorithm.cpp diff --git a/Examples/Run/HelloWorld/HelloLoggerAlgorithm.hpp b/Examples/HelloWorld/HelloLoggerAlgorithm.hpp similarity index 100% rename from Examples/Run/HelloWorld/HelloLoggerAlgorithm.hpp rename to Examples/HelloWorld/HelloLoggerAlgorithm.hpp diff --git a/Examples/Run/HelloWorld/HelloRandomAlgorithm.cpp b/Examples/HelloWorld/HelloRandomAlgorithm.cpp similarity index 100% rename from Examples/Run/HelloWorld/HelloRandomAlgorithm.cpp rename to Examples/HelloWorld/HelloRandomAlgorithm.cpp diff --git a/Examples/Run/HelloWorld/HelloRandomAlgorithm.hpp b/Examples/HelloWorld/HelloRandomAlgorithm.hpp similarity index 100% rename from Examples/Run/HelloWorld/HelloRandomAlgorithm.hpp rename to Examples/HelloWorld/HelloRandomAlgorithm.hpp diff --git a/Examples/Run/HelloWorld/HelloWhiteBoardAlgorithm.cpp b/Examples/HelloWorld/HelloWhiteBoardAlgorithm.cpp similarity index 100% rename from Examples/Run/HelloWorld/HelloWhiteBoardAlgorithm.cpp rename to Examples/HelloWorld/HelloWhiteBoardAlgorithm.cpp diff --git a/Examples/Run/HelloWorld/HelloWhiteBoardAlgorithm.hpp b/Examples/HelloWorld/HelloWhiteBoardAlgorithm.hpp similarity index 100% rename from Examples/Run/HelloWorld/HelloWhiteBoardAlgorithm.hpp rename to Examples/HelloWorld/HelloWhiteBoardAlgorithm.hpp diff --git a/Examples/Run/HelloWorld/HelloWorld.cpp b/Examples/HelloWorld/HelloWorld.cpp similarity index 72% rename from Examples/Run/HelloWorld/HelloWorld.cpp rename to Examples/HelloWorld/HelloWorld.cpp index 7aedcab85b0..535ad4d6e3c 100644 --- a/Examples/Run/HelloWorld/HelloWorld.cpp +++ b/Examples/HelloWorld/HelloWorld.cpp @@ -11,7 +11,6 @@ #include "ActsExamples/Framework/RandomNumbers.hpp" #include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" #include #include @@ -21,29 +20,19 @@ #include "HelloWhiteBoardAlgorithm.hpp" int main(int argc, char* argv[]) { - // setup options - // every component should have an associated option setup function - // that should be called here. - auto opt = ActsExamples::Options::makeDefaultOptions(); - ActsExamples::Options::addSequencerOptions(opt); - ActsExamples::Options::addRandomNumbersOptions(opt); - // parse options from command line flags - auto vm = ActsExamples::Options::parse(opt, argc, argv); - // an empty variables map indicates an error - if (vm.empty()) { - return EXIT_FAILURE; - } - - // extract some common options - auto logLevel = ActsExamples::Options::readLogLevel(vm); + (void)argc; + (void)argv; + Acts::Logging::Level logLevel = Acts::Logging::INFO; // setup basic tools shared among algorithms auto rnd = std::make_shared( - ActsExamples::Options::readRandomNumbersConfig(vm)); + ActsExamples::RandomNumbers::Config{}); // setup the sequencer first w/ config derived from options - ActsExamples::Sequencer sequencer( - ActsExamples::Options::readSequencerConfig(vm)); + ActsExamples::Sequencer::Config seqCfg; + seqCfg.events = 10; + seqCfg.numThreads = -1; + ActsExamples::Sequencer sequencer(seqCfg); // add HelloWorld algorithm that does nothing sequencer.addAlgorithm( diff --git a/Examples/Run/Alignment/CMakeLists.txt b/Examples/Run/Alignment/CMakeLists.txt deleted file mode 100644 index 4a521691f7f..00000000000 --- a/Examples/Run/Alignment/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# shared code -add_subdirectory(Common) - -# Alignment for Generic Contextual detector -add_executable( - ActsExampleDetectorAlignContextual - ContextualAlignment.cpp) -target_link_libraries( - ActsExampleDetectorAlignContextual - PRIVATE - ActsExamplesAlignmentCommon - ActsExamplesUtilities - ActsExamplesDetectorContextual -) - - -install( - TARGETS - ActsExampleDetectorAlignContextual - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Examples/Run/Alignment/Common/CMakeLists.txt b/Examples/Run/Alignment/Common/CMakeLists.txt deleted file mode 100644 index c0b858bbc2d..00000000000 --- a/Examples/Run/Alignment/Common/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -add_library( - ActsExamplesAlignmentCommon SHARED - DetectorAlignment.cpp) -target_include_directories( - ActsExamplesAlignmentCommon - PUBLIC $) -target_link_libraries( - ActsExamplesAlignmentCommon - PUBLIC - ActsExamplesFramework - ActsExamplesCommon - ActsExamplesUtilities - ActsExamplesMagneticField - ActsExamplesIoPerformance - ActsExamplesAlignment) - -install( - TARGETS ActsExamplesAlignmentCommon - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/Examples/Run/Alignment/Common/DetectorAlignment.cpp b/Examples/Run/Alignment/Common/DetectorAlignment.cpp deleted file mode 100644 index f6365a32825..00000000000 --- a/Examples/Run/Alignment/Common/DetectorAlignment.cpp +++ /dev/null @@ -1,237 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "DetectorAlignment.hpp" - -#include "Acts/Definitions/Units.hpp" -#include "ActsExamples/Alignment/AlignmentAlgorithm.hpp" -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Framework/WhiteBoard.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" -#include "ActsExamples/Io/Csv/CsvSimHitReader.hpp" -#include "ActsExamples/Io/Json/JsonGeometryList.hpp" -#include "ActsExamples/Io/Performance/TrackFinderPerformanceWriter.hpp" -#include "ActsExamples/Io/Performance/TrackFitterPerformanceWriter.hpp" -#include "ActsExamples/Io/Root/RootTrackStatesWriter.hpp" -#include "ActsExamples/Io/Root/RootTrackSummaryWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/CsvOptionsReader.hpp" -#include "ActsExamples/Options/DigitizationOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Options/ParticleSmearingOptions.hpp" -#include "ActsExamples/Options/TrackFittingOptions.hpp" -#include "ActsExamples/Options/TruthSeedSelectorOptions.hpp" -#include "ActsExamples/Reconstruction/ReconstructionBase.hpp" -#include "ActsExamples/TrackFitting/SurfaceSortingAlgorithm.hpp" -#include "ActsExamples/TrackFitting/TrackFitterFunction.hpp" -#include "ActsExamples/TrackFitting/TrackFittingAlgorithm.hpp" -#include "ActsExamples/TruthTracking/TruthSeedSelector.hpp" -#include "ActsExamples/TruthTracking/TruthTrackFinder.hpp" -#include "ActsExamples/Utilities/Options.hpp" -#include "ActsExamples/Utilities/Paths.hpp" - -#include -#include - -using namespace Acts::UnitLiterals; -using namespace ActsExamples; -using namespace std::filesystem; - -void addAlignmentOptions(ActsExamples::Options::Description& desc) { - using boost::program_options::value; - auto opt = desc.add_options(); - opt("reco-with-misalignment-correction", value()->default_value(false), - "Correct for detector misalignment effects."); - opt("alignment-geo-config-file", value()->default_value(""), - "Json file for alignment geometry elements selection"); -} - -int runDetectorAlignment( - int argc, char* argv[], - const std::shared_ptr& detector, - ActsAlignment::AlignedTransformUpdater alignedTransformUpdater, - const AlignedDetElementGetter& alignedDetElementsGetter) { - // using boost::program_options::value; - - // setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addRandomNumbersOptions(desc); - Options::addGeometryOptions(desc); - Options::addMaterialOptions(desc); - Options::addInputOptions(desc); - Options::addParticleSmearingOptions(desc); - Options::addOutputOptions(desc, OutputFormat::DirectoryOnly); - detector->addOptions(desc); - Options::addMagneticFieldOptions(desc); - Options::addFittingOptions(desc); - Options::addDigitizationOptions(desc); - Options::addTruthSeedSelectorOptions(desc); - addAlignmentOptions(desc); - - auto vm = Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - Sequencer sequencer(Options::readSequencerConfig(vm)); - - // Read some standard options - auto logLevel = Options::readLogLevel(vm); - auto outputDir = ensureWritableDirectory(vm["output-dir"].as()); - auto rnd = std::make_shared( - Options::readRandomNumbersConfig(vm)); - - if (vm["fit-directed-navigation"].as()) { - throw std::runtime_error( - "Directed navigation not supported anymore in the examples binaries." - "Please refer to the RefittingAlgorithm in the python bindings."); - } - - // Setup detector geometry - auto geometry = Geometry::build(vm, *detector); - auto trackingGeometry = geometry.first; - // Add context decorators - for (const auto& cdr : geometry.second) { - sequencer.addContextDecorator(cdr); - } - // Setup the magnetic field - auto magneticField = Options::readMagneticField(vm); - - // Read the sim hits - auto simHitReaderCfg = setupSimHitReading(vm, sequencer); - // Read the particles - auto particleReader = setupParticleReading(vm, sequencer); - - // Run the sim hits smearing - auto digiCfg = setupDigitization(vm, sequencer, rnd, trackingGeometry, - simHitReaderCfg.outputSimHits); - // Run the particle selection - // The pre-selection will select truth particles satisfying provided criteria - // from all particles read in by particle reader for further processing. It - // has no impact on the truth hits read-in by the cluster reader. - TruthSeedSelector::Config particleSelectorCfg = - Options::readTruthSeedSelectorConfig(vm); - particleSelectorCfg.inputParticles = particleReader.outputParticles; - particleSelectorCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - particleSelectorCfg.outputParticles = "particles_selected"; - particleSelectorCfg.nHitsMin = 9; - particleSelectorCfg.ptMin = 500._MeV; - sequencer.addAlgorithm( - std::make_shared(particleSelectorCfg, logLevel)); - - // The selected particles - const auto& inputParticles = particleSelectorCfg.outputParticles; - - // Run the particle smearing - auto particleSmearingCfg = - setupParticleSmearing(vm, sequencer, rnd, inputParticles); - - // The fitter needs the measurements (proto tracks) and initial - // track states (proto states). The elements in both collections - // must match and must be created from the same input particles. - // Create truth tracks - TruthTrackFinder::Config trackFinderCfg; - trackFinderCfg.inputParticles = inputParticles; - trackFinderCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - trackFinderCfg.outputProtoTracks = "prototracks"; - sequencer.addAlgorithm( - std::make_shared(trackFinderCfg, logLevel)); - - if (vm["reco-with-misalignment-correction"].as()) { - // setup the alignment (which will update the aligned transforms of the - // detector elements) - AlignmentAlgorithm::Config alignment; - alignment.inputSourceLinks = digiCfg.outputSourceLinks; - alignment.inputMeasurements = digiCfg.outputMeasurements; - alignment.inputProtoTracks = trackFinderCfg.outputProtoTracks; - alignment.inputInitialTrackParameters = - particleSmearingCfg.outputTrackParameters; - alignment.outputAlignmentParameters = "alignment-parameters"; - alignment.alignedTransformUpdater = std::move(alignedTransformUpdater); - std::string path = vm["alignment-geo-config-file"].as(); - if (not path.empty()) { - alignment.alignedDetElements = alignedDetElementsGetter( - detector, ActsExamples::readJsonGeometryList(path)); - } - - // The criteria to determine if the iteration has converged. - alignment.deltaChi2ONdfCutOff = {10, 0.00005}; - alignment.chi2ONdfCutOff = 0.01; - alignment.maxNumIterations = 60; - alignment.align = AlignmentAlgorithm::makeAlignmentFunction( - trackingGeometry, magneticField); - sequencer.addAlgorithm( - std::make_shared(alignment, logLevel)); - } - - // setup the fitter - TrackFittingAlgorithm::Config fitter; - fitter.inputMeasurements = digiCfg.outputMeasurements; - fitter.inputSourceLinks = digiCfg.outputSourceLinks; - fitter.inputProtoTracks = trackFinderCfg.outputProtoTracks; - fitter.inputInitialTrackParameters = - particleSmearingCfg.outputTrackParameters; - fitter.outputTracks = "tracks"; - fitter.pickTrack = vm["fit-pick-track"].as(); - fitter.fit = ActsExamples::makeKalmanFitterFunction( - trackingGeometry, magneticField, - vm["fit-multiple-scattering-correction"].as(), - vm["fit-energy-loss-correction"].as()); - sequencer.addAlgorithm( - std::make_shared(fitter, logLevel)); - - // write track states from fitting - RootTrackStatesWriter::Config trackStatesWriter; - trackStatesWriter.inputTracks = fitter.outputTracks; - trackStatesWriter.inputParticles = inputParticles; - trackStatesWriter.inputSimHits = simHitReaderCfg.outputSimHits; - trackStatesWriter.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - trackStatesWriter.inputMeasurementSimHitsMap = - digiCfg.outputMeasurementSimHitsMap; - trackStatesWriter.filePath = outputDir + "/trackstates_fitter.root"; - sequencer.addWriter( - std::make_shared(trackStatesWriter, logLevel)); - - // write track summary from CKF - RootTrackSummaryWriter::Config trackSummaryWriter; - trackSummaryWriter.inputTracks = fitter.outputTracks; - trackSummaryWriter.inputParticles = inputParticles; - trackSummaryWriter.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - trackSummaryWriter.filePath = outputDir + "/tracksummary_fitter.root"; - sequencer.addWriter( - std::make_shared(trackSummaryWriter, logLevel)); - - // Write CKF performance data - // write reconstruction performance data - TrackFinderPerformanceWriter::Config perfFinder; - perfFinder.inputProtoTracks = trackFinderCfg.outputProtoTracks; - perfFinder.inputParticles = inputParticles; - perfFinder.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - perfFinder.filePath = outputDir + "/performance_track_finder.root"; - sequencer.addWriter( - std::make_shared(perfFinder, logLevel)); - - TrackFitterPerformanceWriter::Config perfFitter; - perfFitter.inputTracks = fitter.outputTracks; - perfFitter.inputParticles = inputParticles; - perfFitter.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - perfFitter.filePath = outputDir + "/performance_track_fitter.root"; - sequencer.addWriter( - std::make_shared(perfFitter, logLevel)); - - return sequencer.run(); -} diff --git a/Examples/Run/Alignment/Common/DetectorAlignment.hpp b/Examples/Run/Alignment/Common/DetectorAlignment.hpp deleted file mode 100644 index 9b8bbcc1424..00000000000 --- a/Examples/Run/Alignment/Common/DetectorAlignment.hpp +++ /dev/null @@ -1,41 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsAlignment/Kernel/Alignment.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Utilities/Options.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -#include - -namespace ActsExamples { -class IBaseDetector; -} - -using AlignedDetElementGetter = - std::function( - const std::shared_ptr&, - const std::vector&)>; - -/// The options for running alignment or not -/// -/// @param desc The options description to add options to -void addAlignmentOptions(ActsExamples::Options::Description& desc); - -/// Main function for running alignment for specific detector. -/// -/// @param argc number of command line arguments -/// @param argv command line arguments -/// @param detector is the detector to be aligned -int runDetectorAlignment( - int argc, char* argv[], - const std::shared_ptr& detector, - ActsAlignment::AlignedTransformUpdater alignedTransformUpdater, - const AlignedDetElementGetter& alignedDetElementsGetter); diff --git a/Examples/Run/Alignment/ContextualAlignment.cpp b/Examples/Run/Alignment/ContextualAlignment.cpp deleted file mode 100644 index 5435b5b485f..00000000000 --- a/Examples/Run/Alignment/ContextualAlignment.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/ContextualDetector/InternallyAlignedDetectorElement.hpp" -#include "ActsExamples/Detector/AlignedDetectorWithOptions.hpp" - -#include "DetectorAlignment.hpp" - -int main(int argc, char* argv[]) { - // 1. The aligned transform updater - ActsAlignment::AlignedTransformUpdater alignedTransformUpdater = - [](Acts::DetectorElementBase* detElement, - const Acts::GeometryContext& gctx, - const Acts::Transform3& aTransform) { - auto* alignedDetElement = dynamic_cast< - ActsExamples::Contextual::InternallyAlignedDetectorElement*>( - detElement); - assert(alignedDetElement != nullptr && "Got wrong detector element"); - auto alignContext = - gctx.get(); - if (alignedDetElement != nullptr) { - alignedDetElement->addAlignedTransform(aTransform, alignContext.iov); - return true; - } - return false; - }; - - // 2. Selector for the detector elements to be aligned - // @todo: allow different levels of alignment - auto alignedDetElementsGetter = - [](const std::shared_ptr& detector, - const std::vector& geometrySelection) - -> std::vector { - std::vector dets; - auto* alignedDetector = - &dynamic_cast(detector.get()) - ->m_detector; - for (auto& lstore : alignedDetector->detectorStore()) { - for (auto& ldet : lstore) { - // get the detector surface - const auto& surface = &ldet->surface(); - auto geoID = surface->geometryId(); - auto it = std::find(geometrySelection.begin(), geometrySelection.end(), - geoID); - if (it != geometrySelection.end()) { - dets.push_back(ldet.get()); - } - } - } - return dets; - }; - - return runDetectorAlignment( - argc, argv, std::make_shared(), - alignedTransformUpdater, alignedDetElementsGetter); -} diff --git a/Examples/Run/CMakeLists.txt b/Examples/Run/CMakeLists.txt deleted file mode 100644 index 935b8938063..00000000000 --- a/Examples/Run/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -message(WARNING "The examples binaries are deprecated and may be removed in the future. Consider using the python bindings.") - -# shared code -add_subdirectory(Common) -add_subdirectory_if(DD4hep ACTS_BUILD_EXAMPLES_DD4HEP) - -# tools -add_subdirectory(Digitization) -add_subdirectory(Fatras) -add_subdirectory_if(Geant4 ACTS_BUILD_EXAMPLES_GEANT4) -add_subdirectory(Generators) -add_subdirectory(Geometry) -add_subdirectory(HelloWorld) -add_subdirectory_if(HepMC3 ACTS_BUILD_EXAMPLES_HEPMC3) -add_subdirectory(MagneticField) -add_subdirectory(MaterialMapping) -add_subdirectory(Misc) -add_subdirectory(Propagation) -add_subdirectory(Reconstruction) -add_subdirectory(Show) -add_subdirectory(Vertexing) -add_subdirectory_if(Alignment ACTS_BUILD_ALIGNMENT) diff --git a/Examples/Run/Common/CMakeLists.txt b/Examples/Run/Common/CMakeLists.txt deleted file mode 100644 index ab9a6aea828..00000000000 --- a/Examples/Run/Common/CMakeLists.txt +++ /dev/null @@ -1,57 +0,0 @@ -include(ActsTargetLinkLibrariesSystem) - -add_library( - ActsExamplesCommon SHARED - src/CommonGeometry.cpp - src/CommonOptions.cpp - src/CommonSimulation.cpp - src/GeometryExampleBase.cpp - src/CommonMaterialMapping.cpp - src/MaterialValidationBase.cpp - src/PropagationExampleBase.cpp - src/ReconstructionBase.cpp - src/TrackFindingOptions.cpp - src/TrackFittingOptions.cpp - src/ParticleSmearingOptions.cpp - src/ParticleSelectorOptions.cpp - src/ParticleGunOptions.cpp - src/DigitizationOptions.cpp - src/MagneticFieldOptions.cpp - src/CsvOptionsReader.cpp - src/CsvOptionsWriter.cpp - src/JsonOptionsWriter.cpp - src/VertexingOptions.cpp - src/SpacePointMakerOptions.cpp - src/TruthSeedSelectorOptions.cpp - src/NuclearInteractionOptions.cpp - src/AlignedDetectorWithOptions.cpp - src/GenericDetectorWithOptions.cpp - src/EmptyDetector.cpp - src/TelescopeDetectorWithOptions.cpp - src/TGeoDetectorWithOptions.cpp) -target_include_directories( - ActsExamplesCommon - PUBLIC $) -target_link_libraries( - ActsExamplesCommon - PUBLIC - ActsCore - ActsExamplesFramework ActsExamplesMagneticField - ActsExamplesPropagation ActsExamplesGenerators - ActsExamplesMaterialMapping ActsExamplesIoCsv ActsExamplesIoJson - ActsExamplesIoRoot ActsExamplesIoObj ActsExamplesIoPerformance - ActsExamplesDigitization ActsExamplesTrackFitting - ActsExamplesTrackFinding ActsExamplesTruthTracking - ActsExamplesIoCsv ActsExamplesDetectorTelescope - ActsExamplesDetectorGeneric ActsExamplesDetectorContextual - ActsExamplesDetectorTGeo) - -acts_target_link_libraries_system( - ActsExamplesCommon PRIVATE dfelibs) - -acts_target_link_libraries_system( - ActsExamplesCommon PUBLIC Boost::program_options) - -install( - TARGETS ActsExamplesCommon - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/Examples/Run/Common/include/ActsExamples/Detector/AlignedDetectorWithOptions.hpp b/Examples/Run/Common/include/ActsExamples/Detector/AlignedDetectorWithOptions.hpp deleted file mode 100644 index 32548b13626..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Detector/AlignedDetectorWithOptions.hpp +++ /dev/null @@ -1,32 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/ContextualDetector/AlignedDetector.hpp" -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -#include -#include - -namespace ActsExamples { - -struct AlignedDetectorWithOptions : public ActsExamples::IBaseDetector { - Contextual::AlignedDetector m_detector; - - public: - void addOptions( - boost::program_options::options_description& opt) const override; - - auto finalize(const boost::program_options::variables_map& vm, - std::shared_ptr mdecorator) - -> std::pair override; -}; - -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Detector/EmptyDetector.hpp b/Examples/Run/Common/include/ActsExamples/Detector/EmptyDetector.hpp deleted file mode 100644 index d13d6954c99..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Detector/EmptyDetector.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -#include -#include - -struct EmptyDetector : public ActsExamples::IBaseDetector { - void addOptions( - boost::program_options::options_description& opt) const override; - - std::pair - finalize(const boost::program_options::variables_map& vm, - std::shared_ptr mdecorator) override; -}; diff --git a/Examples/Run/Common/include/ActsExamples/Detector/GenericDetectorWithOptions.hpp b/Examples/Run/Common/include/ActsExamples/Detector/GenericDetectorWithOptions.hpp deleted file mode 100644 index d3c2768d66f..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Detector/GenericDetectorWithOptions.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2022 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -#pragma once - -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/GenericDetector/GenericDetector.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { - -class GenericDetectorWithOptions : public IBaseDetector { - GenericDetector m_detector; - - public: - void addOptions( - boost::program_options::options_description& opt) const override; - - auto finalize(const boost::program_options::variables_map& vm, - std::shared_ptr mdecorator) - -> std::pair override; -}; -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Detector/IBaseDetector.hpp b/Examples/Run/Common/include/ActsExamples/Detector/IBaseDetector.hpp deleted file mode 100644 index a52e5f1b0b6..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Detector/IBaseDetector.hpp +++ /dev/null @@ -1,41 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -#include -#include -#include - -namespace Acts { -class TrackingGeometry; -class IMaterialDecorator; -} // namespace Acts - -namespace ActsExamples { -class IContextDecorator; -} // namespace ActsExamples - -namespace ActsExamples { -class IBaseDetector { - public: - using ContextDecorators = - std::vector>; - using TrackingGeometryPtr = std::shared_ptr; - - virtual ~IBaseDetector() = default; - virtual void addOptions( - boost::program_options::options_description& opt) const = 0; - - virtual std::pair finalize( - const boost::program_options::variables_map& vm, - std::shared_ptr mdecorator) = 0; -}; -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Detector/TGeoDetectorWithOptions.hpp b/Examples/Run/Common/include/ActsExamples/Detector/TGeoDetectorWithOptions.hpp deleted file mode 100644 index 1ee4295b5fa..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Detector/TGeoDetectorWithOptions.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -#pragma once - -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/TGeoDetector/TGeoDetector.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { - -class TGeoDetectorWithOptions : public IBaseDetector { - TGeoDetector m_detector; - - void addOptions( - boost::program_options::options_description& opt) const override; - - auto finalize(const boost::program_options::variables_map& vm, - std::shared_ptr mdecorator) - -> std::pair override; -}; -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Detector/TelescopeDetectorWithOptions.hpp b/Examples/Run/Common/include/ActsExamples/Detector/TelescopeDetectorWithOptions.hpp deleted file mode 100644 index b251039655b..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Detector/TelescopeDetectorWithOptions.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -#pragma once - -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/TelescopeDetector/TelescopeDetector.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -namespace ActsExamples { - -class TelescopeDetectorWithOptions : public IBaseDetector { - Telescope::TelescopeDetector m_detector; - - public: - void addOptions(ActsExamples::Options::Description& desc) const override; - - auto finalize(const boost::program_options::variables_map& vm, - std::shared_ptr /*mdecorator*/) - -> std::pair override; -}; -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Geometry/CommonGeometry.hpp b/Examples/Run/Common/include/ActsExamples/Geometry/CommonGeometry.hpp deleted file mode 100644 index 3a79322062c..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Geometry/CommonGeometry.hpp +++ /dev/null @@ -1,41 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -#include -#include -#include - -namespace Acts { -class TrackingGeometry; -} - -namespace ActsExamples { -class DetectorWithOptions; -class IContextDecorator; -namespace Geometry { - -/// @brief helper method to setup the geometry -/// -/// @tparam options_map_t Type of the options to be read -/// @tparam geometry_setupt_t Type of the callable geometry setup -/// -/// @param vm the parsed options map -/// @param geometrySetup the callable geometry setup -/// -/// @return a pair of TrackingGeometry and context decorators -std::pair, - std::vector>> -build(const boost::program_options::variables_map& vm, IBaseDetector& detector); - -} // namespace Geometry -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Geometry/GeometryExampleBase.hpp b/Examples/Run/Common/include/ActsExamples/Geometry/GeometryExampleBase.hpp deleted file mode 100644 index 295ebb1d2fe..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Geometry/GeometryExampleBase.hpp +++ /dev/null @@ -1,18 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -namespace ActsExamples { -class IBaseDetector; -} - -/// @brief method to process a geometry -/// @param detector The detector descriptor instance -int processGeometry(int argc, char* argv[], - ActsExamples::IBaseDetector& detector); diff --git a/Examples/Run/Common/include/ActsExamples/Geometry/MaterialWiper.hpp b/Examples/Run/Common/include/ActsExamples/Geometry/MaterialWiper.hpp deleted file mode 100644 index c4bf9ee0d72..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Geometry/MaterialWiper.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -/////////////////////////////////////////////////////////////////// -// MaterialWiper.hpp, Acts project -/////////////////////////////////////////////////////////////////// - -#pragma once - -#include "Acts/Geometry/TrackingVolume.hpp" -#include "Acts/Material/IMaterialDecorator.hpp" -#include "Acts/Surfaces/Surface.hpp" - -// @note This file will go into the acts-core -namespace Acts { - -/// @class MaterialWiper -/// -/// This decorator sets the nulls-material -/// -class MaterialWiper : public IMaterialDecorator { - public: - /// Decorate a surface - /// - /// @param surface the non-cost surface that is decorated - void decorate(Surface& surface) const final { - surface.assignSurfaceMaterial(nullptr); - } - - /// Decorate a TrackingVolume - /// - /// @param volume the non-cost volume that is decorated - void decorate(TrackingVolume& volume) const final { - volume.assignVolumeMaterial(nullptr); - } -}; - -} // namespace Acts diff --git a/Examples/Run/Common/include/ActsExamples/MaterialMapping/CommonMaterialMapping.hpp b/Examples/Run/Common/include/ActsExamples/MaterialMapping/CommonMaterialMapping.hpp deleted file mode 100644 index 02a3157ef7b..00000000000 --- a/Examples/Run/Common/include/ActsExamples/MaterialMapping/CommonMaterialMapping.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2017-2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -namespace ActsExamples { -class IBaseDetector; -} - -/// @brief The material validation example, it runs a propagation -/// and then writes out the material information -/// -/// @param argc the number of arguments of the call -/// @param atgv the argument list -/// @param detector the detector instance -/// -int runMaterialMapping(int argc, char* argv[], - ActsExamples::IBaseDetector& detector); diff --git a/Examples/Run/Common/include/ActsExamples/MaterialMapping/MaterialValidationBase.hpp b/Examples/Run/Common/include/ActsExamples/MaterialMapping/MaterialValidationBase.hpp deleted file mode 100644 index 3bf362b1876..00000000000 --- a/Examples/Run/Common/include/ActsExamples/MaterialMapping/MaterialValidationBase.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2017-2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -namespace ActsExamples { -class IBaseDetector; -} - -/// @brief The material validation example, it runs a propagation -/// and then writes out the material information -/// -/// @param argc the number of arguments of the call -/// @param atgv the argument list -/// @param detector the detector instance -int materialValidationExample(int argc, char* argv[], - ActsExamples::IBaseDetector& detector); diff --git a/Examples/Run/Common/include/ActsExamples/Options/CommonOptions.hpp b/Examples/Run/Common/include/ActsExamples/Options/CommonOptions.hpp deleted file mode 100644 index 4ac8badc3c6..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/CommonOptions.hpp +++ /dev/null @@ -1,84 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2017-2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "Acts/Utilities/EnumBitwiseOperators.hpp" -#include "Acts/Utilities/Logger.hpp" -#include "ActsExamples/Framework/RandomNumbers.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" - -#include - -#include - -namespace ActsExamples { - -enum class OutputFormat : uint8_t { - DirectoryOnly = 0, - Root = 1, - Csv = 2, - Obj = 4, - Json = 8, - Cbor = 16, - Txt = 32, - All = std::numeric_limits::max() -}; - -ACTS_DEFINE_ENUM_BITWISE_OPERATORS(OutputFormat) - -namespace Options { - -/// Construct the options description with minimal default options. -/// -/// @param caption Optional help text caption -boost::program_options::options_description makeDefaultOptions( - const std::string& caption = std::string()); - -/// Add sequencer options, e.g. number of events -void addSequencerOptions(boost::program_options::options_description& opt); - -/// Add random number options such as the global seed. -void addRandomNumbersOptions(boost::program_options::options_description& opt); - -/// Add common geometry-related options. -void addGeometryOptions(boost::program_options::options_description& opt); - -/// Add common material-related options. -void addMaterialOptions(boost::program_options::options_description& opt); - -/// Add common input-related options. -void addInputOptions(boost::program_options::options_description& opt); - -/// Add common output-related options. -void addOutputOptions(boost::program_options::options_description& opt, - OutputFormat format); - -/// Parse options and return the resulting variables map. -/// -/// Automatically prints the help text if requested. -/// -/// @returns Empty variables map if help text was shown. -boost::program_options::variables_map parse( - const boost::program_options::options_description& opt, int argc, - char* argv[]); - -/// Read the log level. -Acts::Logging::Level readLogLevel( - const boost::program_options::variables_map& vm); - -/// Read the sequencer config. -Sequencer::Config readSequencerConfig( - const boost::program_options::variables_map& vm); - -// Read the random numbers config. -RandomNumbers::Config readRandomNumbersConfig( - const boost::program_options::variables_map& vm); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/CsvOptionsReader.hpp b/Examples/Run/Common/include/ActsExamples/Options/CsvOptionsReader.hpp deleted file mode 100644 index 9ed16b2c938..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/CsvOptionsReader.hpp +++ /dev/null @@ -1,45 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Io/Csv/CsvMeasurementReader.hpp" -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" -#include "ActsExamples/Io/Csv/CsvPlanarClusterReader.hpp" -#include "ActsExamples/Io/Csv/CsvSimHitReader.hpp" -#include "ActsExamples/Io/Csv/CsvSpacePointReader.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { -namespace Options { - -// There are no additional CSV reader options apart from the -// format-independent, generic input option. - -/// Read the CSV particle reader config. -ActsExamples::CsvParticleReader::Config readCsvParticleReaderConfig( - const Variables& vm); - -/// Read the CSV sim hit reader config. -ActsExamples::CsvSimHitReader::Config readCsvSimHitReaderConfig( - const Variables& vm); - -/// Read the CSV space point reader config. -ActsExamples::CsvSpacePointReader::Config readCsvSpacePointReaderConfig( - const Variables& vm); - -/// Read the CSV measurement reader config. -ActsExamples::CsvMeasurementReader::Config readCsvMeasurementReaderConfig( - const Variables& vm); - -/// Read the CSV particle reader config. -ActsExamples::CsvPlanarClusterReader::Config readCsvPlanarClusterReaderConfig( - const Variables& vm); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/CsvOptionsWriter.hpp b/Examples/Run/Common/include/ActsExamples/Options/CsvOptionsWriter.hpp deleted file mode 100644 index bf8f4122506..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/CsvOptionsWriter.hpp +++ /dev/null @@ -1,45 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2017-2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Io/Csv/CsvMeasurementWriter.hpp" -#include "ActsExamples/Io/Csv/CsvParticleWriter.hpp" -#include "ActsExamples/Io/Csv/CsvPlanarClusterWriter.hpp" -#include "ActsExamples/Io/Csv/CsvSimHitWriter.hpp" -#include "ActsExamples/Io/Csv/CsvTrackingGeometryWriter.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { -namespace Options { - -// Add common CSV writer options. -void addCsvWriterOptions(Description& desc); - -/// Read the CSV particle writer options. -ActsExamples::CsvParticleWriter::Config readCsvParticleWriterConfig( - const Variables& vm); - -/// Read the CSV sim hit writer options. -ActsExamples::CsvSimHitWriter::Config readCsvSimHitWriterConfig( - const Variables& vm); - -/// Read the CSV planar cluster writer options. -ActsExamples::CsvPlanarClusterWriter::Config readCsvPlanarClusterWriterConfig( - const Variables& vm); - -/// Read the CSV measurement writer options. -ActsExamples::CsvMeasurementWriter::Config readCsvMeasurementWriterConfig( - const Variables& vm); - -/// Read the CSV tracking geometry writer config. -ActsExamples::CsvTrackingGeometryWriter::Config -readCsvTrackingGeometryWriterConfig(const Variables& vm); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/DigitizationOptions.hpp b/Examples/Run/Common/include/ActsExamples/Options/DigitizationOptions.hpp deleted file mode 100644 index 841d3628eba..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/DigitizationOptions.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Digitization/DigitizationAlgorithm.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { -namespace Options { - -/// Add Digitization options. -/// -/// @param desc The options description to add options to -void addDigitizationOptions(Description &desc); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/EmptyDetectorOptions.hpp b/Examples/Run/Common/include/ActsExamples/Options/EmptyDetectorOptions.hpp deleted file mode 100644 index c40ae3b1aad..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/EmptyDetectorOptions.hpp +++ /dev/null @@ -1,36 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "Acts/Definitions/Units.hpp" - -#include - -#include - -namespace ActsExamples { - -namespace Options { - -/// The empty geometry options, the are prefixes with geo-generic -/// -/// @tparam options_t Type of the options object (bound to boost API) -/// -/// @param opt The provided object, where root specific options are attached -template -void addEmptyGeometryOptions(options_t& opt) { - using namespace Acts::UnitLiterals; - namespace po = boost::program_options; - opt.add_options()("geo-empty-radius", po::value()->default_value(2_m), - "Radius of the empty cylinder [in m]. ")( - "geo-empty-halfLength", po::value()->default_value(10_m), - "Half length of the empty cylinder [in m]."); -} -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/GenericDetectorOptions.hpp b/Examples/Run/Common/include/ActsExamples/Options/GenericDetectorOptions.hpp deleted file mode 100644 index 430c790bf1b..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/GenericDetectorOptions.hpp +++ /dev/null @@ -1,38 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "Acts/Definitions/Units.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include - -#include - -namespace ActsExamples { - -namespace Options { - -namespace po = boost::program_options; - -/// The generic geometry options, the are prefixes with geo-generic -/// -/// @tparam options_t Type of the options object (bound to boost API) -/// -/// @param opt The provided object, where root specific options are attached -template -void addGenericGeometryOptions(options_t& opt) { - opt.add_options()("geo-generic-buildlevel", - po::value()->default_value(3), - "The building level: 0 - pixel barrel only, 1 - pixel " - "detector only, 2 - full barrel only, 3 - full detector " - "(without stereo modules)."); -} -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/JsonOptionsWriter.hpp b/Examples/Run/Common/include/ActsExamples/Options/JsonOptionsWriter.hpp deleted file mode 100644 index de425a4fbfc..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/JsonOptionsWriter.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Io/Json/JsonSurfacesWriter.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { -namespace Options { - -// Add common Json writer options. -void addJsonWriterOptions(Description& desc); - -/// Read the Json tracking geometry writer config. -ActsExamples::JsonSurfacesWriter::Config readJsonSurfacesWriterConfig( - const Variables& vm); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/MagneticFieldOptions.hpp b/Examples/Run/Common/include/ActsExamples/Options/MagneticFieldOptions.hpp deleted file mode 100644 index 755f20d95c3..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/MagneticFieldOptions.hpp +++ /dev/null @@ -1,32 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2017-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "Acts/MagneticField/MagneticFieldProvider.hpp" -#include "ActsExamples/MagneticField/MagneticField.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { - -class Sequencer; - -namespace Options { - -/// Add magnetic field options with a `bf-` prefix. -void addMagneticFieldOptions(Description& desc); - -/// Setup any additional services required for the magnetic field. -void setupMagneticFieldServices(const Variables& vars, Sequencer& seq); - -/// Read and create the magnetic field from the given user variables. -std::shared_ptr readMagneticField( - const Variables& vars); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/NuclearInteractionOptions.hpp b/Examples/Run/Common/include/ActsExamples/Options/NuclearInteractionOptions.hpp deleted file mode 100644 index 2c09fb84256..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/NuclearInteractionOptions.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "Acts/Definitions/Units.hpp" -#include "Acts/Utilities/Logger.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" -#include "ActsFatras/Physics/NuclearInteraction/NuclearInteraction.hpp" -#include "ActsFatras/Physics/NuclearInteraction/NuclearInteractionParameters.hpp" - -#include - -#include "boost/program_options.hpp" - -namespace ActsExamples { -namespace Options { - -/// Add Fatras options. -/// -/// @param desc The options description to add options to -void addNuclearInteractionOptions(Description& desc); - -/// Reads the parametrisation and provides the parametrisation -ActsFatras::detail::MultiParticleNuclearInteractionParametrisation -readParametrisations(const std::string& fileName); - -/// Read Fatras options to create the algorithm config. -/// -/// @param variables the variables to read from -std::string readNuclearInteractionConfig( - const boost::program_options::variables_map& variables); - -/// Read the parametrisations. -/// -/// @tparam simulator_t type of the simulation kernel -/// @param [in] nuclearInteractionParametrisation File name of the -/// parametrisations -/// @param [in, out] simulator The simulation kernel -template -void setNuclearInteractionParametrisations( - const std::string& nuclearInteractionParametrisation, - simulator_t& simulator) { - if (nuclearInteractionParametrisation.empty()) { - return; - } - - auto& chargedNuclearInteraction = - simulator.charged.interactions - .template get(); - auto& neutralNuclearInteraction = - simulator.neutral.interactions - .template get(); - - const auto mpp = readParametrisations(nuclearInteractionParametrisation); - - chargedNuclearInteraction.multiParticleParameterisation = mpp; - neutralNuclearInteraction.multiParticleParameterisation = mpp; -} - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/ParticleGunOptions.hpp b/Examples/Run/Common/include/ActsExamples/Options/ParticleGunOptions.hpp deleted file mode 100644 index dc8b101b6ac..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/ParticleGunOptions.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Generators/EventGenerator.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { -namespace Options { - -/// Add options for a particle-gun-like event generator. -void addParticleGunOptions(Description& desc); - -/// Create the event generator config from particle-gun options. -EventGenerator::Config readParticleGunOptions(const Variables& vars); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/ParticleSelectorOptions.hpp b/Examples/Run/Common/include/ActsExamples/Options/ParticleSelectorOptions.hpp deleted file mode 100644 index 50e0b995c5a..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/ParticleSelectorOptions.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2016-2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/TruthTracking/ParticleSelector.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -#include - -namespace ActsExamples { -namespace Options { - -void addParticleSelectorOptions(Options::Description& desc); - -ActsExamples::ParticleSelector::Config readParticleSelectorConfig( - const Options::Variables& vars); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/ParticleSmearingOptions.hpp b/Examples/Run/Common/include/ActsExamples/Options/ParticleSmearingOptions.hpp deleted file mode 100644 index 8f2cad9fd45..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/ParticleSmearingOptions.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/TruthTracking/ParticleSmearing.hpp" -#include "ActsExamples/Utilities/Options.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -#include - -namespace ActsExamples { - -class Sequencer; - -namespace Options { - -/// Add particle smearing options with a `smearing-` prefix. -void addParticleSmearingOptions(Description& desc); - -/// Read options -ParticleSmearing::Config readParticleSmearingOptions( - const Options::Variables& vars); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/SpacePointMakerOptions.hpp b/Examples/Run/Common/include/ActsExamples/Options/SpacePointMakerOptions.hpp deleted file mode 100644 index 9bd59dc6af5..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/SpacePointMakerOptions.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/TrackFinding/SpacePointMaker.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { -namespace Options { - -/// Add SpacePointMaker options. -/// -/// @param desc The options description to add options to -void addSpacePointMakerOptions(Description& desc); - -/// Read SpacePointMaker options to create the algorithm config. -/// -/// @param variables The variables to read from -SpacePointMaker::Config readSpacePointMakerConfig(const Variables& variables); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/TrackFindingOptions.hpp b/Examples/Run/Common/include/ActsExamples/Options/TrackFindingOptions.hpp deleted file mode 100644 index c03cd9c4270..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/TrackFindingOptions.hpp +++ /dev/null @@ -1,30 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "Acts/Utilities/Logger.hpp" -#include "ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { -namespace Options { - -/// Add TrackFinding options. -/// -/// @param desc The options description to add options to -void addTrackFindingOptions(Description& desc); - -/// Read TrackFinding options to create the algorithm config. -/// -/// @param variables The variables to read from -TrackFindingAlgorithm::Config readTrackFindingConfig( - const Variables& variables); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/TrackFittingOptions.hpp b/Examples/Run/Common/include/ActsExamples/Options/TrackFittingOptions.hpp deleted file mode 100644 index 28a323ba36b..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/TrackFittingOptions.hpp +++ /dev/null @@ -1,20 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include - -namespace ActsExamples { -namespace Options { - -/// Add common fitted related options -void addFittingOptions(boost::program_options::options_description& opt); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/TruthSeedSelectorOptions.hpp b/Examples/Run/Common/include/ActsExamples/Options/TruthSeedSelectorOptions.hpp deleted file mode 100644 index 9b71312e939..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/TruthSeedSelectorOptions.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2022 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/TruthTracking/TruthSeedSelector.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { -namespace Options { - -void addTruthSeedSelectorOptions(Options::Description& desc); - -ActsExamples::TruthSeedSelector::Config readTruthSeedSelectorConfig( - const Options::Variables& vars); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Options/VertexingOptions.hpp b/Examples/Run/Common/include/ActsExamples/Options/VertexingOptions.hpp deleted file mode 100644 index ceddfe3c41b..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Options/VertexingOptions.hpp +++ /dev/null @@ -1,21 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { -namespace Options { - -/// Add vertexing options. -/// -/// @param desc The options description to add options to -void addVertexingOptions(Description& desc); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/include/ActsExamples/Propagation/PropagationExampleBase.hpp b/Examples/Run/Common/include/ActsExamples/Propagation/PropagationExampleBase.hpp deleted file mode 100644 index 53f8058a9db..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Propagation/PropagationExampleBase.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2017-2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -namespace ActsExamples { -class IBaseDetector; -} - -/// The Propagation example -/// -/// -/// @param argc the number of arguments of the call -/// @param argv the argument list -/// @param detector The detector descriptor instance -int propagationExample(int argc, char* argv[], - ActsExamples::IBaseDetector& detector); diff --git a/Examples/Run/Common/include/ActsExamples/Reconstruction/ReconstructionBase.hpp b/Examples/Run/Common/include/ActsExamples/Reconstruction/ReconstructionBase.hpp deleted file mode 100644 index 295ed624ffb..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Reconstruction/ReconstructionBase.hpp +++ /dev/null @@ -1,86 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Digitization/DigitizationConfig.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Framework/WhiteBoard.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" -#include "ActsExamples/Io/Csv/CsvSimHitReader.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/CsvOptionsReader.hpp" -#include "ActsExamples/Options/ParticleSmearingOptions.hpp" -#include "ActsExamples/TruthTracking/ParticleSmearing.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include -#include -#include - -/// Setup sim hit csv reader -/// -/// @param vars The configuration variables -/// @param sequencer The framework sequencer -/// -/// @return config for sim hits csv reader -ActsExamples::CsvSimHitReader::Config setupSimHitReading( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer); - -/// Setup sim particle csv reader -/// -/// @param vars The configuration variables -/// @param sequencer The framework sequencer -/// -/// @return config for sim particles csv reader -ActsExamples::CsvParticleReader::Config setupParticleReading( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer); - -/// Setup sim hit smearing -/// -/// @param vars The configuration variables -/// @param sequencer The framework sequencer -/// @param rnd The random number service -/// @param trackingGeometry The TrackingGeometry for the tracking setup -/// @param inputSimHits The input sim hit collection (e.g. from sim hit reader) -/// -/// @return config for hit smearing -ActsExamples::DigitizationConfig setupDigitization( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer, - std::shared_ptr rnd, - std::shared_ptr trackingGeometry, - const std::string& inputSimHits); - -/// Setup particle smearing -/// -/// @param vars The configuration variables -/// @param sequencer The framework sequencer -/// @param rnd The random number service -/// @param inputParticles The input particle collection (e.g. from particle -/// reader or from particle selection) -/// -/// @return config for particle smearing -ActsExamples::ParticleSmearing::Config setupParticleSmearing( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer, - std::shared_ptr rnd, - const std::string& inputParticles); - -/// Setup reading measurements -/// -/// @param vars The configuration variables -/// @param sequencer The framework sequencer -/// -/// @return config for reading measurements -ActsExamples::CsvMeasurementReader::Config setupMeasurementReading( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer); diff --git a/Examples/Run/Common/include/ActsExamples/Simulation/CommonSimulation.hpp b/Examples/Run/Common/include/ActsExamples/Simulation/CommonSimulation.hpp deleted file mode 100644 index 7b5415be893..00000000000 --- a/Examples/Run/Common/include/ActsExamples/Simulation/CommonSimulation.hpp +++ /dev/null @@ -1,50 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Framework/RandomNumbers.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { -namespace Simulation { - -/// Collection names -static constexpr const char* kParticlesInput = "particles_input"; -static constexpr const char* kParticlesSelection = "particles_selection"; -static constexpr const char* kParticlesInitial = "particles_initial"; -static constexpr const char* kParticlesFinal = "particles_final"; -static constexpr const char* kSimHits = "simhits"; -static constexpr const char* kMaterialTracks = "material_tracks"; - -/// Add input options -/// -/// @param desc is the boost options descr format -void addInputOptions(ActsExamples::Options::Description& desc); - -/// Setup the input from the provided options -/// -/// @param vars the parsed variables from the boost options -/// @param sequencer the non-const sequencer -/// @param randomNumbers the randomNumbers shared pointer -/// -void setupInput( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer, - std::shared_ptr randomNumbers); - -/// Setup the output from the provided options -/// -/// @param vars the parsed variables from the boost options -/// @param sequencer the non-const sequencer -void setupOutput(const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer); - -} // namespace Simulation -} // namespace ActsExamples diff --git a/Examples/Run/Common/src/AlignedDetectorWithOptions.cpp b/Examples/Run/Common/src/AlignedDetectorWithOptions.cpp deleted file mode 100644 index 2345d44ea1c..00000000000 --- a/Examples/Run/Common/src/AlignedDetectorWithOptions.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2022 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/AlignedDetectorWithOptions.hpp" - -#include "ActsExamples/Options/GenericDetectorOptions.hpp" - -#include - -using namespace Acts::UnitLiterals; - -namespace ActsExamples { - -void AlignedDetectorWithOptions::addOptions( - boost::program_options::options_description& opt) const { - // Add the generic geometry options - ActsExamples::Options::addGenericGeometryOptions(opt); - // specify the rotation setp - opt.add_options()( - "align-seed", - boost::program_options::value()->default_value(1324354657), - "Seed for the decorator random numbers.")( - "align-iovsize", - boost::program_options::value()->default_value(100), - "Size of a valid IOV.")( - "align-flushsize", - boost::program_options::value()->default_value(200), - "Span until garbage collection is active.")( - "align-no-gc", boost::program_options::bool_switch())( - "align-sigma-iplane", - boost::program_options::value()->default_value(100.), - "Sigma of the in-plane misalignment in [um]")( - "align-sigma-oplane", - boost::program_options::value()->default_value(50.), - "Sigma of the out-of-plane misalignment in [um]")( - "align-sigma-irot", - boost::program_options::value()->default_value(20.), - "Sigma of the in-plane rotation misalignment in [mrad]")( - "align-sigma-orot", - boost::program_options::value()->default_value(0.), - "Sigma of the out-of-plane rotation misalignment in [mrad]")( - "align-loglevel", - boost::program_options::value()->default_value(3), - "Output log level of the alignment decorator.")( - "align-firstnominal", - boost::program_options::value()->default_value(false), - "Keep the first iov batch nominal.")( - "align-mode", - boost::program_options::value()->default_value("internal")); -} - -auto AlignedDetectorWithOptions::finalize( - const boost::program_options::variables_map& vm, - std::shared_ptr mdecorator) - -> std::pair { - // -------------------------------------------------------------------------------- - - using Config = Contextual::AlignedDetector::Config; - Config cfg; - - cfg.buildLevel = vm["geo-generic-buildlevel"].template as(); - // set geometry building logging level - cfg.surfaceLogLevel = Acts::Logging::Level( - vm["geo-surface-loglevel"].template as()); - cfg.layerLogLevel = - Acts::Logging::Level(vm["geo-layer-loglevel"].template as()); - cfg.volumeLogLevel = Acts::Logging::Level( - vm["geo-volume-loglevel"].template as()); - - cfg.buildProto = (vm["mat-input-type"].template as() == "proto"); - - cfg.decoratorLogLevel = - Acts::Logging::Level(vm["align-loglevel"].template as()); - - cfg.seed = vm["align-seed"].template as(); - cfg.iovSize = vm["align-iovsize"].template as(); - cfg.flushSize = vm["align-flushsize"].template as(); - cfg.doGarbageCollection = !vm["align-no-gc"].as(); - - // The misalignments - cfg.sigmaInPlane = vm["align-sigma-iplane"].template as() * 1_um; - cfg.sigmaOutPlane = vm["align-sigma-oplane"].template as() * 1_um; - cfg.sigmaInRot = vm["align-sigma-irot"].template as() * 0.001; - cfg.sigmaOutRot = vm["align-sigma-orot"].template as() * 0.001; - cfg.firstIovNominal = vm["align-firstnominal"].template as(); - - auto mode = vm["align-mode"].as(); - if (mode == "external") { - cfg.mode = Config::Mode::External; - } else if (mode == "internal") { - cfg.mode = Config::Mode::Internal; - } else { - throw std::invalid_argument{ - "--align-mode must be 'external' or 'internal'"}; - } - - return m_detector.finalize(cfg, mdecorator); -} - -} // namespace ActsExamples diff --git a/Examples/Run/Common/src/CommonGeometry.cpp b/Examples/Run/Common/src/CommonGeometry.cpp deleted file mode 100644 index ba63eb5b702..00000000000 --- a/Examples/Run/Common/src/CommonGeometry.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Geometry/MaterialWiper.hpp" -#include "ActsExamples/Io/Root/RootMaterialDecorator.hpp" -#include -#include -#include -#include - -#include - -#include - -namespace ActsExamples { -namespace Geometry { - -/// @brief helper method to setup the geometry -/// -/// @tparam options_map_t Type of the options to be read -/// @tparam geometry_setupt_t Type of the callable geometry setup -/// -/// @param vm the parsed options map -/// @param geometrySetup the callable geometry setup -/// -/// @return a pair of TrackingGeometry and context decorators -std::pair, - std::vector>> -build(const boost::program_options::variables_map& vm, - IBaseDetector& detector) { - // Material decoration - std::shared_ptr matDeco = nullptr; - auto matType = vm["mat-input-type"].template as(); - if (matType == "none") { - matDeco = std::make_shared(); - } else if (matType == "file") { - // Retrieve the filename - auto fileName = vm["mat-input-file"].template as(); - // json or root based decorator - if (fileName.find(".json") != std::string::npos || - fileName.find(".cbor") != std::string::npos) { - // Set up the converter first - Acts::MaterialMapJsonConverter::Config jsonGeoConvConfig; - // Set up the json-based decorator - matDeco = std::make_shared( - jsonGeoConvConfig, fileName, Acts::Logging::INFO); - } else if (fileName.find(".root") != std::string::npos) { - // Set up the root-based decorator - ActsExamples::RootMaterialDecorator::Config rootMatDecConfig; - rootMatDecConfig.fileName = fileName; - matDeco = std::make_shared( - rootMatDecConfig, Acts::Logging::INFO); - } - } - - /// Return the geometry and context decorators - return detector.finalize(vm, matDeco); -} - -} // namespace Geometry -} // namespace ActsExamples diff --git a/Examples/Run/Common/src/CommonMaterialMapping.cpp b/Examples/Run/Common/src/CommonMaterialMapping.cpp deleted file mode 100644 index 4360d426683..00000000000 --- a/Examples/Run/Common/src/CommonMaterialMapping.cpp +++ /dev/null @@ -1,227 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2017-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Geometry/GeometryContext.hpp" -#include "Acts/Geometry/TrackingGeometry.hpp" -#include "Acts/MagneticField/MagneticFieldContext.hpp" -#include "Acts/Material/SurfaceMaterialMapper.hpp" -#include "Acts/Plugins/Json/MaterialMapJsonConverter.hpp" -#include "Acts/Propagator/Navigator.hpp" -#include "Acts/Propagator/Propagator.hpp" -#include "Acts/Propagator/StraightLineStepper.hpp" -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Json/JsonMaterialWriter.hpp" -#include "ActsExamples/Io/Root/RootMaterialTrackReader.hpp" -#include "ActsExamples/Io/Root/RootMaterialTrackWriter.hpp" -#include "ActsExamples/Io/Root/RootMaterialWriter.hpp" -#include "ActsExamples/MaterialMapping/MaterialMapping.hpp" -#include "ActsExamples/MaterialMapping/MaterialMappingOptions.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Propagation/PropagationOptions.hpp" -#include "ActsExamples/Simulation/CommonSimulation.hpp" -#include "ActsExamples/Utilities/Paths.hpp" - -#include - -#include - -namespace po = boost::program_options; - -int runMaterialMapping(int argc, char* argv[], - ActsExamples::IBaseDetector& detector) { - // Setup and parse options - auto desc = ActsExamples::Options::makeDefaultOptions(); - ActsExamples::Options::addSequencerOptions(desc); - ActsExamples::Options::addGeometryOptions(desc); - ActsExamples::Options::addMaterialOptions(desc); - ActsExamples::Options::addMaterialMappingOptions(desc); - ActsExamples::Options::addPropagationOptions(desc); - ActsExamples::Options::addInputOptions(desc); - ActsExamples::Options::addOutputOptions(desc, - ActsExamples::OutputFormat::Root | - ActsExamples::OutputFormat::Json | - ActsExamples::OutputFormat::Cbor); - - // Add specific options for this geometry - detector.addOptions(desc); - auto vm = ActsExamples::Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - ActsExamples::Sequencer sequencer( - ActsExamples::Options::readSequencerConfig(vm)); - - // Get the log level - auto logLevel = ActsExamples::Options::readLogLevel(vm); - - // The geometry, material and decoration - auto geometry = ActsExamples::Geometry::build(vm, detector); - auto tGeometry = geometry.first; - auto contextDecorators = geometry.second; - for (const auto& cdr : contextDecorators) { - sequencer.addContextDecorator(cdr); - } - - ActsExamples::WhiteBoard contextBoard( - Acts::getDefaultLogger("contextBoard", logLevel)); - - // The geometry context - ActsExamples::AlgorithmContext context(0, 0, contextBoard); - - /// Decorate the context - for (auto& cdr : contextDecorators) { - if (cdr->decorate(context) != ActsExamples::ProcessCode::SUCCESS) { - throw std::runtime_error("Failed to decorate event context"); - } - } - - /// Default contexts - Acts::GeometryContext geoContext = context.geoContext; - Acts::MagneticFieldContext mfContext = context.magFieldContext; - - // Straight line stepper - using SlStepper = Acts::StraightLineStepper; - using Propagator = Acts::Propagator; - - auto mapSurface = vm["mat-mapping-surfaces"].template as(); - auto mapVolume = vm["mat-mapping-volumes"].template as(); - auto volumeStep = vm["mat-mapping-volume-stepsize"].template as(); - if (!mapSurface && !mapVolume) { - return EXIT_FAILURE; - } - // --------------------------------------------------------------------------------- - // Input directory & input file handling - std::string intputDir = vm["input-dir"].template as(); - auto intputFiles = vm["input-files"].template as>(); - bool readCachedSurfaceInformation = - vm["mat-mapping-read-surfaces"].template as(); - if (vm["input-root"].template as()) { - // Read the material step information from a ROOT TTree - ActsExamples::RootMaterialTrackReader::Config matTrackReaderRootConfig; - matTrackReaderRootConfig.collection = - ActsExamples::Simulation::kMaterialTracks; - matTrackReaderRootConfig.fileList = intputFiles; - matTrackReaderRootConfig.readCachedSurfaceInformation = - readCachedSurfaceInformation; - auto matTrackReaderRoot = - std::make_shared( - matTrackReaderRootConfig, logLevel); - sequencer.addReader(matTrackReaderRoot); - } - - /// The material mapping algorithm - ActsExamples::MaterialMapping::Config mmAlgConfig{geoContext, mfContext}; - mmAlgConfig.collection = ActsExamples::Simulation::kMaterialTracks; - if (mapSurface) { - // Get a Navigator - Acts::Navigator navigator({tGeometry, true, true, true}); - // Make stepper and propagator - SlStepper stepper; - Propagator propagator(stepper, std::move(navigator)); - /// The material surface mapper - Acts::SurfaceMaterialMapper::Config smmConfig; - auto smm = std::make_shared( - smmConfig, std::move(propagator), - Acts::getDefaultLogger("SurfaceMaterialMapper", logLevel)); - mmAlgConfig.materialSurfaceMapper = smm; - } - if (mapVolume) { - // Get a Navigator - Acts::Navigator navigator({tGeometry}); - // Make stepper and propagator - SlStepper stepper; - Propagator propagator(stepper, std::move(navigator)); - /// The material volume mapper - Acts::VolumeMaterialMapper::Config vmmConfig; - vmmConfig.mappingStep = volumeStep; - auto vmm = std::make_shared( - vmmConfig, std::move(propagator), - Acts::getDefaultLogger("VolumeMaterialMapper", logLevel)); - mmAlgConfig.materialVolumeMapper = vmm; - } - mmAlgConfig.trackingGeometry = tGeometry; - - // Get the file name from the options - std::string materialFileName = vm["mat-output-file"].as(); - - if (not materialFileName.empty() and vm["output-root"].template as()) { - // The writer of the indexed material - ActsExamples::RootMaterialWriter::Config rmwConfig; - rmwConfig.filePath = materialFileName + ".root"; - // Fulfill the IMaterialWriter interface - - auto rmw = - std::make_shared(rmwConfig, logLevel); - mmAlgConfig.materialWriters.push_back(rmw); - - if (mapSurface) { - // Write the propagation steps as ROOT TTree - ActsExamples::RootMaterialTrackWriter::Config matTrackWriterRootConfig; - matTrackWriterRootConfig.filePath = materialFileName + "_tracks.root"; - matTrackWriterRootConfig.collection = - mmAlgConfig.mappingMaterialCollection; - matTrackWriterRootConfig.storeSurface = true; - matTrackWriterRootConfig.storeVolume = true; - auto matTrackWriterRoot = - std::make_shared( - matTrackWriterRootConfig, logLevel); - sequencer.addWriter(matTrackWriterRoot); - } - } - - if (!materialFileName.empty() and (vm["output-json"].template as() or - vm["output-cbor"].template as())) { - /// The name of the output file - std::string fileName = vm["mat-output-file"].template as(); - // the material writer - Acts::MaterialMapJsonConverter::Config jmConverterCfg; - jmConverterCfg.processSensitives = - vm["mat-output-sensitives"].template as(); - jmConverterCfg.processApproaches = - vm["mat-output-approaches"].template as(); - jmConverterCfg.processRepresenting = - vm["mat-output-representing"].template as(); - jmConverterCfg.processBoundaries = - vm["mat-output-boundaries"].template as(); - jmConverterCfg.processVolumes = - vm["mat-output-volumes"].template as(); - jmConverterCfg.context = geoContext; - // The writer - ActsExamples::JsonMaterialWriter::Config jmWriterCfg; - jmWriterCfg.converterCfg = std::move(jmConverterCfg); - jmWriterCfg.fileName = materialFileName; - - ActsExamples::JsonFormat format = ActsExamples::JsonFormat::NoOutput; - if (vm["output-json"].template as()) { - format = format | ActsExamples::JsonFormat::Json; - } - if (vm["output-cbor"].template as()) { - format = format | ActsExamples::JsonFormat::Cbor; - } - jmWriterCfg.writeFormat = format; - - auto jmw = std::make_shared( - std::move(jmWriterCfg), Acts::Logging::INFO); - - mmAlgConfig.materialWriters.push_back(jmw); - } - - // Create the material mapping - auto mmAlg = std::make_shared(mmAlgConfig); - - // Append the Algorithm - sequencer.addAlgorithm(mmAlg); - - // Initiate the run - sequencer.run(); - // Return success code - return 0; -} diff --git a/Examples/Run/Common/src/CommonOptions.cpp b/Examples/Run/Common/src/CommonOptions.cpp deleted file mode 100644 index 48e587e780b..00000000000 --- a/Examples/Run/Common/src/CommonOptions.cpp +++ /dev/null @@ -1,229 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/CommonOptions.hpp" - -#include "Acts/Utilities/Helpers.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include -#include -#include -#include - -using namespace boost::program_options; - -boost::program_options::options_description -ActsExamples::Options::makeDefaultOptions(const std::string& caption) { - std::cout - << "\n\n======================= DEPRECATION NOTICE " - "========================\n" - "The examples executables is deprecated. They will be removed in a\n" - "future version.\n" - "Consider using the python bindings for the example algorithms: \n" - "https://acts.readthedocs.io/en/latest/examples/python_bindings.html\n" - "===================================================================" - "\n\n" - << std::endl; - - options_description opt(caption); - - opt.add_options()("help,h", "Produce help message"); - opt.add_options()( - "loglevel,l", value()->default_value(2), - "The output log level. Please set the wished number (0 = VERBOSE, 1 = " - "DEBUG, 2 = INFO, 3 = WARNING, 4 = ERROR, 5 = FATAL)."); - opt.add_options()( - "response-file", value()->default_value(""), - "Configuration file (response file) replacing command line options."); - - return opt; -} - -void ActsExamples::Options::addSequencerOptions( - boost::program_options::options_description& opt) { - // sequencer options - opt.add_options()("events,n", value(), - "The number of events to process. If not given, all " - "available events will be processed.")( - "skip", value()->default_value(0), - "The number of events to skip")("jobs,j", value()->default_value(-1), - "Number of parallel jobs, negative for " - "automatic."); -} - -void ActsExamples::Options::addRandomNumbersOptions( - boost::program_options::options_description& opt) { - opt.add_options()("rnd-seed", value()->default_value(1234567890u), - "Random numbers seed."); -} - -void ActsExamples::Options::addGeometryOptions( - boost::program_options::options_description& opt) { - opt.add_options()("geo-surface-loglevel", - value()->default_value(3), - "The outoput log level for the surface building.")( - "geo-layer-loglevel", value()->default_value(3), - "The output log level for the layer building.")( - "geo-volume-loglevel", value()->default_value(3), - "The output log level " - "for the volume " - "building."); -} - -void ActsExamples::Options::addMaterialOptions( - boost::program_options::options_description& opt) { - opt.add_options()( - "mat-input-type", value()->default_value("build"), - "The way material is loaded: 'none', 'build', 'proto', 'file'.")( - "mat-input-file", value()->default_value(""), - "Name of the material map input file, supported: '.json', '.cbor' or " - "'.root'.")("mat-output-file", value()->default_value(""), - "Name of the material map output file (without extension).")( - "mat-output-sensitives", value()->default_value(true), - "Write material information of sensitive surfaces.")( - "mat-output-approaches", value()->default_value(true), - "Write material information of approach surfaces.")( - "mat-output-representing", value()->default_value(true), - "Write material information of representing surfaces.")( - "mat-output-boundaries", value()->default_value(true), - "Write material information of boundary surfaces.")( - "mat-output-volumes", value()->default_value(true), - "Write material information of volumes.")( - "mat-output-dense-volumes", value()->default_value(false), - "Write material information of dense volumes.")( - "mat-output-allmaterial", value()->default_value(false), - "Add protoMaterial to all surfaces and volume for the mapping."); -} - -void ActsExamples::Options::addOutputOptions( - boost::program_options::options_description& opt, - OutputFormat formatFlags) { - // Add specific options for this example - opt.add_options()("output-dir", value()->default_value(""), - "Output directory location."); - - if (ACTS_CHECK_BIT(formatFlags, OutputFormat::Root)) { - opt.add_options()("output-root", bool_switch(), - "Switch on to write '.root' output file(s)."); - } - - if (ACTS_CHECK_BIT(formatFlags, OutputFormat::Csv)) { - opt.add_options()("output-csv", bool_switch(), - "Switch on to write '.csv' output file(s)."); - } - - if (ACTS_CHECK_BIT(formatFlags, OutputFormat::Obj)) { - opt.add_options()("output-obj", bool_switch(), - "Switch on to write '.obj' output file(s)."); - } - - if (ACTS_CHECK_BIT(formatFlags, OutputFormat::Json)) { - opt.add_options()("output-json", bool_switch(), - "Switch on to write '.json' output file(s)."); - } - - if (ACTS_CHECK_BIT(formatFlags, OutputFormat::Cbor)) { - opt.add_options()("output-cbor", bool_switch(), - "Switch on to write '.cbor' output file(s)."); - } - - if (ACTS_CHECK_BIT(formatFlags, OutputFormat::Txt)) { - opt.add_options()("output-txt", bool_switch(), - "Switch on to write '.txt' output file(s)."); - } -} - -void ActsExamples::Options::addInputOptions( - boost::program_options::options_description& opt) { - // Add specific options for this example - opt.add_options()("input-dir", value()->default_value(""), - "Input directory location.")( - "input-files", value>(), - "Input files, can occur multiple times.")( - "input-root", value()->default_value(false), - "Switch on to read '.root' file(s).")( - "input-csv", value()->default_value(false), - "Switch on to read '.csv' file(s).")("input-obj", - value()->default_value(false), - "Switch on to read '.obj' file(s).")( - "input-json", value()->default_value(false), - "Switch on to read '.json' file(s).")( - "input-cbor", value()->default_value(false), - "Switch on to read '.cbor' file(s)."); -} - -boost::program_options::variables_map ActsExamples::Options::parse( - const boost::program_options::options_description& opt, int argc, - char* argv[]) noexcept(false) { - variables_map vm; - store(command_line_parser(argc, argv).options(opt).run(), vm); - notify(vm); - - if (vm.count("response-file") != 0u and - not vm["response-file"].template as().empty()) { - // Load the file and tokenize it - std::ifstream ifs(vm["response-file"].as().c_str()); - if (!ifs) { - throw(std::system_error(std::error_code(), - "Could not open response file.")); - } - // Read the whole file into a string - std::stringstream ss; - ss << ifs.rdbuf(); - std::string rString = ss.str(); - std::vector args; - const std::regex rgx("[ \t\r\n\f]"); - std::sregex_token_iterator iter(rString.begin(), rString.end(), rgx, -1); - std::sregex_token_iterator end; - for (; iter != end; ++iter) { - if (std::string(*iter).empty()) { - continue; - } - args.push_back(*iter); - } - // Parse the file and store the options - store(command_line_parser(args).options(opt).run(), vm); - } - - // Automatically handle help - if (vm.count("help") != 0u) { - std::cout << opt << std::endl; - vm.clear(); - } - return vm; -} - -Acts::Logging::Level ActsExamples::Options::readLogLevel( - const boost::program_options::variables_map& vm) { - return Acts::Logging::Level(vm["loglevel"].as()); -} - -ActsExamples::Sequencer::Config ActsExamples::Options::readSequencerConfig( - const boost::program_options::variables_map& vm) { - Sequencer::Config cfg; - cfg.skip = vm["skip"].as(); - if (not vm["events"].empty()) { - cfg.events = vm["events"].as(); - } - cfg.logLevel = readLogLevel(vm); - cfg.numThreads = vm["jobs"].as(); - if (not vm["output-dir"].empty()) { - cfg.outputDir = vm["output-dir"].as(); - } - return cfg; -} - -// Read the random numbers config. -ActsExamples::RandomNumbers::Config -ActsExamples::Options::readRandomNumbersConfig( - const boost::program_options::variables_map& vm) { - ActsExamples::RandomNumbers::Config cfg; - cfg.seed = vm["rnd-seed"].as(); - return cfg; -} diff --git a/Examples/Run/Common/src/CommonSimulation.cpp b/Examples/Run/Common/src/CommonSimulation.cpp deleted file mode 100644 index 7403a31709f..00000000000 --- a/Examples/Run/Common/src/CommonSimulation.cpp +++ /dev/null @@ -1,142 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Simulation/CommonSimulation.hpp" - -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" -#include "ActsExamples/Io/Csv/CsvParticleWriter.hpp" -#include "ActsExamples/Io/Csv/CsvSimHitWriter.hpp" -#include "ActsExamples/Io/Root/RootParticleWriter.hpp" -#include "ActsExamples/Io/Root/RootSimHitWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/ParticleGunOptions.hpp" -#include "ActsExamples/Options/ParticleSelectorOptions.hpp" -#include "ActsExamples/TruthTracking/ParticleSelector.hpp" -#include "ActsExamples/Utilities/Paths.hpp" - -#include - -namespace ActsExamples { -namespace Simulation { - -// input handling -void addInputOptions(ActsExamples::Options::Description& desc) { - using boost::program_options::value; - - auto opt = desc.add_options(); - // do not use the common input options: they have the wrong doc text and add a - // lot of unused options. - opt("input-dir", value(), - "Read particle input from CSV files in the given directory. If not " - "given, particles are generated with the particle gun"); - ActsExamples::Options::addParticleGunOptions(desc); - ActsExamples::Options::addParticleSelectorOptions(desc); -} - -void setupInput( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer, - std::shared_ptr randomNumbers) { - auto logLevel = Options::readLogLevel(vars); - - if (not vars["input-dir"].empty()) { - // read particle input from csv file - CsvParticleReader::Config readParticles; - readParticles.inputDir = vars["input-dir"].as(); - readParticles.inputStem = "particles"; - readParticles.outputParticles = kParticlesInput; - sequencer.addReader( - std::make_shared(readParticles, logLevel)); - - } else { - // generate particle input from a particle gun - auto gen = Options::readParticleGunOptions(vars); - gen.outputParticles = kParticlesInput; - gen.randomNumbers = std::move(randomNumbers); - sequencer.addReader(std::make_shared(gen, logLevel)); - } - - // add additional particle selection - auto select = ActsExamples::Options::readParticleSelectorConfig(vars); - select.inputParticles = kParticlesInput; - select.outputParticles = kParticlesSelection; - sequencer.addAlgorithm( - std::make_shared(select, logLevel)); -} - -// output handling - -// output options are just the common output options -void setupOutput(const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer) { - auto logLevel = Options::readLogLevel(vars); - auto outputDir = - ensureWritableDirectory(vars["output-dir"].template as()); - - // Write simulation information as CSV files - if (vars["output-csv"].template as()) { - // NOTE: the collection names are an internal implementation detail but the - // output file stems are a public user interface. the former can be - // changed at-will, but the later should always be the same. - - // write simulated particle initial states - CsvParticleWriter::Config writeInitial; - writeInitial.inputParticles = kParticlesInitial; - writeInitial.outputDir = outputDir; - writeInitial.outputStem = "particles_initial"; - sequencer.addWriter( - std::make_shared(writeInitial, logLevel)); - - // write simulated particle final states - CsvParticleWriter::Config writeFinal; - writeFinal.inputParticles = kParticlesFinal; - writeFinal.outputDir = outputDir; - writeFinal.outputStem = "particles_final"; - sequencer.addWriter( - std::make_shared(writeFinal, logLevel)); - - // write simulated hits - CsvSimHitWriter::Config writeSimHits; - writeSimHits.inputSimHits = kSimHits; - writeSimHits.outputDir = outputDir; - writeSimHits.outputStem = "hits"; - sequencer.addWriter( - std::make_shared(writeSimHits, logLevel)); - } - - // Write simulation information as ROOT files - if (vars["output-root"].template as()) { - // NOTE: the collection names are an internal implementation detail but the - // output file names are a public user interface. the former can be - // changed at-will, but the later should always be the same. - - // write simulated particle initial states - RootParticleWriter::Config writeInitial; - writeInitial.inputParticles = kParticlesInitial; - writeInitial.filePath = joinPaths(outputDir, "particles_initial.root"); - sequencer.addWriter( - std::make_shared(writeInitial, logLevel)); - - // write simulated particle final states - RootParticleWriter::Config writeFinal; - writeFinal.inputParticles = kParticlesFinal; - writeFinal.filePath = joinPaths(outputDir, "particles_final.root"); - sequencer.addWriter( - std::make_shared(writeFinal, logLevel)); - - // write simulated hits - RootSimHitWriter::Config writeHits; - writeHits.inputSimHits = kSimHits; - writeHits.filePath = joinPaths(outputDir, "hits.root"); - sequencer.addWriter( - std::make_shared(writeHits, logLevel)); - } -} - -} // namespace Simulation -} // namespace ActsExamples diff --git a/Examples/Run/Common/src/CsvOptionsReader.cpp b/Examples/Run/Common/src/CsvOptionsReader.cpp deleted file mode 100644 index 392aca3fa69..00000000000 --- a/Examples/Run/Common/src/CsvOptionsReader.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/CsvOptionsReader.hpp" - -#include - -ActsExamples::CsvParticleReader::Config -ActsExamples::Options::readCsvParticleReaderConfig(const Variables& vm) { - ActsExamples::CsvParticleReader::Config cfg; - if (not vm["input-dir"].empty()) { - cfg.inputDir = vm["input-dir"].as(); - } - return cfg; -} - -ActsExamples::CsvSimHitReader::Config -ActsExamples::Options::readCsvSimHitReaderConfig(const Variables& vm) { - ActsExamples::CsvSimHitReader::Config cfg; - if (not vm["input-dir"].empty()) { - cfg.inputDir = vm["input-dir"].as(); - } - return cfg; -} - -ActsExamples::CsvSpacePointReader::Config -ActsExamples::Options::readCsvSpacePointReaderConfig(const Variables& vm) { - ActsExamples::CsvSpacePointReader::Config cfg; - if (not vm["input-dir"].empty()) { - cfg.inputDir = vm["input-dir"].as(); - } - return cfg; -} - -ActsExamples::CsvMeasurementReader::Config -ActsExamples::Options::readCsvMeasurementReaderConfig(const Variables& vm) { - ActsExamples::CsvMeasurementReader::Config cfg; - if (not vm["input-dir"].empty()) { - cfg.inputDir = vm["input-dir"].as(); - } - return cfg; -} - -ActsExamples::CsvPlanarClusterReader::Config -ActsExamples::Options::readCsvPlanarClusterReaderConfig(const Variables& vm) { - ActsExamples::CsvPlanarClusterReader::Config cfg; - if (not vm["input-dir"].empty()) { - cfg.inputDir = vm["input-dir"].as(); - } - return cfg; -} diff --git a/Examples/Run/Common/src/CsvOptionsWriter.cpp b/Examples/Run/Common/src/CsvOptionsWriter.cpp deleted file mode 100644 index 16bd88a519b..00000000000 --- a/Examples/Run/Common/src/CsvOptionsWriter.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/CsvOptionsWriter.hpp" - -#include - -#include -#include - -void ActsExamples::Options::addCsvWriterOptions( - ActsExamples::Options::Description& desc) { - using namespace boost::program_options; - - desc.add_options()("csv-output-precision", - value()->default_value( - std::numeric_limits::max_digits10), - "Floating number output precision.")( - "csv-tg-perevent", bool_switch(), "Write tracking geometry per event."); -} - -ActsExamples::CsvParticleWriter::Config -ActsExamples::Options::readCsvParticleWriterConfig( - const ActsExamples::Options::Variables& vm) { - ActsExamples::CsvParticleWriter::Config cfg; - if (not vm["output-dir"].empty()) { - cfg.outputDir = vm["output-dir"].as(); - } - cfg.outputPrecision = vm["csv-output-precision"].as(); - return cfg; -} - -ActsExamples::CsvSimHitWriter::Config -ActsExamples::Options::readCsvSimHitWriterConfig(const Variables& vm) { - ActsExamples::CsvSimHitWriter::Config cfg; - if (not vm["output-dir"].empty()) { - cfg.outputDir = vm["output-dir"].as(); - } - return cfg; -} - -ActsExamples::CsvPlanarClusterWriter::Config -ActsExamples::Options::readCsvPlanarClusterWriterConfig( - const ActsExamples::Options::Variables& vm) { - ActsExamples::CsvPlanarClusterWriter::Config cfg; - if (not vm["output-dir"].empty()) { - cfg.outputDir = vm["output-dir"].as(); - } - cfg.outputPrecision = vm["csv-output-precision"].as(); - return cfg; -} - -ActsExamples::CsvMeasurementWriter::Config -ActsExamples::Options::readCsvMeasurementWriterConfig( - const ActsExamples::Options::Variables& vm) { - ActsExamples::CsvMeasurementWriter::Config cfg; - if (not vm["output-dir"].empty()) { - cfg.outputDir = vm["output-dir"].as(); - } - // cfg.outputPrecision = vm["csv-output-precision"].as(); - return cfg; -} - -ActsExamples::CsvTrackingGeometryWriter::Config -ActsExamples::Options::readCsvTrackingGeometryWriterConfig( - const ActsExamples::Options::Variables& vm) { - ActsExamples::CsvTrackingGeometryWriter::Config cfg; - if (not vm["output-dir"].empty()) { - cfg.outputDir = vm["output-dir"].as(); - } - cfg.outputPrecision = vm["csv-output-precision"].as(); - cfg.writePerEvent = (vm.count("csv-tg-perevent") != 0u); - return cfg; -} diff --git a/Examples/Run/Common/src/DigitizationOptions.cpp b/Examples/Run/Common/src/DigitizationOptions.cpp deleted file mode 100644 index d611097cbeb..00000000000 --- a/Examples/Run/Common/src/DigitizationOptions.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/DigitizationOptions.hpp" - -#include "Acts/Definitions/TrackParametrization.hpp" -#include "Acts/Definitions/Units.hpp" -#include "Acts/Utilities/Logger.hpp" -#include "ActsExamples/Digitization/Smearers.hpp" -#include "ActsExamples/Digitization/SmearingConfig.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include -#include - -#include - -void ActsExamples::Options::addDigitizationOptions(Description& desc) { - using boost::program_options::bool_switch; - using boost::program_options::value; - - auto opt = desc.add_options(); - opt("digi-config-file", value()->default_value(""), - "Configuration (.json) file for digitization description, overwrites " - "smearing options input on command line."); - opt("dump-digi-config", value()->default_value(""), - "Path to .json file in which to dump digitization configuration."); - opt("digi-merge", bool_switch(), "Turn on hit merging"); - opt("digi-merge-nsigma", value()->default_value(1.0), - "Defines how close smeared parameters have to be when merging"); - opt("digi-merge-common-corner", bool_switch(), - "Merge clusters which share a corner (8-cell connectivity)"); -} diff --git a/Examples/Run/Common/src/EmptyDetector.cpp b/Examples/Run/Common/src/EmptyDetector.cpp deleted file mode 100644 index 0f1b58f9d9d..00000000000 --- a/Examples/Run/Common/src/EmptyDetector.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/EmptyDetector.hpp" - -#include "Acts/Definitions/Units.hpp" -#include "Acts/Geometry/CylinderVolumeBounds.hpp" -#include "Acts/Geometry/TrackingGeometry.hpp" -#include "Acts/Geometry/TrackingVolume.hpp" -#include "ActsExamples/Framework/IContextDecorator.hpp" -#include "ActsExamples/Options/EmptyDetectorOptions.hpp" - -#include - -void EmptyDetector::addOptions( - boost::program_options::options_description& opt) const { - ActsExamples::Options::addEmptyGeometryOptions(opt); -} - -auto EmptyDetector::finalize( - const boost::program_options::variables_map& vm, - std::shared_ptr /*mdecorator*/) - -> std::pair { - using namespace Acts::UnitLiterals; - - // Create an empty cylinder with the chosen radius / halflength - double r = vm["geo-empty-radius"].as() * 1_m; - double hz = vm["geo-empty-halfLength"].as() * 1_m; - - // The cylinder volume bounds - auto cvBounds = std::make_shared(0.0, r, hz); - - // Create the world volume - auto worldVolume = Acts::TrackingVolume::create( - Acts::Transform3::Identity(), cvBounds, nullptr, "EmptyCylinder"); - - // Create the tracking geometry - auto tgGeometry = - std::make_shared(std::move(worldVolume), nullptr); - - /// Empty decorators - ContextDecorators eContextDecorators = {}; - - // And return the pair with empty decorators - return std::make_pair( - std::move(tgGeometry), std::move(eContextDecorators)); -} diff --git a/Examples/Run/Common/src/GenericDetectorWithOptions.cpp b/Examples/Run/Common/src/GenericDetectorWithOptions.cpp deleted file mode 100644 index deffe3d11fc..00000000000 --- a/Examples/Run/Common/src/GenericDetectorWithOptions.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2022 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/GenericDetectorWithOptions.hpp" - -#include "ActsExamples/Options/GenericDetectorOptions.hpp" - -#include - -namespace ActsExamples { - -void GenericDetectorWithOptions::addOptions( - boost::program_options::options_description& opt) const { - ActsExamples::Options::addGenericGeometryOptions(opt); -} - -auto GenericDetectorWithOptions::finalize( - const boost::program_options::variables_map& vm, - std::shared_ptr mdecorator) - -> std::pair { - GenericDetector::Config cfg; - - cfg.buildLevel = vm["geo-generic-buildlevel"].template as(); - // set geometry building logging level - cfg.surfaceLogLevel = Acts::Logging::Level( - vm["geo-surface-loglevel"].template as()); - cfg.layerLogLevel = - Acts::Logging::Level(vm["geo-layer-loglevel"].template as()); - cfg.volumeLogLevel = Acts::Logging::Level( - vm["geo-volume-loglevel"].template as()); - - cfg.buildProto = (vm["mat-input-type"].template as() == "proto"); - - return m_detector.finalize(cfg, std::move(mdecorator)); -} - -} // namespace ActsExamples diff --git a/Examples/Run/Common/src/GeometryExampleBase.cpp b/Examples/Run/Common/src/GeometryExampleBase.cpp deleted file mode 100644 index dadb36d23b9..00000000000 --- a/Examples/Run/Common/src/GeometryExampleBase.cpp +++ /dev/null @@ -1,190 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Framework/AlgorithmContext.hpp" -#include "ActsExamples/Framework/IContextDecorator.hpp" -#include "ActsExamples/Framework/WhiteBoard.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Csv/CsvTrackingGeometryWriter.hpp" -#include "ActsExamples/Io/Json/JsonMaterialWriter.hpp" -#include "ActsExamples/Io/Json/JsonSurfacesWriter.hpp" -#include "ActsExamples/Io/Root/RootMaterialWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/CsvOptionsWriter.hpp" -#include "ActsExamples/Options/JsonOptionsWriter.hpp" -#include "ActsExamples/Plugins/Obj/ObjTrackingGeometryWriter.hpp" -#include "ActsExamples/Plugins/Obj/ObjWriterOptions.hpp" -#include "ActsExamples/Utilities/Options.hpp" -#include "ActsExamples/Utilities/Paths.hpp" -#include -#include -#include - -#include -#include -#include - -int processGeometry(int argc, char* argv[], - ActsExamples::IBaseDetector& detector) { - // setup and parse options - auto desc = ActsExamples::Options::makeDefaultOptions(); - ActsExamples::Options::addSequencerOptions(desc); - ActsExamples::Options::addGeometryOptions(desc); - ActsExamples::Options::addMaterialOptions(desc); - ActsExamples::Options::addObjWriterOptions(desc); - ActsExamples::Options::addCsvWriterOptions(desc); - ActsExamples::Options::addJsonWriterOptions(desc); - ActsExamples::Options::addOutputOptions( - desc, - ActsExamples::OutputFormat::Root | ActsExamples::OutputFormat::Json | - ActsExamples::OutputFormat::Cbor | ActsExamples::OutputFormat::Csv | - ActsExamples::OutputFormat::Obj); - - // Add specific options for this geometry - detector.addOptions(desc); - auto vm = ActsExamples::Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - // Now read the standard options - auto logLevel = ActsExamples::Options::readLogLevel(vm); - std::size_t nEvents = - ActsExamples::Options::readSequencerConfig(vm).events.value_or(1); - - // The geometry, material and decoration - auto geometry = ActsExamples::Geometry::build(vm, detector); - auto tGeometry = geometry.first; - auto contextDecorators = geometry.second; - - // The detectors - auto volumeLogLevel = - Acts::Logging::Level(vm["geo-volume-loglevel"].as()); - - for (std::size_t ievt = 0; ievt < nEvents; ++ievt) { - // Setup the event and algorithm context - ActsExamples::WhiteBoard eventStore( - Acts::getDefaultLogger("EventStore#" + std::to_string(ievt), logLevel)); - std::size_t ialg = 0; - - // The geometry context - ActsExamples::AlgorithmContext context(ialg, ievt, eventStore); - - /// Decorate the context - for (auto& cdr : contextDecorators) { - if (cdr->decorate(context) != ActsExamples::ProcessCode::SUCCESS) { - throw std::runtime_error("Failed to decorate event context"); - } - } - - std::string geoContextStr = ""; - if (!contextDecorators.empty()) { - // We need indeed a context object - if (nEvents > 1) { - geoContextStr = "_geoContext" + std::to_string(ievt); - } - } - - // --------------------------------------------------------------------------------- - // Output directory - std::string outputDir = vm["output-dir"].template as(); - - // OBJ output - if (vm["output-obj"].as()) { - // Configure the tracking geometry writer - auto tgObjWriterConfig = - ActsExamples::Options::readObjTrackingGeometryWriterConfig(vm); - tgObjWriterConfig.outputDir = outputDir; - auto tgObjWriter = - std::make_shared( - tgObjWriterConfig, volumeLogLevel); - // Write the tracking geometry object - tgObjWriter->write(context, *tGeometry); - } - - // CSV output - if (vm["output-csv"].as()) { - // setup the tracking geometry writer - ActsExamples::CsvTrackingGeometryWriter::Config tgCsvWriterConfig; - tgCsvWriterConfig.trackingGeometry = tGeometry; - tgCsvWriterConfig.outputDir = outputDir; - tgCsvWriterConfig.writePerEvent = true; - auto tgCsvWriter = - std::make_shared( - tgCsvWriterConfig, logLevel); - - // Write the tracking geometry object - tgCsvWriter->write(context); - } - - // JSON output - if (vm["output-json"].as()) { - auto sJsonWriterConfig = - ActsExamples::Options::readJsonSurfacesWriterConfig(vm); - sJsonWriterConfig.trackingGeometry = tGeometry; - sJsonWriterConfig.outputDir = outputDir; - sJsonWriterConfig.writePerEvent = true; - auto sJsonWriter = std::make_shared( - sJsonWriterConfig, logLevel); - - // Write the tracking geometry object - sJsonWriter->write(context); - } - - // Get the file name from the options - std::string materialFileName = vm["mat-output-file"].as(); - - if (!materialFileName.empty() and vm["output-root"].template as()) { - // The writer of the indexed material - ActsExamples::RootMaterialWriter::Config rmwConfig; - rmwConfig.filePath = materialFileName + ".root"; - ActsExamples::RootMaterialWriter rmwImpl(rmwConfig, logLevel); - rmwImpl.write(*tGeometry); - } - - if (!materialFileName.empty() and (vm["output-json"].template as() or - vm["output-cbor"].template as())) { - // the material writer - Acts::MaterialMapJsonConverter::Config jmConverterCfg; - jmConverterCfg.processSensitives = - vm["mat-output-sensitives"].template as(); - jmConverterCfg.processApproaches = - vm["mat-output-approaches"].template as(); - jmConverterCfg.processRepresenting = - vm["mat-output-representing"].template as(); - jmConverterCfg.processBoundaries = - vm["mat-output-boundaries"].template as(); - jmConverterCfg.processVolumes = - vm["mat-output-volumes"].template as(); - jmConverterCfg.processDenseVolumes = - vm["mat-output-dense-volumes"].template as(); - jmConverterCfg.processNonMaterial = - vm["mat-output-allmaterial"].template as(); - jmConverterCfg.context = context.geoContext; - // The writer - ActsExamples::JsonMaterialWriter::Config jmWriterCfg; - jmWriterCfg.converterCfg = std::move(jmConverterCfg); - jmWriterCfg.fileName = materialFileName; - ActsExamples::JsonFormat format = ActsExamples::JsonFormat::NoOutput; - if (vm["output-json"].template as()) { - format = format | ActsExamples::JsonFormat::Json; - } - if (vm["output-cbor"].template as()) { - format = format | ActsExamples::JsonFormat::Cbor; - } - jmWriterCfg.writeFormat = format; - - ActsExamples::JsonMaterialWriter jmwImpl(jmWriterCfg, logLevel); - - jmwImpl.write(*tGeometry); - } - } - - return 0; -} diff --git a/Examples/Run/Common/src/JsonOptionsWriter.cpp b/Examples/Run/Common/src/JsonOptionsWriter.cpp deleted file mode 100644 index 96f70b11f22..00000000000 --- a/Examples/Run/Common/src/JsonOptionsWriter.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/JsonOptionsWriter.hpp" - -#include - -void ActsExamples::Options::addJsonWriterOptions( - ActsExamples::Options::Description& desc) { - using namespace boost::program_options; - - desc.add_options()("json-output-precision", - value()->default_value( - std::numeric_limits::max_digits10), - "Floating number output precision.")( - "json-write-sf-boundaries", bool_switch(), - "Write tracking boundary surfaces.")( - "json-write-sf-approach", bool_switch(), - "Write tracking geometry approach surfaces.")( - "json-write-sf-layer", bool_switch(), - "Write tracking geometry layer surfaces.")( - "json-write-sf-sensitive", bool_switch(), - "Write tracking geometry sensitive surfaces.")( - "json-write-sf-names-only", bool_switch(), - "Write only names of tracking geometry surfaces."); -} - -ActsExamples::JsonSurfacesWriter::Config -ActsExamples::Options::readJsonSurfacesWriterConfig( - const ActsExamples::Options::Variables& vm) { - ActsExamples::JsonSurfacesWriter::Config cfg; - if (not vm["output-dir"].empty()) { - cfg.outputDir = vm["output-dir"].as(); - } - cfg.outputPrecision = vm["json-output-precision"].as(); - cfg.writeLayer = vm["json-write-sf-layer"].as(); - cfg.writeApproach = vm["json-write-sf-approach"].as(); - cfg.writeSensitive = vm["json-write-sf-sensitive"].as(); - cfg.writeBoundary = vm["json-write-sf-boundaries"].as(); - cfg.writeOnlyNames = vm["json-write-sf-names-only"].as(); - - return cfg; -} diff --git a/Examples/Run/Common/src/MagneticFieldOptions.cpp b/Examples/Run/Common/src/MagneticFieldOptions.cpp deleted file mode 100644 index d1221370865..00000000000 --- a/Examples/Run/Common/src/MagneticFieldOptions.cpp +++ /dev/null @@ -1,231 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/MagneticFieldOptions.hpp" - -#include "Acts/Definitions/Units.hpp" -#include "Acts/MagneticField/BFieldMapUtils.hpp" -#include "Acts/MagneticField/MagneticFieldProvider.hpp" -#include "Acts/MagneticField/SolenoidBField.hpp" -#include "Acts/Utilities/Logger.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/MagneticField/FieldMapRootIo.hpp" -#include "ActsExamples/MagneticField/FieldMapTextIo.hpp" -#include "ActsExamples/MagneticField/ScalableBFieldService.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include -#include -#include -#include - -#include - -void ActsExamples::Options::addMagneticFieldOptions(Description& desc) { - using boost::program_options::bool_switch; - using boost::program_options::value; - - // avoid adding the options twice - if (desc.find_nothrow("bf-constant-tesla", true) != nullptr) { - return; - } - - auto opt = desc.add_options(); - opt("bf-constant-tesla", value>(), - "Set a constant magnetic field vector in Tesla. If given, this takes " - "preference over all other options."); - opt("bf-scalable", bool_switch(), - "If given, the constant field strength will be scaled differently in " - "every event. This is for testing only."); - opt("bf-scalable-scalor", value()->default_value(1.25), - "Scaling factor for the event-dependent field strength scaling. A unit " - "value means that the field strength stays the same for every event."); - opt("bf-map-file", value(), - "Read a magnetic field map from the given file. ROOT and text file " - "formats are supported. Only used if no constant field is given."); - opt("bf-map-tree", value()->default_value("bField"), - "Name of the TTree in the ROOT file. Only used if the field map is read " - "from a ROOT file."); - opt("bf-map-type", value()->default_value("xyz"), - "Either 'xyz' or 'rz' to define the type of the field map."); - opt("bf-map-octantonly", bool_switch(), - "If given, the field map is assumed to describe only the first " - "octant/quadrant and the field is symmetrically extended to the full " - "space."); - opt("bf-map-lengthscale-mm", value()->default_value(1.), - "Optional length scale modifier for the field map grid. This options " - "only needs to be set if the length unit in the field map file is not " - "`mm`. The value must scale from the stored unit to the equivalent value " - "in `mm`."); - opt("bf-map-fieldscale-tesla", value()->default_value(1.), - "Optional field value scale modifier for the field map value. This " - "option only needs to be set if the field value unit in the field map " - "file is not `Tesla`. The value must scale from the stored unit to the " - "equivalent value in `Tesla`."); - opt("bf-solenoid-mag-tesla", value()->default_value(0.), - "The magnitude of a solenoid magnetic field in the center in `Tesla`. " - "Only used " - "if neither constant field nor a magnetic field map is given."); - opt("bf-solenoid-length", value()->default_value(6000), - "The length of the solenoid magnetic field in `mm`."); - opt("bf-solenoid-radius", value()->default_value(1200), - "The radius of the solenoid magnetic field in `mm`."); - opt("bf-solenoid-ncoils", value()->default_value(1194), - "Number of coils for the solenoid magnetic field."); - opt("bf-solenoid-map-rlim", - value()->value_name("MIN:MAX")->default_value({0, 1200}), - "The length bounds of the grid created from the analytical solenoid " - "field in `mm`."); - opt("bf-solenoid-map-zlim", - value()->value_name("MIN:MAX")->default_value({-3000, 3000}), - "The radius bounds of the grid created from the analytical solenoid " - "field in `mm`."); - opt("bf-solenoid-map-nbins", value>()->default_value({{150, 200}}), - "The number of bins in r-z directions for the grid created from the " - "analytical solenoid field."); -} - -void ActsExamples::Options::setupMagneticFieldServices(const Variables& vars, - Sequencer& sequencer) { - if (vars["bf-scalable"].as()) { - ScalableBFieldService::Config sbfCfg; - sbfCfg.scalor = vars["bf-scalable-scalor"].as(); - sequencer.addContextDecorator( - std::make_shared(sbfCfg, Acts::Logging::INFO)); - } -} - -std::shared_ptr -ActsExamples::Options::readMagneticField(const Variables& vars) { - using namespace ActsExamples::detail; - using std::filesystem::path; - - ACTS_LOCAL_LOGGER( - Acts::getDefaultLogger("MagneticField", Acts::Logging::INFO)); - - // first option: create a constant field - if (vars.count("bf-constant-tesla") != 0u) { - const auto values = vars["bf-constant-tesla"].as>(); - Acts::Vector3 field(values[0] * Acts::UnitConstants::T, - values[1] * Acts::UnitConstants::T, - values[2] * Acts::UnitConstants::T); - if (vars["bf-scalable"].as()) { - ACTS_INFO("Use a constant magnetic field with per-event scaling"); - return std::make_shared(field); - } else { - ACTS_INFO("Use a constant magnetic field"); - return std::make_shared(field); - } - } - - // second option: read a field map from a file - if (vars.count("bf-map-file") != 0u) { - const path file = vars["bf-map-file"].as(); - const auto tree = vars["bf-map-tree"].as(); - const auto type = vars["bf-map-type"].as(); - const auto useOctantOnly = vars["bf-map-octantonly"].as(); - const auto lengthUnit = - vars["bf-map-lengthscale-mm"].as() * Acts::UnitConstants::mm; - const auto fieldUnit = - vars["bf-map-fieldscale-tesla"].as() * Acts::UnitConstants::T; - - bool readRoot = false; - if (file.extension() == ".root") { - ACTS_INFO("Read magnetic field map from ROOT file '" << file << "'"); - readRoot = true; - } else if (file.extension() == ".txt") { - ACTS_INFO("Read magnetic field map from text file '" << file << "'"); - readRoot = false; - } else { - ACTS_ERROR("'" << file - << "' is an unsupported magnetic field map file type"); - throw std::runtime_error("Unsupported magnetic field map file type"); - } - - if (type == "xyz") { - auto mapBins = [](std::array bins, - std::array sizes) { - return (bins[0] * (sizes[1] * sizes[2]) + bins[1] * sizes[2] + bins[2]); - }; - - ACTS_INFO("Use XYZ field map"); - if (readRoot) { - auto map = makeMagneticFieldMapXyzFromRoot( - std::move(mapBins), file.native(), tree, lengthUnit, fieldUnit, - useOctantOnly); - return std::make_shared(std::move(map)); - - } else { - auto map = makeMagneticFieldMapXyzFromText(std::move(mapBins), - file.native(), lengthUnit, - fieldUnit, useOctantOnly); - return std::make_shared(std::move(map)); - } - - } else if (type == "rz") { - auto mapBins = [](std::array bins, - std::array sizes) { - return (bins[1] * sizes[0] + bins[0]); - }; - - ACTS_INFO("Use RZ field map"); - if (readRoot) { - auto map = makeMagneticFieldMapRzFromRoot( - std::move(mapBins), file.native(), tree, lengthUnit, fieldUnit, - useOctantOnly); - return std::make_shared(std::move(map)); - - } else { - auto map = makeMagneticFieldMapRzFromText(std::move(mapBins), - file.native(), lengthUnit, - fieldUnit, useOctantOnly); - return std::make_shared(std::move(map)); - } - - } else { - ACTS_ERROR("'" << type << "' is an unknown magnetic field map type"); - throw std::runtime_error("Unknown magnetic field map type"); - } - } - - // third option: create a solenoid field - if (vars["bf-solenoid-mag-tesla"].as() > 0) { - // Construct a solenoid field - Acts::SolenoidBField::Config solenoidConfig{}; - solenoidConfig.length = - vars["bf-solenoid-length"].as() * Acts::UnitConstants::mm; - solenoidConfig.radius = - vars["bf-solenoid-radius"].as() * Acts::UnitConstants::mm; - solenoidConfig.nCoils = vars["bf-solenoid-ncoils"].as(); - solenoidConfig.bMagCenter = - vars["bf-solenoid-mag-tesla"].as() * Acts::UnitConstants::T; - ACTS_INFO("Use solenoid magnetic field with magnitude " - << solenoidConfig.bMagCenter / Acts::UnitConstants::T - << " Tesla at the center."); - const auto solenoidField = Acts::SolenoidBField(solenoidConfig); - // The parameters for creating a field map - auto getRange = [&](const char* name, auto unit, auto& lower, auto& upper) { - auto interval = vars[name].as(); - lower = interval.lower.value() * unit; - upper = interval.upper.value() * unit; - }; - std::pair rlim, zlim; - getRange("bf-solenoid-map-rlim", Acts::UnitConstants::mm, rlim.first, - rlim.second); - getRange("bf-solenoid-map-zlim", Acts::UnitConstants::mm, zlim.first, - zlim.second); - const auto nbins = vars["bf-solenoid-map-nbins"].as>(); - auto map = - Acts::solenoidFieldMap(rlim, zlim, {nbins[0], nbins[1]}, solenoidField); - return std::make_shared(std::move(map)); - } - - // default option: no field - ACTS_INFO("Use no magnetic field"); - return std::make_shared(); -} diff --git a/Examples/Run/Common/src/MaterialValidationBase.cpp b/Examples/Run/Common/src/MaterialValidationBase.cpp deleted file mode 100644 index 7a13d2158ea..00000000000 --- a/Examples/Run/Common/src/MaterialValidationBase.cpp +++ /dev/null @@ -1,206 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2017-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Propagator/DefaultExtension.hpp" -#include "Acts/Propagator/DenseEnvironmentExtension.hpp" -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Framework/RandomNumbers.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Root/RootMaterialTrackWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Propagation/PropagationAlgorithm.hpp" -#include "ActsExamples/Propagation/PropagationOptions.hpp" -#include "ActsExamples/Propagation/PropagatorInterface.hpp" -#include "ActsExamples/Utilities/Paths.hpp" -#include -#include -#include -#include -#include - -#include - -#include - -namespace po = boost::program_options; - -namespace { -/// @brief Propagation setup -/// -/// @tparam bfield_t Type of the magnetic field -/// -/// @param sequencer The framework sequencer, Propagation algorithm to be added -/// @param bfield The bfield object needed for the stepper & propagator -/// @param vm The program options for the log file -/// @param randomNumberSvc The framework random number engine -/// @param tGeometry The TrackingGeometry object -/// -/// @return a process code -ActsExamples::ProcessCode setupPropagation( - ActsExamples::Sequencer& sequencer, - std::shared_ptr bfield, - po::variables_map& vm, - std::shared_ptr randomNumberSvc, - std::shared_ptr tGeometry) { - // Get the log level - auto logLevel = ActsExamples::Options::readLogLevel(vm); - - // Get a Navigator - Acts::Navigator::Config cfg; - cfg.trackingGeometry = std::move(tGeometry); - cfg.resolvePassive = true; - cfg.resolveMaterial = true; - cfg.resolveSensitive = true; - Acts::Navigator navigator(cfg); - - // Resolve the bfield map template and create the propagator - using Stepper = Acts::EigenStepper< - Acts::StepperExtensionList, - Acts::detail::HighestValidAuctioneer>; - using Propagator = Acts::Propagator; - Stepper stepper(std::move(bfield)); - Propagator propagator(std::move(stepper), std::move(navigator)); - - // Read the propagation config and create the algorithms - auto pAlgConfig = ActsExamples::Options::readPropagationConfig(vm); - pAlgConfig.randomNumberSvc = std::move(randomNumberSvc); - pAlgConfig.recordMaterialInteractions = true; - - pAlgConfig.propagatorImpl = - std::make_shared>( - std::move(propagator)); - - auto propagationAlg = std::make_shared( - pAlgConfig, logLevel); - - // Add the propagation algorithm - sequencer.addAlgorithm({propagationAlg}); - - return ActsExamples::ProcessCode::SUCCESS; -} - -/// @brief Straight Line Propagation setup -/// -/// @param sequencer The framework sequencer, Propagation algorithm to be added -/// @param vm The program options for the log file -/// @param randomNumberSvc The framework random number engine -/// @param tGeometry The TrackingGeometry object -/// -/// @return a process code -ActsExamples::ProcessCode setupStraightLinePropagation( - ActsExamples::Sequencer& sequencer, po::variables_map& vm, - std::shared_ptr randomNumberSvc, - std::shared_ptr tGeometry) { - // Get the log level - auto logLevel = ActsExamples::Options::readLogLevel(vm); - - // Get a Navigator - Acts::Navigator navigator({std::move(tGeometry)}); - - // Straight line stepper - using SlStepper = Acts::StraightLineStepper; - using Propagator = Acts::Propagator; - // Make stepper and propagator - SlStepper stepper; - Propagator propagator(stepper, std::move(navigator)); - - // Read the propagation config and create the algorithms - auto pAlgConfig = ActsExamples::Options::readPropagationConfig(vm); - - pAlgConfig.randomNumberSvc = std::move(randomNumberSvc); - pAlgConfig.propagatorImpl = - std::make_shared>( - std::move(propagator)); - auto propagationAlg = std::make_shared( - pAlgConfig, logLevel); - - // Add the propagation algorithm - sequencer.addAlgorithm({propagationAlg}); - - return ActsExamples::ProcessCode::SUCCESS; -} - -} // namespace - -int materialValidationExample(int argc, char* argv[], - ActsExamples::IBaseDetector& detector) { - // Setup and parse options - auto desc = ActsExamples::Options::makeDefaultOptions(); - ActsExamples::Options::addSequencerOptions(desc); - ActsExamples::Options::addGeometryOptions(desc); - ActsExamples::Options::addMaterialOptions(desc); - ActsExamples::Options::addMagneticFieldOptions(desc); - ActsExamples::Options::addRandomNumbersOptions(desc); - ActsExamples::Options::addPropagationOptions(desc); - ActsExamples::Options::addOutputOptions(desc, - ActsExamples::OutputFormat::Root); - - // Add specific options for this geometry - detector.addOptions(desc); - auto vm = ActsExamples::Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - ActsExamples::Sequencer sequencer( - ActsExamples::Options::readSequencerConfig(vm)); - - // Now read the standard options - auto logLevel = ActsExamples::Options::readLogLevel(vm); - - // The geometry, material and decoration - auto geometry = ActsExamples::Geometry::build(vm, detector); - auto tGeometry = geometry.first; - auto contextDecorators = geometry.second; - for (const auto& cdr : contextDecorators) { - sequencer.addContextDecorator(cdr); - } - - // Create the random number engine - auto randomNumberSvcCfg = ActsExamples::Options::readRandomNumbersConfig(vm); - auto randomNumberSvc = - std::make_shared(randomNumberSvcCfg); - - // Create BField service - ActsExamples::Options::setupMagneticFieldServices(vm, sequencer); - auto bField = ActsExamples::Options::readMagneticField(vm); - - if (vm["prop-stepper"].template as() == 0) { - // Straight line stepper was chosen - setupStraightLinePropagation(sequencer, vm, randomNumberSvc, tGeometry); - } else { - setupPropagation(sequencer, bField, vm, randomNumberSvc, tGeometry); - } - - // --------------------------------------------------------------------------------- - // Output directory - std::string outputDir = vm["output-dir"].template as(); - auto matCollection = vm["prop-material-collection"].as(); - - if (vm["output-root"].template as()) { - // Write the propagation steps as ROOT TTree - ActsExamples::RootMaterialTrackWriter::Config matTrackWriterRootConfig; - matTrackWriterRootConfig.collection = matCollection; - matTrackWriterRootConfig.filePath = - ActsExamples::joinPaths(outputDir, matCollection + ".root"); - matTrackWriterRootConfig.storeSurface = true; - matTrackWriterRootConfig.storeVolume = true; - auto matTrackWriterRoot = - std::make_shared( - matTrackWriterRootConfig, logLevel); - sequencer.addWriter(matTrackWriterRoot); - } - - // Initiate the run - sequencer.run(); - // Return success code - return 0; -} diff --git a/Examples/Run/Common/src/NuclearInteractionOptions.cpp b/Examples/Run/Common/src/NuclearInteractionOptions.cpp deleted file mode 100644 index 8fc446ae487..00000000000 --- a/Examples/Run/Common/src/NuclearInteractionOptions.cpp +++ /dev/null @@ -1,239 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/NuclearInteractionOptions.hpp" - -#include "ActsExamples/Utilities/Options.hpp" - -#include - -#include -#include -#include - -namespace { -std::pair, std::vector> readHistogram( - const std::string&& binBordersName, const std::string&& binContentsName) { - std::vector* binBorders = nullptr; - std::vector* binContents = nullptr; - // Get the decomposed histogram - binBorders = (std::vector*)gDirectory->Get(binBordersName.c_str()); - binContents = - (std::vector*)gDirectory->Get(binContentsName.c_str()); - // Return the histogram if available - if (binBorders != nullptr && binContents != nullptr) { - return std::make_pair(*binBorders, *binContents); - } - return std::make_pair(std::vector(), std::vector()); -} - -Acts::ActsDynamicVector readVector(const std::string&& vectorName) { - std::vector* vector = nullptr; - // Get the vector - vector = (std::vector*)gDirectory->Get(vectorName.c_str()); - // Return the vector if available - if (vector != nullptr) { - Acts::ActsDynamicVector result; - const unsigned int sizeVec = vector->size(); - result.resize(sizeVec); - for (unsigned int i = 0; i < sizeVec; i++) { - result(i) = (*vector)[i]; - } - - return result; - } - return Acts::ActsDynamicVector(); -} - -void readKinematicParameters( - ActsFatras::detail::NuclearInteractionParameters& parameters, - TObject* folder, bool softInteractionParameters) { - if (folder->IsFolder()) { - // Find the momentum and invariant mass distributions - const char* distributionName = folder->GetName(); - unsigned int mult = std::stoi(distributionName); - gDirectory->cd(distributionName); - std::vector, std::vector>> - momentumDistributions; - momentumDistributions.resize(mult + 1); - std::vector, std::vector>> - invariantMassDistributions; - invariantMassDistributions.resize(mult); - for (unsigned int i = 0; i < mult; i++) { - momentumDistributions[i] = readHistogram( - ("MomentumDistributionBinBorders_" + std::to_string(i)).c_str(), - ("MomentumDistributionBinContents_" + std::to_string(i)).c_str()); - - invariantMassDistributions[i] = readHistogram( - ("InvariantMassDistributionBinBorders_" + std::to_string(i)).c_str(), - ("InvariantMassDistributionBinContents_" + std::to_string(i)) - .c_str()); - } - momentumDistributions.back() = readHistogram( - ("MomentumDistributionBinBorders_" + std::to_string(mult)).c_str(), - ("MomentumDistributionBinContents_" + std::to_string(mult)).c_str()); - - // Get the eigenspace components for the kinematic parameters - Acts::ActsDynamicVector momentumEigenvalues = - readVector("MomentumEigenvalues"); - Acts::ActsDynamicVector momentumEigenvectors = - readVector("MomentumEigenvectors"); - Acts::ActsDynamicVector momentumMean = readVector("MomentumMean"); - Acts::ActsDynamicVector invariantMassEigenvalues = - readVector("InvariantMassEigenvalues"); - Acts::ActsDynamicVector invariantMassEigenvectors = - readVector("InvariantMassEigenvectors"); - Acts::ActsDynamicVector invariantMassMean = readVector("InvariantMassMean"); - - // Test that a parametrisation is present - if (momentumEigenvalues.size() != 0 && momentumEigenvectors.size() != 0 && - momentumMean.size() != 0 && invariantMassEigenvalues.size() != 0 && - invariantMassEigenvectors.size() != 0 && - invariantMassMean.size() != 0) { - // Prepare and store the kinematic parameters - ActsFatras::detail::NuclearInteractionParameters:: - ParametersWithFixedMultiplicity kinematicParameters( - momentumDistributions, momentumEigenvalues, momentumEigenvectors, - momentumMean, invariantMassDistributions, - invariantMassEigenvalues, invariantMassEigenvectors, - invariantMassMean); - if (softInteractionParameters) { - if (mult >= parameters.softKinematicParameters.size()) { - parameters.softKinematicParameters.resize(mult + 1); - } - parameters.softKinematicParameters[mult] = kinematicParameters; - } else { - if (mult >= parameters.hardKinematicParameters.size()) { - parameters.hardKinematicParameters.resize(mult + 1); - } - parameters.hardKinematicParameters[mult] = kinematicParameters; - } - } - gDirectory->cd(".."); - } -} -} // namespace - -void ActsExamples::Options::addNuclearInteractionOptions( - ActsExamples::Options::Description& desc) { - using boost::program_options::value; - - auto opt = desc.add_options(); - opt("fatras-nuclear-interaction-parametrisation", - value()->default_value({}), - "File containing parametrisations for nuclear interaction."); -} - -std::string ActsExamples::Options::readNuclearInteractionConfig( - const boost::program_options::variables_map& variables) { - return variables["fatras-nuclear-interaction-parametrisation"] - .as(); -} - -ActsFatras::detail::MultiParticleNuclearInteractionParametrisation -ActsExamples::Options::readParametrisations(const std::string& fileName) { - // The collection - ActsFatras::detail::MultiParticleNuclearInteractionParametrisation mpp; - - // Now read file - ActsFatras::detail::NuclearInteractionParametrisation parametrisation; - TFile tf(fileName.c_str(), "read"); - gDirectory->cd(); - auto listOfParticles = gDirectory->GetListOfKeys(); - auto initialParticle = listOfParticles->First(); - while (initialParticle != nullptr) { - // Get the initial particle - char const* particleName = initialParticle->GetName(); - gDirectory->cd(particleName); - - // Walk over all initial momenta for a particle - auto listOfMomenta = gDirectory->GetListOfKeys(); - auto initialMomentum = listOfMomenta->First(); - while (initialMomentum != nullptr) { - // Parameters for a fixed initial momentum - ActsFatras::detail::NuclearInteractionParameters parameters; - // Get the initial momentum - char const* nameMomentum = initialMomentum->GetName(); - parameters.momentum = std::stof(nameMomentum); - gDirectory->cd(nameMomentum); - - // Get the nuclear interaction probability - parameters.nuclearInteractionProbability = readHistogram( - "NuclearInteractionBinBorders", "NuclearInteractionBinContents"); - - // Get the soft interaction probability - TVectorF* softInteraction = (TVectorF*)gDirectory->Get("SoftInteraction"); - parameters.softInteractionProbability = (*softInteraction)[0]; - - // Get the branching probabilities - std::vector branchingPdgIds = - *((std::vector*)gDirectory->Get("BranchingPdgIds")); - std::vector targetPdgIds = - *((std::vector*)gDirectory->Get("TargetPdgIds")); - std::vector targetPdgProbability = - *((std::vector*)gDirectory->Get("TargetPdgProbability")); - parameters.pdgMap.reserve(branchingPdgIds.size()); - for (unsigned int i = 0; i < branchingPdgIds.size(); i++) { - auto it = parameters.pdgMap.begin(); - while (it->first != branchingPdgIds[i] && - it != parameters.pdgMap.end()) { - it++; - } - - const auto target = - std::make_pair(targetPdgIds[i], targetPdgProbability[i]); - if (it != parameters.pdgMap.end()) { - it->second.push_back(target); - } else { - parameters.pdgMap.push_back(std::make_pair( - branchingPdgIds[i], std::vector>{target})); - } - } - - // Get the soft distributions - gDirectory->cd("soft"); - // Get the multiplicity distribution - parameters.softMultiplicity = - readHistogram("MultiplicityBinBorders", "MultiplicityBinContents"); - // Get the distributions for each final state multiplicity - auto softList = gDirectory->GetListOfKeys(); - auto softElement = softList->First(); - while (softElement != nullptr) { - readKinematicParameters(parameters, softElement, true); - softElement = softList->After(softElement); - } - - // Get the hard distributions - gDirectory->cd("../hard"); - // Get the multiplicity distribution - parameters.hardMultiplicity = - readHistogram("MultiplicityBinBorders", "MultiplicityBinContents"); - - // Get the distributions for each final state multiplicity - auto hardList = gDirectory->GetListOfKeys(); - auto hardElement = hardList->First(); - while (hardElement != nullptr) { - readKinematicParameters(parameters, hardElement, false); - hardElement = hardList->After(hardElement); - } - - initialMomentum = listOfMomenta->After(initialMomentum); - // Store the parametrisation - parametrisation.push_back( - std::make_pair(parameters.momentum, parameters)); - } - tf.Close(); - - // Write to the collection to the EventStore - mpp.push_back(std::make_pair(std::stof(particleName), parametrisation)); - - initialParticle = listOfParticles->After(initialParticle); - } - // Return success flag - return mpp; -} diff --git a/Examples/Run/Common/src/ParticleGunOptions.cpp b/Examples/Run/Common/src/ParticleGunOptions.cpp deleted file mode 100644 index 46edf22081b..00000000000 --- a/Examples/Run/Common/src/ParticleGunOptions.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/ParticleGunOptions.hpp" - -#include "Acts/Definitions/Units.hpp" -#include "ActsExamples/Generators/MultiplicityGenerators.hpp" -#include "ActsExamples/Generators/ParametricParticleGenerator.hpp" -#include "ActsExamples/Generators/VertexGenerators.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include - -void ActsExamples::Options::addParticleGunOptions(Description& desc) { - using boost::program_options::bool_switch; - using boost::program_options::value; - - auto opt = desc.add_options(); - opt("gen-vertex-xy-std-mm", value()->default_value(0.0), - "Transverse vertex standard deviation in mm"); - opt("gen-vertex-z-std-mm", value()->default_value(0.0), - "Longitudinal vertex standard deviation in mm"); - opt("gen-vertex-t-std-ns", value()->default_value(0.0), - "Temporal vertex standard deviation in ns"); - opt("gen-phi-degree", - value()->value_name("MIN:MAX")->default_value({-180.0, 180.0}), - "Transverse direction angle generation range in degree"); - opt("gen-eta", - value()->value_name("MIN:MAX")->default_value({-4.0, 4.0}), - "Pseudo-rapidity generation range"); - opt("gen-eta-uniform", bool_switch(), - "Sample eta directly and not cos(theta)."); - opt("gen-mom-gev", - value()->value_name("MIN:MAX")->default_value({1.0, 10.0}), - "Absolute (or transverse) momentum generation range in GeV"); - opt("gen-mom-transverse", bool_switch(), - "Momentum referse to transverse momentum"); - opt("gen-pdg", value()->default_value(Acts::PdgParticle::eMuon), - "PDG number of the particle, will be adjusted for charge flip."); - opt("gen-randomize-charge", bool_switch(), - "Flip the charge and change the PDG number accordingly."); - opt("gen-nparticles", value()->default_value(1u), - "Number of generated particles per vertex"); - opt("gen-nvertices", value()->default_value(1u), - "Number of generated vertices"); -} - -ActsExamples::EventGenerator::Config -ActsExamples::Options::readParticleGunOptions(const Variables& vars) { - using namespace Acts::UnitLiterals; - - // access user config w/ unit conversion - auto getValue = [&](const char* name, auto unit) { - return vars[name].as() * unit; - }; - auto getRange = [&](const char* name, auto unit, auto& lower, auto& upper) { - auto interval = vars[name].as(); - lower = interval.lower.value() * unit; - upper = interval.upper.value() * unit; - }; - - auto vertexGen = std::make_shared(); - vertexGen->stddev[Acts::ePos0] = getValue("gen-vertex-xy-std-mm", 1_mm); - vertexGen->stddev[Acts::ePos1] = getValue("gen-vertex-xy-std-mm", 1_mm); - vertexGen->stddev[Acts::ePos2] = getValue("gen-vertex-z-std-mm", 1_mm); - vertexGen->stddev[Acts::eTime] = getValue("gen-vertex-t-std-ns", 1_ns); - - ParametricParticleGenerator::Config pgCfg; - getRange("gen-phi-degree", 1_degree, pgCfg.phiMin, pgCfg.phiMax); - // user config sets eta but the generator takes theta - double etaMin = 0, etaMax = 0; - getRange("gen-eta", 1.0, etaMin, etaMax); - - pgCfg.etaUniform = vars["gen-eta-uniform"].template as(); - pgCfg.thetaMin = 2 * std::atan(std::exp(-etaMin)); - pgCfg.thetaMax = 2 * std::atan(std::exp(-etaMax)); - getRange("gen-mom-gev", 1_GeV, pgCfg.pMin, pgCfg.pMax); - pgCfg.pTransverse = vars["gen-mom-transverse"].template as(); - pgCfg.pdg = - static_cast(vars["gen-pdg"].template as()); - pgCfg.randomizeCharge = vars["gen-randomize-charge"].template as(); - pgCfg.numParticles = vars["gen-nparticles"].as(); - - if (pgCfg.numParticles > std::pow(2, ActsFatras::Barcode::bits(2))) { - throw std::runtime_error{ - "Too many particles per vertex requested for Fatras Barcode"}; - } - - std::size_t nVertices = vars["gen-nvertices"].as(); - - if (nVertices > std::pow(2, ActsFatras::Barcode::bits(0))) { - throw std::runtime_error{"Too many vertices requested for Fatras Barcode"}; - } - - auto mGen = std::make_shared(); - mGen->n = nVertices; - - EventGenerator::Config cfg; - cfg.generators = { - {std::move(mGen), std::move(vertexGen), - std::make_shared(pgCfg)}, - }; - - return cfg; -} diff --git a/Examples/Run/Common/src/ParticleSelectorOptions.cpp b/Examples/Run/Common/src/ParticleSelectorOptions.cpp deleted file mode 100644 index 3606c7028aa..00000000000 --- a/Examples/Run/Common/src/ParticleSelectorOptions.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2022 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/ParticleSelectorOptions.hpp" - -#include "Acts/Definitions/Units.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include - -namespace ActsExamples { -namespace Options { - -void addParticleSelectorOptions(Options::Description& desc) { - using boost::program_options::bool_switch; - using boost::program_options::value; - using Options::Interval; - - auto opt = desc.add_options(); - opt("select-rho-mm", value()->value_name("MIN:MAX"), - "Select particle transverse distance to the origin in mm"); - opt("select-absz-mm", value()->value_name("MIN:MAX"), - "Select particle absolute longitudinal distance to the origin in mm"); - opt("select-time-ns", value()->value_name("MIN:MAX"), - "Select particle time in ns"); - opt("select-phi-degree", value()->value_name("MIN:MAX"), - "Select particle direction angle in the transverse plane in degree"); - opt("select-eta", value()->value_name("MIN:MAX"), - "Select particle pseudo-rapidity"); - opt("select-abseta", value()->value_name("MIN:MAX"), - "Select particle absolute pseudo-rapidity"); - opt("select-pt-gev", value()->value_name("MIN:MAX"), - "Select particle transverse momentum in GeV"); - opt("remove-charged", bool_switch(), "Remove charged particles"); - opt("remove-neutral", bool_switch(), "Remove neutral particles"); -} - -ActsExamples::ParticleSelector::Config readParticleSelectorConfig( - const Options::Variables& vars) { - using namespace Acts::UnitLiterals; - - // Set boundary values if the given config exists - auto extractInterval = [&](const char* name, auto unit, auto& lower, - auto& upper) { - if (vars[name].empty()) { - return; - } - auto interval = vars[name].as(); - lower = interval.lower.value_or(lower) * unit; - upper = interval.upper.value_or(upper) * unit; - }; - - ActsExamples::ParticleSelector::Config cfg; - extractInterval("select-rho-mm", 1_mm, cfg.rhoMin, cfg.rhoMax); - extractInterval("select-absz-mm", 1_mm, cfg.absZMin, cfg.absZMax); - extractInterval("select-time-ns", 1_ns, cfg.timeMin, cfg.timeMax); - extractInterval("select-phi-degree", 1_degree, cfg.phiMin, cfg.phiMax); - extractInterval("select-eta", 1.0, cfg.etaMin, cfg.etaMax); - extractInterval("select-abseta", 1.0, cfg.absEtaMin, cfg.absEtaMax); - extractInterval("select-pt-gev", 1_GeV, cfg.ptMin, cfg.ptMax); - cfg.removeCharged = vars["remove-charged"].as(); - cfg.removeNeutral = vars["remove-neutral"].as(); - return cfg; -} - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/src/ParticleSmearingOptions.cpp b/Examples/Run/Common/src/ParticleSmearingOptions.cpp deleted file mode 100644 index a2dbb29162d..00000000000 --- a/Examples/Run/Common/src/ParticleSmearingOptions.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/ParticleSmearingOptions.hpp" - -void ActsExamples::Options::addParticleSmearingOptions(Description& desc) { - using boost::program_options::value; - using Options::Reals; - - auto opt = desc.add_options(); - opt("smear-sigma-D0", value>()->default_value({{20, 30, 0.3}}), - "Smear the initial Pt-dependent d0 in perigee frame with a_0[um] + " - "a_1[um]*exp(-1.*abs(a_2[1/GeV])*pt)"); - opt("smear-sigma-Z0", value>()->default_value({{20, 30, 0.3}}), - "Smear the initial Pt-dependent z0 in perigee frame with a_0[um] + " - "a_1[um]*exp(-1.*abs(a_2[1/GeV])*pt)"); - opt("smear-sigma-T0", value()->default_value(1), - "Smear the initial time in ns"); - opt("smear-sigma-momentum", value>()->default_value({{1, 1, 0.05}}), - "Smear the initial phi (degree), theta (degree) and momentum (relative)"); - opt("smear-initial-variance-inflation", - value>()->default_value({{1., 1., 1., 1., 1., 1.}}), - "Inflate the initial covariance matrix"); -} - -ActsExamples::ParticleSmearing::Config -ActsExamples::Options::readParticleSmearingOptions( - const ActsExamples::Options::Variables& vars) { - using namespace ActsExamples; - using namespace Acts::UnitConstants; - using Options::Reals; - - ParticleSmearing::Config cfg; - - auto sigmaD0Opts = vars["smear-sigma-D0"].template as>(); - auto sigmaZ0Opts = vars["smear-sigma-Z0"].template as>(); - auto sigmaMomOpts = vars["smear-sigma-momentum"].template as>(); - cfg.sigmaD0 = sigmaD0Opts[0] * Acts::UnitConstants::um; - cfg.sigmaD0PtA = sigmaD0Opts[1] * Acts::UnitConstants::um; - cfg.sigmaD0PtB = sigmaD0Opts[2] / Acts::UnitConstants::GeV; - cfg.sigmaZ0 = sigmaZ0Opts[0] * Acts::UnitConstants::um; - cfg.sigmaZ0PtA = sigmaZ0Opts[1] * Acts::UnitConstants::um; - cfg.sigmaZ0PtB = sigmaZ0Opts[2] / Acts::UnitConstants::GeV; - cfg.sigmaT0 = vars["smear-sigma-T0"].as() * Acts::UnitConstants::ns; - cfg.sigmaPhi = sigmaMomOpts[0] * Acts::UnitConstants::degree; - cfg.sigmaTheta = sigmaMomOpts[1] * Acts::UnitConstants::degree; - cfg.sigmaPRel = sigmaMomOpts[2]; - auto varInflation = - vars["smear-initial-variance-inflation"].template as>(); - cfg.initialVarInflation = {varInflation[0], varInflation[1], varInflation[2], - varInflation[3], varInflation[4], varInflation[5]}; - return cfg; -} diff --git a/Examples/Run/Common/src/PropagationExampleBase.cpp b/Examples/Run/Common/src/PropagationExampleBase.cpp deleted file mode 100644 index b2f3e3689d3..00000000000 --- a/Examples/Run/Common/src/PropagationExampleBase.cpp +++ /dev/null @@ -1,143 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Geometry/TrackingGeometry.hpp" -#include "Acts/Propagator/AtlasStepper.hpp" -#include "Acts/Propagator/EigenStepper.hpp" -#include "Acts/Propagator/Navigator.hpp" -#include "Acts/Propagator/Propagator.hpp" -#include "Acts/Propagator/StraightLineStepper.hpp" -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Framework/RandomNumbers.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Root/RootPropagationStepsWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Plugins/Obj/ObjPropagationStepsWriter.hpp" -#include "ActsExamples/Propagation/PropagationAlgorithm.hpp" -#include "ActsExamples/Propagation/PropagationOptions.hpp" -#include "ActsExamples/Propagation/PropagatorInterface.hpp" -#include "ActsExamples/Utilities/Paths.hpp" - -#include - -#include - -int propagationExample(int argc, char* argv[], - ActsExamples::IBaseDetector& detector) { - // Setup and parse options - auto desc = ActsExamples::Options::makeDefaultOptions(); - ActsExamples::Options::addSequencerOptions(desc); - ActsExamples::Options::addGeometryOptions(desc); - ActsExamples::Options::addMaterialOptions(desc); - ActsExamples::Options::addMagneticFieldOptions(desc); - ActsExamples::Options::addRandomNumbersOptions(desc); - ActsExamples::Options::addPropagationOptions(desc); - ActsExamples::Options::addOutputOptions( - desc, ActsExamples::OutputFormat::Root | ActsExamples::OutputFormat::Obj); - - // Add specific options for this geometry - detector.addOptions(desc); - auto vm = ActsExamples::Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - ActsExamples::Sequencer sequencer( - ActsExamples::Options::readSequencerConfig(vm)); - - // Now read the standard options - auto logLevel = ActsExamples::Options::readLogLevel(vm); - - // The geometry, material and decoration - auto geometry = ActsExamples::Geometry::build(vm, detector); - auto tGeometry = geometry.first; - auto contextDecorators = geometry.second; - // Add the decorator to the sequencer - for (const auto& cdr : contextDecorators) { - sequencer.addContextDecorator(cdr); - } - - // Create the random number engine - auto randomNumberSvcCfg = ActsExamples::Options::readRandomNumbersConfig(vm); - auto randomNumberSvc = - std::make_shared(randomNumberSvcCfg); - - // Create BField service - ActsExamples::Options::setupMagneticFieldServices(vm, sequencer); - auto bField = ActsExamples::Options::readMagneticField(vm); - - // Check what output exists, if none exists, the SteppingLogger - // will switch to sterile. - bool rootOutput = vm["output-root"].template as(); - bool objOutput = vm["output-obj"].template as(); - - auto setupPropagator = [&](auto&& stepper) { - using Stepper = std::decay_t; - using Propagator = Acts::Propagator; - Acts::Navigator::Config navCfg{tGeometry}; - navCfg.resolveMaterial = vm["prop-resolve-material"].template as(); - navCfg.resolvePassive = vm["prop-resolve-passive"].template as(); - navCfg.resolveSensitive = vm["prop-resolve-sensitive"].template as(); - Acts::Navigator navigator(navCfg); - - Propagator propagator(std::move(stepper), std::move(navigator)); - - // Read the propagation config and create the algorithms - auto pAlgConfig = ActsExamples::Options::readPropagationConfig(vm); - pAlgConfig.randomNumberSvc = randomNumberSvc; - pAlgConfig.sterileLogger = not rootOutput and not objOutput; - - pAlgConfig.propagatorImpl = - std::make_shared>( - std::move(propagator)); - - sequencer.addAlgorithm(std::make_shared( - pAlgConfig, logLevel)); - }; - - // translate option to variant - if (vm["prop-stepper"].template as() == 0) { - setupPropagator(Acts::StraightLineStepper{}); - } else if (vm["prop-stepper"].template as() == 1) { - setupPropagator(Acts::EigenStepper<>{std::move(bField)}); - } else if (vm["prop-stepper"].template as() == 2) { - setupPropagator(Acts::AtlasStepper{std::move(bField)}); - } - - // --------------------------------------------------------------------------------- - // Output directory - std::string outputDir = vm["output-dir"].template as(); - auto psCollection = vm["prop-step-collection"].as(); - - if (rootOutput) { - // Write the propagation steps as ROOT TTree - ActsExamples::RootPropagationStepsWriter::Config pstepWriterRootConfig; - pstepWriterRootConfig.collection = psCollection; - pstepWriterRootConfig.filePath = - ActsExamples::joinPaths(outputDir, psCollection + ".root"); - sequencer.addWriter( - std::make_shared( - pstepWriterRootConfig)); - } - - if (objOutput) { - using PropagationSteps = Acts::detail::Step; - using ObjPropagationStepsWriter = - ActsExamples::ObjPropagationStepsWriter; - - // Write the propagation steps as Obj TTree - ObjPropagationStepsWriter::Config pstepWriterObjConfig; - pstepWriterObjConfig.collection = psCollection; - pstepWriterObjConfig.outputDir = outputDir; - sequencer.addWriter( - std::make_shared(pstepWriterObjConfig)); - } - - return sequencer.run(); -} diff --git a/Examples/Run/Common/src/ReconstructionBase.cpp b/Examples/Run/Common/src/ReconstructionBase.cpp deleted file mode 100644 index 46b61fecec7..00000000000 --- a/Examples/Run/Common/src/ReconstructionBase.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Reconstruction/ReconstructionBase.hpp" - -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Json/JsonDigitizationConfig.hpp" -#include "ActsExamples/Io/Performance/CKFPerformanceWriter.hpp" -#include "ActsExamples/Io/Performance/SeedingPerformanceWriter.hpp" -#include "ActsExamples/Io/Performance/TrackFinderPerformanceWriter.hpp" -#include "ActsExamples/Io/Performance/TrackFitterPerformanceWriter.hpp" -#include "ActsExamples/Io/Root/RootTrackStatesWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/DigitizationOptions.hpp" -#include "ActsExamples/Options/TrackFindingOptions.hpp" -#include "ActsExamples/Options/TrackFittingOptions.hpp" -#include "ActsExamples/TrackFinding/SeedingAlgorithm.hpp" -#include "ActsExamples/TrackFinding/SpacePointMaker.hpp" -#include "ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp" -#include "ActsExamples/TrackFitting/SurfaceSortingAlgorithm.hpp" -#include "ActsExamples/TrackFitting/TrackFittingAlgorithm.hpp" -#include "ActsExamples/TruthTracking/TruthTrackFinder.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -ActsExamples::CsvSimHitReader::Config setupSimHitReading( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer) { - using namespace ActsExamples; - - // Read some standard options - auto logLevel = Options::readLogLevel(vars); - - // Read truth hits from CSV files - auto simHitReaderCfg = Options::readCsvSimHitReaderConfig(vars); - simHitReaderCfg.inputStem = "hits"; - simHitReaderCfg.outputSimHits = "hits"; - sequencer.addReader( - std::make_shared(simHitReaderCfg, logLevel)); - - return simHitReaderCfg; -} - -ActsExamples::CsvParticleReader::Config setupParticleReading( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer) { - using namespace ActsExamples; - - // Read some standard options - auto logLevel = Options::readLogLevel(vars); - - // Read particles (initial states) and clusters from CSV files - auto particleReader = Options::readCsvParticleReaderConfig(vars); - particleReader.inputStem = "particles_initial"; - particleReader.outputParticles = "particles_initial"; - sequencer.addReader( - std::make_shared(particleReader, logLevel)); - - return particleReader; -} - -ActsExamples::DigitizationConfig setupDigitization( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer, - std::shared_ptr rnd, - std::shared_ptr trackingGeometry, - const std::string& inputSimHits) { - using namespace ActsExamples; - - // Read some standard options - auto logLevel = Options::readLogLevel(vars); - - auto digiCfg = ActsExamples::DigitizationConfig( - vars["digi-merge"].as(), vars["digi-merge-nsigma"].as(), - vars["digi-merge-common-corner"].as(), - ActsExamples::readDigiConfigFromJson( - vars["digi-config-file"].as())); - // Common options for digitization - digiCfg.inputSimHits = inputSimHits; - digiCfg.randomNumbers = std::move(rnd); - digiCfg.trackingGeometry = std::move(trackingGeometry); - sequencer.addAlgorithm( - std::make_shared(digiCfg, logLevel)); - - if (not vars["dump-digi-config"].as().empty()) { - writeDigiConfigToJson(digiCfg.digitizationConfigs, - vars["dump-digi-config"].as()); - } - - return digiCfg; -} - -ActsExamples::ParticleSmearing::Config setupParticleSmearing( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer, - std::shared_ptr rnd, - const std::string& inputParticles) { - using namespace ActsExamples; - using namespace Acts::UnitLiterals; - - // Read some standard options - auto logLevel = Options::readLogLevel(vars); - - // Create smeared particles states - ParticleSmearing::Config particleSmearingCfg = - Options::readParticleSmearingOptions(vars); - particleSmearingCfg.inputParticles = inputParticles; - particleSmearingCfg.outputTrackParameters = "smearedparameters"; - particleSmearingCfg.randomNumbers = std::move(rnd); - sequencer.addAlgorithm( - std::make_shared(particleSmearingCfg, logLevel)); - - return particleSmearingCfg; -} - -ActsExamples::CsvMeasurementReader::Config setupMeasurementReading( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer) { - using namespace ActsExamples; - // Read some standard options - auto logLevel = Options::readLogLevel(vars); - - // Read particles (initial states) from CSV files - auto measurementsReader = Options::readCsvMeasurementReaderConfig(vars); - measurementsReader.outputMeasurements = "measurements"; - measurementsReader.outputMeasurementSimHitsMap = "measurements2hits"; - measurementsReader.outputSourceLinks = "source_links"; - measurementsReader.outputClusters = "clusters"; - sequencer.addReader( - std::make_shared(measurementsReader, logLevel)); - - return measurementsReader; -} diff --git a/Examples/Run/Common/src/SpacePointMakerOptions.cpp b/Examples/Run/Common/src/SpacePointMakerOptions.cpp deleted file mode 100644 index 7f4604081a4..00000000000 --- a/Examples/Run/Common/src/SpacePointMakerOptions.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/SpacePointMakerOptions.hpp" - -#include "ActsExamples/Io/Json/JsonGeometryList.hpp" - -#include - -#include - -void ActsExamples::Options::addSpacePointMakerOptions( - ActsExamples::Options::Description& desc) { - using boost::program_options::value; - - auto opt = desc.add_options(); - opt("geo-selection-config-file", value()->default_value(""), - "Json file for space point geometry selection"); -} - -ActsExamples::SpacePointMaker::Config -ActsExamples::Options::readSpacePointMakerConfig( - const ActsExamples::Options::Variables& variables) { - SpacePointMaker::Config cfg; - std::string path{variables["geo-selection-config-file"].as()}; - if (not path.empty()) { - cfg.geometrySelection = ActsExamples::readJsonGeometryList(path); - } - return cfg; -} diff --git a/Examples/Run/Common/src/TGeoDetectorWithOptions.cpp b/Examples/Run/Common/src/TGeoDetectorWithOptions.cpp deleted file mode 100644 index 65003057817..00000000000 --- a/Examples/Run/Common/src/TGeoDetectorWithOptions.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TGeoDetectorWithOptions.hpp" - -#include "Acts/Geometry/CylinderVolumeBuilder.hpp" -#include "Acts/Geometry/CylinderVolumeHelper.hpp" -#include "Acts/Geometry/GeometryContext.hpp" -#include "Acts/Geometry/LayerArrayCreator.hpp" -#include "Acts/Geometry/LayerCreator.hpp" -#include "Acts/Geometry/PassiveLayerBuilder.hpp" -#include "Acts/Geometry/SurfaceArrayCreator.hpp" -#include "Acts/Geometry/TrackingGeometry.hpp" -#include "Acts/Geometry/TrackingGeometryBuilder.hpp" -#include "Acts/Geometry/TrackingVolumeArrayCreator.hpp" -#include "Acts/Plugins/TGeo/TGeoCylinderDiscSplitter.hpp" -#include "Acts/Plugins/TGeo/TGeoDetectorElement.hpp" -#include "Acts/Plugins/TGeo/TGeoLayerBuilder.hpp" -#include "Acts/Utilities/Logger.hpp" -#include "ActsExamples/Framework/IContextDecorator.hpp" -#include "ActsExamples/TGeoDetector/JsonTGeoDetectorConfig.hpp" -#include "ActsExamples/TGeoDetector/TGeoITkModuleSplitter.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include -#include -#include - -#include - -namespace ActsExamples { -using namespace Options; - -namespace { - -/// Read the TGeo layer builder configurations from the user configuration -/// specified with --geo-tgeo-jsonconfig. -void readTGeoLayerBuilderConfigs(const Variables& vm, - TGeoDetector::Config& config) { - const auto path = vm["geo-tgeo-jsonconfig"].template as(); - TGeoDetector::readTGeoLayerBuilderConfigsFile(path, config); -} - -/// Dump TGeo Detector config to file. -void writeTGeoDetectorConfig(const Variables& vm, - TGeoDetector::Config& config) { - const auto path = vm["geo-tgeo-dump-jsonconfig"].template as(); - nlohmann::json djson; - if (path.empty()) { - return; - } - std::ofstream outfile(path, std::ofstream::out | std::ofstream::binary); - - djson["geo-tgeo-unit-scalor"] = config.unitScalor; - djson["geo-tgeo-build-beampipe"] = config.buildBeamPipe; - djson["geo-tgeo-beampipe-parameters"] = - std::array{config.beamPipeRadius, config.beamPipeHalflengthZ, - config.beamPipeLayerThickness}; - - // Enable empty volume dump - if (config.volumes.empty()) { - config.volumes.emplace_back(); - } - djson["Volumes"] = config.volumes; - - outfile << djson.dump(2) << std::endl; -} - -} // namespace - -void TGeoDetectorWithOptions::addOptions( - boost::program_options::options_description& opt) const { - using boost::program_options::value; - - auto tmp = opt.add_options(); - // required global options - tmp("geo-tgeo-filename", value()->default_value(""), - "Root file name."); - tmp("geo-tgeo-jsonconfig", value()->default_value(""), - "Json config file name."); - tmp("geo-tgeo-dump-jsonconfig", - value()->default_value("tgeo_empty_config.json"), - "Json file to dump empty config into."); -} - -auto TGeoDetectorWithOptions::finalize( - const boost::program_options::variables_map& vm, - std::shared_ptr mdecorator) - -> std::pair { - TGeoDetector::Config config; - - config.fileName = vm["geo-tgeo-filename"].as(); - - config.surfaceLogLevel = Acts::Logging::Level( - vm["geo-surface-loglevel"].template as()); - config.layerLogLevel = - Acts::Logging::Level(vm["geo-layer-loglevel"].template as()); - config.volumeLogLevel = Acts::Logging::Level( - vm["geo-volume-loglevel"].template as()); - - // No valid geometry configuration. Stop - if (vm["geo-tgeo-jsonconfig"].as().empty()) { - writeTGeoDetectorConfig(vm, config); - std::exit(EXIT_SUCCESS); - } - // Enable dump from full config - else if (not(vm["geo-tgeo-dump-jsonconfig"].as().compare( - "tgeo_empty_cofig.json") == 0)) { - readTGeoLayerBuilderConfigs(vm, config); - writeTGeoDetectorConfig(vm, config); - } else { - readTGeoLayerBuilderConfigs(vm, config); - } - - return m_detector.finalize(config, std::move(mdecorator)); -} - -} // namespace ActsExamples diff --git a/Examples/Run/Common/src/TelescopeDetectorWithOptions.cpp b/Examples/Run/Common/src/TelescopeDetectorWithOptions.cpp deleted file mode 100644 index 52586fbef34..00000000000 --- a/Examples/Run/Common/src/TelescopeDetectorWithOptions.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2022 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TelescopeDetectorWithOptions.hpp" - -#include "ActsExamples/Utilities/Options.hpp" - -#include - -namespace ActsExamples { - -void TelescopeDetectorWithOptions::addOptions( - ActsExamples::Options::Description& desc) const { - using boost::program_options::value; - using namespace Options; - - auto opt = desc.add_options(); - opt("geo-tele-positions", - value()->default_value({{0, 30, 60, 120, 150, 180}}), - "Telescope detector Input: the layers positions in the longitudinal " - "direction in mm"); - opt("geo-tele-stereos", - value()->default_value({{0, 0, 0, 0, 0, 0}}), - "Telescope detector Input: the layers stereo angle around the " - "longitudinal " - "direction in rad"); - opt("geo-tele-offsets", value>()->default_value({{0, 0}}), - "Telescope detector Input: the layers offsets in the transverse plane " - "in " - "mm. Same values for " - "all layers"); - opt("geo-tele-bounds", value>()->default_value({{25, 100}}), - "Telescope detector Input: the values for surface bounds in mm: " - "(halfX, halfY) - plane surface, (minR, maxR) - disc surface"); - opt("geo-tele-thickness", value()->default_value(80), - "Telescope detector Input: the silicon material thickness of " - "each layer in um. Same value for all layers"); - opt("geo-tele-surface", value()->default_value(0), - "Telescope detector Input: the detector surface type: 0 - plane " - "surface, " - "1 - disc surface"); - opt("geo-tele-alignaxis", value()->default_value(2), - "Telescope detector Input: the detector is placed along which " - "axis: 0 - x axis, 1 - y axis, 2 - z axis"); -} - -auto TelescopeDetectorWithOptions::finalize( - const boost::program_options::variables_map& vm, - std::shared_ptr /*mdecorator*/) - -> std::pair { - Telescope::TelescopeDetector::Config cfg; - - cfg.positions = vm["geo-tele-positions"] - .template as() - .values; - cfg.stereos = vm["geo-tele-stereos"] - .template as() - .values; - cfg.offsets = - vm["geo-tele-offsets"].template as>(); - // The bounds values are taken as (halfX, halfY) for plane surface and - // (minR, maxR) for disc surface - cfg.bounds = - vm["geo-tele-bounds"].template as>(); - // Translate the thickness in unit of mm - cfg.thickness = vm["geo-tele-thickness"].template as() * 0.001; - cfg.surfaceType = vm["geo-tele-surface"].template as(); - cfg.binValue = vm["geo-tele-alignaxis"].template as(); - - return m_detector.finalize(cfg, {}); -} - -} // namespace ActsExamples diff --git a/Examples/Run/Common/src/TrackFindingOptions.cpp b/Examples/Run/Common/src/TrackFindingOptions.cpp deleted file mode 100644 index 9309f5b301b..00000000000 --- a/Examples/Run/Common/src/TrackFindingOptions.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/TrackFindingOptions.hpp" - -#include "Acts/Geometry/GeometryIdentifier.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include - -#include - -void ActsExamples::Options::addTrackFindingOptions( - ActsExamples::Options::Description& desc) { - using boost::program_options::value; - - auto opt = desc.add_options(); - opt("ckf-selection-abseta-bins", value()->default_value({{}}), - "bins in |eta| to specify variable selections"); - opt("ckf-selection-chi2max", value()->default_value({{15}}), - "Maximum chi2 for CKF measurement selection " - "(specify multiple values with --ckf-selection-abseta-bins)"); - opt("ckf-selection-nmax", value()->default_value({{10}}), - "Maximum number of measurement candidates on a " - "surface for CKF measurement selection " - "(specify multiple values with --ckf-selection-abseta-bins)"); - opt("ckf-initial-variance-inflation", - value>()->default_value({{1., 1., 1., 1., 1., 1.}}), - "Inflation factor for the initial variances in the CKF search, must be " - "of form i:j:k:l:m:n."); -} - -ActsExamples::TrackFindingAlgorithm::Config -ActsExamples::Options::readTrackFindingConfig( - const ActsExamples::Options::Variables& variables) { - auto etaBins = variables["ckf-selection-abseta-bins"] - .template as() - .values; - auto chi2Max = - variables["ckf-selection-chi2max"].template as().values; - auto nMax = - variables["ckf-selection-nmax"].template as().values; - - // config is a GeometryHierarchyMap with just the global default - TrackFindingAlgorithm::Config cfg; - cfg.measurementSelectorCfg = { - {Acts::GeometryIdentifier(), - {etaBins, chi2Max, {nMax.begin(), nMax.end()}}}, - }; - return cfg; -} diff --git a/Examples/Run/Common/src/TrackFittingOptions.cpp b/Examples/Run/Common/src/TrackFittingOptions.cpp deleted file mode 100644 index 450c0fb59c5..00000000000 --- a/Examples/Run/Common/src/TrackFittingOptions.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/TrackFittingOptions.hpp" - -#include "ActsExamples/Utilities/Options.hpp" - -using namespace boost::program_options; - -void ActsExamples::Options::addFittingOptions( - boost::program_options::options_description& opt) { - opt.add_options()("fit-directed-navigation", bool_switch(), - "Fit tracks with DirectNavigator"); - opt.add_options()("fit-multiple-scattering-correction", - value()->default_value(true), - "Correct for multiple scattering effects."); - opt.add_options()("fit-energy-loss-correction", - value()->default_value(true), - "Correct for energyloss effects."); - opt.add_options()( - "fit-ftob-nonlinear-correction", value()->default_value(false), - "Correct for non-linear effects during free to bound transformation."); - opt.add_options()("fit-pick-track", value()->default_value(-1), - "Pick a single track by track number (-1 for all tracks)"); - opt.add_options()( - "fit-initial-variance-inflation", - value>()->default_value({{1., 1., 1., 1., 1., 1.}}), - "Inflation factor for the initial covariance for the Kalman filter, 6 " - "values are required in the form of i:j:k:l:m:n."); -} diff --git a/Examples/Run/Common/src/TruthSeedSelectorOptions.cpp b/Examples/Run/Common/src/TruthSeedSelectorOptions.cpp deleted file mode 100644 index bee92cf2997..00000000000 --- a/Examples/Run/Common/src/TruthSeedSelectorOptions.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2022 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/TruthSeedSelectorOptions.hpp" - -#include "Acts/Definitions/Units.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include - -namespace ActsExamples { -namespace Options { - -void addTruthSeedSelectorOptions(Options::Description& desc) { - using boost::program_options::value; - using Options::Interval; - - auto opt = desc.add_options(); - opt("select-rho-mm", value()->value_name("MIN:MAX"), - "Select particle transverse distance to the origin in mm"); - opt("select-z-mm", value()->value_name("MIN:MAX"), - "Select particle longitudinal distance range to the origin in mm"); - opt("select-phi-degree", value()->value_name("MIN:MAX"), - "Select particle direction angle in the transverse plane in degree"); - opt("select-eta", value()->value_name("MIN:MAX"), - "Select particle pseudo-rapidity"); - opt("select-abseta", value()->value_name("MIN:MAX"), - "Select particle absolute pseudo-rapidity"); - opt("select-pt-gev", value()->value_name("MIN:MAX"), - "Select particle transverse momentum in GeV"); - opt("select-min-hits", value()->default_value(3), - "Select particle minimum hits"); -} - -ActsExamples::TruthSeedSelector::Config readTruthSeedSelectorConfig( - const Options::Variables& vars) { - using namespace Acts::UnitLiterals; - - // Set boundary values if the given config exists - auto extractInterval = [&](const char* name, auto unit, auto& lower, - auto& upper) { - if (vars[name].empty()) { - return; - } - auto interval = vars[name].as(); - lower = interval.lower.value_or(lower) * unit; - upper = interval.upper.value_or(upper) * unit; - }; - - ActsExamples::TruthSeedSelector::Config cfg; - extractInterval("select-rho-mm", 1_mm, cfg.rhoMin, cfg.rhoMax); - extractInterval("select-z-mm", 1_mm, cfg.zMin, cfg.zMax); - extractInterval("select-phi-degree", 1_degree, cfg.phiMin, cfg.phiMax); - extractInterval("select-eta", 1.0, cfg.etaMin, cfg.etaMax); - extractInterval("select-abseta", 1.0, cfg.absEtaMin, cfg.absEtaMax); - extractInterval("select-pt-gev", 1_GeV, cfg.ptMin, cfg.ptMax); - cfg.nHitsMin = vars["select-min-hits"].as(); - return cfg; -} - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Common/src/VertexingOptions.cpp b/Examples/Run/Common/src/VertexingOptions.cpp deleted file mode 100644 index 4da7226d6bd..00000000000 --- a/Examples/Run/Common/src/VertexingOptions.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/VertexingOptions.hpp" - -#include "Acts/Definitions/TrackParametrization.hpp" -#include "Acts/Definitions/Units.hpp" -#include "Acts/Utilities/Logger.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include -#include -#include - -#include - -void ActsExamples::Options::addVertexingOptions(Description& desc) { - using boost::program_options::bool_switch; - using boost::program_options::value; - - auto opt = desc.add_options(); - opt("vertexing-eta-max", value()->default_value(2.5), - "Input track selection cut for primary vertexing - maximum absolute eta"); - opt("vertexing-rho-max", value()->default_value(4.), - "Input track selection cut for primary vertexing - maximum rho in mm"); - opt("vertexing-pt-min", value()->default_value(500.), - "Input track selection cut for primary vertexing - minimum pt in MeV"); -} diff --git a/Examples/Run/DD4hep/CMakeLists.txt b/Examples/Run/DD4hep/CMakeLists.txt deleted file mode 100644 index c07fa41300f..00000000000 --- a/Examples/Run/DD4hep/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -add_library( - ActsExamplesDD4hepDetectorWithOptions SHARED - src/DD4hepDetectorWithOptions.cpp -) - -target_link_libraries( - ActsExamplesDD4hepDetectorWithOptions PUBLIC - ActsExamplesCommon ActsExamplesDetectorDD4hep) - -target_include_directories( - ActsExamplesDD4hepDetectorWithOptions - PUBLIC $) - -install( - TARGETS ActsExamplesDD4hepDetectorWithOptions - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/Examples/Run/DD4hep/include/ActsExamples/Detector/DD4hepDetectorOptions.hpp b/Examples/Run/DD4hep/include/ActsExamples/Detector/DD4hepDetectorOptions.hpp deleted file mode 100644 index 59d8e14fd9a..00000000000 --- a/Examples/Run/DD4hep/include/ActsExamples/Detector/DD4hepDetectorOptions.hpp +++ /dev/null @@ -1,76 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2017 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/DD4hepDetector/DD4hepGeometryService.hpp" -#include "ActsExamples/Utilities/Options.hpp" -#include - -#include -#include - -#include - -namespace po = boost::program_options; - -namespace ActsExamples { - -namespace Options { - -/// the particle gun options, the are prefixes with gp -template -void addDD4hepOptions(aopt_t& opt) { - opt.add_options()( - "dd4hep-input", po::value>(), - "The locations of the input DD4hep files, use 'file:foo.xml'. In case " - "you want to read in multiple files, add the option multiple times.")( - "dd4hep-envelopeR", po::value()->default_value(1.), - "The envelop cover in R for DD4hep volumes in mm.")( - "dd4hep-envelopeR", po::value()->default_value(1.), - "The tolerance added to the geometrical extension in r of the " - "layers contained to build the volume envelope around in mm.")( - "dd4hep-envelopeZ", po::value()->default_value(1.), - "The tolerance added to the geometrical extension in z of the " - "layers contained to build the volume envelope around in mm.")( - "dd4hep-layerThickness", po::value()->default_value(10e-10), - "In case no surfaces (to be contained by the layer) are handed over, " - "the layer thickness will be set to this value.")( - "dd4hep-buildFCChh", po::value()->default_value(true), - "If you are not building the FCChh detector please set this flag to " - "false.")("dd4hep-loglevel", po::value()->default_value(2), - "The output log level of the geometry building. Please set the " - "wished " - "number (0 = VERBOSE, 1 = " - "DEBUG, 2 = INFO, 3 = WARNING, 4 = ERROR, 5 = FATAL)."); -} - -/// read the particle gun options and return a Config file -template -ActsExamples::DD4hep::DD4hepGeometryService::Config readDD4hepConfig( - const amap_t& vm) { - using namespace Acts::UnitLiterals; - ActsExamples::DD4hep::DD4hepGeometryService::Config gsConfig; - gsConfig.logLevel = - Acts::Logging::Level(vm["dd4hep-loglevel"].template as()); - gsConfig.xmlFileNames = - vm["dd4hep-input"].template as>(); - gsConfig.bTypePhi = Acts::equidistant; - gsConfig.bTypeR = Acts::arbitrary; - gsConfig.bTypeZ = Acts::equidistant; - gsConfig.envelopeR = vm["dd4hep-envelopeR"].template as() * 1_mm; - gsConfig.envelopeZ = vm["dd4hep-envelopeZ"].template as() * 1_mm; - gsConfig.defaultLayerThickness = - vm["dd4hep-layerThickness"].template as() * 1_mm; - if (vm["dd4hep-buildFCChh"].template as()) { - gsConfig.sortDetectors = ActsExamples::DD4hep::sortFCChhDetElements; - } - return gsConfig; -} -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/DD4hep/include/ActsExamples/Detector/DD4hepDetectorWithOptions.hpp b/Examples/Run/DD4hep/include/ActsExamples/Detector/DD4hepDetectorWithOptions.hpp deleted file mode 100644 index 58342ffcf6e..00000000000 --- a/Examples/Run/DD4hep/include/ActsExamples/Detector/DD4hepDetectorWithOptions.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2022 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -#pragma once - -#include "ActsExamples/DD4hepDetector/DD4hepDetector.hpp" -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { - -class DD4hepDetectorWithOptions : public IBaseDetector { - DD4hep::DD4hepDetector m_detector; - - public: - void addOptions( - boost::program_options::options_description& opt) const override; - - auto finalize(const boost::program_options::variables_map& vm, - std::shared_ptr mdecorator) - -> std::pair override; -}; - -} // namespace ActsExamples diff --git a/Examples/Run/DD4hep/src/DD4hepDetectorWithOptions.cpp b/Examples/Run/DD4hep/src/DD4hepDetectorWithOptions.cpp deleted file mode 100644 index e5a4a05dddd..00000000000 --- a/Examples/Run/DD4hep/src/DD4hepDetectorWithOptions.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2022 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/DD4hepDetectorWithOptions.hpp" - -#include "ActsExamples/Detector/DD4hepDetectorOptions.hpp" - -#include - -namespace ActsExamples { - -void DD4hepDetectorWithOptions::addOptions( - boost::program_options::options_description& opt) const { - ActsExamples::Options::addDD4hepOptions(opt); -} - -auto DD4hepDetectorWithOptions::finalize( - const boost::program_options::variables_map& vm, - std::shared_ptr mdecorator) - -> std::pair { - // read the detector config & dd4hep detector - auto dd4HepDetectorConfig = - ActsExamples::Options::readDD4hepConfig(vm); - return m_detector.finalize(dd4HepDetectorConfig, mdecorator); -} - -} // namespace ActsExamples diff --git a/Examples/Run/Digitization/CMakeLists.txt b/Examples/Run/Digitization/CMakeLists.txt deleted file mode 100644 index 24a2b7d1a15..00000000000 --- a/Examples/Run/Digitization/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -# shared code -add_subdirectory(Common) - -# Digitization for Generic detector -add_executable( - ActsExampleDigitizationConfigGeneric - GenericDigitizationConfigExample.cpp) -target_link_libraries( - ActsExampleDigitizationConfigGeneric - PRIVATE - ActsExamplesCommon - ActsExamplesDigitizationCommon -) - -install( - TARGETS - ActsExampleDigitizationConfigGeneric - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -add_executable( - ActsExampleDigitizationGeneric - GenericDigitizationExample.cpp) -target_link_libraries( - ActsExampleDigitizationGeneric - PRIVATE - ActsExamplesCommon - ActsExamplesDigitizationCommon -) - -install( - TARGETS - ActsExampleDigitizationGeneric - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -# Digitization for TGeo detector -add_executable( - ActsExampleDigitizationConfigTGeo - TGeoDigitizationConfigExample.cpp) -target_link_libraries( - ActsExampleDigitizationConfigTGeo - PRIVATE - ActsExamplesCommon - ActsExamplesDigitizationCommon -) - -install( - TARGETS - ActsExampleDigitizationConfigTGeo - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -add_executable( - ActsExampleDigitizationTGeo - TGeoDigitizationExample.cpp) -target_link_libraries( - ActsExampleDigitizationTGeo - PRIVATE - ActsExamplesCommon - ActsExamplesDigitizationCommon -) - -install( - TARGETS - ActsExampleDigitizationTGeo - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -add_subdirectory_if(DD4hep ACTS_BUILD_EXAMPLES_DD4HEP) diff --git a/Examples/Run/Digitization/Common/CMakeLists.txt b/Examples/Run/Digitization/Common/CMakeLists.txt deleted file mode 100644 index 27b2fa9535d..00000000000 --- a/Examples/Run/Digitization/Common/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -add_library( - ActsExamplesDigitizationCommon SHARED - DigitizationConfigExample.cpp - DigitizationExample.cpp - DigitizationInput.cpp) -target_include_directories( - ActsExamplesDigitizationCommon - PUBLIC $) -target_link_libraries( - ActsExamplesDigitizationCommon - PUBLIC - ActsExamplesFramework - ActsExamplesCommon - ActsExamplesDigitization - ActsExamplesIoCsv - ActsExamplesIoJson - ActsExamplesIoRoot) - -install( - TARGETS ActsExamplesDigitizationCommon - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/Examples/Run/Digitization/Common/DigitizationConfigExample.cpp b/Examples/Run/Digitization/Common/DigitizationConfigExample.cpp deleted file mode 100644 index 15de5608a9f..00000000000 --- a/Examples/Run/Digitization/Common/DigitizationConfigExample.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Geometry/GeometryHierarchyMap.hpp" -#include "Acts/Geometry/TrackingGeometry.hpp" -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Digitization/DigitizationConfigurator.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Json/JsonDigitizationConfig.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/DigitizationOptions.hpp" -#include "ActsExamples/Utilities/Options.hpp" -#include "ActsExamples/Utilities/Paths.hpp" - -#include -#include - -#include - -#include "DigitizationInput.hpp" - -using namespace ActsExamples; - -int runDigitizationConfigExample( - int argc, char* argv[], - const std::shared_ptr& detector) { - // Setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addGeometryOptions(desc); - Options::addMaterialOptions(desc); - Options::addDigitizationOptions(desc); - - auto opt = desc.add_options(); - opt("digi-compactify-output", boost::program_options::bool_switch(), - "Try to compactify the resulting output .json file by " - "identifying common items."); - - // Add specific options for this geometry - detector->addOptions(desc); - auto vm = Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - // Get the input configuration - auto inputConfig = - readDigiConfigFromJson(vm["digi-config-file"].as()); - - // The geometry, material and decoration - auto geometry = Geometry::build(vm, *detector); - - // Build a parser and visit the geometry - ActsExamples::DigitizationConfigurator digiConfigurator; - digiConfigurator.compactify = vm["digi-compactify-output"].as(); - digiConfigurator.inputDigiComponents = inputConfig; - - geometry.first->visitSurfaces(digiConfigurator); - - Acts::GeometryHierarchyMap outputConfig( - digiConfigurator.outputDigiComponents); - - if (not vm["dump-digi-config"].as().empty()) { - writeDigiConfigToJson(outputConfig, - vm["dump-digi-config"].as()); - } - - return 0; -} diff --git a/Examples/Run/Digitization/Common/DigitizationConfigExample.hpp b/Examples/Run/Digitization/Common/DigitizationConfigExample.hpp deleted file mode 100644 index a67b275c5be..00000000000 --- a/Examples/Run/Digitization/Common/DigitizationConfigExample.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -namespace ActsExamples { -class IBaseDetector; -} - -/// The Digitization example -/// -/// @param argc the number of arguments of the call -/// @param argv the argument list -/// @param detector The detector descriptor instance -int runDigitizationConfigExample( - int argc, char* argv[], - const std::shared_ptr& detector); diff --git a/Examples/Run/Digitization/Common/DigitizationExample.cpp b/Examples/Run/Digitization/Common/DigitizationExample.cpp deleted file mode 100644 index 0606594369e..00000000000 --- a/Examples/Run/Digitization/Common/DigitizationExample.cpp +++ /dev/null @@ -1,156 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Definitions/Units.hpp" -#include "Acts/Geometry/TrackingGeometry.hpp" -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Digitization/DigitizationAlgorithm.hpp" -#include "ActsExamples/Framework/RandomNumbers.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Csv/CsvMeasurementReader.hpp" -#include "ActsExamples/Io/Csv/CsvMeasurementWriter.hpp" -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" -#include "ActsExamples/Io/Csv/CsvSimHitReader.hpp" -#include "ActsExamples/Io/Json/JsonDigitizationConfig.hpp" -#include "ActsExamples/Io/Root/RootMeasurementWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/CsvOptionsReader.hpp" -#include "ActsExamples/Options/CsvOptionsWriter.hpp" -#include "ActsExamples/Options/DigitizationOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Utilities/Options.hpp" -#include "ActsExamples/Utilities/Paths.hpp" - -#include -#include - -#include - -#include "DigitizationInput.hpp" - -using namespace Acts::UnitLiterals; -using namespace ActsExamples; - -int runDigitizationExample( - int argc, char* argv[], - const std::shared_ptr& detector) { - // Setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addRandomNumbersOptions(desc); - Options::addGeometryOptions(desc); - Options::addMaterialOptions(desc); - Options::addOutputOptions(desc, OutputFormat::Csv | OutputFormat::Root); - Options::addCsvWriterOptions(desc); - Options::addInputOptions(desc); - Options::addMagneticFieldOptions(desc); - Options::addDigitizationOptions(desc); - - auto opt = desc.add_options(); - opt("digi-read-write-test", boost::program_options::bool_switch(), - "Test reading and writing roundtrip."); - - // Add specific options for this geometry - detector->addOptions(desc); - auto vm = Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - Sequencer sequencer(Options::readSequencerConfig(vm)); - - // Now read the standard options - auto logLevel = Options::readLogLevel(vm); - auto outputDir = ensureWritableDirectory(vm["output-dir"].as()); - - // The geometry, material and decoration - auto geometry = Geometry::build(vm, *detector); - auto tGeometry = geometry.first; - auto contextDecorators = geometry.second; - auto randomNumbers = - std::make_shared(Options::readRandomNumbersConfig(vm)); - - // Add the decorator to the sequencer - for (const auto& cdr : contextDecorators) { - sequencer.addContextDecorator(cdr); - } - - // Setup the magnetic field - Options::setupMagneticFieldServices(vm, sequencer); - auto magneticField = Options::readMagneticField(vm); - - // Read the sim hits - auto simHitReaderCfg = setupSimHitReading(vm, sequencer); - // Read the particles - auto particleReaderCfg = setupParticleReading(vm, sequencer); - - auto digiCfg = DigitizationConfig( - vm["digi-merge"].as(), vm["digi-merge-nsigma"].as(), - vm["digi-merge-common-corner"].as(), - readDigiConfigFromJson(vm["digi-config-file"].as())); - digiCfg.inputSimHits = simHitReaderCfg.outputSimHits; - digiCfg.trackingGeometry = tGeometry; - digiCfg.randomNumbers = randomNumbers; - - if (not vm["dump-digi-config"].as().empty()) { - writeDigiConfigToJson(digiCfg.digitizationConfigs, - vm["dump-digi-config"].as()); - } - - std::vector< - std::pair>> - bIndexInput; - - if (vm["digi-read-write-test"].as()) { - // Read measurements from CSV files - auto measReaderCfg = Options::readCsvMeasurementReaderConfig(vm); - measReaderCfg.inputDir = vm["input-dir"].as(); - measReaderCfg.outputMeasurements = digiCfg.outputMeasurements; - measReaderCfg.outputSourceLinks = digiCfg.outputSourceLinks; - measReaderCfg.outputClusters = digiCfg.outputClusters; - measReaderCfg.outputMeasurementSimHitsMap = - digiCfg.outputMeasurementSimHitsMap; - sequencer.addReader( - std::make_shared(measReaderCfg, logLevel)); - } else { - sequencer.addAlgorithm( - std::make_shared(digiCfg, logLevel)); - } - - // Write digitization output as ROOT files - if (vm["output-root"].template as()) { - RootMeasurementWriter::Config measWriterRoot; - measWriterRoot.inputMeasurements = digiCfg.outputMeasurements; - measWriterRoot.inputClusters = digiCfg.outputClusters; - measWriterRoot.inputSimHits = simHitReaderCfg.outputSimHits; - measWriterRoot.inputMeasurementSimHitsMap = - digiCfg.outputMeasurementSimHitsMap; - measWriterRoot.filePath = - joinPaths(outputDir, std::string(digiCfg.outputMeasurements) + ".root"); - measWriterRoot.boundIndices = - Acts::GeometryHierarchyMap>( - digiCfg.getBoundIndices()); - measWriterRoot.trackingGeometry = tGeometry; - sequencer.addWriter( - std::make_shared(measWriterRoot, logLevel)); - } - - // Write digitization out as CSV files - if (vm["output-csv"].template as()) { - CsvMeasurementWriter::Config measWriterCsv = - Options::readCsvMeasurementWriterConfig(vm); - measWriterCsv.inputMeasurements = digiCfg.outputMeasurements; - measWriterCsv.inputClusters = digiCfg.outputClusters; - measWriterCsv.inputMeasurementSimHitsMap = - digiCfg.outputMeasurementSimHitsMap; - sequencer.addWriter( - std::make_shared(measWriterCsv, logLevel)); - } - - return sequencer.run(); -} diff --git a/Examples/Run/Digitization/Common/DigitizationExample.hpp b/Examples/Run/Digitization/Common/DigitizationExample.hpp deleted file mode 100644 index 9fdf8650068..00000000000 --- a/Examples/Run/Digitization/Common/DigitizationExample.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -namespace ActsExamples { -class IBaseDetector; -} - -/// The Digitization example -/// -/// @param argc the number of arguments of the call -/// @param argv the argument list -/// @param detector The detector descriptor instance -int runDigitizationExample( - int argc, char* argv[], - const std::shared_ptr& detector); diff --git a/Examples/Run/Digitization/Common/DigitizationInput.cpp b/Examples/Run/Digitization/Common/DigitizationInput.cpp deleted file mode 100644 index 9998965b00f..00000000000 --- a/Examples/Run/Digitization/Common/DigitizationInput.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "DigitizationInput.hpp" - -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -ActsExamples::CsvSimHitReader::Config setupSimHitReading( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer) { - using namespace ActsExamples; - - // Read some standard options - auto logLevel = Options::readLogLevel(vars); - - // Read truth hits from CSV files - auto simHitReaderCfg = Options::readCsvSimHitReaderConfig(vars); - simHitReaderCfg.inputStem = "hits"; - simHitReaderCfg.outputSimHits = "hits"; - sequencer.addReader( - std::make_shared(simHitReaderCfg, logLevel)); - - return simHitReaderCfg; -} - -ActsExamples::CsvParticleReader::Config setupParticleReading( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer) { - using namespace ActsExamples; - - // Read some standard options - auto logLevel = Options::readLogLevel(vars); - - // Read particles (initial states) from CSV files - auto particleReader = Options::readCsvParticleReaderConfig(vars); - particleReader.inputStem = "particles_initial"; - particleReader.outputParticles = "particles_initial"; - sequencer.addReader( - std::make_shared(particleReader, logLevel)); - - return particleReader; -} diff --git a/Examples/Run/Digitization/Common/DigitizationInput.hpp b/Examples/Run/Digitization/Common/DigitizationInput.hpp deleted file mode 100644 index b4805fe9b96..00000000000 --- a/Examples/Run/Digitization/Common/DigitizationInput.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Framework/WhiteBoard.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" -#include "ActsExamples/Io/Csv/CsvSimHitReader.hpp" -#include "ActsExamples/Options/CsvOptionsReader.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include -#include - -/// Setup sim hit csv reader -/// -/// @param vars The configuration variables -/// @param sequencer The framework sequencer -/// -/// @return config for sim hits csv reader -ActsExamples::CsvSimHitReader::Config setupSimHitReading( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer); - -/// Setup sim particle csv reader -/// -/// @param vars The configuration variables -/// @param sequencer The framework sequencer -/// -/// @return config for sim particles csv reader -ActsExamples::CsvParticleReader::Config setupParticleReading( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer); diff --git a/Examples/Run/Digitization/DD4hep/CMakeLists.txt b/Examples/Run/Digitization/DD4hep/CMakeLists.txt deleted file mode 100644 index e09aeabcc2a..00000000000 --- a/Examples/Run/Digitization/DD4hep/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Digitization for DD4hep detector -add_executable( - ActsExampleDigitizationConfigDD4hep - DD4hepDigitizationConfigExample.cpp) -target_link_libraries( - ActsExampleDigitizationConfigDD4hep - PRIVATE - ActsExamplesDigitizationCommon - ActsExamplesDD4hepDetectorWithOptions -) - -install( - TARGETS - ActsExampleDigitizationConfigDD4hep - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -add_executable( - ActsExampleDigitizationDD4hep - DD4hepDigitizationExample.cpp) -target_link_libraries( - ActsExampleDigitizationDD4hep - PRIVATE - ActsExamplesDigitizationCommon - ActsExamplesDD4hepDetectorWithOptions) - -install( - TARGETS ActsExampleDigitizationDD4hep - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Examples/Run/Digitization/DD4hep/DD4hepDigitizationConfigExample.cpp b/Examples/Run/Digitization/DD4hep/DD4hepDigitizationConfigExample.cpp deleted file mode 100644 index 8aa68c29fcc..00000000000 --- a/Examples/Run/Digitization/DD4hep/DD4hepDigitizationConfigExample.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/DD4hepDetectorWithOptions.hpp" - -#include "DigitizationConfigExample.hpp" - -int main(int argc, char* argv[]) { - return runDigitizationConfigExample( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Digitization/DD4hep/DD4hepDigitizationExample.cpp b/Examples/Run/Digitization/DD4hep/DD4hepDigitizationExample.cpp deleted file mode 100644 index f8851ba2ec4..00000000000 --- a/Examples/Run/Digitization/DD4hep/DD4hepDigitizationExample.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/DD4hepDetectorWithOptions.hpp" - -#include "DigitizationExample.hpp" - -int main(int argc, char* argv[]) { - return runDigitizationExample( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Digitization/GenericDigitizationConfigExample.cpp b/Examples/Run/Digitization/GenericDigitizationConfigExample.cpp deleted file mode 100644 index a9a3df1c7ef..00000000000 --- a/Examples/Run/Digitization/GenericDigitizationConfigExample.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/GenericDetectorWithOptions.hpp" - -#include "DigitizationConfigExample.hpp" - -int main(int argc, char* argv[]) { - return runDigitizationConfigExample( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Digitization/GenericDigitizationExample.cpp b/Examples/Run/Digitization/GenericDigitizationExample.cpp deleted file mode 100644 index b673bb2a7d2..00000000000 --- a/Examples/Run/Digitization/GenericDigitizationExample.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/GenericDetectorWithOptions.hpp" - -#include "DigitizationExample.hpp" - -int main(int argc, char* argv[]) { - return runDigitizationExample( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Digitization/TGeoDigitizationConfigExample.cpp b/Examples/Run/Digitization/TGeoDigitizationConfigExample.cpp deleted file mode 100644 index 5b77d017e3f..00000000000 --- a/Examples/Run/Digitization/TGeoDigitizationConfigExample.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TGeoDetectorWithOptions.hpp" - -#include "DigitizationConfigExample.hpp" - -int main(int argc, char* argv[]) { - return runDigitizationConfigExample( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Digitization/TGeoDigitizationExample.cpp b/Examples/Run/Digitization/TGeoDigitizationExample.cpp deleted file mode 100644 index 36471208e43..00000000000 --- a/Examples/Run/Digitization/TGeoDigitizationExample.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TGeoDetectorWithOptions.hpp" - -#include "DigitizationExample.hpp" - -int main(int argc, char* argv[]) { - return runDigitizationExample( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Fatras/AlignedFatrasExample.cpp b/Examples/Run/Fatras/AlignedFatrasExample.cpp deleted file mode 100644 index 9471aa53333..00000000000 --- a/Examples/Run/Fatras/AlignedFatrasExample.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/AlignedDetectorWithOptions.hpp" -#include "ActsExamples/Fatras/FatrasCommon.hpp" - -int main(int argc, char* argv[]) { - return runFatras( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Fatras/CMakeLists.txt b/Examples/Run/Fatras/CMakeLists.txt deleted file mode 100644 index 0f4d12fe96a..00000000000 --- a/Examples/Run/Fatras/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -# Common library that implements the core functionality -add_subdirectory(Common) - -# Generic detector -add_executable( - ActsExampleFatrasGeneric - GenericFatrasExample.cpp) -target_link_libraries( - ActsExampleFatrasGeneric - PRIVATE ActsExamplesFatrasCommon ActsExamplesCommon ActsExamplesIoJson) - -# Generic detector with alignment -add_executable( - ActsExampleFatrasAligned - AlignedFatrasExample.cpp) -target_link_libraries( - ActsExampleFatrasAligned - PRIVATE ActsExamplesFatrasCommon ActsExamplesCommon ActsExamplesIoJson) - -# TGeo detector -add_executable( - ActsExampleFatrasTGeo - TGeoFatrasExample.cpp) -target_link_libraries( - ActsExampleFatrasTGeo - PRIVATE ActsExamplesFatrasCommon ActsExamplesCommon ActsExamplesIoJson) - -# Telescope detector -add_executable( - ActsExampleFatrasTelescope - TelescopeFatrasExample.cpp) -target_link_libraries( - ActsExampleFatrasTelescope - PRIVATE ActsExamplesFatrasCommon ActsExamplesCommon ActsExamplesIoJson) - -install( - TARGETS - ActsExampleFatrasGeneric - ActsExampleFatrasAligned - ActsExampleFatrasTGeo - ActsExampleFatrasTelescope - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -add_subdirectory_if(DD4hep ACTS_BUILD_EXAMPLES_DD4HEP) diff --git a/Examples/Run/Fatras/Common/CMakeLists.txt b/Examples/Run/Fatras/Common/CMakeLists.txt deleted file mode 100644 index 872e0530874..00000000000 --- a/Examples/Run/Fatras/Common/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -add_library( - ActsExamplesFatrasCommon SHARED - src/FatrasCommon.cpp src/FatrasOptions.cpp) -target_include_directories( - ActsExamplesFatrasCommon - PUBLIC $) -target_link_libraries( - ActsExamplesFatrasCommon - PUBLIC - ActsCore - ActsExamplesFramework ActsExamplesCommon - ActsExamplesGenerators - ActsExamplesMagneticField - ActsExamplesFatras - ActsExamplesIoCsv ActsExamplesIoRoot) - -install( - TARGETS ActsExamplesFatrasCommon - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/Examples/Run/Fatras/Common/include/ActsExamples/Fatras/FatrasCommon.hpp b/Examples/Run/Fatras/Common/include/ActsExamples/Fatras/FatrasCommon.hpp deleted file mode 100644 index 7d5088871fe..00000000000 --- a/Examples/Run/Fatras/Common/include/ActsExamples/Fatras/FatrasCommon.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2017-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include - -namespace ActsExamples { -class IBaseDetector; -} - -/// Main function for running Fatras with a specific detector. -/// -/// @param argc number of command line arguments -/// @param argv command line arguments -/// @param detector is the detector to be used -int runFatras(int argc, char* argv[], - const std::shared_ptr& detector); diff --git a/Examples/Run/Fatras/Common/include/ActsExamples/Options/FatrasOptions.hpp b/Examples/Run/Fatras/Common/include/ActsExamples/Options/FatrasOptions.hpp deleted file mode 100644 index a318d24d281..00000000000 --- a/Examples/Run/Fatras/Common/include/ActsExamples/Options/FatrasOptions.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Fatras/FatrasSimulation.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { -namespace Options { - -void addFatrasOptions(Options::Description& desc); - -ActsExamples::FatrasSimulation::Config readFatrasConfig( - const Options::Variables& vars); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Fatras/Common/src/FatrasCommon.cpp b/Examples/Run/Fatras/Common/src/FatrasCommon.cpp deleted file mode 100644 index 877b709c7e8..00000000000 --- a/Examples/Run/Fatras/Common/src/FatrasCommon.cpp +++ /dev/null @@ -1,107 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Fatras/FatrasCommon.hpp" - -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Fatras/FatrasSimulation.hpp" -#include "ActsExamples/Framework/RandomNumbers.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Generators/EventGenerator.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" -#include "ActsExamples/Io/Csv/CsvParticleWriter.hpp" -#include "ActsExamples/Io/Csv/CsvSimHitWriter.hpp" -#include "ActsExamples/Io/Root/RootParticleWriter.hpp" -#include "ActsExamples/Io/Root/RootSimHitWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/FatrasOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Options/ParticleGunOptions.hpp" -#include "ActsExamples/Simulation/CommonSimulation.hpp" -#include "ActsExamples/TruthTracking/ParticleSelector.hpp" -#include "ActsExamples/Utilities/Paths.hpp" - -#include -#include - -#include - -using namespace ActsExamples; - -namespace { - -// simulation handling - -void setupFatrasSimulation( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer, - std::shared_ptr randomNumbers, - std::shared_ptr trackingGeometry) { - auto logLevel = Options::readLogLevel(vars); - auto fatrasCfg = Options::readFatrasConfig(vars); - fatrasCfg.inputParticles = Simulation::kParticlesSelection; - fatrasCfg.outputParticlesInitial = Simulation::kParticlesInitial; - fatrasCfg.outputParticlesFinal = Simulation::kParticlesFinal; - fatrasCfg.outputSimHits = Simulation::kSimHits; - fatrasCfg.randomNumbers = std::move(randomNumbers); - fatrasCfg.trackingGeometry = std::move(trackingGeometry); - fatrasCfg.magneticField = ActsExamples::Options::readMagneticField(vars); - - sequencer.addAlgorithm( - std::make_shared(std::move(fatrasCfg), logLevel)); -} - -} // namespace - -/// Fatras main function -/// -/// Standard arguments @param argc and @param argv[] are forwarded -/// @param detector abstracts the used detector input -int runFatras(int argc, char* argv[], - const std::shared_ptr& detector) { - using namespace ActsExamples; - - // Setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addRandomNumbersOptions(desc); - Simulation::addInputOptions(desc); - Options::addOutputOptions(desc, OutputFormat::Root | OutputFormat::Csv); - // Add general and detector-specific geometry options - Options::addGeometryOptions(desc); - detector->addOptions(desc); - Options::addMaterialOptions(desc); - Options::addMagneticFieldOptions(desc); - // Algorithm-specific options - Options::addFatrasOptions(desc); - - auto vars = Options::parse(desc, argc, argv); - if (vars.empty()) { - return EXIT_FAILURE; - } - - // Basic services - auto randomNumbers = - std::make_shared(Options::readRandomNumbersConfig(vars)); - - // Setup sequencer - Sequencer sequencer(Options::readSequencerConfig(vars)); - // Setup detector geometry and material and the magnetic field - auto [trackingGeometry, contextDecorators] = Geometry::build(vars, *detector); - for (const auto& cdr : contextDecorators) { - sequencer.addContextDecorator(cdr); - } - // Setup input, algorithm chain, output - Simulation::setupInput(vars, sequencer, randomNumbers); - setupFatrasSimulation(vars, sequencer, randomNumbers, trackingGeometry); - Simulation::setupOutput(vars, sequencer); - - // Run the simulation - return sequencer.run(); -} diff --git a/Examples/Run/Fatras/Common/src/FatrasOptions.cpp b/Examples/Run/Fatras/Common/src/FatrasOptions.cpp deleted file mode 100644 index 3cb13bf4a6e..00000000000 --- a/Examples/Run/Fatras/Common/src/FatrasOptions.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/FatrasOptions.hpp" - -#include "Acts/Definitions/Units.hpp" -#include "ActsExamples/Fatras/FatrasSimulation.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include - -#include - -namespace ActsExamples { -namespace Options { - -void addFatrasOptions(Options::Description& desc) { - using boost::program_options::bool_switch; - using boost::program_options::value; - - auto opt = desc.add_options(); - opt("fatras-pmin-gev", value()->default_value(0.5), - "Minimum momentum for simulated particles in GeV"); - opt("fatras-em-scattering", value()->default_value(true), - "Simulate multiple scattering of charged particles"); - opt("fatras-em-ionisation", value()->default_value(true), - "Simulate ionisiation/excitation energy loss of charged particles"); - opt("fatras-em-radiation", value()->default_value(true), - "Simulate radiative energy loss of charged particles"); - opt("fatras-em-photonconversion", value()->default_value(true), - "Simulate electron-positron pair production by photon conversion"); - opt("fatras-hits", - value() - ->value_name("none|sensitive|material|all") - ->default_value("sensitive"), - "Which surfaces should record charged particle hits"); -} - -ActsExamples::FatrasSimulation::Config readFatrasConfig( - const Options::Variables& vars) { - using namespace Acts::UnitLiterals; - - ActsExamples::FatrasSimulation::Config cfg; - - cfg.pMin = vars["fatras-pmin-gev"].as() * 1_GeV; - - cfg.emScattering = vars["fatras-em-scattering"].as(); - cfg.emEnergyLossIonisation = vars["fatras-em-ionisation"].as(); - cfg.emEnergyLossRadiation = vars["fatras-em-radiation"].as(); - cfg.emPhotonConversion = vars["fatras-em-photonconversion"].as(); - - // select hit surfaces for charged particles - const std::string hits = vars["fatras-hits"].as(); - if (hits == "sensitive") { - cfg.generateHitsOnSensitive = true; - cfg.generateHitsOnMaterial = false; - cfg.generateHitsOnPassive = false; - } else if (hits == "material") { - cfg.generateHitsOnSensitive = false; - cfg.generateHitsOnMaterial = true; - cfg.generateHitsOnPassive = false; - } else if (hits == "all") { - cfg.generateHitsOnSensitive = true; - cfg.generateHitsOnMaterial = true; - cfg.generateHitsOnPassive = true; - } else { - throw std::runtime_error("Invalid Fatras hits selection '" + hits + "'"); - } - - return cfg; -} - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Fatras/DD4hep/CMakeLists.txt b/Examples/Run/Fatras/DD4hep/CMakeLists.txt deleted file mode 100644 index 5af84d9d327..00000000000 --- a/Examples/Run/Fatras/DD4hep/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -add_executable( - ActsExampleFatrasDD4hep - DD4hepFatrasExample.cpp) -target_link_libraries( - ActsExampleFatrasDD4hep - PRIVATE ActsExamplesFatrasCommon ActsExamplesDD4hepDetectorWithOptions) - -install( - TARGETS ActsExampleFatrasDD4hep - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Examples/Run/Fatras/DD4hep/DD4hepFatrasExample.cpp b/Examples/Run/Fatras/DD4hep/DD4hepFatrasExample.cpp deleted file mode 100644 index 5eaf857d0d8..00000000000 --- a/Examples/Run/Fatras/DD4hep/DD4hepFatrasExample.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2017-2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/DD4hepDetectorWithOptions.hpp" -#include "ActsExamples/Fatras/FatrasCommon.hpp" - -int main(int argc, char* argv[]) { - return runFatras(argc, argv, - std::make_shared()); -} diff --git a/Examples/Run/Fatras/GenericFatrasExample.cpp b/Examples/Run/Fatras/GenericFatrasExample.cpp deleted file mode 100644 index 18de8bd1656..00000000000 --- a/Examples/Run/Fatras/GenericFatrasExample.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018-2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/GenericDetectorWithOptions.hpp" -#include "ActsExamples/Fatras/FatrasCommon.hpp" - -int main(int argc, char* argv[]) { - return runFatras( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Fatras/TGeoFatrasExample.cpp b/Examples/Run/Fatras/TGeoFatrasExample.cpp deleted file mode 100644 index 5ab3847f43c..00000000000 --- a/Examples/Run/Fatras/TGeoFatrasExample.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018-2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TGeoDetectorWithOptions.hpp" -#include "ActsExamples/Fatras/FatrasCommon.hpp" - -int main(int argc, char* argv[]) { - return runFatras(argc, argv, - std::make_shared()); -} diff --git a/Examples/Run/Fatras/TelescopeFatrasExample.cpp b/Examples/Run/Fatras/TelescopeFatrasExample.cpp deleted file mode 100644 index 70c858691d8..00000000000 --- a/Examples/Run/Fatras/TelescopeFatrasExample.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TelescopeDetectorWithOptions.hpp" -#include "ActsExamples/Fatras/FatrasCommon.hpp" - -int main(int argc, char* argv[]) { - return runFatras( - argc, argv, - std::make_shared()); -} diff --git a/Examples/Run/Geant4/CMakeLists.txt b/Examples/Run/Geant4/CMakeLists.txt deleted file mode 100644 index b458533e4f0..00000000000 --- a/Examples/Run/Geant4/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -add_subdirectory(Common) - -add_executable( - ActsExampleMaterialRecordingGdml - GdmlMaterialRecording.cpp) -target_link_libraries( - ActsExampleMaterialRecordingGdml - PRIVATE - ActsExamplesCommon - ActsExamplesFramework - ActsExamplesGeant4 - ActsExamplesGeant4Common - ActsExamplesIoRoot) - -add_executable( - ActsExampleTestMockupBuilder - TestMockupBuilder.cpp) -target_link_libraries( - ActsExampleTestMockupBuilder - PRIVATE - ActsCore - ActsExamplesCommon - ActsExamplesFramework - ActsExamplesGeant4 - ActsExamplesGeant4Common - ActsExamplesIoRoot - ActsPluginGeant4 - ActsExamplesDetectorGeant4 - ActsExamplesMuonSpectrometerMockupDetector - ) - -install( - TARGETS - ActsExampleMaterialRecordingGdml - ActsExampleTestMockupBuilder - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -add_subdirectory_if(DD4hep ACTS_BUILD_EXAMPLES_DD4HEP) -add_subdirectory_if(HepMC ACTS_BUILD_EXAMPLES_DD4HEP AND ACTS_BUILD_EXAMPLES_HEPMC3) diff --git a/Examples/Run/Geant4/Common/CMakeLists.txt b/Examples/Run/Geant4/Common/CMakeLists.txt deleted file mode 100644 index 5c864812543..00000000000 --- a/Examples/Run/Geant4/Common/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -add_library( - ActsExamplesGeant4Common SHARED - src/Geant4Common.cpp - src/Geant4Options.cpp) - -target_include_directories( - ActsExamplesGeant4Common - PUBLIC $) -target_link_libraries( - ActsExamplesGeant4Common - PUBLIC - ActsCore - ActsExamplesFramework - ActsExamplesCommon - ActsExamplesGenerators - ActsExamplesMagneticField - ActsExamplesGeant4 - ActsExamplesIoCsv - ActsExamplesIoRoot - ${Geant4_LIBRARIES}) - -install( - TARGETS ActsExamplesGeant4Common - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/Examples/Run/Geant4/Common/include/ActsExamples/Geant4/Geant4Common.hpp b/Examples/Run/Geant4/Common/include/ActsExamples/Geant4/Geant4Common.hpp deleted file mode 100644 index a667e2e2cd6..00000000000 --- a/Examples/Run/Geant4/Common/include/ActsExamples/Geant4/Geant4Common.hpp +++ /dev/null @@ -1,83 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -#include -#include - -namespace Acts { -class TrackingGeometry; -class MagneticFieldProvider; -} // namespace Acts - -class G4VUserDetectorConstruction; -class G4RunManager; -class G4UserRunAction; -class G4UserEventAction; -class G4UserTrackingAction; -class G4UserSteppingAction; -class G4VUserPhysicsList; - -namespace ActsExamples { - -class DetectorConstructionFactory; - -/// Main function for running Geant4 material recording with a specific -/// detector. -/// -/// @param vars the parsed variables -/// @param sequencer the event sequencer -/// @param detectorConstructionFactory is the detector construction factory to be used -/// @param trackingGeometry the tracking geometry for the sennsitive mapping -/// @param magneticField the ACTS magnetic field to be wrapped -/// -void setupMaterialRecording( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer, - std::shared_ptr detectorConstructionFactory); - -/// Main function for running Geant4 simulation with a specific detector. -/// -/// @param vars the parsed variables -/// @param sequencer the event sequencer -/// @param detectorConstructionFactory is the detector construction factory to be used -/// @param trackingGeometry the tracking geometry for the sennsitive mapping -/// @param magneticField the ACTS magnetic field to be wrapped -/// -void setupGeant4Simulation( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer, - std::shared_ptr detectorConstructionFactory, - std::shared_ptr trackingGeometry, - std::shared_ptr magneticField); - -/// Specific setup: Material Recording -/// -/// @param vars the parsed variables -/// @param detectorConstructionFactory is the detector construction factory to be used -int runMaterialRecording( - const ActsExamples::Options::Variables& vars, - std::shared_ptr - detectorConstructionFactory); - -/// Specific setup: Geant4 Simulation -/// -/// @param vars the parsed variables -/// @param detectorConstructionFactory is the detector construction factory to be used -/// @param trackingGeometry the tracking geometry for the sennsitive mapping -int runGeant4Simulation( - const ActsExamples::Options::Variables& vars, - std::shared_ptr - detectorConstructionFactory, - std::shared_ptr trackingGeometry); - -} // namespace ActsExamples diff --git a/Examples/Run/Geant4/Common/include/ActsExamples/Options/Geant4Options.hpp b/Examples/Run/Geant4/Common/include/ActsExamples/Options/Geant4Options.hpp deleted file mode 100644 index 6bc9602b49e..00000000000 --- a/Examples/Run/Geant4/Common/include/ActsExamples/Options/Geant4Options.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "Acts/Definitions/Units.hpp" -#include "Acts/Utilities/Logger.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { - -namespace Options { - -/// @brief Geant4 specific options -/// -/// @param desc The option descrion forward -void addGeant4Options(Description& desc); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Geant4/Common/src/Geant4Common.cpp b/Examples/Run/Geant4/Common/src/Geant4Common.cpp deleted file mode 100644 index f81cdff989f..00000000000 --- a/Examples/Run/Geant4/Common/src/Geant4Common.cpp +++ /dev/null @@ -1,164 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Geant4/Geant4Common.hpp" - -#include "Acts/Geometry/TrackingGeometry.hpp" -#include "Acts/MagneticField/MagneticFieldProvider.hpp" -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Framework/RandomNumbers.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Geant4/EventStore.hpp" -#include "ActsExamples/Geant4/Geant4Simulation.hpp" -#include "ActsExamples/Geant4/MagneticFieldWrapper.hpp" -#include "ActsExamples/Geant4/MaterialPhysicsList.hpp" -#include "ActsExamples/Geant4/MaterialSteppingAction.hpp" -#include "ActsExamples/Geant4/ParticleTrackingAction.hpp" -#include "ActsExamples/Geant4/SensitiveSteppingAction.hpp" -#include "ActsExamples/Geant4/SensitiveSurfaceMapper.hpp" -#include "ActsExamples/Geant4/SimParticleTranslation.hpp" -#include "ActsExamples/Io/Root/RootMaterialTrackWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Options/ParticleGunOptions.hpp" -#include "ActsExamples/Simulation/CommonSimulation.hpp" -#include "ActsExamples/Utilities/Paths.hpp" - -#include -#include - -#include -#include -#include -#include - -namespace ActsExamples { - -void setupMaterialRecording( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer, - std::shared_ptr detectorConstructionFactory) { - auto g4loglevel = - Acts::Logging::Level(vars["g4-loglevel"].as()); - std::size_t seed = vars["g4-seed"].as(); - - Geant4MaterialRecording::Config g4Cfg; - - g4Cfg.detectorConstructionFactory = std::move(detectorConstructionFactory); - g4Cfg.randomNumbers = std::make_shared( - ActsExamples::RandomNumbers::Config{seed}); - g4Cfg.inputParticles = Simulation::kParticlesInitial; - g4Cfg.outputMaterialTracks = Simulation::kMaterialTracks; - g4Cfg.excludeMaterials = {"Air", "Vacuum"}; - - sequencer.addAlgorithm( - std::make_shared(g4Cfg, g4loglevel)); -} - -void setupGeant4Simulation( - const ActsExamples::Options::Variables& vars, - ActsExamples::Sequencer& sequencer, - std::shared_ptr detectorConstructionFactory, - std::shared_ptr trackingGeometry, - std::shared_ptr magneticField) { - auto g4loglevel = - Acts::Logging::Level(vars["g4-loglevel"].as()); - std::size_t seed = vars["g4-seed"].as(); - - Geant4Simulation::Config g4Cfg; - - g4Cfg.detectorConstructionFactory = std::move(detectorConstructionFactory); - g4Cfg.randomNumbers = std::make_shared( - ActsExamples::RandomNumbers::Config{seed}); - g4Cfg.inputParticles = Simulation::kParticlesSelection; - g4Cfg.outputSimHits = Simulation::kSimHits; - g4Cfg.outputParticlesInitial = Simulation::kParticlesInitial; - g4Cfg.outputParticlesFinal = Simulation::kParticlesFinal; - g4Cfg.trackingGeometry = std::move(trackingGeometry); - g4Cfg.magneticField = std::move(magneticField); - - sequencer.addAlgorithm(std::make_shared(g4Cfg, g4loglevel)); -} - -int runMaterialRecording( - const ActsExamples::Options::Variables& vars, - std::shared_ptr detectorConstructionFactory) { - // Set up the sequencer - Sequencer sequencer(Options::readSequencerConfig(vars)); - - // Output level and log level - auto logLevel = Options::readLogLevel(vars); - - std::string outputDir = - ensureWritableDirectory(vars["output-dir"].as()); - - // Basic services - auto rnd = - std::make_shared(Options::readRandomNumbersConfig(vars)); - - // Event generation w/ particle gun - EventGenerator::Config evgen = Options::readParticleGunOptions(vars); - evgen.outputParticles = Simulation::kParticlesInitial; - evgen.randomNumbers = rnd; - sequencer.addReader(std::make_shared(evgen, logLevel)); - - // Set up the Geant4 Simulation - setupMaterialRecording(vars, sequencer, - std::move(detectorConstructionFactory)); - - // setup the output writing - if (vars["output-root"].as()) { - // Write the propagation steps as ROOT TTree - RootMaterialTrackWriter::Config materialTrackWriter; - materialTrackWriter.prePostStep = true; - materialTrackWriter.recalculateTotals = true; - materialTrackWriter.collection = Simulation::kMaterialTracks; - materialTrackWriter.filePath = joinPaths( - outputDir, - "geant4_" + std::string(Simulation::kMaterialTracks) + ".root"); - sequencer.addWriter(std::make_shared( - materialTrackWriter, logLevel)); - } - - auto result = sequencer.run(); - return result; -} - -int runGeant4Simulation( - const ActsExamples::Options::Variables& vars, - std::shared_ptr detectorConstructionFactory, - std::shared_ptr trackingGeometry) { - // Basic services - auto randomNumbers = - std::make_shared(Options::readRandomNumbersConfig(vars)); - - // Set up the sequencer - Sequencer sequencer(Options::readSequencerConfig(vars)); - - // Set up the magnetic field - auto magneticField = ActsExamples::Options::readMagneticField(vars); - - // Setup algorithm chain: Input / Simulation / Output - Simulation::setupInput(vars, sequencer, randomNumbers); - setupGeant4Simulation(vars, sequencer, std::move(detectorConstructionFactory), - std::move(trackingGeometry), magneticField); - Simulation::setupOutput(vars, sequencer); - - auto result = sequencer.run(); - return result; -} - -} // namespace ActsExamples diff --git a/Examples/Run/Geant4/Common/src/Geant4Options.cpp b/Examples/Run/Geant4/Common/src/Geant4Options.cpp deleted file mode 100644 index aff13dda8f3..00000000000 --- a/Examples/Run/Geant4/Common/src/Geant4Options.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/Geant4Options.hpp" - -#include "ActsExamples/Utilities/Options.hpp" - -#include - -#include - -void ActsExamples::Options::addGeant4Options( - ActsExamples::Options::Description& desc) { - using boost::program_options::bool_switch; - using boost::program_options::value; - - auto opt = desc.add_options(); - opt("g4-rnd-seed1", value()->default_value(287362910), - "The first seed of the Geant4 random number generation"); - opt("g4-rnd-seed2", value()->default_value(730284537), - "The second seed of the Geant4 random number generation"); - opt("g4-loglevel", value()->default_value(2), - "Screen output log level for Geant4 actions."); - - opt("g4-seed", value()->default_value(12348777), - "Random seed for G4 RNG"); -} diff --git a/Examples/Run/Geant4/DD4hep/CMakeLists.txt b/Examples/Run/Geant4/DD4hep/CMakeLists.txt deleted file mode 100644 index 6a6e715030d..00000000000 --- a/Examples/Run/Geant4/DD4hep/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -add_executable( - ActsExampleGeant4DD4hep - DD4hepGeant4Simulation.cpp) -target_link_libraries( - ActsExampleGeant4DD4hep - PRIVATE - ActsExamplesCommon - ActsExamplesDD4hepDetectorWithOptions - ActsExamplesFramework - ActsExamplesGeant4 - ActsExamplesGeant4Common - ActsExamplesMagneticField - ActsExamplesIoRoot) - -install( - TARGETS ActsExampleGeant4DD4hep - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - - -add_executable( - ActsExampleMaterialRecordingDD4hep - DD4hepMaterialRecording.cpp) -target_link_libraries( - ActsExampleMaterialRecordingDD4hep - PRIVATE - ActsExamplesCommon - ActsExamplesDD4hepDetectorWithOptions - ActsExamplesFramework - ActsExamplesGeant4 - ActsExamplesGeant4Common - ActsExamplesIoRoot) - -install( - TARGETS ActsExampleMaterialRecordingDD4hep - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Examples/Run/Geant4/DD4hep/DD4hepGeant4Simulation.cpp b/Examples/Run/Geant4/DD4hep/DD4hepGeant4Simulation.cpp deleted file mode 100644 index 9b7ba1bb08e..00000000000 --- a/Examples/Run/Geant4/DD4hep/DD4hepGeant4Simulation.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/DD4hepDetector/DD4hepDetector.hpp" -#include "ActsExamples/DD4hepDetector/DD4hepGeometryService.hpp" -#include "ActsExamples/DDG4/DDG4DetectorConstruction.hpp" -#include "ActsExamples/Detector/DD4hepDetectorOptions.hpp" -#include "ActsExamples/Geant4/Geant4Common.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/Geant4Options.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Simulation/CommonSimulation.hpp" - -#include - -int main(int argc, char* argv[]) { - using namespace ActsExamples; - using namespace ActsExamples::Simulation; - - // Setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addDD4hepOptions(desc); - Simulation::addInputOptions(desc); // These are specific to the simulation - Options::addRandomNumbersOptions(desc); - Options::addGeant4Options(desc); - Options::addOutputOptions(desc, OutputFormat::Root | OutputFormat::Csv); - Options::addMagneticFieldOptions(desc); - - auto vars = Options::parse(desc, argc, argv); - if (vars.empty()) { - return EXIT_FAILURE; - } - - // Setup the DD4hep detector - auto dd4hepCfg = Options::readDD4hepConfig(vars); - auto geometrySvc = std::make_shared(dd4hepCfg); - auto detector = std::make_shared(geometrySvc); - auto magneticField = ActsExamples::Options::readMagneticField(vars); - auto trackingGeometry = - geometrySvc->trackingGeometry(Acts::GeometryContext()); - - return runGeant4Simulation( - vars, std::make_unique(detector), - trackingGeometry); -} diff --git a/Examples/Run/Geant4/DD4hep/DD4hepMaterialRecording.cpp b/Examples/Run/Geant4/DD4hep/DD4hepMaterialRecording.cpp deleted file mode 100644 index 6c0cdb6fd34..00000000000 --- a/Examples/Run/Geant4/DD4hep/DD4hepMaterialRecording.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2017-2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/DD4hepDetector/DD4hepDetector.hpp" -#include "ActsExamples/DD4hepDetector/DD4hepGeometryService.hpp" -#include "ActsExamples/DDG4/DDG4DetectorConstruction.hpp" -#include "ActsExamples/Detector/DD4hepDetectorOptions.hpp" -#include "ActsExamples/Geant4/Geant4Common.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/Geant4Options.hpp" -#include "ActsExamples/Options/ParticleGunOptions.hpp" - -#include - -#include - -using namespace ActsExamples; - -int main(int argc, char* argv[]) { - // Setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addOutputOptions(desc, OutputFormat::Root); - Options::addDD4hepOptions(desc); - Options::addGeant4Options(desc); - Options::addParticleGunOptions(desc); - Options::addRandomNumbersOptions(desc); - auto vm = Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - // Setup the DD4hep detector - auto dd4hepCfg = Options::readDD4hepConfig(vm); - auto geometrySvc = std::make_shared(dd4hepCfg); - auto detector = std::make_shared(geometrySvc); - - return runMaterialRecording( - vm, std::make_unique(detector)); -} diff --git a/Examples/Run/Geant4/GdmlMaterialRecording.cpp b/Examples/Run/Geant4/GdmlMaterialRecording.cpp deleted file mode 100644 index 04fe0b40f51..00000000000 --- a/Examples/Run/Geant4/GdmlMaterialRecording.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Geant4/GdmlDetectorConstruction.hpp" -#include "ActsExamples/Geant4/Geant4Common.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/Geant4Options.hpp" -#include "ActsExamples/Options/ParticleGunOptions.hpp" - -#include - -using namespace ActsExamples; - -int main(int argc, char* argv[]) { - // Setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addOutputOptions(desc, OutputFormat::Root); - Options::addGeant4Options(desc); - Options::addParticleGunOptions(desc); - Options::addRandomNumbersOptions(desc); - desc.add_options()( - "gdml-file", - boost::program_options::value()->default_value(""), - "GDML detector file."); - - auto vm = Options::parse(desc, argc, argv); - - if (vm.empty()) { - return EXIT_FAILURE; - } - auto gdmlFile = vm["gdml-file"].as(); - - return runMaterialRecording( - vm, std::make_unique(gdmlFile)); -} diff --git a/Examples/Run/Geant4/HepMC/CMakeLists.txt b/Examples/Run/Geant4/HepMC/CMakeLists.txt deleted file mode 100644 index 7cb5451a9f0..00000000000 --- a/Examples/Run/Geant4/HepMC/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -add_executable( - ActsExampleEventRecording - EventRecordingExample.cpp) -target_link_libraries( - ActsExampleEventRecording - PRIVATE - ActsExamplesCommon - ActsExamplesDD4hepDetectorWithOptions - ActsExamplesEventRecording - ActsExamplesFramework - ActsExamplesGeant4 - ActsExamplesIoHepMC3 - ActsExamplesHepMC3Options - ActsExamplesGeant4Common) - -install( - TARGETS ActsExampleEventRecording - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Examples/Run/Geant4/HepMC/EventRecordingExample.cpp b/Examples/Run/Geant4/HepMC/EventRecordingExample.cpp deleted file mode 100644 index 02267597a78..00000000000 --- a/Examples/Run/Geant4/HepMC/EventRecordingExample.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Geometry/GeometryContext.hpp" -#include "ActsExamples/DD4hepDetector/DD4hepDetector.hpp" -#include "ActsExamples/DD4hepDetector/DD4hepGeometryService.hpp" -#include "ActsExamples/DDG4/DDG4DetectorConstruction.hpp" -#include "ActsExamples/Detector/DD4hepDetectorOptions.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Geant4HepMC/EventRecording.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" -#include "ActsExamples/Io/HepMC3/HepMC3Writer.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/CsvOptionsReader.hpp" -#include "ActsExamples/Options/Geant4Options.hpp" -#include "ActsExamples/Options/HepMC3Options.hpp" -#include "ActsExamples/Utilities/Paths.hpp" - -#include -#include - -#include - -int main(int argc, char* argv[]) { - // Declare the supported program options. - // Setup and parse options - auto desc = ActsExamples::Options::makeDefaultOptions(); - ActsExamples::Options::addSequencerOptions(desc); - ActsExamples::Options::addOutputOptions( - desc, ActsExamples::OutputFormat::DirectoryOnly); - ActsExamples::Options::addInputOptions(desc); - ActsExamples::Options::addDD4hepOptions(desc); - ActsExamples::Options::addGeant4Options(desc); - ActsExamples::Options::addHepMC3WriterOptions(desc); - - auto vm = ActsExamples::Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - auto logLevel = ActsExamples::Options::readLogLevel(vm); - - ActsExamples::Sequencer sequencer( - ActsExamples::Options::readSequencerConfig(vm)); - - // Read particles (initial states) and clusters from CSV files - auto particleReader = ActsExamples::Options::readCsvParticleReaderConfig(vm); - particleReader.inputStem = "particles"; - particleReader.outputParticles = "particles"; - sequencer.addReader(std::make_shared( - particleReader, logLevel)); - - // Prepare the detector - auto dd4hepCfg = ActsExamples::Options::readDD4hepConfig(vm); - auto geometrySvc = - std::make_shared(dd4hepCfg); - auto detector = - std::make_shared(geometrySvc); - - // Prepare the recording - ActsExamples::EventRecording::Config erConfig; - erConfig.inputParticles = particleReader.outputParticles; - erConfig.outputHepMcTracks = "geant-event"; - erConfig.detectorConstructionFactory = - std::make_unique(detector); - erConfig.seed1 = vm["g4-rnd-seed1"].as(); - erConfig.seed2 = vm["g4-rnd-seed2"].as(); - - // Create the writer - auto hepMC3WriterConfig = ActsExamples::Options::readHepMC3WriterOptions(vm); - hepMC3WriterConfig.inputEvents = erConfig.outputHepMcTracks; - - // Add to the sequencer - sequencer.addAlgorithm(std::make_shared( - std::move(erConfig), logLevel)); - sequencer.addWriter(std::make_shared( - std::move(hepMC3WriterConfig), logLevel)); - - // Run - return sequencer.run(); -} diff --git a/Examples/Run/Geant4/TestMockupBuilder.cpp b/Examples/Run/Geant4/TestMockupBuilder.cpp deleted file mode 100644 index 76e1f6f3c2d..00000000000 --- a/Examples/Run/Geant4/TestMockupBuilder.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2022-2023 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Detector/Detector.hpp" -#include "Acts/Detector/DetectorVolume.hpp" -#include "Acts/Detector/Portal.hpp" -#include "Acts/MagneticField/ConstantBField.hpp" -#include "Acts/MagneticField/MagneticFieldContext.hpp" -#include "Acts/Navigation/DetectorNavigator.hpp" -#include "Acts/Navigation/DetectorVolumeFinders.hpp" -#include "Acts/Navigation/NavigationState.hpp" -#include "Acts/Navigation/SurfaceCandidatesUpdaters.hpp" -#include "Acts/Propagator/AbortList.hpp" -#include "Acts/Propagator/EigenStepper.hpp" -#include "Acts/Propagator/Propagator.hpp" -#include "Acts/Propagator/SurfaceCollector.hpp" -#include "Acts/Visualization/GeometryView3D.hpp" -#include "Acts/Visualization/IVisualization3D.hpp" -#include "Acts/Visualization/ObjVisualization3D.hpp" -#include "ActsExamples/Geant4Detector/Geant4Detector.hpp" -#include "ActsExamples/MuonSpectrometerMockupDetector/MockupSectorBuilder.hpp" - -#include - -using namespace Acts; -using namespace ActsExamples; - -struct StrawSelector { - /// Call operator - /// @param sf The input surface to be checked - bool operator()(const Surface& sf) const { - return (sf.type() == Surface::Straw); - } -}; - -int main() { - auto mockup_config = MockupSectorBuilder::Config(); - - auto mockup_chamberConfig_inner = MockupSectorBuilder::ChamberConfig(); - auto mockup_chamberConfig_middle = MockupSectorBuilder::ChamberConfig(); - auto mockup_chamberConfig_outer = MockupSectorBuilder::ChamberConfig(); - - mockup_config.gdmlPath = - " ../../../../acts/Examples/Detectors/MuonSpectrometerMockupDetector/" - "MuonChamber.gdml"; - mockup_config.NumberOfSectors = 8; - - mockup_chamberConfig_inner.name = "Inner_Detector_Chamber"; - mockup_chamberConfig_inner.SensitiveNames = {"Inner_Skin"}; - mockup_chamberConfig_inner.PassiveNames = {"xx"}; - - mockup_chamberConfig_middle.name = "Middle_Detector_Chamber"; - mockup_chamberConfig_middle.SensitiveNames = {"Middle_Skin"}; - mockup_chamberConfig_middle.PassiveNames = {"xx"}; - - mockup_chamberConfig_outer.name = "Outer_Detector_Chamber"; - mockup_chamberConfig_outer.SensitiveNames = {"Outer_Skin"}; - mockup_chamberConfig_outer.PassiveNames = {"xx"}; - - MockupSectorBuilder mockup_builder(mockup_config); - - GeometryContext gctx; - auto detectorVolume_inner_chamber = - mockup_builder.buildChamber(mockup_chamberConfig_inner); - - auto detectorVolume_middle_chamber = - mockup_builder.buildChamber(mockup_chamberConfig_middle); - - auto detectorVolume_outer_chamber = - mockup_builder.buildChamber(mockup_chamberConfig_outer); - - std::vector> - detector_volumes = {detectorVolume_inner_chamber, - detectorVolume_middle_chamber, - detectorVolume_outer_chamber}; - - auto detectorVolume_sector = mockup_builder.buildSector(detector_volumes); - - mockup_builder.drawSector(detectorVolume_sector, "sector_test.obj"); - - auto detector_sector = Acts::Experimental::Detector::makeShared( - "Detector", {detectorVolume_sector}, - Acts::Experimental::tryRootVolumes()); -} diff --git a/Examples/Run/Generators/CMakeLists.txt b/Examples/Run/Generators/CMakeLists.txt deleted file mode 100644 index ed963d362ba..00000000000 --- a/Examples/Run/Generators/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -add_executable( - ActsExampleParticleGun - ParticleGun.cpp) -target_link_libraries( - ActsExampleParticleGun - PRIVATE - ActsExamplesFramework ActsExamplesGenerators ActsExamplesCommon - ActsExamplesIoCsv ActsExamplesIoRoot ActsExamplesPrinters) - -install( - TARGETS ActsExampleParticleGun - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -add_subdirectory_if(Pythia8 ACTS_BUILD_EXAMPLES_PYTHIA8) diff --git a/Examples/Run/Generators/ParticleGun.cpp b/Examples/Run/Generators/ParticleGun.cpp deleted file mode 100644 index 8d6844398c3..00000000000 --- a/Examples/Run/Generators/ParticleGun.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Framework/RandomNumbers.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Io/Csv/CsvParticleWriter.hpp" -#include "ActsExamples/Io/Root/RootParticleWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/ParticleGunOptions.hpp" -#include "ActsExamples/Printers/ParticlesPrinter.hpp" -#include "ActsExamples/Utilities/Paths.hpp" -#include - -#include -#include - -using namespace ActsExamples; - -int main(int argc, char* argv[]) { - // Setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addRandomNumbersOptions(desc); - Options::addParticleGunOptions(desc); - Options::addOutputOptions(desc, OutputFormat::Csv | OutputFormat::Root); - auto vm = Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - Sequencer sequencer(Options::readSequencerConfig(vm)); - - Acts::Logging::Level logLevel = Options::readLogLevel(vm); - - // Basic services - auto rnd = - std::make_shared(Options::readRandomNumbersConfig(vm)); - - // Event generation w/ particle gun - EventGenerator::Config evgen = Options::readParticleGunOptions(vm); - evgen.outputParticles = "particles"; - evgen.randomNumbers = rnd; - sequencer.addReader(std::make_shared(evgen, logLevel)); - - // Print generated particles - if ((logLevel == Acts::Logging::VERBOSE) or - (logLevel == Acts::Logging::DEBUG)) { - ParticlesPrinter::Config print; - print.inputParticles = evgen.outputParticles; - sequencer.addAlgorithm(std::make_shared(print, logLevel)); - } - - // Different output modes - auto outputDir = ensureWritableDirectory(vm["output-dir"].as()); - if (vm["output-csv"].as()) { - CsvParticleWriter::Config csvWriter; - csvWriter.inputParticles = evgen.outputParticles; - csvWriter.outputDir = outputDir; - csvWriter.outputStem = "particles"; - sequencer.addWriter( - std::make_shared(csvWriter, logLevel)); - } - if (vm["output-root"].as()) { - RootParticleWriter::Config rootWriter; - rootWriter.inputParticles = evgen.outputParticles; - rootWriter.filePath = joinPaths(outputDir, "particles.root"); - sequencer.addWriter( - std::make_shared(rootWriter, logLevel)); - } - - return sequencer.run(); -} diff --git a/Examples/Run/Generators/Pythia8/CMakeLists.txt b/Examples/Run/Generators/Pythia8/CMakeLists.txt deleted file mode 100644 index e62cc5d1cb8..00000000000 --- a/Examples/Run/Generators/Pythia8/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -add_library(ActsExamplesGeneratorsPythia8Options SHARED - Options/src/Pythia8Options.cpp) -target_include_directories( - ActsExamplesGeneratorsPythia8Options - PUBLIC $) -target_link_libraries( - ActsExamplesGeneratorsPythia8Options - PUBLIC - Boost::program_options - PRIVATE - ActsExamplesFramework - ActsExamplesGenerators - ActsExamplesGeneratorsPythia8) - -add_executable( - ActsExamplePythia8 - Pythia8.cpp) -target_link_libraries( - ActsExamplePythia8 - PRIVATE - ActsExamplesFramework ActsExamplesCommon - ActsExamplesGenerators ActsExamplesGeneratorsPythia8 - ActsExamplesIoCsv ActsExamplesIoRoot ActsExamplesPrinters - ActsExamplesGeneratorsPythia8Options) - -install( - TARGETS ActsExamplePythia8 - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Examples/Run/Generators/Pythia8/Options/include/ActsExamples/Options/Pythia8Options.hpp b/Examples/Run/Generators/Pythia8/Options/include/ActsExamples/Options/Pythia8Options.hpp deleted file mode 100644 index 814fee52f49..00000000000 --- a/Examples/Run/Generators/Pythia8/Options/include/ActsExamples/Options/Pythia8Options.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Generators/EventGenerator.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { -namespace Options { - -/// Add options for a Pythia8-based event-generator. -void addPythia8Options(Description& desc); - -/// Create the event generator config from Pythia8 options. -/// -/// This builds a full event generator with separate hard scatter and pileup. -/// Not just the Pythia8 process generators to simplify the handling. -EventGenerator::Config readPythia8Options(const Variables& vars, - Acts::Logging::Level lvl); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/Generators/Pythia8/Options/src/Pythia8Options.cpp b/Examples/Run/Generators/Pythia8/Options/src/Pythia8Options.cpp deleted file mode 100644 index fe53eb6c91d..00000000000 --- a/Examples/Run/Generators/Pythia8/Options/src/Pythia8Options.cpp +++ /dev/null @@ -1,104 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/Pythia8Options.hpp" - -#include "Acts/Definitions/PdgParticle.hpp" -#include "Acts/Definitions/Units.hpp" -#include "ActsExamples/Generators/MultiplicityGenerators.hpp" -#include "ActsExamples/Generators/Pythia8ProcessGenerator.hpp" -#include "ActsExamples/Generators/VertexGenerators.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include - -#include - -void ActsExamples::Options::addPythia8Options(Description& desc) { - using boost::program_options::bool_switch; - using boost::program_options::value; - - auto opt = desc.add_options(); - opt("gen-nhard", value()->default_value(1u), - "Number of hard interactions, zero to disable"); - opt("gen-npileup", value()->default_value(200.0), - "Mean number of pile-up interactions, zero to disable"); - opt("gen-vertex-xy-std-mm", value()->default_value(0.0125), - "Transverse vertex standard deviation in mm"); - opt("gen-vertex-z-std-mm", value()->default_value(55.5), - "Longitudinal vertex standard deviation in mm"); - opt("gen-vertex-t-std-ns", value()->default_value(5.0), - "Temporal vertex standard deviation in ns"); - opt("gen-cms-energy-gev", value()->default_value(14000.0), - "Center-of-mass energy collision in GeV"); - opt("gen-pdg-beam0", - value()->default_value(Acts::PdgParticle::eProton), - "PDG number of the first beam particle"); - opt("gen-pdg-beam1", - value()->default_value(Acts::PdgParticle::eProton), - "PDG number of the second beam particle"); - opt("gen-hard-process", - value>()->default_value({"HardQCD:all = on"}, - "HardQCD:all = on"), - "Pythia8 process string for the hard interactions. Can be given multiple " - "times."); - opt("gen-pileup-process", - value>()->default_value({"SoftQCD:all = on"}, - "SoftQCD:all = on"), - "Pythi8 process string for the pile-up interactions. Can be given " - "multiple times."); -} - -ActsExamples::EventGenerator::Config ActsExamples::Options::readPythia8Options( - const Variables& vars, Acts::Logging::Level lvl) { - using namespace Acts::UnitLiterals; - - const auto nhard = vars["gen-nhard"].as(); - const auto npileup = vars["gen-npileup"].as(); - const auto pdgBeam0 = static_cast( - vars["gen-pdg-beam0"].template as()); - const auto pdgBeam1 = static_cast( - vars["gen-pdg-beam1"].template as()); - const auto cmsEnergy = vars["gen-cms-energy-gev"].as() * 1_GeV; - - auto vertexGen = std::make_shared(); - vertexGen->stddev[Acts::ePos0] = - vars["gen-vertex-xy-std-mm"].as() * 1_mm; - vertexGen->stddev[Acts::ePos1] = - vars["gen-vertex-xy-std-mm"].as() * 1_mm; - vertexGen->stddev[Acts::ePos2] = - vars["gen-vertex-z-std-mm"].as() * 1_mm; - vertexGen->stddev[Acts::eTime] = - vars["gen-vertex-t-std-ns"].as() * 1_ns; - - EventGenerator::Config cfg; - if (0u < nhard) { - Pythia8Generator::Config hard; - hard.pdgBeam0 = pdgBeam0; - hard.pdgBeam1 = pdgBeam1; - hard.cmsEnergy = cmsEnergy; - hard.settings = vars["gen-hard-process"].as>(); - - cfg.generators.push_back( - {std::make_shared(nhard), vertexGen, - std::make_shared(hard, lvl)}); - } - if (0.0 < npileup) { - Pythia8Generator::Config pileup; - pileup.pdgBeam0 = pdgBeam0; - pileup.pdgBeam1 = pdgBeam1; - pileup.cmsEnergy = cmsEnergy; - pileup.settings = vars["gen-pileup-process"].as>(); - - cfg.generators.push_back( - {std::make_shared(npileup), vertexGen, - std::make_shared(pileup, lvl)}); - } - - return cfg; -} diff --git a/Examples/Run/Generators/Pythia8/Pythia8.cpp b/Examples/Run/Generators/Pythia8/Pythia8.cpp deleted file mode 100644 index 2a0726e735f..00000000000 --- a/Examples/Run/Generators/Pythia8/Pythia8.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Framework/RandomNumbers.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Io/Csv/CsvParticleWriter.hpp" -#include "ActsExamples/Io/Root/RootParticleWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/Pythia8Options.hpp" -#include "ActsExamples/Printers/ParticlesPrinter.hpp" -#include "ActsExamples/TruthTracking/ParticleSelector.hpp" -#include "ActsExamples/Utilities/Paths.hpp" -#include - -#include -#include - -using namespace Acts::UnitLiterals; -using namespace ActsExamples; - -int main(int argc, char* argv[]) { - // setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addRandomNumbersOptions(desc); - Options::addPythia8Options(desc); - Options::addOutputOptions(desc, OutputFormat::Csv | OutputFormat::Root); - auto vm = Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - auto logLevel = Options::readLogLevel(vm); - Sequencer::Config sequencerCfg = Options::readSequencerConfig(vm); - Sequencer sequencer(sequencerCfg); - - // basic services - auto rnd = - std::make_shared(Options::readRandomNumbersConfig(vm)); - - // event generation w/ internal pythia8 instance - EventGenerator::Config evgen = Options::readPythia8Options(vm, logLevel); - evgen.outputParticles = "particles"; - evgen.randomNumbers = rnd; - sequencer.addReader(std::make_shared(evgen, logLevel)); - - // print generated particles - if ((logLevel == Acts::Logging::VERBOSE) or - (logLevel == Acts::Logging::DEBUG)) { - ParticlesPrinter::Config print; - print.inputParticles = evgen.outputParticles; - sequencer.addAlgorithm(std::make_shared(print, logLevel)); - } - - // different output modes - auto outputDir = ensureWritableDirectory(vm["output-dir"].as()); - if (vm["output-csv"].as()) { - CsvParticleWriter::Config csvWriter; - csvWriter.inputParticles = evgen.outputParticles; - csvWriter.outputDir = outputDir; - csvWriter.outputStem = "particles"; - sequencer.addWriter( - std::make_shared(csvWriter, logLevel)); - } - if (vm["output-root"].as()) { - RootParticleWriter::Config rootWriter; - rootWriter.inputParticles = evgen.outputParticles; - rootWriter.filePath = joinPaths(outputDir, "particles.root"); - sequencer.addWriter( - std::make_shared(rootWriter, logLevel)); - } - - return sequencer.run(); -} diff --git a/Examples/Run/Geometry/AlignedGeometryExample.cpp b/Examples/Run/Geometry/AlignedGeometryExample.cpp deleted file mode 100644 index cb442a04268..00000000000 --- a/Examples/Run/Geometry/AlignedGeometryExample.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/AlignedDetectorWithOptions.hpp" -#include "ActsExamples/Geometry/GeometryExampleBase.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - ActsExamples::AlignedDetectorWithOptions alignedDetector; - - // now process it - return processGeometry(argc, argv, alignedDetector); -} diff --git a/Examples/Run/Geometry/CMakeLists.txt b/Examples/Run/Geometry/CMakeLists.txt deleted file mode 100644 index 4a561a11986..00000000000 --- a/Examples/Run/Geometry/CMakeLists.txt +++ /dev/null @@ -1,59 +0,0 @@ -set(_common_libraries - ActsCore - ActsExamplesFramework - ActsExamplesCommon - ActsExamplesIoObj - ActsExamplesIoCsv - ActsExamplesIoJson - ActsExamplesIoRoot) - -# Empty detector -add_executable( - ActsExampleGeometryEmpty - EmptyGeometryExample.cpp) -target_link_libraries( - ActsExampleGeometryEmpty - PRIVATE ${_common_libraries}) - -# Generic detector -add_executable( - ActsExampleGeometryGeneric - GenericGeometryExample.cpp) -target_link_libraries( - ActsExampleGeometryGeneric - PRIVATE ${_common_libraries}) - -# Generic detector with alignment -add_executable( - ActsExampleGeometryAligned - AlignedGeometryExample.cpp) -target_link_libraries( - ActsExampleGeometryAligned - PRIVATE ${_common_libraries}) - -# TGeo detector -add_executable( - ActsExampleGeometryTGeo - TGeoGeometryExample.cpp) -target_link_libraries( - ActsExampleGeometryTGeo - PRIVATE ${_common_libraries}) - -# Telescope detector -add_executable( - ActsExampleGeometryTelescope - TelescopeGeometryExample.cpp) -target_link_libraries( - ActsExampleGeometryTelescope - PRIVATE ${_common_libraries}) - -install( - TARGETS - ActsExampleGeometryEmpty - ActsExampleGeometryGeneric - ActsExampleGeometryAligned - ActsExampleGeometryTGeo - ActsExampleGeometryTelescope - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -add_subdirectory_if(DD4hep ACTS_BUILD_EXAMPLES_DD4HEP) diff --git a/Examples/Run/Geometry/DD4hep/CMakeLists.txt b/Examples/Run/Geometry/DD4hep/CMakeLists.txt deleted file mode 100644 index a82fcfcc296..00000000000 --- a/Examples/Run/Geometry/DD4hep/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -add_executable( - ActsExampleGeometryDD4hep - DD4hepGeometryExample.cpp) -target_link_libraries( - ActsExampleGeometryDD4hep - PRIVATE ${_common_libraries} ActsExamplesDD4hepDetectorWithOptions) - -install( - TARGETS ActsExampleGeometryDD4hep - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Examples/Run/Geometry/DD4hep/DD4hepGeometryExample.cpp b/Examples/Run/Geometry/DD4hep/DD4hepGeometryExample.cpp deleted file mode 100644 index f4af0d5778e..00000000000 --- a/Examples/Run/Geometry/DD4hep/DD4hepGeometryExample.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/DD4hepDetectorWithOptions.hpp" -#include "ActsExamples/Geometry/GeometryExampleBase.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - ActsExamples::DD4hepDetectorWithOptions detector; - // now process it - return processGeometry(argc, argv, detector); -} diff --git a/Examples/Run/Geometry/EmptyGeometryExample.cpp b/Examples/Run/Geometry/EmptyGeometryExample.cpp deleted file mode 100644 index 6f3660d2a21..00000000000 --- a/Examples/Run/Geometry/EmptyGeometryExample.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/EmptyDetector.hpp" -#include "ActsExamples/Geometry/GeometryExampleBase.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - EmptyDetector detector; - // now process it - return processGeometry(argc, argv, detector); -} diff --git a/Examples/Run/Geometry/GenericGeometryExample.cpp b/Examples/Run/Geometry/GenericGeometryExample.cpp deleted file mode 100644 index 89d07786106..00000000000 --- a/Examples/Run/Geometry/GenericGeometryExample.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/GenericDetectorWithOptions.hpp" -#include "ActsExamples/Geometry/GeometryExampleBase.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - ActsExamples::GenericDetectorWithOptions detector; - - return processGeometry(argc, argv, detector); -} diff --git a/Examples/Run/Geometry/TGeoGeometryExample.cpp b/Examples/Run/Geometry/TGeoGeometryExample.cpp deleted file mode 100644 index 29d16b7f1de..00000000000 --- a/Examples/Run/Geometry/TGeoGeometryExample.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TGeoDetectorWithOptions.hpp" -#include "ActsExamples/Geometry/GeometryExampleBase.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - ActsExamples::TGeoDetectorWithOptions detector; - - // now process it - return processGeometry(argc, argv, detector); -} diff --git a/Examples/Run/Geometry/TelescopeGeometryExample.cpp b/Examples/Run/Geometry/TelescopeGeometryExample.cpp deleted file mode 100644 index dcfc2a24030..00000000000 --- a/Examples/Run/Geometry/TelescopeGeometryExample.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TelescopeDetectorWithOptions.hpp" -#include "ActsExamples/Geometry/GeometryExampleBase.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - ActsExamples::TelescopeDetectorWithOptions detector; - // now process it - return processGeometry(argc, argv, detector); -} diff --git a/Examples/Run/HepMC3/CMakeLists.txt b/Examples/Run/HepMC3/CMakeLists.txt deleted file mode 100644 index 5db01d7cd0b..00000000000 --- a/Examples/Run/HepMC3/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -add_library( - ActsExamplesHepMC3Options SHARED - Options/src/HepMC3Options.cpp -) -target_include_directories( - ActsExamplesHepMC3Options PUBLIC - $) -target_link_libraries( - ActsExamplesHepMC3Options - PUBLIC - Boost::program_options - PRIVATE - ActsExamplesFramework - ActsExamplesIoHepMC3) - -add_executable( - ActsExampleHepMC3Exe - HepMC3Example.cpp) -target_link_libraries( - ActsExampleHepMC3Exe - PRIVATE - ActsCore ActsFatras - ActsExamplesCommon ActsExamplesFramework ActsExamplesIoHepMC3 ActsExamplesHepMC3Options) - -add_executable( - ActsExampleHepMC3Histogram - HepMC3HistogramExample.cpp) -target_link_libraries( - ActsExampleHepMC3Histogram - PRIVATE - ActsCore ActsExamplesCommon - ActsExamplesFramework ActsExamplesIoHepMC3 ActsExamplesHepMC3 ActsExamplesIoNuclearInteractions ActsExamplesHepMC3Options) - -install( - TARGETS ActsExampleHepMC3Exe ActsExampleHepMC3Histogram - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - diff --git a/Examples/Run/HepMC3/HepMC3Example.cpp b/Examples/Run/HepMC3/HepMC3Example.cpp deleted file mode 100644 index f1bf213fdf2..00000000000 --- a/Examples/Run/HepMC3/HepMC3Example.cpp +++ /dev/null @@ -1,145 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018-2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Definitions/ParticleData.hpp" -#include "ActsExamples/EventData/SimParticle.hpp" -#include "ActsExamples/EventData/SimVertex.hpp" -#include "ActsExamples/Io/HepMC3/HepMC3Event.hpp" -#include "ActsExamples/Io/HepMC3/HepMC3Reader.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/HepMC3Options.hpp" - -#include - -#include -#include - -/// -/// Straight forward example of reading a HepMC3 file. -/// -int main(int argc, char** argv) { - // Declare the supported program options. - // Setup and parse options - auto desc = ActsExamples::Options::makeDefaultOptions(); - ActsExamples::Options::addHepMC3ReaderOptions(desc); - auto vm = ActsExamples::Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - auto logLevel = ActsExamples::Options::readLogLevel(vm); - - // Create the reader - auto hepMC3ReaderConfig = ActsExamples::Options::readHepMC3ReaderOptions(vm); - ActsExamples::HepMC3AsciiReader simReader(hepMC3ReaderConfig, logLevel); - - std::cout << "Preparing reader " << std::flush; - HepMC3::ReaderAscii reader("test.hepmc3"); - if (simReader.status(reader)) { - std::cout << "successful" << std::endl; - } else { - std::cout << "failed" << std::endl; - } - - HepMC3::GenEvent genevt; - - std::cout << "Reading event " << std::flush; - if (simReader.readEvent(reader, genevt)) { - std::cout << "successful" << std::endl; - } else { - std::cout << "failed" << std::endl; - } - std::cout << std::endl; - - using namespace ActsExamples::HepMC3Event; - std::cout << "Event data:" << std::endl; - std::cout << "Units: "; - if (momentumUnit(genevt) == Acts::UnitConstants::GeV) { - std::cout << "[GEV], "; - } else if (momentumUnit(genevt) == Acts::UnitConstants::MeV) { - std::cout << "[MeV], "; - } - if (lengthUnit(genevt) == Acts::UnitConstants::mm) { - std::cout << "[mm]" << std::endl; - } else if (lengthUnit(genevt) == Acts::UnitConstants::cm) { - std::cout << "[cm]" << std::endl; - } - Acts::Vector3 evtPos = eventPos(genevt); - std::cout << "Event position: " << evtPos(0) << ", " << evtPos(1) << ", " - << evtPos(2) << std::endl; - std::cout << "Event time: " << eventTime(genevt) << std::endl; - - std::cout << "Beam particles: "; - std::vector beam = beams(genevt); - if (beam.empty()) { - std::cout << "none" << std::endl; - } else { - for (auto& pbeam : beam) { - std::cout << Acts::findName(static_cast(pbeam.pdg())) - .value_or("invalid") - << " "; - } - std::cout << std::endl; - } - - std::cout << std::endl << "Vertices: "; - std::vector> vertices = - ActsExamples::HepMC3Event::vertices(genevt); - if (vertices.empty()) { - std::cout << "none" << std::endl; - } else { - std::cout << std::endl; - for (auto& vertex : vertices) { - for (auto& particle : vertex->incoming) { - std::cout << Acts::findName( - static_cast(particle.pdg())) - .value_or("invalid") - << " "; - } - std::cout << "-> "; - for (auto& particle : vertex->outgoing) { - std::cout << Acts::findName( - static_cast(particle.pdg())) - .value_or("invalid") - << " "; - } - std::cout << "\t@(" << vertex->time() << ", " << vertex->position()(0) - << ", " << vertex->position()(1) << ", " - << vertex->position()(2) << ")" << std::endl; - } - std::cout << std::endl; - } - - std::cout << "Total particle record:" << std::endl; - std::vector particles = - ActsExamples::HepMC3Event::particles(genevt); - for (auto& particle : particles) { - std::cout << Acts::findName(static_cast(particle.pdg())) - .value_or("invalid") - << "\tID:" << particle.particleId() << ", momentum: (" - << particle.fourMomentum()(0) << ", " - << particle.fourMomentum()(1) << ", " - << particle.fourMomentum()(2) << "), mass: " << particle.mass() - << std::endl; - } - - std::cout << std::endl << "Initial to final state: "; - std::vector fState = finalState(genevt); - for (auto& pbeam : beam) { - std::cout << Acts::findName(static_cast(pbeam.pdg())) - .value_or("invalid") - << " "; - } - std::cout << "-> "; - for (auto& fs : fState) { - std::cout << Acts::findName(static_cast(fs.pdg())) - .value_or("invalid") - << " "; - } - std::cout << std::endl; -} diff --git a/Examples/Run/HepMC3/HepMC3HistogramExample.cpp b/Examples/Run/HepMC3/HepMC3HistogramExample.cpp deleted file mode 100644 index 2302018cd76..00000000000 --- a/Examples/Run/HepMC3/HepMC3HistogramExample.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/HepMC/HepMCProcessExtractor.hpp" -#include "ActsExamples/Io/HepMC3/HepMC3Reader.hpp" -#include "ActsExamples/Io/NuclearInteractions/RootNuclearInteractionParametersWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/HepMC3Options.hpp" - -/// -/// Straight forward example of reading a HepMC3 file. -/// -int main(int argc, char** argv) { - // Declare the supported program options. - // Setup and parse options - auto desc = ActsExamples::Options::makeDefaultOptions(); - ActsExamples::Options::addSequencerOptions(desc); - ActsExamples::Options::addInputOptions(desc); - ActsExamples::Options::addHepMC3ReaderOptions(desc); - - auto vm = ActsExamples::Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - auto logLevel = ActsExamples::Options::readLogLevel(vm); - - ActsExamples::Sequencer sequencer( - ActsExamples::Options::readSequencerConfig(vm)); - - // Create the reader - auto hepMC3ReaderConfig = ActsExamples::Options::readHepMC3ReaderOptions(vm); - hepMC3ReaderConfig.outputEvents = "hepmc-events"; - - ActsExamples::HepMCProcessExtractor::Config extractionConfig; - extractionConfig.inputEvents = hepMC3ReaderConfig.outputEvents; - extractionConfig.extractionProcess = "Inelastic"; - - ActsExamples::RootNuclearInteractionParametersWriter::Config writerCfg; - writerCfg.inputSimulationProcesses = - extractionConfig.outputSimulationProcesses; - - // Add to the sequencer - sequencer.addReader(std::make_shared( - hepMC3ReaderConfig, logLevel)); - sequencer.addAlgorithm(std::make_shared( - std::move(extractionConfig), logLevel)); - sequencer.addWriter( - std::make_shared( - writerCfg, logLevel)); - - // Run - return sequencer.run(); -} diff --git a/Examples/Run/HepMC3/Options/include/ActsExamples/Options/HepMC3Options.hpp b/Examples/Run/HepMC3/Options/include/ActsExamples/Options/HepMC3Options.hpp deleted file mode 100644 index 81946f2a512..00000000000 --- a/Examples/Run/HepMC3/Options/include/ActsExamples/Options/HepMC3Options.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Io/HepMC3/HepMC3Reader.hpp" -#include "ActsExamples/Io/HepMC3/HepMC3Writer.hpp" -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -namespace ActsExamples { -namespace Options { - -/// Add HepMC3 specific writer options. -/// -/// @param desc The option description forward -void addHepMC3WriterOptions(Description& desc); - -/// Read the HepMC3 writer options and @return a HepMC3WriterAscii::Config -/// -/// @param variables is the parameter map for the options -/// -/// @returns a Config object for the HepMC3WriterAscii -HepMC3AsciiWriter::Config readHepMC3WriterOptions(const Variables& variables); - -/// Add HepMC3 specific reader options. -/// -/// @param desc The option description forward -void addHepMC3ReaderOptions(Description& desc); - -/// Read the HepMC3 reader options and @return a HepMC3ReaderAscii::Config -/// -/// @param variables is the parameter map for the options -/// -/// @returns a Config object for the HepMC3ReaderAscii -HepMC3AsciiReader::Config readHepMC3ReaderOptions(const Variables& variables); - -} // namespace Options -} // namespace ActsExamples diff --git a/Examples/Run/HepMC3/Options/src/HepMC3Options.cpp b/Examples/Run/HepMC3/Options/src/HepMC3Options.cpp deleted file mode 100644 index a659a8299b6..00000000000 --- a/Examples/Run/HepMC3/Options/src/HepMC3Options.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Options/HepMC3Options.hpp" - -#include "ActsExamples/Utilities/Options.hpp" - -#include - -#include - -void ActsExamples::Options::addHepMC3WriterOptions( - ActsExamples::Options::Description& desc) { - using boost::program_options::value; - - auto opt = desc.add_options(); - - opt("hepmc3-stem", value()->default_value("events"), - "The stem of file names of the output"); -} - -ActsExamples::HepMC3AsciiWriter::Config -ActsExamples::Options::readHepMC3WriterOptions( - const ActsExamples::Options::Variables& variables) { - ActsExamples::HepMC3AsciiWriter::Config writerConfig; - writerConfig.outputDir = variables["output-dir"].as(); - writerConfig.outputStem = variables["hepmc3-stem"].as(); - - return writerConfig; -} - -void ActsExamples::Options::addHepMC3ReaderOptions( - ActsExamples::Options::Description& desc) { - using boost::program_options::value; - - auto opt = desc.add_options(); - - opt("hepmc3-stem", value()->default_value("events"), - "The stem of file names of the input"); -} - -ActsExamples::HepMC3AsciiReader::Config -ActsExamples::Options::readHepMC3ReaderOptions( - const ActsExamples::Options::Variables& variables) { - ActsExamples::HepMC3AsciiReader::Config readerConfig; - readerConfig.inputDir = variables["input-dir"].as(); - readerConfig.inputStem = variables["hepmc3-stem"].as(); - - return readerConfig; -} diff --git a/Examples/Run/HepMC3/test.hepmc3 b/Examples/Run/HepMC3/test.hepmc3 deleted file mode 100644 index 67e5491b939..00000000000 --- a/Examples/Run/HepMC3/test.hepmc3 +++ /dev/null @@ -1,55 +0,0 @@ -HepMC::Version 3.0.0 -HepMC::Asciiv3-START_EVENT_LISTING -E 0 7 12 -U GEV MM -A 0 GenCrossSection 2.64422551e+03 2.64422551e+03 -1 -1 -A 0 GenPdfInfo 11 -11 9.97420767e-01 9.99999975e-01 9.18812775e+01 1.56824725e+01 2.82148362e+06 0 0 -P 1 0 11 0.0000000000000000e+00 0.0000000000000000e+00 4.5999999997161737e+01 4.6000000000000007e+01 5.1099999999999995e-04 4 -P 2 1 11 0.0000000000000000e+00 0.0000000000000000e+00 4.5881355265109356e+01 4.5881355265109356e+01 0.0000000000000000e+00 61 -P 3 1 22 0.0000000000000000e+00 0.0000000000000000e+00 1.1864473489064407e-01 1.1864473489064407e-01 0.0000000000000000e+00 1 -P 4 2 11 0.0000000000000000e+00 0.0000000000000000e+00 4.5881355265109356e+01 4.5881355265109356e+01 0.0000000000000000e+00 21 -P 5 0 -11 0.0000000000000000e+00 0.0000000000000000e+00 -4.5999999997161737e+01 4.6000000000000007e+01 5.1099999999999995e-04 4 -P 6 5 -11 0.0000000000000000e+00 0.0000000000000000e+00 -4.5999998855671230e+01 4.5999998855671230e+01 0.0000000000000000e+00 61 -P 7 5 22 0.0000000000000000e+00 0.0000000000000000e+00 -1.1443287704082650e-06 1.1443287704082650e-06 0.0000000000000000e+00 1 -P 8 6 -11 0.0000000000000000e+00 0.0000000000000000e+00 -4.5999998855671230e+01 4.5999998855671230e+01 0.0000000000000000e+00 21 -V -5 0 [4,8] -P 9 -5 23 0.0000000000000000e+00 0.0000000000000000e+00 -1.1864359056187368e-01 9.1881354120780586e+01 9.1881277520323493e+01 22 -P 10 9 23 0.0000000000000000e+00 0.0000000000000000e+00 -1.1864359056187367e-01 9.1881354120780586e+01 9.1881277520323493e+01 62 -P 11 10 15 -2.3389081325813049e+01 -2.6534544925397686e+01 -2.9321164328115067e+01 4.5978461985283630e+01 1.7768200000000001e+00 1 -P 12 10 -15 2.3389081325813049e+01 2.6534544925397686e+01 2.9202520737553193e+01 4.5902892135496963e+01 1.7768200000000001e+00 1 -E 1 7 12 -U GEV MM -A 0 GenCrossSection 2.40293765e+03 8.99943574e+02 -1 -1 -A 0 GenPdfInfo 11 -11 9.99977625e-01 9.99999997e-01 9.19989706e+01 1.40670487e+03 2.09202705e+07 0 0 -P 1 0 11 0.0000000000000000e+00 0.0000000000000000e+00 4.5999999997161737e+01 4.6000000000000007e+01 5.1099999999999995e-04 4 -P 2 1 11 0.0000000000000000e+00 0.0000000000000000e+00 4.5998970770665402e+01 4.5998970770665430e+01 0.0000000000000000e+00 61 -P 3 1 22 0.0000000000000000e+00 0.0000000000000000e+00 1.0292293345912640e-03 1.0292293345912640e-03 0.0000000000000000e+00 1 -P 4 2 11 0.0000000000000000e+00 0.0000000000000000e+00 4.5998970770665409e+01 4.5998970770665409e+01 0.0000000000000000e+00 21 -P 5 0 -11 0.0000000000000000e+00 0.0000000000000000e+00 -4.5999999997161737e+01 4.6000000000000007e+01 5.1099999999999995e-04 4 -P 6 5 -11 0.0000000000000000e+00 0.0000000000000000e+00 -4.5999999862323357e+01 4.5999999862323385e+01 0.0000000000000000e+00 61 -P 7 5 22 0.0000000000000000e+00 0.0000000000000000e+00 -1.3767663631369942e-07 1.3767663631369942e-07 0.0000000000000000e+00 1 -P 8 6 -11 0.0000000000000000e+00 0.0000000000000000e+00 -4.5999999862323364e+01 4.5999999862323364e+01 0.0000000000000000e+00 21 -V -5 0 [4,8] -P 9 -5 23 0.0000000000000000e+00 0.0000000000000000e+00 -1.0290916579549503e-03 9.1998970632988772e+01 9.1998970627233106e+01 22 -P 10 9 23 0.0000000000000000e+00 0.0000000000000000e+00 -1.0290916579549503e-03 9.1998970632988815e+01 9.1998970627233106e+01 62 -P 11 10 15 6.7919236668591969e+00 4.5413314931060853e+01 -2.0732324913308533e+00 4.5999508501718438e+01 1.7768200000000001e+00 1 -P 12 10 -15 -6.7919236668591969e+00 -4.5413314931060853e+01 2.0722033996728983e+00 4.5999462131270334e+01 1.7768200000000001e+00 1 -E 2 7 12 -U GEV MM -A 0 GenCrossSection 2.89278209e+03 9.99735480e+02 -1 -1 -A 0 GenPdfInfo 11 -11 9.99737447e-01 9.99999918e-01 9.19879180e+01 1.36829980e+02 9.14025571e+05 0 0 -P 1 0 11 0.0000000000000000e+00 0.0000000000000000e+00 4.5999999997161737e+01 4.6000000000000007e+01 5.1099999999999995e-04 4 -P 2 1 11 0.0000000000000000e+00 0.0000000000000000e+00 4.5987922581845588e+01 4.5987922581845574e+01 0.0000000000000000e+00 61 -P 3 1 22 0.0000000000000000e+00 0.0000000000000000e+00 1.2077418154412099e-02 1.2077418154412099e-02 0.0000000000000000e+00 1 -P 4 2 11 0.0000000000000000e+00 0.0000000000000000e+00 4.5987922581845588e+01 4.5987922581845588e+01 0.0000000000000000e+00 21 -P 5 0 -11 0.0000000000000000e+00 0.0000000000000000e+00 -4.5999999997161737e+01 4.6000000000000007e+01 5.1099999999999995e-04 4 -P 6 5 -11 0.0000000000000000e+00 0.0000000000000000e+00 -4.5999996233650400e+01 4.5999996233650386e+01 0.0000000000000000e+00 61 -P 7 5 22 0.0000000000000000e+00 0.0000000000000000e+00 -3.7663496001982821e-06 3.7663496001982821e-06 0.0000000000000000e+00 1 -P 8 6 -11 0.0000000000000000e+00 0.0000000000000000e+00 -4.5999996233650400e+01 4.5999996233650400e+01 0.0000000000000000e+00 21 -V -5 0 [4,8] -P 9 -5 23 0.0000000000000000e+00 0.0000000000000000e+00 -1.2073651804811902e-02 9.1987918815495988e+01 9.1987918023147003e+01 22 -P 10 9 23 0.0000000000000000e+00 0.0000000000000000e+00 -1.2073651804811902e-02 9.1987918815495959e+01 9.1987918023147003e+01 62 -P 11 10 15 -3.8800515636276924e+00 -2.0378448657427619e+01 4.1005561965189088e+01 4.5988576529538129e+01 1.7768200000000001e+00 1 -P 12 10 -15 3.8800515636276924e+00 2.0378448657427619e+01 -4.1017635616993900e+01 4.5999342285957852e+01 1.7768200000000001e+00 1 -HepMC::Asciiv3-END_EVENT_LISTING - diff --git a/Examples/Run/MagneticField/BFieldAccessExample.cpp b/Examples/Run/MagneticField/BFieldAccessExample.cpp deleted file mode 100644 index 8d26fc76a2c..00000000000 --- a/Examples/Run/MagneticField/BFieldAccessExample.cpp +++ /dev/null @@ -1,176 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2017-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Definitions/Units.hpp" -#include "Acts/MagneticField/MagneticFieldProvider.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include -#include - -#include - -#if ((BOOST_VERSION / 100) % 1000) <= 71 -// Boost <=1.71 and lower do not have progress_display.hpp as a replacement yet -#include -using progress_display = boost::progress_display; -#else -// Boost >=1.72 can use this as a replacement -#include -using progress_display = boost::timer::progress_display; -#endif - -/// The main executable -/// -/// Creates an InterpolatedBFieldMap from a txt or csv file -/// It then tests random versus stepwise access with the -/// direct getField access and the cell.getField access -/// with cell caching - -namespace po = boost::program_options; - -using UniformDist = std::uniform_real_distribution; -using RandomEngine = std::mt19937; - -void accessStepWise(const Acts::MagneticFieldProvider& bField, - const Acts::MagneticFieldContext& bFieldContext, - std::size_t events, std::size_t theta_steps, double theta_0, - double theta_step, std::size_t phi_steps, double phi_0, - double phi_step, std::size_t access_steps, - double access_step) { - std::cout << "[>>>] Start: step-wise access pattern ... " << std::endl; - // initialize the field cache - auto bCache = bField.makeCache(bFieldContext); - // boost display - std::size_t totalSteps = events * theta_steps * phi_steps * access_steps; - progress_display show_progress(totalSteps); - // the event loop - // loop over the events - @todo move to parallel for - for (std::size_t ievt = 0; ievt < events; ++ievt) { - for (std::size_t itheta = 0; itheta < theta_steps; ++itheta) { - double theta = theta_0 + itheta * theta_step; - for (std::size_t iphi = 0; iphi < phi_steps; ++iphi) { - double phi = phi_0 + iphi * phi_step; - // make a direction - Acts::Vector3 dir(cos(phi) * sin(theta), sin(phi) * sin(theta), - cos(theta)); - // check for the current step - double currentStep = 0.; - // now step through the magnetic field - for (std::size_t istep = 0; istep < access_steps; ++istep) { - Acts::Vector3 position = currentStep * dir; - // access the field with the cell - auto field_from_cache = bField.getField(position, bCache); - (void)field_from_cache; // we don't use this explicitly - // increase the step - currentStep += access_step; - // show the progress bar - ++show_progress; - } - } - } - std::cout << "[<<<] End result: total steps:" << totalSteps << std::endl; - } -} - -void accessRandom(const Acts::MagneticFieldProvider& bField, - const Acts::MagneticFieldContext& bFieldContext, - std::size_t totalSteps, double radius) { - std::cout << "[>>>] Start: random access pattern ... " << std::endl; - RandomEngine rng; - UniformDist xDist(-radius, radius); - UniformDist yDist(-radius, radius); - UniformDist zDist(-radius, radius); - - // initialize the field cache - auto bCache = bField.makeCache(bFieldContext); - progress_display show_progress(totalSteps); - - // the event loop - // loop over the events - @todo move to parallel for - for (std::size_t istep = 0; istep < totalSteps; ++istep) { - Acts::Vector3 position(xDist(rng), yDist(rng), zDist(rng)); - // access the field with the cell - auto field_from_cache = bField.getField(position, bCache); - (void)field_from_cache; // we don't use this explicitly - // show the progress bar - ++show_progress; - } - std::cout << "[<<<] End result: total steps: " << totalSteps << std::endl; -} - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // Declare the supported program options. - auto desc = ActsExamples::Options::makeDefaultOptions(); - ActsExamples::Options::addSequencerOptions(desc); - ActsExamples::Options::addMagneticFieldOptions(desc); - desc.add_options()( - "bf-phi-range", - po::value>()->default_value( - {{-M_PI, M_PI}}), - "range in which the phi parameter is generated.")( - "bf-theta-range", - po::value>()->default_value({{0., M_PI}}), - "range in which the eta parameter is generated.")( - "bf-phisteps", po::value()->default_value(1000), - "number of steps for the phi parameter.")( - "bf-thetasteps", po::value()->default_value(100), - "number of steps for the eta parameter.")( - "bf-accesssteps", po::value()->default_value(100), - "number of steps for magnetic field access.")( - "bf-tracklength", po::value()->default_value(100.), - "track length in [mm] magnetic field access."); - auto vm = ActsExamples::Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - // A test magnetic field context - Acts::MagneticFieldContext magFieldContext = Acts::MagneticFieldContext(); - - // TODO - // Why does this need number-of-events? If it really does emulate - // per-event access patterns this should be switched to a proper - // Sequencer-based tool. Otherwise it should be removed. - auto nEvents = ActsExamples::Options::readSequencerConfig(vm).events.value(); - auto bField = ActsExamples::Options::readMagneticField(vm); - - // Get the phi and eta range - auto phir = vm["bf-phi-range"].as>(); - auto thetar = vm["bf-theta-range"].as>(); - // Get the granularity - std::size_t phi_steps = vm["bf-phisteps"].as(); - std::size_t theta_steps = vm["bf-thetasteps"].as(); - // The defaults - std::size_t access_steps = vm["bf-accesssteps"].as(); - double track_length = - vm["bf-tracklength"].as() * Acts::UnitConstants::mm; - // sort the ranges - and prepare the access grid - std::sort(phir.begin(), phir.end()); - std::sort(thetar.begin(), thetar.end()); - double phi_span = std::abs(phir[1] - phir[0]); - double phi_step = phi_span / phi_steps; - double theta_span = std::abs(thetar[1] - thetar[0]); - double theta_step = theta_span / theta_steps; - double access_step = track_length / access_steps; - - accessStepWise(*bField, magFieldContext, nEvents, theta_steps, thetar[0], - theta_step, phi_steps, phir[0], phi_step, access_steps, - access_step); - - accessRandom(*bField, magFieldContext, - nEvents * theta_steps * phi_steps * access_steps, track_length); - return EXIT_SUCCESS; -} diff --git a/Examples/Run/MagneticField/BFieldExample.cpp b/Examples/Run/MagneticField/BFieldExample.cpp deleted file mode 100644 index d491bb3989c..00000000000 --- a/Examples/Run/MagneticField/BFieldExample.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2017-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Io/Root/RootBFieldWriter.hpp" -#include "ActsExamples/MagneticField/MagneticField.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include - -#include - -namespace po = boost::program_options; - -/// The main executable -/// -/// Creates an InterpolatedBFieldMap from a txt or csv file and writes out the -/// grid points and values of the map into root format. The Field can then be -/// displayed using the root script printBField.cpp -int main(int argc, char* argv[]) { - using boost::program_options::value; - - // setup and parse options - auto desc = ActsExamples::Options::makeDefaultOptions(); - ActsExamples::Options::addMagneticFieldOptions(desc); - desc.add_options()("bf-file-out", - value()->default_value("BFieldOut.root"), - "Set this name for an output root file.")( - "bf-map-out", value()->default_value("bField"), - "Set this name for the tree in the out file.")( - "bf-out-rz", value()->default_value(false), - "Please set this flag to true, if you want to print out the field map in " - "cylinder coordinates (r,z). The default are cartesian coordinates " - "(x,y,z). ")( - "bf-rRange", value>(), - "[optional] range which the bfield map should be written out in either r " - "(cylinder " - "coordinates) or x/y (cartesian coordinates) in [mm]. In case no value " - "is handed over the whole map will be written out. Please " - "hand over by simply separating the values by space")( - "bf-zRange", value>(), - "[optional] range which the bfield map should be written out in z in " - "[mm].In case no value is handed over for 'bf-rRange' and 'bf-zRange the " - "whole map will be written out. " - "Please hand over by simply separating the values by space")( - "bf-rBins", value()->default_value(200), - "[optional] The number of bins in r. This parameter only needs to be " - "specified if 'bf-rRange' and 'bf-zRange' are given.")( - "bf-ZBins", value()->default_value(300), - "[optional] The number of bins in z. This parameter only needs to be " - "specified if 'bf-rRange' and 'bf-zRange' are given.")( - "bf-PhiBins", value()->default_value(100), - "[optional] The number of bins in phi. This parameter only needs to be " - "specified if 'bf-rRange' and 'bf-zRange' are given and 'bf-out-rz' is " - "turned on."); - auto vm = ActsExamples::Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - auto bFieldVar = ActsExamples::Options::readMagneticField(vm); - - auto bField = - std::dynamic_pointer_cast( - bFieldVar); - if (!bField) { - std::cout << "Bfield map could not be read. Exiting." << std::endl; - return EXIT_FAILURE; - } - - using GridType = ActsExamples::RootBFieldWriter::GridType; - - // Write the interpolated magnetic field - ActsExamples::RootBFieldWriter::Config writerConfig; - if (vm["bf-out-rz"].template as()) { - writerConfig.gridType = GridType::rz; - } else { - writerConfig.gridType = GridType::xyz; - } - writerConfig.treeName = vm["bf-map-out"].template as(); - writerConfig.fileName = vm["bf-file-out"].template as(); - writerConfig.bField = bField; - std::cout << "setting rBounds" << std::endl; - if (vm.count("bf-rRange") != 0u && vm.count("bf-zRange") != 0u) { - auto rBounds = - vm["bf-rRange"].template as>(); - auto zBounds = - vm["bf-zRange"].template as>(); - - rBounds[0] *= Acts::UnitConstants::mm; - rBounds[1] *= Acts::UnitConstants::mm; - - zBounds[0] *= Acts::UnitConstants::mm; - zBounds[1] *= Acts::UnitConstants::mm; - - writerConfig.rBounds = rBounds; - writerConfig.zBounds = zBounds; - } - writerConfig.rBins = vm["bf-rBins"].template as(); - writerConfig.zBins = vm["bf-ZBins"].template as(); - writerConfig.phiBins = vm["bf-PhiBins"].template as(); - - ActsExamples::RootBFieldWriter::run(writerConfig); -} diff --git a/Examples/Run/MagneticField/CMakeLists.txt b/Examples/Run/MagneticField/CMakeLists.txt deleted file mode 100644 index 3af5e95312d..00000000000 --- a/Examples/Run/MagneticField/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -add_executable( - ActsExampleMagneticField - BFieldExample.cpp) -target_link_libraries( - ActsExampleMagneticField - PRIVATE - ActsCore - ActsExamplesFramework ActsExamplesCommon - ActsExamplesMagneticField ActsExamplesIoRoot - Boost::program_options) - -add_executable( - ActsExampleMagneticFieldAccess - BFieldAccessExample.cpp) -target_link_libraries( - ActsExampleMagneticFieldAccess - PRIVATE - ActsCore - ActsExamplesFramework ActsExamplesCommon - ActsExamplesMagneticField ActsExamplesIoRoot) - -install( - TARGETS ActsExampleMagneticField ActsExampleMagneticFieldAccess - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Examples/Run/MaterialMapping/CMakeLists.txt b/Examples/Run/MaterialMapping/CMakeLists.txt deleted file mode 100644 index 32d3a7ea1ac..00000000000 --- a/Examples/Run/MaterialMapping/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -set(_common_libraries - ActsCore - ActsExamplesFramework - ActsExamplesCommon - ActsExamplesIoRoot - ActsExamplesIoJson - ActsExamplesMagneticField) - -add_executable( - ActsExampleMaterialValidationGeneric - GenericMaterialValidation.cpp) -target_link_libraries( - ActsExampleMaterialValidationGeneric - PRIVATE ${_common_libraries} ActsExamplesPropagation ActsExamplesDetectorGeneric) - -add_executable( - ActsExampleMaterialMappingGeneric - GenericMaterialMapping.cpp) -target_link_libraries( - ActsExampleMaterialMappingGeneric - PRIVATE ${_common_libraries} ActsExamplesMaterialMapping ActsExamplesDetectorGeneric) - -install( - TARGETS - ActsExampleMaterialValidationGeneric - ActsExampleMaterialMappingGeneric - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -add_subdirectory_if(DD4hep ACTS_BUILD_EXAMPLES_DD4HEP) -add_subdirectory_if(TGeo ACTS_BUILD_PLUGIN_TGEO) diff --git a/Examples/Run/MaterialMapping/DD4hep/CMakeLists.txt b/Examples/Run/MaterialMapping/DD4hep/CMakeLists.txt deleted file mode 100644 index faaf1f84f2a..00000000000 --- a/Examples/Run/MaterialMapping/DD4hep/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -add_executable( - ActsExampleMaterialValidationDD4hep - DD4hepMaterialValidation.cpp) -target_link_libraries( - ActsExampleMaterialValidationDD4hep - PRIVATE - ${_common_libraries} - ActsExamplesPropagation ActsExamplesDD4hepDetectorWithOptions) - -add_executable( - ActsExampleMaterialMappingDD4hep - DD4hepMaterialMapping.cpp) -target_link_libraries( - ActsExampleMaterialMappingDD4hep - PRIVATE - ${_common_libraries} - ActsExamplesMaterialMapping ActsExamplesDD4hepDetectorWithOptions) - -install( - TARGETS - ActsExampleMaterialValidationDD4hep - ActsExampleMaterialMappingDD4hep - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Examples/Run/MaterialMapping/DD4hep/DD4hepMaterialMapping.cpp b/Examples/Run/MaterialMapping/DD4hep/DD4hepMaterialMapping.cpp deleted file mode 100644 index 51709d3e118..00000000000 --- a/Examples/Run/MaterialMapping/DD4hep/DD4hepMaterialMapping.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/DD4hepDetectorWithOptions.hpp" -#include "ActsExamples/MaterialMapping/CommonMaterialMapping.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - ActsExamples::DD4hepDetectorWithOptions detector; - // now process it - return runMaterialMapping(argc, argv, detector); -} diff --git a/Examples/Run/MaterialMapping/DD4hep/DD4hepMaterialValidation.cpp b/Examples/Run/MaterialMapping/DD4hep/DD4hepMaterialValidation.cpp deleted file mode 100644 index d54d8bafb37..00000000000 --- a/Examples/Run/MaterialMapping/DD4hep/DD4hepMaterialValidation.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/DD4hepDetectorWithOptions.hpp" -#include "ActsExamples/MaterialMapping/MaterialValidationBase.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - ActsExamples::DD4hepDetectorWithOptions detector; - // now process it - return materialValidationExample(argc, argv, detector); -} diff --git a/Examples/Run/MaterialMapping/GenericMaterialMapping.cpp b/Examples/Run/MaterialMapping/GenericMaterialMapping.cpp deleted file mode 100644 index 13bcabab0b5..00000000000 --- a/Examples/Run/MaterialMapping/GenericMaterialMapping.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018-2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/GenericDetectorWithOptions.hpp" -#include "ActsExamples/MaterialMapping/CommonMaterialMapping.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - ActsExamples::GenericDetectorWithOptions detector; - // now process it - return runMaterialMapping(argc, argv, detector); -} diff --git a/Examples/Run/MaterialMapping/GenericMaterialValidation.cpp b/Examples/Run/MaterialMapping/GenericMaterialValidation.cpp deleted file mode 100644 index a27e149e89f..00000000000 --- a/Examples/Run/MaterialMapping/GenericMaterialValidation.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/GenericDetectorWithOptions.hpp" -#include "ActsExamples/MaterialMapping/MaterialValidationBase.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - ActsExamples::GenericDetectorWithOptions detector; - // now process it - return materialValidationExample(argc, argv, detector); -} diff --git a/Examples/Run/MaterialMapping/TGeo/CMakeLists.txt b/Examples/Run/MaterialMapping/TGeo/CMakeLists.txt deleted file mode 100644 index 5ba598db860..00000000000 --- a/Examples/Run/MaterialMapping/TGeo/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -add_executable( - ActsExampleMaterialValidationTGeo - TGeoMaterialValidation.cpp) -target_link_libraries( - ActsExampleMaterialValidationTGeo - PRIVATE - ${_common_libraries} - ActsExamplesPropagation ActsExamplesDetectorTGeo) - -add_executable( - ActsExampleMaterialMappingTGeo - TGeoMaterialMapping.cpp) -target_link_libraries( - ActsExampleMaterialMappingTGeo - PRIVATE - ${_common_libraries} - ActsExamplesMaterialMapping ActsExamplesDetectorTGeo) - -install( - TARGETS - ActsExampleMaterialValidationTGeo - ActsExampleMaterialMappingTGeo - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Examples/Run/MaterialMapping/TGeo/TGeoMaterialMapping.cpp b/Examples/Run/MaterialMapping/TGeo/TGeoMaterialMapping.cpp deleted file mode 100644 index fb3d03fb8e6..00000000000 --- a/Examples/Run/MaterialMapping/TGeo/TGeoMaterialMapping.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TGeoDetectorWithOptions.hpp" -#include "ActsExamples/MaterialMapping/CommonMaterialMapping.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - ActsExamples::TGeoDetectorWithOptions detector; - // now process it - return runMaterialMapping(argc, argv, detector); -} diff --git a/Examples/Run/MaterialMapping/TGeo/TGeoMaterialValidation.cpp b/Examples/Run/MaterialMapping/TGeo/TGeoMaterialValidation.cpp deleted file mode 100644 index 90538947f8d..00000000000 --- a/Examples/Run/MaterialMapping/TGeo/TGeoMaterialValidation.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TGeoDetectorWithOptions.hpp" -#include "ActsExamples/MaterialMapping/MaterialValidationBase.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - ActsExamples::TGeoDetectorWithOptions detector; - // now process it - return materialValidationExample(argc, argv, detector); -} diff --git a/Examples/Run/Misc/CMakeLists.txt b/Examples/Run/Misc/CMakeLists.txt deleted file mode 100644 index 5fc95bb0d56..00000000000 --- a/Examples/Run/Misc/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -add_executable( - ActsTabulateEnergyLoss - TabulateEnergyLoss.cpp) -target_link_libraries( - ActsTabulateEnergyLoss - PRIVATE ActsCore ActsFatras) - -install( - TARGETS ActsTabulateEnergyLoss - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Examples/Run/Misc/TabulateEnergyLoss.cpp b/Examples/Run/Misc/TabulateEnergyLoss.cpp deleted file mode 100644 index 247ee3e5615..00000000000 --- a/Examples/Run/Misc/TabulateEnergyLoss.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -/// @brief compute energy loss tables using the Acts implementation - -#include "Acts/Definitions/ParticleData.hpp" -#include "Acts/Definitions/PdgParticle.hpp" -#include "Acts/Definitions/Units.hpp" -#include "Acts/Material/Interactions.hpp" -#include "Acts/Material/Material.hpp" -#include "Acts/Material/MaterialSlab.hpp" - -#include -#include -#include -#include - -using namespace Acts::UnitLiterals; - -static constexpr int width = 11; -static constexpr int precision = 3; -static constexpr char separator = ' '; - -static void printHeader(std::ostream& os, const Acts::MaterialSlab& slab, - Acts::PdgParticle pdg, float mass, float charge) { - os << "# material: " << slab << '\n'; - os << "# particle pdg id: " << pdg << '\n'; - os << "# particle mass: " << mass / 1_MeV << "MeV\n"; - os << "# particle charge: " << charge / 1_e << "e\n"; - os << "# particle momentum is given in GeV\n"; - os << "# tabulated energy loss is given in MeV\n"; - os << "# delta is the total energy loss\n"; - os << "# delta_ion is the energy loss due to ionisation and excitation\n"; - os << "# delta_rad is the energy loss due to radiative effects\n"; - os << "# sigma is the width of the energy loss distribution\n"; - // column names - os << std::left; - os << std::setw(width) << "momentum" << separator; - os << std::setw(width) << "beta" << separator; - os << std::setw(width) << "beta_gamma" << separator; - os << std::setw(width) << "delta" << separator; - os << std::setw(width) << "delta_ion" << separator; - os << std::setw(width) << "delta_rad" << separator; - os << std::setw(width) << "sigma" << '\n'; -} - -static void printLine(std::ostream& os, float mass, float momentum, float delta, - float deltaIon, float deltaRad, float sigma) { - const auto energy = std::hypot(mass, momentum); - const auto beta = momentum / energy; - const auto betaGamma = momentum / mass; - os << std::right << std::fixed << std::setprecision(precision); - os << std::setw(width) << momentum / 1_GeV << separator; - os << std::setw(width) << beta << separator; - os << std::setw(width) << betaGamma << separator; - os << std::setw(width) << delta / 1_MeV << separator; - os << std::setw(width) << deltaIon / 1_MeV << separator; - os << std::setw(width) << deltaRad / 1_MeV << separator; - os << std::setw(width) << sigma / 1_MeV << '\n'; -} - -int main(int argc, char const* argv[]) { - // handle input arguments - if (argc != 6) { - std::cerr << "usage: " << argv[0] << " thickness pdg p_min p_max n\n"; - std::cerr << "\n"; - std::cerr << "tabulate energy loss over a configurable momentum range.\n"; - std::cerr << "\n"; - std::cerr << "parameters:\n"; - std::cerr << " thickness: material thickness in mm\n"; - std::cerr << " pdg: PDG particle type identifier\n"; - std::cerr << " p_{min/max}: momentum range in GeV\n"; - std::cerr << " n: number of points in the momentum range\n"; - return EXIT_FAILURE; - } - const auto thickness = atof(argv[1]) * 1_mm; - const auto pdg = static_cast(atoi(argv[2])); - const auto absPdg = Acts::makeAbsolutePdgParticle(pdg); - const auto mass = Acts::findMass(pdg).value_or(0); - const auto charge = Acts::findCharge(pdg).value_or(0); - const auto pmin = atof(argv[3]) * 1_GeV; - const auto pmax = atof(argv[4]) * 1_GeV; - const auto deltap = (pmax - pmin) / atoi(argv[5]); - - // use fixed material (beryllium) for now - // TODO make material configurable by command line - const auto material = Acts::Material::fromMassDensity( - 35.28_cm, 42.10_cm, 9.012, 4, 1.848_g / 1_cm3); - const Acts::MaterialSlab slab(material, thickness); - - printHeader(std::cout, slab, pdg, mass, charge); - // scan momentum - for (auto p = pmin; p < pmax; p += deltap) { - const auto qOverP = charge / p; - - // TODO make mean/mode configurable by command line - const auto delta = - computeEnergyLossMean(slab, absPdg, mass, qOverP, charge); - const auto deltaIon = - Acts::computeEnergyLossBethe(slab, mass, qOverP, charge); - const auto deltaRad = - computeEnergyLossRadiative(slab, absPdg, mass, qOverP, charge); - const auto sigma = - Acts::computeEnergyLossLandauSigma(slab, mass, qOverP, charge); - - printLine(std::cout, mass, p, delta, deltaIon, deltaRad, sigma); - } - - return EXIT_SUCCESS; -} diff --git a/Examples/Run/Propagation/AlignedPropagationExample.cpp b/Examples/Run/Propagation/AlignedPropagationExample.cpp deleted file mode 100644 index 68af2e7498a..00000000000 --- a/Examples/Run/Propagation/AlignedPropagationExample.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/AlignedDetectorWithOptions.hpp" -#include "ActsExamples/Propagation/PropagationExampleBase.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - ActsExamples::AlignedDetectorWithOptions alignedDetector; - - // now process it - return propagationExample(argc, argv, alignedDetector); -} diff --git a/Examples/Run/Propagation/CMakeLists.txt b/Examples/Run/Propagation/CMakeLists.txt deleted file mode 100644 index 1dce92cedd4..00000000000 --- a/Examples/Run/Propagation/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -set(_common_libraries - ActsCore - ActsExamplesFramework - ActsExamplesPropagation - ActsExamplesCommon - ActsExamplesMagneticField - ActsExamplesIoObj - ActsExamplesIoJson - ActsExamplesIoRoot) - -# Empty detector -add_executable( - ActsExamplePropagationEmpty - EmptyDetectorPropagationExample.cpp) -target_link_libraries( - ActsExamplePropagationEmpty - PRIVATE ${_common_libraries}) - -# Generic detector -add_executable( - ActsExamplePropagationGeneric - GenericPropagationExample.cpp) -target_link_libraries( - ActsExamplePropagationGeneric - PRIVATE ${_common_libraries}) - -# Generic detector with alignment -add_executable( - ActsExamplePropagationAligned - AlignedPropagationExample.cpp) -target_link_libraries( - ActsExamplePropagationAligned - PRIVATE ${_common_libraries}) - - -# TGeo detector -add_executable( - ActsExamplePropagationTGeo - TGeoPropagationExample.cpp) -target_link_libraries( - ActsExamplePropagationTGeo - PRIVATE ${_common_libraries}) - -install( - TARGETS - ActsExamplePropagationEmpty - ActsExamplePropagationGeneric - ActsExamplePropagationAligned - ActsExamplePropagationTGeo - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -add_subdirectory_if(DD4hep ACTS_BUILD_EXAMPLES_DD4HEP) diff --git a/Examples/Run/Propagation/DD4hep/CMakeLists.txt b/Examples/Run/Propagation/DD4hep/CMakeLists.txt deleted file mode 100644 index 98369582b75..00000000000 --- a/Examples/Run/Propagation/DD4hep/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -add_executable( - ActsExamplePropagationDD4hep - DD4hepPropagationExample.cpp) -target_link_libraries( - ActsExamplePropagationDD4hep - PRIVATE ${_common_libraries} ActsExamplesDD4hepDetectorWithOptions) - -install( - TARGETS ActsExamplePropagationDD4hep - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Examples/Run/Propagation/DD4hep/DD4hepPropagationExample.cpp b/Examples/Run/Propagation/DD4hep/DD4hepPropagationExample.cpp deleted file mode 100644 index 65e0622da53..00000000000 --- a/Examples/Run/Propagation/DD4hep/DD4hepPropagationExample.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/DD4hepDetectorWithOptions.hpp" -#include "ActsExamples/Propagation/PropagationExampleBase.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - ActsExamples::DD4hepDetectorWithOptions detector; - - // now process it - return propagationExample(argc, argv, detector); -} diff --git a/Examples/Run/Propagation/EmptyDetectorPropagationExample.cpp b/Examples/Run/Propagation/EmptyDetectorPropagationExample.cpp deleted file mode 100644 index 944ba7914f9..00000000000 --- a/Examples/Run/Propagation/EmptyDetectorPropagationExample.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/EmptyDetector.hpp" -#include "ActsExamples/Propagation/PropagationExampleBase.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - EmptyDetector emptyDetector; - - // now process it - return propagationExample(argc, argv, emptyDetector); -} diff --git a/Examples/Run/Propagation/GenericPropagationExample.cpp b/Examples/Run/Propagation/GenericPropagationExample.cpp deleted file mode 100644 index 040db01770b..00000000000 --- a/Examples/Run/Propagation/GenericPropagationExample.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/GenericDetectorWithOptions.hpp" -#include "ActsExamples/Propagation/PropagationExampleBase.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - ActsExamples::GenericDetectorWithOptions detector; - - // now process it - return propagationExample(argc, argv, detector); -} diff --git a/Examples/Run/Propagation/TGeoPropagationExample.cpp b/Examples/Run/Propagation/TGeoPropagationExample.cpp deleted file mode 100644 index aeb2dd64cc3..00000000000 --- a/Examples/Run/Propagation/TGeoPropagationExample.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TGeoDetectorWithOptions.hpp" -#include "ActsExamples/Propagation/PropagationExampleBase.hpp" - -/// @brief main executable -/// -/// @param argc The argument count -/// @param argv The argument list -int main(int argc, char* argv[]) { - // -------------------------------------------------------------------------------- - ActsExamples::TGeoDetectorWithOptions detector; - - // now process it - return propagationExample(argc, argv, detector); -} diff --git a/Examples/Run/Reconstruction/CMakeLists.txt b/Examples/Run/Reconstruction/CMakeLists.txt deleted file mode 100644 index 170bd93607f..00000000000 --- a/Examples/Run/Reconstruction/CMakeLists.txt +++ /dev/null @@ -1,146 +0,0 @@ -# shared code -add_subdirectory(Common) - -# Truth fitting for Generic detector -add_executable( - ActsExampleTruthTracksGeneric - GenericRecTruthTracks.cpp) -target_link_libraries( - ActsExampleTruthTracksGeneric - PRIVATE - ActsExamplesRecTracksCommon - ActsExamplesDetectorGeneric) -# Truth fitting for TGeo detector -add_executable( - ActsExampleTruthTracksTGeo - TGeoRecTruthTracks.cpp) -target_link_libraries( - ActsExampleTruthTracksTGeo - PRIVATE - ActsExamplesRecTracksCommon - ActsExamplesDetectorTGeo) - -# Truth fitting for Telescope detector -add_executable( - ActsExampleTruthTracksTelescope - TelescopeRecTruthTracks.cpp) -target_link_libraries( - ActsExampleTruthTracksTelescope - PRIVATE - ActsExamplesRecTracksCommon - ActsExamplesDetectorTelescope) - -# CKF reco for Generic detector -add_executable( - ActsExampleCKFTracksGeneric - GenericRecCKFTracks.cpp) -target_link_libraries( - ActsExampleCKFTracksGeneric - PRIVATE - ActsExamplesRecTracksCommon - ActsExamplesDetectorGeneric) - -# CKF reco for TGeo detector -add_executable( - ActsExampleCKFTracksTGeo - TGeoRecCKFTracks.cpp) -target_link_libraries( - ActsExampleCKFTracksTGeo - PRIVATE - ActsExamplesRecTracksCommon - ActsExamplesDetectorTGeo) - -# CKF reco for Telescope detector -add_executable( - ActsExampleCKFTracksTelescope - TelescopeRecCKFTracks.cpp) -target_link_libraries( - ActsExampleCKFTracksTelescope - PRIVATE - ActsExamplesRecTracksCommon - ActsExamplesDetectorTelescope) - -# Hough Transform -add_executable( - ActsExampleHough - HoughExample.cpp) -target_link_libraries( - ActsExampleHough - PRIVATE - ActsExamplesRecTracksCommon - ActsExamplesDetectorGeneric -) - -# Seeding for Generic detector -add_executable( - ActsExampleSeedingGeneric - GenericSeedingExample.cpp) -target_link_libraries( - ActsExampleSeedingGeneric - PRIVATE - ActsExamplesRecTracksCommon - ActsExamplesDetectorGeneric -) - -# Seeding for TGeo detector -add_executable( - ActsExampleSeedingTGeo - TGeoSeedingExample.cpp) -target_link_libraries( - ActsExampleSeedingTGeo - PRIVATE - ActsExamplesRecTracksCommon - ActsExamplesDetectorTGeo -) - -# ================================================= -# Convert measurements to spacepoints and write sp to csv -add_executable( - ActsExampleMeasurementsToSPTGeo - MeasurementsToSPTGeo.cpp -) -target_link_libraries( - ActsExampleMeasurementsToSPTGeo - PRIVATE - ActsExamplesFramework - ActsExamplesCommon - ActsExamplesIoCsv - ActsExamplesIoJson - ActsExamplesIoRoot - ActsExamplesDetectorTGeo - ActsExamplesMagneticField - ActsExamplesTrackFinding - ActsExamplesRecTracksCommon -) - -add_executable( - ActsExampleMeasurementsToSPGeneric - MeasurementsToSPGeneric.cpp) -target_link_libraries( - ActsExampleMeasurementsToSPGeneric - PRIVATE - ActsExamplesFramework - ActsExamplesCommon - ActsExamplesIoCsv - ActsExamplesIoJson - ActsExamplesIoRoot - ActsExamplesDetectorGeneric - ActsExamplesMagneticField - ActsExamplesTrackFinding - ActsExamplesRecTracksCommon) -# ================================================= - -install( - TARGETS - ActsExampleTruthTracksGeneric - ActsExampleTruthTracksTGeo - ActsExampleTruthTracksTelescope - ActsExampleCKFTracksGeneric - ActsExampleCKFTracksTGeo - ActsExampleCKFTracksTelescope - ActsExampleSeedingGeneric - ActsExampleHough - ActsExampleSeedingTGeo - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -add_subdirectory_if(DD4hep ACTS_BUILD_EXAMPLES_DD4HEP) diff --git a/Examples/Run/Reconstruction/Common/CMakeLists.txt b/Examples/Run/Reconstruction/Common/CMakeLists.txt deleted file mode 100644 index c9b84df132d..00000000000 --- a/Examples/Run/Reconstruction/Common/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ -add_library( - ActsExamplesRecTracksCommon SHARED - RecTruthTracks.cpp - RecCKFTracks.cpp - SeedingExample.cpp - HoughExample.cpp - MeasurementsToSpacepoints.cpp -) -target_include_directories( - ActsExamplesRecTracksCommon - PUBLIC $) -target_link_libraries( - ActsExamplesRecTracksCommon - PUBLIC - ActsExamplesFramework - ActsExamplesCommon - ActsExamplesUtilities - ActsExamplesMagneticField - ActsExamplesIoPerformance) -if(ACTS_BUILD_PLUGIN_ONNX) - target_compile_definitions( - ActsExamplesRecTracksCommon PUBLIC ACTS_PLUGIN_ONNX) - target_link_libraries( - ActsExamplesRecTracksCommon PUBLIC ActsPluginOnnx) -endif() - -install( - TARGETS ActsExamplesRecTracksCommon - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/Examples/Run/Reconstruction/Common/HoughExample.cpp b/Examples/Run/Reconstruction/Common/HoughExample.cpp deleted file mode 100644 index 18132f57e88..00000000000 --- a/Examples/Run/Reconstruction/Common/HoughExample.cpp +++ /dev/null @@ -1,209 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Definitions/Units.hpp" -#include "Acts/Geometry/TrackingGeometry.hpp" -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" -#include "ActsExamples/Io/Csv/CsvSimHitReader.hpp" -#include "ActsExamples/Io/Performance/SeedingPerformanceWriter.hpp" -#include "ActsExamples/Io/Performance/TrackFinderPerformanceWriter.hpp" -#include "ActsExamples/Io/Root/RootTrackParameterWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/CsvOptionsReader.hpp" -#include "ActsExamples/Options/DigitizationOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Options/SpacePointMakerOptions.hpp" -#include "ActsExamples/Reconstruction/ReconstructionBase.hpp" -#include "ActsExamples/TrackFinding/DefaultHoughFunctions.hpp" -#include "ActsExamples/TrackFinding/HoughTransformSeeder.hpp" -#include "ActsExamples/TrackFinding/SpacePointMaker.hpp" -#include "ActsExamples/TrackFinding/TrackParamsEstimationAlgorithm.hpp" -#include "ActsExamples/TruthTracking/TruthSeedSelector.hpp" -#include "ActsExamples/Utilities/Options.hpp" -#include "ActsExamples/Utilities/Paths.hpp" - -#include - -#include - -using namespace Acts::UnitLiterals; -using namespace ActsExamples; - -int runHoughExample( - int argc, char* argv[], - const std::shared_ptr& detector) { - // Setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addRandomNumbersOptions(desc); - Options::addGeometryOptions(desc); - Options::addMaterialOptions(desc); - Options::addOutputOptions(desc, OutputFormat::DirectoryOnly); - Options::addInputOptions(desc); - Options::addMagneticFieldOptions(desc); - Options::addSpacePointMakerOptions(desc); - Options::addDigitizationOptions(desc); - // Add specific options for this geometry - detector->addOptions(desc); - auto vm = Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - Sequencer sequencer(Options::readSequencerConfig(vm)); - - // Now read the standard options - auto logLevel = Options::readLogLevel(vm); - auto outputDir = ensureWritableDirectory(vm["output-dir"].as()); - - // The geometry, material and decoration - auto geometry = Geometry::build(vm, *detector); - auto tGeometry = geometry.first; - auto contextDecorators = geometry.second; - auto rnd = - std::make_shared(Options::readRandomNumbersConfig(vm)); - - // Add the decorator to the sequencer - for (const auto& cdr : contextDecorators) { - sequencer.addContextDecorator(cdr); - } - - // Setup the magnetic field - Options::setupMagneticFieldServices(vm, sequencer); - auto magneticField = Options::readMagneticField(vm); - - // Read the sim hits - auto simHitReaderCfg = setupSimHitReading(vm, sequencer); - // Read the particles - auto particleReader = setupParticleReading(vm, sequencer); - - // Run the sim hits smearing - auto digiCfg = setupDigitization(vm, sequencer, rnd, tGeometry, - simHitReaderCfg.outputSimHits); - - // Run the particle selection - // The pre-selection will select truth particles satisfying provided criteria - // from all particles read in by particle reader for further processing. It - // has no impact on the truth hits read-in by the cluster reader. - TruthSeedSelector::Config particleSelectorCfg; - particleSelectorCfg.inputParticles = particleReader.outputParticles; - particleSelectorCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - particleSelectorCfg.outputParticles = "particles_selected"; - particleSelectorCfg.ptMin = 1_GeV; - particleSelectorCfg.etaMax = 2.5; - particleSelectorCfg.etaMin = -2.5; - particleSelectorCfg.nHitsMin = 9; - sequencer.addAlgorithm( - std::make_shared(particleSelectorCfg, logLevel)); - - // The selected particles - const auto& inputParticles = particleSelectorCfg.outputParticles; - - // Create space points - SpacePointMaker::Config spCfg = Options::readSpacePointMakerConfig(vm); - spCfg.inputSourceLinks = digiCfg.outputSourceLinks; - spCfg.inputMeasurements = digiCfg.outputMeasurements; - spCfg.outputSpacePoints = "spacepoints"; - spCfg.trackingGeometry = tGeometry; - sequencer.addAlgorithm(std::make_shared(spCfg, logLevel)); - - // Hough algorithm - ActsExamples::HoughTransformSeeder::Config houghCfg; - houghCfg.inputSpacePoints = { - spCfg.outputSpacePoints, - }; - houghCfg.outputSeeds = "seeds"; - houghCfg.outputProtoTracks = "prototracks"; - - houghCfg.inputMeasurements = digiCfg.outputMeasurements; - houghCfg.trackingGeometry = tGeometry; - houghCfg.inputSourceLinks = digiCfg.outputSourceLinks; - houghCfg.geometrySelection = {Acts::GeometryIdentifier().setVolume(0)}; - - houghCfg.subRegions = {0, 1}; - - houghCfg.xMin = -0.05; // minphi - houghCfg.xMax = 0.25; // maxphi - houghCfg.yMin = -1.25; // min q/pt, -1/0.8 GeV - houghCfg.yMax = 1.25; // max q/pt, +1/0.8 GeV - - houghCfg.houghHistSize_x = 216; - houghCfg.houghHistSize_y = 216; // i.e. number of bins in q/pT - - houghCfg.hitExtend_x = { - 2, 1, 0, 0, 0, - 0, 0, 0, 0, 0}; // Hit lines will fill extra bins in x by this amount on - // each side, size == nLayers - houghCfg.nLayers = 10; - - houghCfg.threshold = {9}; // Minimum point value post-convolution to accept - // as a road (inclusive) - - houghCfg.localMaxWindowSize = - 0; // Only create roads from a local maximum, requires traceHits - houghCfg.kA = 0.0003; // Assume B = 2T constant. - - houghCfg.fieldCorrector - .connect<&ActsExamples::DefaultHoughFunctions::fieldCorrectionDefault>(); - houghCfg.layerIDFinder - .connect<&ActsExamples::DefaultHoughFunctions::findLayerIDDefault>(); - houghCfg.sliceTester - .connect<&ActsExamples::DefaultHoughFunctions::inSliceDefault>(); - - sequencer.addAlgorithm( - std::make_shared(houghCfg, logLevel)); - - // Algorithm estimating track parameter from seed - TrackParamsEstimationAlgorithm::Config paramsEstimationCfg; - paramsEstimationCfg.inputSeeds = houghCfg.outputSeeds; - paramsEstimationCfg.outputTrackParameters = "estimatedparameters"; - paramsEstimationCfg.trackingGeometry = tGeometry; - paramsEstimationCfg.magneticField = magneticField; - sequencer.addAlgorithm(std::make_shared( - paramsEstimationCfg, logLevel)); /// Object 'prototracks' does not exists - - // Seeding performance Writers - TrackFinderPerformanceWriter::Config tfPerfCfg; - tfPerfCfg.inputProtoTracks = houghCfg.outputProtoTracks; - tfPerfCfg.inputParticles = inputParticles; - tfPerfCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - tfPerfCfg.filePath = outputDir + "/performance_seeding_trees.root"; - sequencer.addWriter( - std::make_shared(tfPerfCfg, logLevel)); - - SeedingPerformanceWriter::Config seedPerfCfg; - seedPerfCfg.inputSeeds = houghCfg.outputSeeds; - seedPerfCfg.inputParticles = inputParticles; - seedPerfCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - seedPerfCfg.filePath = outputDir + "/performance_seeding.root"; - sequencer.addWriter( - std::make_shared(seedPerfCfg, logLevel)); - - // The track parameters estimation writer - RootTrackParameterWriter::Config trackParamsWriterCfg; - trackParamsWriterCfg.inputTrackParameters = - paramsEstimationCfg.outputTrackParameters; - trackParamsWriterCfg.inputProtoTracks = houghCfg.outputProtoTracks; - trackParamsWriterCfg.inputParticles = particleReader.outputParticles; - trackParamsWriterCfg.inputSimHits = simHitReaderCfg.outputSimHits; - trackParamsWriterCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - trackParamsWriterCfg.inputMeasurementSimHitsMap = - digiCfg.outputMeasurementSimHitsMap; - trackParamsWriterCfg.filePath = outputDir + "/estimatedparams.root"; - trackParamsWriterCfg.treeName = "estimatedparams"; - sequencer.addWriter(std::make_shared( - trackParamsWriterCfg, logLevel)); - - return sequencer.run(); -} diff --git a/Examples/Run/Reconstruction/Common/HoughExample.hpp b/Examples/Run/Reconstruction/Common/HoughExample.hpp deleted file mode 100644 index 94ae5c08291..00000000000 --- a/Examples/Run/Reconstruction/Common/HoughExample.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once -#include "Acts/Geometry/GeometryIdentifier.hpp" - -#include - -namespace ActsExamples { -class IBaseDetector; -} - -/// The Propagation example -/// -/// -/// @param argc the number of arguments of the call -/// @param argv the argument list -/// @param detector The detector descriptor instance -int runHoughExample( - int argc, char* argv[], - const std::shared_ptr& detector); diff --git a/Examples/Run/Reconstruction/Common/MLAmbiguityResolutionDemo.onnx b/Examples/Run/Reconstruction/Common/MLAmbiguityResolutionDemo.onnx deleted file mode 100644 index b9f6ca91836..00000000000 --- a/Examples/Run/Reconstruction/Common/MLAmbiguityResolutionDemo.onnx +++ /dev/null @@ -1,27 +0,0 @@ -tf2onnx1.6.3:÷ -½ - dense_input:0 -@StatefulPartitionedCall/sequential/dense/MatMul/ReadVariableOp:01StatefulPartitionedCall/sequential/dense/MatMul:0/StatefulPartitionedCall/sequential/dense/MatMul"MatMul -á -1StatefulPartitionedCall/sequential/dense/MatMul:0 -AStatefulPartitionedCall/sequential/dense/BiasAdd/ReadVariableOp:02StatefulPartitionedCall/sequential/dense/BiasAdd:00StatefulPartitionedCall/sequential/dense/BiasAdd"Add -š -2StatefulPartitionedCall/sequential/dense/BiasAdd:0/StatefulPartitionedCall/sequential/dense/Relu:0-StatefulPartitionedCall/sequential/dense/Relu"Relu -å -/StatefulPartitionedCall/sequential/dense/Relu:0 -BStatefulPartitionedCall/sequential/dense_1/MatMul/ReadVariableOp:03StatefulPartitionedCall/sequential/dense_1/MatMul:01StatefulPartitionedCall/sequential/dense_1/MatMul"MatMul -é -3StatefulPartitionedCall/sequential/dense_1/MatMul:0 -CStatefulPartitionedCall/sequential/dense_1/BiasAdd/ReadVariableOp:04StatefulPartitionedCall/sequential/dense_1/BiasAdd:02StatefulPartitionedCall/sequential/dense_1/BiasAdd"Add - -4StatefulPartitionedCall/sequential/dense_1/BiasAdd:0 -Identity:02StatefulPartitionedCall/sequential/dense_1/Sigmoid"Sigmoidtf2onnx*XBBStatefulPartitionedCall/sequential/dense_1/MatMul/ReadVariableOp:0J “¹\¿ßÊ?*R6?*OBCStatefulPartitionedCall/sequential/dense_1/BiasAdd/ReadVariableOp:0JI=À*nB@StatefulPartitionedCall/sequential/dense/MatMul/ReadVariableOp:0J$\ ½³5`½GM½½Ñ{¿K׋?cW?²Ϳ¬Å˜?Ìi?*UBAStatefulPartitionedCall/sequential/dense/BiasAdd/ReadVariableOp:0J 8Ü.@¼5¿ R7¿Rconverted from ./v2_finalZ% - dense_input:0 - -unk__6 -b" - -Identity:0 - -unk__7 -B \ No newline at end of file diff --git a/Examples/Run/Reconstruction/Common/MeasurementsToSpacepoints.cpp b/Examples/Run/Reconstruction/Common/MeasurementsToSpacepoints.cpp deleted file mode 100644 index 844fee208ac..00000000000 --- a/Examples/Run/Reconstruction/Common/MeasurementsToSpacepoints.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Definitions/Units.hpp" -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Framework/RandomNumbers.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" // for evaluating performance -#include "ActsExamples/Io/Csv/CsvSimHitReader.hpp" -#include "ActsExamples/Io/Csv/CsvSpacepointWriter.hpp" -#include "ActsExamples/Io/Json/JsonDigitizationConfig.hpp" // to read digi config -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/CsvOptionsReader.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Reconstruction/ReconstructionBase.hpp" -#include "ActsExamples/TrackFinding/SpacePointMaker.hpp" -#include "ActsExamples/TruthTracking/TruthSeedSelector.hpp" // for evaluating performance -#include "ActsExamples/Utilities/Options.hpp" -#include "ActsExamples/Utilities/Paths.hpp" -#include - -#include - -#include - -using namespace Acts::UnitLiterals; -using namespace ActsExamples; - -static std::unique_ptr m_logger; -const Acts::Logger& logger() { - return *m_logger; -} -int runMeasurementsToSP( - int argc, char* argv[], - const std::shared_ptr& detector) { - // Setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addRandomNumbersOptions(desc); - Options::addGeometryOptions(desc); - Options::addMaterialOptions(desc); - Options::addOutputOptions(desc, OutputFormat::Csv | OutputFormat::Root); - Options::addInputOptions(desc); - Options::addMagneticFieldOptions(desc); - - // Add specific options for this geometry - // make it as an argument. - // auto detector = std::make_shared(); - detector->addOptions(desc); - - auto vm = Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - Sequencer sequencer(Options::readSequencerConfig(vm)); - - // Now read the standard options - auto logLevel = Options::readLogLevel(vm); - auto outputDir = ensureWritableDirectory(vm["output-dir"].as()); - - m_logger = Acts::getDefaultLogger("MeasurementsToSP", logLevel); - ACTS_INFO("after parsing input options"); - - // The geometry, material and decoration - // build the detector - auto geometry = Geometry::build(vm, *detector); - auto tGeometry = geometry.first; - auto contextDecorators = geometry.second; - auto randomNumbers = - std::make_shared(Options::readRandomNumbersConfig(vm)); - - ACTS_INFO("after building geometry"); - - // Add the decorator to the sequencer - for (const auto& cdr : contextDecorators) { - sequencer.addContextDecorator(cdr); - } - - ACTS_INFO("after adding context decorator"); - - // Setup the magnetic field - Options::setupMagneticFieldServices(vm, sequencer); - auto magneticField = Options::readMagneticField(vm); - - ACTS_INFO("after setting magnetic field"); - - // Read the inputs - auto simHitReaderCfg = setupSimHitReading(vm, sequencer); - auto particleReader = setupParticleReading(vm, sequencer); - auto measurementsReader = setupMeasurementReading(vm, sequencer); - - ACTS_INFO("after reading SimHits and particles"); - - // Now measurements --> SpacePoints - SpacePointMaker::Config spCfg; - spCfg.inputSourceLinks = measurementsReader.outputSourceLinks; - spCfg.inputMeasurements = measurementsReader.outputMeasurements; - spCfg.outputSpacePoints = "spacepoints"; - spCfg.trackingGeometry = tGeometry; - spCfg.geometrySelection = {Acts::GeometryIdentifier().setVolume(0)}; - sequencer.addAlgorithm(std::make_shared(spCfg, logLevel)); - - // // write out spacepoints... - CsvSpacepointWriter::Config spWriterCfg; - spWriterCfg.inputSpacepoints = spCfg.outputSpacePoints; - spWriterCfg.outputDir = outputDir; - sequencer.addWriter( - std::make_shared(spWriterCfg, logLevel)); - - return sequencer.run(); -} diff --git a/Examples/Run/Reconstruction/Common/MeasurementsToSpacepoints.hpp b/Examples/Run/Reconstruction/Common/MeasurementsToSpacepoints.hpp deleted file mode 100644 index 352f58b3b83..00000000000 --- a/Examples/Run/Reconstruction/Common/MeasurementsToSpacepoints.hpp +++ /dev/null @@ -1,18 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include -namespace ActsExamples { -class IBaseDetector; -} - -int runMeasurementsToSP( - int argc, char* argv[], - const std::shared_ptr& detector); diff --git a/Examples/Run/Reconstruction/Common/RecCKFTracks.cpp b/Examples/Run/Reconstruction/Common/RecCKFTracks.cpp deleted file mode 100644 index 9948c47c85c..00000000000 --- a/Examples/Run/Reconstruction/Common/RecCKFTracks.cpp +++ /dev/null @@ -1,344 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Utilities/Logger.hpp" -#include "ActsExamples/Detector/IBaseDetector.hpp" -#ifdef ACTS_PLUGIN_ONNX -#include "Acts/Plugins/Onnx/MLTrackClassifier.hpp" -#endif -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Framework/WhiteBoard.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" -#include "ActsExamples/Io/Csv/CsvSimHitReader.hpp" -#include "ActsExamples/Io/Csv/CsvTrackWriter.hpp" -#include "ActsExamples/Io/Performance/CKFPerformanceWriter.hpp" -#include "ActsExamples/Io/Performance/TrackFinderPerformanceWriter.hpp" -#include "ActsExamples/Io/Root/RootTrackStatesWriter.hpp" -#include "ActsExamples/Io/Root/RootTrackSummaryWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/CsvOptionsReader.hpp" -#include "ActsExamples/Options/CsvOptionsWriter.hpp" -#include "ActsExamples/Options/DigitizationOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Options/SpacePointMakerOptions.hpp" -#include "ActsExamples/Options/TrackFindingOptions.hpp" -#include "ActsExamples/Options/TrackFittingOptions.hpp" -#include "ActsExamples/Reconstruction/ReconstructionBase.hpp" -#include "ActsExamples/TrackFinding/SeedingAlgorithm.hpp" -#include "ActsExamples/TrackFinding/SpacePointMaker.hpp" -#include "ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp" -#include "ActsExamples/TrackFinding/TrackParamsEstimationAlgorithm.hpp" -#include "ActsExamples/TruthTracking/TruthSeedSelector.hpp" -#include "ActsExamples/TruthTracking/TruthTrackFinder.hpp" -#include "ActsExamples/Utilities/Options.hpp" -#include "ActsExamples/Utilities/Paths.hpp" -#include "ActsExamples/Utilities/SeedsToPrototracks.hpp" -#include - -#include -#include - -using namespace Acts::UnitLiterals; -using namespace ActsExamples; -using namespace std::filesystem; -using namespace std::placeholders; - -void addRecCKFOptions(ActsExamples::Options::Description& desc) { - using namespace ActsExamples; - using boost::program_options::bool_switch; - - auto opt = desc.add_options(); - opt("ckf-truth-smeared-seeds", bool_switch(), - "Use track parameters smeared from truth particles for steering CKF"); - opt("ckf-truth-estimated-seeds", bool_switch(), - "Use track parameters estimated from truth tracks for steering CKF"); -} - -int runRecCKFTracks( - int argc, char* argv[], - const std::shared_ptr& detector) { - // setup and parse options - auto desc = ActsExamples::Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addRandomNumbersOptions(desc); - Options::addGeometryOptions(desc); - Options::addMaterialOptions(desc); - Options::addInputOptions(desc); - Options::addOutputOptions(desc, - OutputFormat::Csv | OutputFormat::DirectoryOnly); - detector->addOptions(desc); - Options::addMagneticFieldOptions(desc); - Options::addFittingOptions(desc); - Options::addTrackFindingOptions(desc); - addRecCKFOptions(desc); - Options::addDigitizationOptions(desc); - Options::addParticleSmearingOptions(desc); - Options::addSpacePointMakerOptions(desc); - Options::addCsvWriterOptions(desc); - - auto vm = Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - Sequencer sequencer(Options::readSequencerConfig(vm)); - - // Read some standard options - auto logLevel = Options::readLogLevel(vm); - auto inputDir = vm["input-dir"].as(); - auto outputDir = ensureWritableDirectory(vm["output-dir"].as()); - auto rnd = std::make_shared( - Options::readRandomNumbersConfig(vm)); - bool truthSmearedSeeded = vm["ckf-truth-smeared-seeds"].template as(); - bool truthEstimatedSeeded = - vm["ckf-truth-estimated-seeds"].template as(); - - // Setup detector geometry - auto geometry = Geometry::build(vm, *detector); - auto trackingGeometry = geometry.first; - // Add context decorators - for (const auto& cdr : geometry.second) { - sequencer.addContextDecorator(cdr); - } - // Set up the magnetic field - auto magneticField = Options::readMagneticField(vm); - - // Read the sim hits - auto simHitReaderCfg = setupSimHitReading(vm, sequencer); - // Read the particles - auto particleReader = setupParticleReading(vm, sequencer); - - // Run the sim hits smearing - auto digiCfg = setupDigitization(vm, sequencer, rnd, trackingGeometry, - simHitReaderCfg.outputSimHits); - - // Run the particle selection - // The pre-selection will select truth particles satisfying provided criteria - // from all particles read in by particle reader for further processing. It - // has no impact on the truth hits read-in by the cluster reader. - TruthSeedSelector::Config particleSelectorCfg; - particleSelectorCfg.inputParticles = particleReader.outputParticles; - particleSelectorCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - particleSelectorCfg.outputParticles = "particles_selected"; - particleSelectorCfg.ptMin = 500_MeV; - particleSelectorCfg.nHitsMin = 9; - sequencer.addAlgorithm( - std::make_shared(particleSelectorCfg, logLevel)); - - // The selected particles - const auto& inputParticles = particleSelectorCfg.outputParticles; - - // Create starting parameters from either particle smearing or combined seed - // finding and track parameters estimation - std::string outputTrackParameters; - if (truthSmearedSeeded) { - // Run the particle smearing - auto particleSmearingCfg = - setupParticleSmearing(vm, sequencer, rnd, inputParticles); - outputTrackParameters = particleSmearingCfg.outputTrackParameters; - } else { - // Create space points - SpacePointMaker::Config spCfg = Options::readSpacePointMakerConfig(vm); - spCfg.inputSourceLinks = digiCfg.outputSourceLinks; - spCfg.inputMeasurements = digiCfg.outputMeasurements; - spCfg.outputSpacePoints = "spacepoints"; - spCfg.trackingGeometry = trackingGeometry; - sequencer.addAlgorithm(std::make_shared(spCfg, logLevel)); - - // Create seeds (i.e. proto tracks) using either truth track finding or seed - // finding algorithm - std::string inputProtoTracks = ""; - std::string inputSeeds = ""; - if (truthEstimatedSeeded) { - // Truth track finding algorithm - TruthTrackFinder::Config trackFinderCfg; - trackFinderCfg.inputParticles = inputParticles; - trackFinderCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - trackFinderCfg.outputProtoTracks = "prototracks"; - sequencer.addAlgorithm( - std::make_shared(trackFinderCfg, logLevel)); - inputProtoTracks = trackFinderCfg.outputProtoTracks; - } else { - // Seeding algorithm - SeedingAlgorithm::Config seedingCfg; - seedingCfg.inputSpacePoints = { - spCfg.outputSpacePoints, - }; - seedingCfg.outputSeeds = "seeds"; - - seedingCfg.gridConfig.rMax = 200._mm; - seedingCfg.seedFinderConfig.rMax = seedingCfg.gridConfig.rMax; - - seedingCfg.seedFilterConfig.deltaRMin = 1_mm; - seedingCfg.seedFinderConfig.deltaRMin = - seedingCfg.seedFilterConfig.deltaRMin; - - seedingCfg.gridConfig.deltaRMax = 60._mm; - seedingCfg.seedFinderConfig.deltaRMax = seedingCfg.gridConfig.deltaRMax; - - seedingCfg.seedFinderConfig.collisionRegionMin = -250_mm; - seedingCfg.seedFinderConfig.collisionRegionMax = 250._mm; - - seedingCfg.gridConfig.zMin = -2000._mm; - seedingCfg.gridConfig.zMax = 2000._mm; - seedingCfg.seedFinderConfig.zMin = seedingCfg.gridConfig.zMin; - seedingCfg.seedFinderConfig.zMax = seedingCfg.gridConfig.zMax; - - seedingCfg.seedFilterConfig.maxSeedsPerSpM = 1; - seedingCfg.seedFinderConfig.maxSeedsPerSpM = - seedingCfg.seedFilterConfig.maxSeedsPerSpM; - - seedingCfg.gridConfig.cotThetaMax = 7.40627; // 2.7 eta - seedingCfg.seedFinderConfig.cotThetaMax = - seedingCfg.gridConfig.cotThetaMax; - - seedingCfg.seedFinderConfig.sigmaScattering = 50; - seedingCfg.seedFinderConfig.radLengthPerSeed = 0.1; - - seedingCfg.gridConfig.minPt = 500._MeV; - seedingCfg.seedFinderConfig.minPt = seedingCfg.gridConfig.minPt; - - seedingCfg.gridOptions.bFieldInZ = 2_T; - - seedingCfg.seedFinderOptions.bFieldInZ = seedingCfg.gridOptions.bFieldInZ; - seedingCfg.seedFinderOptions.beamPos = {0_mm, 0_mm}; - - seedingCfg.seedFinderConfig.impactMax = 3._mm; - - sequencer.addAlgorithm( - std::make_shared(seedingCfg, logLevel)); - - SeedsToPrototracks::Config seedsToPrototrackCfg; - seedsToPrototrackCfg.inputSeeds = seedingCfg.outputSeeds; - seedsToPrototrackCfg.outputProtoTracks = "prototracks"; - sequencer.addAlgorithm( - std::make_shared(seedsToPrototrackCfg, logLevel)); - - inputProtoTracks = seedsToPrototrackCfg.outputProtoTracks; - inputSeeds = seedingCfg.outputSeeds; - } - - // write track finding/seeding performance - TrackFinderPerformanceWriter::Config tfPerfCfg; - tfPerfCfg.inputProtoTracks = inputProtoTracks; - // using selected particles - tfPerfCfg.inputParticles = inputParticles; - tfPerfCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - tfPerfCfg.filePath = outputDir + "/performance_seeding_trees.root"; - sequencer.addWriter( - std::make_shared(tfPerfCfg, logLevel)); - - // Algorithm estimating track parameter from seed - TrackParamsEstimationAlgorithm::Config paramsEstimationCfg; - paramsEstimationCfg.inputSeeds = inputSeeds; - paramsEstimationCfg.outputTrackParameters = "estimatedparameters"; - paramsEstimationCfg.trackingGeometry = trackingGeometry; - paramsEstimationCfg.magneticField = magneticField; - paramsEstimationCfg.bFieldMin = 0.1_T; - paramsEstimationCfg.initialSigmas = {25._um, 100._um, 0.02_degree, - 0.02_degree, 0.1 / 1._GeV, 1400._s}; - paramsEstimationCfg.initialVarInflation = - vm["ckf-initial-variance-inflation"].template as>(); - - sequencer.addAlgorithm(std::make_shared( - paramsEstimationCfg, logLevel)); - - outputTrackParameters = paramsEstimationCfg.outputTrackParameters; - } - - // Set up the track finding algorithm with CKF - // It takes all the source links created from truth hit smearing, seeds from - // truth particle smearing and source link selection config - auto trackFindingCfg = Options::readTrackFindingConfig(vm); - trackFindingCfg.inputMeasurements = digiCfg.outputMeasurements; - trackFindingCfg.inputSourceLinks = digiCfg.outputSourceLinks; - trackFindingCfg.inputInitialTrackParameters = outputTrackParameters; - trackFindingCfg.outputTracks = "tracks"; - trackFindingCfg.computeSharedHits = true; - trackFindingCfg.findTracks = TrackFindingAlgorithm::makeTrackFinderFunction( - trackingGeometry, magneticField, - *Acts::getDefaultLogger("TrackFinder", logLevel)); - sequencer.addAlgorithm( - std::make_shared(trackFindingCfg, logLevel)); - - // write track states from CKF - RootTrackStatesWriter::Config trackStatesWriter; - trackStatesWriter.inputTracks = trackFindingCfg.outputTracks; - // @note The full particles collection is used here to avoid lots of warnings - // since the unselected CKF track might have a majority particle not in the - // filtered particle collection. This could be avoided when a separate track - // selection algorithm is used. - trackStatesWriter.inputParticles = particleReader.outputParticles; - trackStatesWriter.inputSimHits = simHitReaderCfg.outputSimHits; - trackStatesWriter.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - trackStatesWriter.inputMeasurementSimHitsMap = - digiCfg.outputMeasurementSimHitsMap; - trackStatesWriter.filePath = outputDir + "/trackstates_ckf.root"; - trackStatesWriter.treeName = "trackstates"; - sequencer.addWriter( - std::make_shared(trackStatesWriter, logLevel)); - - // write track summary from CKF - RootTrackSummaryWriter::Config trackSummaryWriter; - trackSummaryWriter.inputTracks = trackFindingCfg.outputTracks; - // @note The full particles collection is used here to avoid lots of warnings - // since the unselected CKF track might have a majority particle not in the - // filtered particle collection. This could be avoided when a separate track - // selection algorithm is used. - trackSummaryWriter.inputParticles = particleReader.outputParticles; - trackSummaryWriter.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - trackSummaryWriter.filePath = outputDir + "/tracksummary_ckf.root"; - trackSummaryWriter.treeName = "tracksummary"; - sequencer.addWriter( - std::make_shared(trackSummaryWriter, logLevel)); - - if (vm["output-csv"].template as()) { - // Write the CKF track as Csv - CsvTrackWriter::Config trackWriterCsvConfig; - trackWriterCsvConfig.inputTracks = trackFindingCfg.outputTracks; - trackWriterCsvConfig.outputDir = outputDir; - trackWriterCsvConfig.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - sequencer.addWriter( - std::make_shared(trackWriterCsvConfig, logLevel)); - } - - // Write CKF performance data - CKFPerformanceWriter::Config perfWriterCfg; - perfWriterCfg.inputParticles = inputParticles; - perfWriterCfg.inputTracks = trackFindingCfg.outputTracks; - perfWriterCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - perfWriterCfg.filePath = outputDir + "/performance_ckf.root"; -#ifdef ACTS_PLUGIN_ONNX - // Onnx plugin related options - // Path to default demo ML model for track classification - path currentFilePath(__FILE__); - path parentPath = currentFilePath.parent_path(); - path demoModelPath = - canonical(parentPath / "MLAmbiguityResolutionDemo.onnx").native(); - // Threshold probability for neural network to classify track as duplicate - double decisionThreshProb = 0.5; - // Initialize OnnxRuntime plugin - Ort::Env env(ORT_LOGGING_LEVEL_WARNING, "MLTrackClassifier"); - Acts::MLTrackClassifier neuralNetworkClassifier(env, demoModelPath.c_str()); - perfWriterCfg.duplicatedPredictor = - std::bind(&Acts::MLTrackClassifier::isDuplicate, &neuralNetworkClassifier, - std::placeholders::_1, decisionThreshProb); -#endif - sequencer.addWriter( - std::make_shared(perfWriterCfg, logLevel)); - - return sequencer.run(); -} diff --git a/Examples/Run/Reconstruction/Common/RecCKFTracks.hpp b/Examples/Run/Reconstruction/Common/RecCKFTracks.hpp deleted file mode 100644 index 652aca8b829..00000000000 --- a/Examples/Run/Reconstruction/Common/RecCKFTracks.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "ActsExamples/Utilities/OptionsFwd.hpp" - -#include - -namespace ActsExamples { -class IBaseDetector; -} - -/// The options for running CKF reco -/// -/// @param desc The options description to add options to -void addRecCKFOptions(ActsExamples::Options::Description& desc); - -/// Main function for running CKF reco with a specific detector. -/// -/// @param argc number of command line arguments -/// @param argv command line arguments -/// @param detector is the detector to be used -int runRecCKFTracks( - int argc, char* argv[], - const std::shared_ptr& detector); diff --git a/Examples/Run/Reconstruction/Common/RecTruthTracks.cpp b/Examples/Run/Reconstruction/Common/RecTruthTracks.cpp deleted file mode 100644 index d42819e90d1..00000000000 --- a/Examples/Run/Reconstruction/Common/RecTruthTracks.cpp +++ /dev/null @@ -1,194 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Definitions/Units.hpp" -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Framework/WhiteBoard.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" -#include "ActsExamples/Io/Csv/CsvSimHitReader.hpp" -#include "ActsExamples/Io/Performance/TrackFinderPerformanceWriter.hpp" -#include "ActsExamples/Io/Performance/TrackFitterPerformanceWriter.hpp" -#include "ActsExamples/Io/Root/RootTrackStatesWriter.hpp" -#include "ActsExamples/Io/Root/RootTrackSummaryWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/CsvOptionsReader.hpp" -#include "ActsExamples/Options/DigitizationOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Options/TrackFittingOptions.hpp" -#include "ActsExamples/Options/TruthSeedSelectorOptions.hpp" -#include "ActsExamples/Reconstruction/ReconstructionBase.hpp" -#include "ActsExamples/TrackFitting/SurfaceSortingAlgorithm.hpp" -#include "ActsExamples/TrackFitting/TrackFitterFunction.hpp" -#include "ActsExamples/TrackFitting/TrackFittingAlgorithm.hpp" -#include "ActsExamples/TruthTracking/TruthSeedSelector.hpp" -#include "ActsExamples/TruthTracking/TruthTrackFinder.hpp" -#include "ActsExamples/Utilities/Options.hpp" -#include "ActsExamples/Utilities/Paths.hpp" - -#include - -using namespace Acts::UnitLiterals; -using namespace ActsExamples; - -int runRecTruthTracks( - int argc, char* argv[], - const std::shared_ptr& detector) { - using boost::program_options::value; - - // setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addRandomNumbersOptions(desc); - Options::addGeometryOptions(desc); - Options::addMaterialOptions(desc); - Options::addInputOptions(desc); - Options::addOutputOptions(desc, OutputFormat::DirectoryOnly); - detector->addOptions(desc); - Options::addMagneticFieldOptions(desc); - Options::addFittingOptions(desc); - Options::addDigitizationOptions(desc); - Options::addParticleSmearingOptions(desc); - Options::addTruthSeedSelectorOptions(desc); - - auto vm = Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - - Sequencer sequencer(Options::readSequencerConfig(vm)); - - // Read some standard options - auto logLevel = Options::readLogLevel(vm); - auto outputDir = ensureWritableDirectory(vm["output-dir"].as()); - auto rnd = std::make_shared( - Options::readRandomNumbersConfig(vm)); - - if (vm["fit-directed-navigation"].as()) { - throw std::runtime_error( - "Directed navigation not supported anymore in the examples binaries." - "Please refer to the RefittingAlgorithm in the python bindings."); - } - - // Setup detector geometry - auto geometry = Geometry::build(vm, *detector); - auto trackingGeometry = geometry.first; - // Add context decorators - for (const auto& cdr : geometry.second) { - sequencer.addContextDecorator(cdr); - } - // Setup the magnetic field - auto magneticField = Options::readMagneticField(vm); - - // Read the sim hits - auto simHitReaderCfg = setupSimHitReading(vm, sequencer); - // Read the particles - auto particleReader = setupParticleReading(vm, sequencer); - - // Run the sim hits smearing - auto digiCfg = setupDigitization(vm, sequencer, rnd, trackingGeometry, - simHitReaderCfg.outputSimHits); - // Run the particle selection - // The pre-selection will select truth particles satisfying provided criteria - // from all particles read in by particle reader for further processing. It - // has no impact on the truth hits read-in by the cluster reader. - TruthSeedSelector::Config particleSelectorCfg = - Options::readTruthSeedSelectorConfig(vm); - particleSelectorCfg.inputParticles = particleReader.outputParticles; - particleSelectorCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - particleSelectorCfg.outputParticles = "particles_selected"; - particleSelectorCfg.nHitsMin = 9; - particleSelectorCfg.ptMin = 500._MeV; - sequencer.addAlgorithm( - std::make_shared(particleSelectorCfg, logLevel)); - - // The selected particles - const auto& inputParticles = particleSelectorCfg.outputParticles; - - // Run the particle smearing - auto particleSmearingCfg = - setupParticleSmearing(vm, sequencer, rnd, inputParticles); - - // The fitter needs the measurements (proto tracks) and initial - // track states (proto states). The elements in both collections - // must match and must be created from the same input particles. - // Create truth tracks - TruthTrackFinder::Config trackFinderCfg; - trackFinderCfg.inputParticles = inputParticles; - trackFinderCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - trackFinderCfg.outputProtoTracks = "prototracks"; - sequencer.addAlgorithm( - std::make_shared(trackFinderCfg, logLevel)); - - // setup the fitter - const double reverseFilteringMomThreshold = 0.0; - TrackFittingAlgorithm::Config fitter; - fitter.inputMeasurements = digiCfg.outputMeasurements; - fitter.inputSourceLinks = digiCfg.outputSourceLinks; - fitter.inputProtoTracks = trackFinderCfg.outputProtoTracks; - fitter.inputInitialTrackParameters = - particleSmearingCfg.outputTrackParameters; - fitter.outputTracks = "tracks"; - fitter.pickTrack = vm["fit-pick-track"].as(); - fitter.fit = makeKalmanFitterFunction( - trackingGeometry, magneticField, - vm["fit-multiple-scattering-correction"].as(), - vm["fit-energy-loss-correction"].as(), reverseFilteringMomThreshold, - Acts::FreeToBoundCorrection( - vm["fit-ftob-nonlinear-correction"].as())); - sequencer.addAlgorithm( - std::make_shared(fitter, logLevel)); - - // write track states from fitting - RootTrackStatesWriter::Config trackStatesWriter; - trackStatesWriter.inputTracks = fitter.outputTracks; - trackStatesWriter.inputParticles = inputParticles; - trackStatesWriter.inputSimHits = simHitReaderCfg.outputSimHits; - trackStatesWriter.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - trackStatesWriter.inputMeasurementSimHitsMap = - digiCfg.outputMeasurementSimHitsMap; - trackStatesWriter.filePath = outputDir + "/trackstates_fitter.root"; - sequencer.addWriter( - std::make_shared(trackStatesWriter, logLevel)); - - // write track summary from CKF - RootTrackSummaryWriter::Config trackSummaryWriter; - trackSummaryWriter.inputTracks = fitter.outputTracks; - trackSummaryWriter.inputParticles = inputParticles; - trackSummaryWriter.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - trackSummaryWriter.filePath = outputDir + "/tracksummary_fitter.root"; - sequencer.addWriter( - std::make_shared(trackSummaryWriter, logLevel)); - - // Write CKF performance data - // write reconstruction performance data - TrackFinderPerformanceWriter::Config perfFinder; - perfFinder.inputProtoTracks = trackFinderCfg.outputProtoTracks; - perfFinder.inputParticles = inputParticles; - perfFinder.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - perfFinder.filePath = outputDir + "/performance_track_finder.root"; - sequencer.addWriter( - std::make_shared(perfFinder, logLevel)); - - TrackFitterPerformanceWriter::Config perfFitter; - perfFitter.inputTracks = fitter.outputTracks; - perfFitter.inputParticles = inputParticles; - perfFitter.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - perfFitter.filePath = outputDir + "/performance_track_fitter.root"; - sequencer.addWriter( - std::make_shared(perfFitter, logLevel)); - - return sequencer.run(); -} diff --git a/Examples/Run/Reconstruction/Common/RecTruthTracks.hpp b/Examples/Run/Reconstruction/Common/RecTruthTracks.hpp deleted file mode 100644 index 8e0456bb2e9..00000000000 --- a/Examples/Run/Reconstruction/Common/RecTruthTracks.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include - -namespace ActsExamples { -class IBaseDetector; -} - -/// Main function for running truth fitting with a specific detector. -/// -/// @param argc number of command line arguments -/// @param argv command line arguments -/// @param detector is the detector to be used -int runRecTruthTracks( - int argc, char* argv[], - const std::shared_ptr& detector); diff --git a/Examples/Run/Reconstruction/Common/SeedingExample.cpp b/Examples/Run/Reconstruction/Common/SeedingExample.cpp deleted file mode 100644 index e050c799fdb..00000000000 --- a/Examples/Run/Reconstruction/Common/SeedingExample.cpp +++ /dev/null @@ -1,223 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Definitions/Units.hpp" -#include "Acts/Geometry/TrackingGeometry.hpp" -#include "ActsExamples/Detector/IBaseDetector.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" -#include "ActsExamples/Io/Csv/CsvSimHitReader.hpp" -#include "ActsExamples/Io/Performance/SeedingPerformanceWriter.hpp" -#include "ActsExamples/Io/Performance/TrackFinderPerformanceWriter.hpp" -#include "ActsExamples/Io/Root/RootTrackParameterWriter.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/CsvOptionsReader.hpp" -#include "ActsExamples/Options/DigitizationOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Options/SpacePointMakerOptions.hpp" -#include "ActsExamples/Reconstruction/ReconstructionBase.hpp" -#include "ActsExamples/TrackFinding/SeedingAlgorithm.hpp" -#include "ActsExamples/TrackFinding/SpacePointMaker.hpp" -#include "ActsExamples/TrackFinding/TrackParamsEstimationAlgorithm.hpp" -#include "ActsExamples/TruthTracking/TruthSeedSelector.hpp" -#include "ActsExamples/Utilities/Options.hpp" -#include "ActsExamples/Utilities/Paths.hpp" -#include "ActsExamples/Utilities/SeedsToPrototracks.hpp" - -#include - -#include - -using namespace Acts::UnitLiterals; -using namespace ActsExamples; - -int runSeedingExample( - int argc, char* argv[], - const std::shared_ptr& detector) { - // Setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addRandomNumbersOptions(desc); - Options::addGeometryOptions(desc); - Options::addMaterialOptions(desc); - Options::addOutputOptions(desc, OutputFormat::DirectoryOnly); - Options::addInputOptions(desc); - Options::addMagneticFieldOptions(desc); - Options::addSpacePointMakerOptions(desc); - Options::addDigitizationOptions(desc); - // Add specific options for this geometry - detector->addOptions(desc); - auto vm = Options::parse(desc, argc, argv); - if (vm.empty()) { - return EXIT_FAILURE; - } - Sequencer sequencer(Options::readSequencerConfig(vm)); - - // Now read the standard options - auto logLevel = Options::readLogLevel(vm); - auto outputDir = ensureWritableDirectory(vm["output-dir"].as()); - - // The geometry, material and decoration - auto geometry = Geometry::build(vm, *detector); - auto tGeometry = geometry.first; - auto contextDecorators = geometry.second; - auto rnd = - std::make_shared(Options::readRandomNumbersConfig(vm)); - - // Add the decorator to the sequencer - for (const auto& cdr : contextDecorators) { - sequencer.addContextDecorator(cdr); - } - - // Setup the magnetic field - Options::setupMagneticFieldServices(vm, sequencer); - auto magneticField = Options::readMagneticField(vm); - - // Read the sim hits - auto simHitReaderCfg = setupSimHitReading(vm, sequencer); - // Read the particles - auto particleReader = setupParticleReading(vm, sequencer); - - // Run the sim hits smearing - auto digiCfg = setupDigitization(vm, sequencer, rnd, tGeometry, - simHitReaderCfg.outputSimHits); - - // Run the particle selection - // The pre-selection will select truth particles satisfying provided criteria - // from all particles read in by particle reader for further processing. It - // has no impact on the truth hits read-in by the cluster reader. - TruthSeedSelector::Config particleSelectorCfg; - particleSelectorCfg.inputParticles = particleReader.outputParticles; - particleSelectorCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - particleSelectorCfg.outputParticles = "particles_selected"; - particleSelectorCfg.ptMin = 1_GeV; - particleSelectorCfg.etaMax = 2.5; - particleSelectorCfg.etaMin = -2.5; - particleSelectorCfg.nHitsMin = 9; - sequencer.addAlgorithm( - std::make_shared(particleSelectorCfg, logLevel)); - - // The selected particles - const auto& inputParticles = particleSelectorCfg.outputParticles; - - // Create space points - SpacePointMaker::Config spCfg = Options::readSpacePointMakerConfig(vm); - spCfg.inputSourceLinks = digiCfg.outputSourceLinks; - spCfg.inputMeasurements = digiCfg.outputMeasurements; - spCfg.outputSpacePoints = "spacepoints"; - spCfg.trackingGeometry = tGeometry; - sequencer.addAlgorithm(std::make_shared(spCfg, logLevel)); - - // Seeding algorithm - SeedingAlgorithm::Config seedingCfg; - seedingCfg.inputSpacePoints = { - spCfg.outputSpacePoints, - }; - seedingCfg.outputSeeds = "seeds"; - seedingCfg.gridConfig.rMax = 200._mm; - seedingCfg.seedFinderConfig.rMax = seedingCfg.gridConfig.rMax; - - seedingCfg.seedFilterConfig.deltaRMin = 1_mm; - seedingCfg.seedFinderConfig.deltaRMin = seedingCfg.seedFilterConfig.deltaRMin; - seedingCfg.seedFinderConfig.deltaRMinTopSP = - seedingCfg.seedFilterConfig.deltaRMin; - seedingCfg.seedFinderConfig.deltaRMinBottomSP = - seedingCfg.seedFilterConfig.deltaRMin; - - seedingCfg.gridConfig.deltaRMax = 60._mm; - seedingCfg.seedFinderConfig.deltaRMax = seedingCfg.gridConfig.deltaRMax; - seedingCfg.seedFinderConfig.deltaRMaxTopSP = seedingCfg.gridConfig.deltaRMax; - seedingCfg.seedFinderConfig.deltaRMaxBottomSP = - seedingCfg.gridConfig.deltaRMax; - - seedingCfg.seedFinderConfig.collisionRegionMin = -250_mm; - seedingCfg.seedFinderConfig.collisionRegionMax = 250._mm; - - seedingCfg.gridConfig.zMin = -2000._mm; - seedingCfg.gridConfig.zMax = 2000._mm; - seedingCfg.seedFinderConfig.zMin = seedingCfg.gridConfig.zMin; - seedingCfg.seedFinderConfig.zMax = seedingCfg.gridConfig.zMax; - - seedingCfg.seedFilterConfig.maxSeedsPerSpM = 1; - seedingCfg.seedFinderConfig.maxSeedsPerSpM = - seedingCfg.seedFilterConfig.maxSeedsPerSpM; - - seedingCfg.gridConfig.cotThetaMax = 7.40627; // 2.7 eta - seedingCfg.seedFinderConfig.cotThetaMax = seedingCfg.gridConfig.cotThetaMax; - - seedingCfg.seedFinderConfig.sigmaScattering = 5; - seedingCfg.seedFinderConfig.radLengthPerSeed = 0.5; - - seedingCfg.gridConfig.minPt = 500._MeV; - seedingCfg.seedFinderConfig.minPt = seedingCfg.gridConfig.minPt; - - seedingCfg.gridOptions.bFieldInZ = 2_T; - - seedingCfg.seedFinderOptions.bFieldInZ = seedingCfg.gridOptions.bFieldInZ; - seedingCfg.seedFinderOptions.beamPos = {0_mm, 0_mm}; - - seedingCfg.seedFinderConfig.impactMax = 3._mm; - - sequencer.addAlgorithm( - std::make_shared(seedingCfg, logLevel)); - - SeedsToPrototracks::Config seedsToPrototrackCfg; - seedsToPrototrackCfg.inputSeeds = seedingCfg.outputSeeds; - seedsToPrototrackCfg.outputProtoTracks = "prototracks"; - sequencer.addAlgorithm( - std::make_shared(seedsToPrototrackCfg, logLevel)); - - // Algorithm estimating track parameter from seed - TrackParamsEstimationAlgorithm::Config paramsEstimationCfg; - paramsEstimationCfg.inputSeeds = seedingCfg.outputSeeds; - paramsEstimationCfg.outputTrackParameters = "estimatedparameters"; - paramsEstimationCfg.trackingGeometry = tGeometry; - paramsEstimationCfg.magneticField = magneticField; - sequencer.addAlgorithm(std::make_shared( - paramsEstimationCfg, logLevel)); - - // Seeding performance Writers - TrackFinderPerformanceWriter::Config tfPerfCfg; - tfPerfCfg.inputProtoTracks = seedsToPrototrackCfg.outputProtoTracks; - tfPerfCfg.inputParticles = inputParticles; - tfPerfCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - tfPerfCfg.filePath = outputDir + "/performance_seeding_trees.root"; - sequencer.addWriter( - std::make_shared(tfPerfCfg, logLevel)); - - SeedingPerformanceWriter::Config seedPerfCfg; - seedPerfCfg.inputSeeds = seedingCfg.outputSeeds; - seedPerfCfg.inputParticles = inputParticles; - seedPerfCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - seedPerfCfg.filePath = outputDir + "/performance_seeding.root"; - sequencer.addWriter( - std::make_shared(seedPerfCfg, logLevel)); - - // The track parameters estimation writer - RootTrackParameterWriter::Config trackParamsWriterCfg; - trackParamsWriterCfg.inputTrackParameters = - paramsEstimationCfg.outputTrackParameters; - trackParamsWriterCfg.inputProtoTracks = - seedsToPrototrackCfg.outputProtoTracks; - trackParamsWriterCfg.inputParticles = particleReader.outputParticles; - trackParamsWriterCfg.inputSimHits = simHitReaderCfg.outputSimHits; - trackParamsWriterCfg.inputMeasurementParticlesMap = - digiCfg.outputMeasurementParticlesMap; - trackParamsWriterCfg.inputMeasurementSimHitsMap = - digiCfg.outputMeasurementSimHitsMap; - trackParamsWriterCfg.filePath = outputDir + "/estimatedparams.root"; - trackParamsWriterCfg.treeName = "estimatedparams"; - sequencer.addWriter(std::make_shared( - trackParamsWriterCfg, logLevel)); - - return sequencer.run(); -} diff --git a/Examples/Run/Reconstruction/Common/SeedingExample.hpp b/Examples/Run/Reconstruction/Common/SeedingExample.hpp deleted file mode 100644 index 77a5d2d693d..00000000000 --- a/Examples/Run/Reconstruction/Common/SeedingExample.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once -#include "Acts/Geometry/GeometryIdentifier.hpp" - -namespace ActsExamples { -class IBaseDetector; -} - -/// The Propagation example -/// -/// -/// @param argc the number of arguments of the call -/// @param argv the argument list -/// @param detector The detector descriptor instance -int runSeedingExample( - int argc, char* argv[], - const std::shared_ptr& detector); diff --git a/Examples/Run/Reconstruction/DD4hep/CMakeLists.txt b/Examples/Run/Reconstruction/DD4hep/CMakeLists.txt deleted file mode 100644 index f63bc37cbe0..00000000000 --- a/Examples/Run/Reconstruction/DD4hep/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -add_executable( - ActsExampleTruthTracksDD4hep - DD4hepRecTruthTracks.cpp) -target_link_libraries( - ActsExampleTruthTracksDD4hep - PRIVATE - ActsExamplesRecTracksCommon - ActsExamplesDD4hepDetectorWithOptions) - -add_executable( - ActsExampleCKFTracksDD4hep - DD4hepRecCKFTracks.cpp) -target_link_libraries( - ActsExampleCKFTracksDD4hep - PRIVATE - ActsExamplesRecTracksCommon - ActsExamplesDD4hepDetectorWithOptions) - -add_executable( - ActsExampleSeedingDD4hep - DD4hepSeedingExample.cpp) -target_link_libraries( - ActsExampleSeedingDD4hep - PRIVATE - ActsExamplesRecTracksCommon - ActsExamplesDD4hepDetectorWithOptions) - -install( - TARGETS - ActsExampleTruthTracksDD4hep - ActsExampleCKFTracksDD4hep - ActsExampleSeedingDD4hep - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Examples/Run/Reconstruction/DD4hep/DD4hepRecCKFTracks.cpp b/Examples/Run/Reconstruction/DD4hep/DD4hepRecCKFTracks.cpp deleted file mode 100644 index 86b66c0b6f1..00000000000 --- a/Examples/Run/Reconstruction/DD4hep/DD4hepRecCKFTracks.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/DD4hepDetectorWithOptions.hpp" - -#include "RecCKFTracks.hpp" - -int main(int argc, char* argv[]) { - return runRecCKFTracks( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Reconstruction/DD4hep/DD4hepRecTruthTracks.cpp b/Examples/Run/Reconstruction/DD4hep/DD4hepRecTruthTracks.cpp deleted file mode 100644 index 302b3432934..00000000000 --- a/Examples/Run/Reconstruction/DD4hep/DD4hepRecTruthTracks.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/DD4hepDetectorWithOptions.hpp" - -#include "RecTruthTracks.hpp" - -int main(int argc, char* argv[]) { - return runRecTruthTracks( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Reconstruction/DD4hep/DD4hepSeedingExample.cpp b/Examples/Run/Reconstruction/DD4hep/DD4hepSeedingExample.cpp deleted file mode 100644 index 1e9a3f39b20..00000000000 --- a/Examples/Run/Reconstruction/DD4hep/DD4hepSeedingExample.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/DD4hepDetectorWithOptions.hpp" - -#include "SeedingExample.hpp" - -int main(int argc, char* argv[]) { - return runSeedingExample( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Reconstruction/GenericRecCKFTracks.cpp b/Examples/Run/Reconstruction/GenericRecCKFTracks.cpp deleted file mode 100644 index 3bcada30cde..00000000000 --- a/Examples/Run/Reconstruction/GenericRecCKFTracks.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/GenericDetectorWithOptions.hpp" - -#include "RecCKFTracks.hpp" - -int main(int argc, char* argv[]) { - return runRecCKFTracks( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Reconstruction/GenericRecTruthTracks.cpp b/Examples/Run/Reconstruction/GenericRecTruthTracks.cpp deleted file mode 100644 index b3bab03ff07..00000000000 --- a/Examples/Run/Reconstruction/GenericRecTruthTracks.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/GenericDetectorWithOptions.hpp" - -#include "RecTruthTracks.hpp" - -int main(int argc, char* argv[]) { - return runRecTruthTracks( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Reconstruction/GenericSeedingExample.cpp b/Examples/Run/Reconstruction/GenericSeedingExample.cpp deleted file mode 100644 index de1e0740fcd..00000000000 --- a/Examples/Run/Reconstruction/GenericSeedingExample.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Geometry/GeometryIdentifier.hpp" -#include "ActsExamples/Detector/GenericDetectorWithOptions.hpp" - -#include "SeedingExample.hpp" - -int main(int argc, char* argv[]) { - return runSeedingExample( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Reconstruction/HoughExample.cpp b/Examples/Run/Reconstruction/HoughExample.cpp deleted file mode 100644 index a6bd291052f..00000000000 --- a/Examples/Run/Reconstruction/HoughExample.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "HoughExample.hpp" - -#include "Acts/Geometry/GeometryIdentifier.hpp" -#include "ActsExamples/Detector/GenericDetectorWithOptions.hpp" - -int main(int argc, char* argv[]) { - return runHoughExample( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Reconstruction/MeasurementsToSPGeneric.cpp b/Examples/Run/Reconstruction/MeasurementsToSPGeneric.cpp deleted file mode 100644 index 357b378c98a..00000000000 --- a/Examples/Run/Reconstruction/MeasurementsToSPGeneric.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/GenericDetectorWithOptions.hpp" - -#include "MeasurementsToSpacepoints.hpp" - -int main(int argc, char* argv[]) { - return runMeasurementsToSP( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Reconstruction/MeasurementsToSPTGeo.cpp b/Examples/Run/Reconstruction/MeasurementsToSPTGeo.cpp deleted file mode 100644 index b5081390229..00000000000 --- a/Examples/Run/Reconstruction/MeasurementsToSPTGeo.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TGeoDetectorWithOptions.hpp" - -#include "MeasurementsToSpacepoints.hpp" - -int main(int argc, char* argv[]) { - return runMeasurementsToSP( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Reconstruction/TGeoRecCKFTracks.cpp b/Examples/Run/Reconstruction/TGeoRecCKFTracks.cpp deleted file mode 100644 index c0d44b74b32..00000000000 --- a/Examples/Run/Reconstruction/TGeoRecCKFTracks.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TGeoDetectorWithOptions.hpp" - -#include "RecCKFTracks.hpp" - -int main(int argc, char* argv[]) { - return runRecCKFTracks( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Reconstruction/TGeoRecTruthTracks.cpp b/Examples/Run/Reconstruction/TGeoRecTruthTracks.cpp deleted file mode 100644 index fde0d42cedf..00000000000 --- a/Examples/Run/Reconstruction/TGeoRecTruthTracks.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TGeoDetectorWithOptions.hpp" - -#include "RecTruthTracks.hpp" - -int main(int argc, char* argv[]) { - return runRecTruthTracks( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Reconstruction/TGeoSeedingExample.cpp b/Examples/Run/Reconstruction/TGeoSeedingExample.cpp deleted file mode 100644 index bd7ddd94b78..00000000000 --- a/Examples/Run/Reconstruction/TGeoSeedingExample.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TGeoDetectorWithOptions.hpp" - -#include "SeedingExample.hpp" - -int main(int argc, char* argv[]) { - return runSeedingExample( - argc, argv, std::make_shared()); -} diff --git a/Examples/Run/Reconstruction/TelescopeRecCKFTracks.cpp b/Examples/Run/Reconstruction/TelescopeRecCKFTracks.cpp deleted file mode 100644 index eb18be67aae..00000000000 --- a/Examples/Run/Reconstruction/TelescopeRecCKFTracks.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TelescopeDetectorWithOptions.hpp" - -#include "RecCKFTracks.hpp" - -int main(int argc, char* argv[]) { - return runRecCKFTracks( - argc, argv, - std::make_shared()); -} diff --git a/Examples/Run/Reconstruction/TelescopeRecTruthTracks.cpp b/Examples/Run/Reconstruction/TelescopeRecTruthTracks.cpp deleted file mode 100644 index 0f96d928ccf..00000000000 --- a/Examples/Run/Reconstruction/TelescopeRecTruthTracks.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "ActsExamples/Detector/TelescopeDetectorWithOptions.hpp" - -#include "RecTruthTracks.hpp" - -int main(int argc, char* argv[]) { - return runRecTruthTracks( - argc, argv, - std::make_shared()); -} diff --git a/Examples/Run/Show/CMakeLists.txt b/Examples/Run/Show/CMakeLists.txt deleted file mode 100644 index c7288fe31a5..00000000000 --- a/Examples/Run/Show/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -add_executable( - ActsExampleShowFatrasGeneric - ShowFatrasGeneric.cpp) -target_link_libraries( - ActsExampleShowFatrasGeneric - PRIVATE - ActsExamplesFramework ActsExamplesCommon ActsExamplesIoCsv - ActsExamplesPrinters ActsExamplesDetectorGeneric) -add_executable( - ActsExampleShowParticles - ShowParticles.cpp) -target_link_libraries( - ActsExampleShowParticles - PRIVATE - ActsExamplesFramework ActsExamplesCommon ActsExamplesIoCsv - ActsExamplesPrinters) - -install( - TARGETS - ActsExampleShowFatrasGeneric - ActsExampleShowParticles - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Examples/Run/Show/ShowFatrasGeneric.cpp b/Examples/Run/Show/ShowFatrasGeneric.cpp deleted file mode 100644 index 13ea7b44939..00000000000 --- a/Examples/Run/Show/ShowFatrasGeneric.cpp +++ /dev/null @@ -1,107 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019-2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -/// @file An example utility to read and print Fatras CSV files. -/// -/// This examples shows how to use the framework CSV I/O and printer algorithms. - -#include "ActsExamples/Detector/GenericDetectorWithOptions.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Framework/WhiteBoard.hpp" -#include "ActsExamples/Geometry/CommonGeometry.hpp" -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" -#include "ActsExamples/Io/Csv/CsvPlanarClusterReader.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Printers/HitsPrinter.hpp" -#include "ActsExamples/Printers/ParticlesPrinter.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include - -#include - -using namespace ActsExamples; -using boost::program_options::value; - -int main(int argc, char* argv[]) { - GenericDetectorWithOptions detector; - - // setup and parse options - auto desc = Options::makeDefaultOptions("Read and print Fatras CSV files"); - auto opts = desc.add_options(); - Options::addSequencerOptions(desc); - opts("input-dir", value()->default_value(""), ""); - Options::addGeometryOptions(desc); - detector.addOptions(desc); - Options::addMaterialOptions(desc); - auto vars = Options::parse(desc, argc, argv); - if (vars.empty()) { - return EXIT_FAILURE; - } - - Sequencer sequencer(Options::readSequencerConfig(vars)); - - // read options - auto logLevel = Options::readLogLevel(vars); - auto inputDir = vars["input-dir"].as(); - - // setup detector - auto [trackingGeometry, contextDecorators] = Geometry::build(vars, detector); - for (const auto& cdr : contextDecorators) { - sequencer.addContextDecorator(cdr); - } - - // read initial/final particles - CsvParticleReader::Config readInitialCfg; - readInitialCfg.inputDir = inputDir; - readInitialCfg.inputStem = "particles_initial"; - readInitialCfg.outputParticles = "particles_initial"; - sequencer.addReader( - std::make_shared(readInitialCfg, logLevel)); - CsvParticleReader::Config readFinalCfg; - readFinalCfg.inputDir = inputDir; - readFinalCfg.inputStem = "particles_final"; - readFinalCfg.outputParticles = "particles_final"; - sequencer.addReader( - std::make_shared(readFinalCfg, logLevel)); - - // read clusters/hits - CsvPlanarClusterReader::Config readClustersCfg; - readClustersCfg.inputDir = inputDir; - readClustersCfg.outputClusters = "clusters"; - readClustersCfg.outputMeasurementParticlesMap = "hit_particle_map"; - readClustersCfg.outputHitIds = "hit_ids"; - readClustersCfg.outputSimHits = "simulated_hits"; - readClustersCfg.trackingGeometry = trackingGeometry; - sequencer.addReader(std::make_shared( - readClustersCfg, logLevel)); - - // print event data - ParticlesPrinter::Config printInitialCfg; - printInitialCfg.inputParticles = readInitialCfg.outputParticles; - sequencer.addAlgorithm( - std::make_shared(printInitialCfg, logLevel)); - ParticlesPrinter::Config printFinalCfg; - printFinalCfg.inputParticles = readFinalCfg.outputParticles; - sequencer.addAlgorithm( - std::make_shared(printFinalCfg, logLevel)); - HitsPrinter::Config printHitsCfg; - printHitsCfg.inputClusters = readClustersCfg.outputClusters; - printHitsCfg.inputMeasurementParticlesMap = - readClustersCfg.outputMeasurementParticlesMap; - printHitsCfg.inputHitIds = readClustersCfg.outputHitIds; - // print all hits in the container - printHitsCfg.selectIndexLength = SIZE_MAX; - // print all hits within a volume/layer/volume - // printHitsCfg.selectVolume = 9; - // printHitsCfg.selectLayer = 6; - // printHits.selectModule = 116; - sequencer.addAlgorithm(std::make_shared(printHitsCfg, logLevel)); - - return sequencer.run(); -} diff --git a/Examples/Run/Show/ShowParticles.cpp b/Examples/Run/Show/ShowParticles.cpp deleted file mode 100644 index 36c0ef5ed7d..00000000000 --- a/Examples/Run/Show/ShowParticles.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -/// @file An example utility to read and print particles CSV files. -/// -/// This examples shows how to use the framework CSV I/O and printer algorithms. - -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Framework/WhiteBoard.hpp" -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/ParticleSelectorOptions.hpp" -#include "ActsExamples/Printers/ParticlesPrinter.hpp" -#include "ActsExamples/TruthTracking/ParticleSelector.hpp" -#include "ActsExamples/Utilities/Options.hpp" - -#include - -#include - -using namespace ActsExamples; -using boost::program_options::value; - -int main(int argc, char* argv[]) { - // setup and parse options - auto desc = Options::makeDefaultOptions("Read and print particles CSVs"); - auto opts = desc.add_options(); - Options::addSequencerOptions(desc); - opts("input-dir", value()->default_value(""), ""); - opts("input-stem", value()->default_value("particles"), ""); - ActsExamples::Options::addParticleSelectorOptions(desc); - auto vars = Options::parse(desc, argc, argv); - if (vars.empty()) { - return EXIT_FAILURE; - } - - Sequencer sequencer(Options::readSequencerConfig(vars)); - - // read options - auto logLevel = Options::readLogLevel(vars); - auto inputDir = vars["input-dir"].as(); - auto inputStem = vars["input-stem"].as(); - - // read particles - CsvParticleReader::Config readParticlesCfg; - readParticlesCfg.inputDir = inputDir; - readParticlesCfg.inputStem = inputStem; - readParticlesCfg.outputParticles = "particles"; - sequencer.addReader( - std::make_shared(readParticlesCfg, logLevel)); - - // pre-select particles - auto selectParticlesCfg = - ActsExamples::Options::readParticleSelectorConfig(vars); - selectParticlesCfg.inputParticles = readParticlesCfg.outputParticles; - selectParticlesCfg.outputParticles = "particles_selected"; - sequencer.addAlgorithm( - std::make_shared(selectParticlesCfg, logLevel)); - - // print selected particles - ParticlesPrinter::Config printParticlesCfg; - printParticlesCfg.inputParticles = selectParticlesCfg.outputParticles; - sequencer.addAlgorithm( - std::make_shared(printParticlesCfg, logLevel)); - - return sequencer.run(); -} diff --git a/Examples/Run/Vertexing/CMakeLists.txt b/Examples/Run/Vertexing/CMakeLists.txt deleted file mode 100644 index 818f000997e..00000000000 --- a/Examples/Run/Vertexing/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(_common_libraries - ActsCore - ActsExamplesFramework - ActsExamplesCommon - ActsExamplesTruthTracking - ActsExamplesVertexing) - -add_executable( - ActsExampleVertexFinderParticleReader - ParticleReaderVertexingExample.cpp) -target_link_libraries( - ActsExampleVertexFinderParticleReader - PRIVATE ${_common_libraries} ActsExamplesIoCsv ActsExamplesPrinters) - -add_executable( - ActsExampleVertexFinderTrackReaderPerformanceWriter - TrackReaderVertexingPerformanceWriterExample.cpp) -target_link_libraries( - ActsExampleVertexFinderTrackReaderPerformanceWriter - PRIVATE ${_common_libraries} ActsExamplesIoRoot ActsExamplesIoPerformance ActsExamplesPrinters) - -install( - TARGETS - ActsExampleVertexFinderParticleReader - ActsExampleVertexFinderTrackReaderPerformanceWriter - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -add_subdirectory_if(Pythia8 ACTS_BUILD_EXAMPLES_PYTHIA8) diff --git a/Examples/Run/Vertexing/ParticleReaderVertexingExample.cpp b/Examples/Run/Vertexing/ParticleReaderVertexingExample.cpp deleted file mode 100644 index edee0e5e937..00000000000 --- a/Examples/Run/Vertexing/ParticleReaderVertexingExample.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -/// @file Find vertices using truth particle information as input -/// -/// Reads truth particles from TrackMl files and use the truth information -/// to generate smeared track parameters. Use this pseudo-reconstructed -/// tracks as the input to the vertex finder. - -#include "Acts/Definitions/Units.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Io/Csv/CsvParticleReader.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/CsvOptionsReader.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Options/ParticleSelectorOptions.hpp" -#include "ActsExamples/Options/VertexingOptions.hpp" -#include "ActsExamples/Printers/TrackParametersPrinter.hpp" -#include "ActsExamples/Reconstruction/ReconstructionBase.hpp" -#include "ActsExamples/TruthTracking/ParticleSelector.hpp" -#include "ActsExamples/TruthTracking/ParticleSmearing.hpp" -#include "ActsExamples/Vertexing/IterativeVertexFinderAlgorithm.hpp" - -#include - -using namespace Acts::UnitLiterals; -using namespace ActsExamples; - -int main(int argc, char* argv[]) { - // setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addRandomNumbersOptions(desc); - Options::addParticleSelectorOptions(desc); - Options::addVertexingOptions(desc); - Options::addInputOptions(desc); - Options::addMagneticFieldOptions(desc); - Options::addOutputOptions(desc, OutputFormat::DirectoryOnly); - Options::addParticleSmearingOptions(desc); - auto vars = Options::parse(desc, argc, argv); - if (vars.empty()) { - return EXIT_FAILURE; - } - - // basic setup - auto logLevel = Options::readLogLevel(vars); - auto rnd = - std::make_shared(Options::readRandomNumbersConfig(vars)); - Sequencer sequencer(Options::readSequencerConfig(vars)); - - // Setup the magnetic field - auto magneticField = Options::readMagneticField(vars); - - // setup particle reader generator - CsvParticleReader::Config readParticles = - Options::readCsvParticleReaderConfig(vars); - readParticles.inputStem = "particles"; - readParticles.outputParticles = "particles"; - sequencer.addReader( - std::make_shared(readParticles, logLevel)); - - // pre-select particles - ParticleSelector::Config selectParticles = - Options::readParticleSelectorConfig(vars); - selectParticles.inputParticles = readParticles.outputParticles; - selectParticles.outputParticles = "particles_selected"; - // smearing only works with charge particles for now - selectParticles.removeNeutral = true; - selectParticles.absEtaMax = vars["vertexing-eta-max"].as(); - selectParticles.rhoMax = vars["vertexing-rho-max"].as() * 1_mm; - selectParticles.ptMin = vars["vertexing-pt-min"].as() * 1_MeV; - sequencer.addAlgorithm( - std::make_shared(selectParticles, logLevel)); - - // Run the particle smearing - auto particleSmearingCfg = setupParticleSmearing( - vars, sequencer, rnd, selectParticles.outputParticles); - - // print input track parameters - TrackParametersPrinter::Config printTracks; - printTracks.inputTrackParameters = particleSmearingCfg.outputTrackParameters; - sequencer.addAlgorithm( - std::make_shared(printTracks, logLevel)); - - // find vertices - IterativeVertexFinderAlgorithm::Config findVertices; - findVertices.bField = magneticField; - findVertices.inputTrackParameters = particleSmearingCfg.outputTrackParameters; - findVertices.outputProtoVertices = "protovertices"; - sequencer.addAlgorithm( - std::make_shared(findVertices, logLevel)); - - return sequencer.run(); -} diff --git a/Examples/Run/Vertexing/Pythia8/AdaptiveMultiVertexFinderExample.cpp b/Examples/Run/Vertexing/Pythia8/AdaptiveMultiVertexFinderExample.cpp deleted file mode 100644 index e7b1c1b45c1..00000000000 --- a/Examples/Run/Vertexing/Pythia8/AdaptiveMultiVertexFinderExample.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Definitions/Units.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Options/ParticleSelectorOptions.hpp" -#include "ActsExamples/Options/ParticleSmearingOptions.hpp" -#include "ActsExamples/Options/Pythia8Options.hpp" -#include "ActsExamples/Options/VertexingOptions.hpp" -#include "ActsExamples/Reconstruction/ReconstructionBase.hpp" -#include "ActsExamples/TruthTracking/ParticleSelector.hpp" -#include "ActsExamples/TruthTracking/ParticleSmearing.hpp" -#include "ActsExamples/Vertexing/AdaptiveMultiVertexFinderAlgorithm.hpp" - -#include - -using namespace Acts::UnitLiterals; -using namespace ActsExamples; - -int main(int argc, char* argv[]) { - // setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addRandomNumbersOptions(desc); - Options::addPythia8Options(desc); - Options::addParticleSelectorOptions(desc); - Options::addVertexingOptions(desc); - Options::addMagneticFieldOptions(desc); - Options::addOutputOptions(desc, OutputFormat::DirectoryOnly); - Options::addParticleSmearingOptions(desc); - auto vars = Options::parse(desc, argc, argv); - if (vars.empty()) { - return EXIT_FAILURE; - } - - // basic setup - auto logLevel = Options::readLogLevel(vars); - auto rnd = - std::make_shared(Options::readRandomNumbersConfig(vars)); - Sequencer sequencer(Options::readSequencerConfig(vars)); - - // Setup the magnetic field - auto magneticField = Options::readMagneticField(vars); - - // setup event generator - EventGenerator::Config evgen = Options::readPythia8Options(vars, logLevel); - evgen.outputParticles = "particles_generated"; - evgen.randomNumbers = rnd; - sequencer.addReader(std::make_shared(evgen, logLevel)); - - // pre-select particles - ParticleSelector::Config selectParticles = - Options::readParticleSelectorConfig(vars); - selectParticles.inputParticles = evgen.outputParticles; - selectParticles.outputParticles = "particles_selected"; - // smearing only works with charge particles for now - selectParticles.removeNeutral = true; - selectParticles.absEtaMax = vars["vertexing-eta-max"].as(); - selectParticles.rhoMax = vars["vertexing-rho-max"].as() * 1_mm; - selectParticles.ptMin = vars["vertexing-pt-min"].as() * 1_MeV; - sequencer.addAlgorithm( - std::make_shared(selectParticles, logLevel)); - - // Run the particle smearing - auto particleSmearingCfg = setupParticleSmearing( - vars, sequencer, rnd, selectParticles.outputParticles); - - // find vertices - AdaptiveMultiVertexFinderAlgorithm::Config findVertices; - findVertices.bField = magneticField; - findVertices.inputTrackParameters = particleSmearingCfg.outputTrackParameters; - findVertices.outputProtoVertices = "protovertices"; - sequencer.addAlgorithm(std::make_shared( - findVertices, logLevel)); - - return sequencer.run(); -} diff --git a/Examples/Run/Vertexing/Pythia8/CMakeLists.txt b/Examples/Run/Vertexing/Pythia8/CMakeLists.txt deleted file mode 100644 index 37e4851aa40..00000000000 --- a/Examples/Run/Vertexing/Pythia8/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -set(_common_libraries - ActsCore - ActsExamplesFramework - ActsExamplesCommon - ActsExamplesGenerators - ActsExamplesGeneratorsPythia8 - ActsExamplesGeneratorsPythia8Options - ActsExamplesTruthTracking - ActsExamplesVertexing) - -add_executable( - ActsExampleAdaptiveMultiVertexFinder - AdaptiveMultiVertexFinderExample.cpp) -target_link_libraries( - ActsExampleAdaptiveMultiVertexFinder - PRIVATE ${_common_libraries} ) -add_executable( - ActsExampleIterativeVertexFinder - IterativeVertexFinderExample.cpp) -target_link_libraries( - ActsExampleIterativeVertexFinder - PRIVATE ${_common_libraries}) -add_executable( - ActsExampleVertexFitter - VertexFitterExample.cpp) -target_link_libraries( - ActsExampleVertexFitter - PRIVATE ${_common_libraries}) - -install( - TARGETS - ActsExampleAdaptiveMultiVertexFinder - ActsExampleIterativeVertexFinder - ActsExampleVertexFitter - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Examples/Run/Vertexing/Pythia8/IterativeVertexFinderExample.cpp b/Examples/Run/Vertexing/Pythia8/IterativeVertexFinderExample.cpp deleted file mode 100644 index 211ab3d9a18..00000000000 --- a/Examples/Run/Vertexing/Pythia8/IterativeVertexFinderExample.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Definitions/Units.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Options/ParticleSelectorOptions.hpp" -#include "ActsExamples/Options/Pythia8Options.hpp" -#include "ActsExamples/Options/VertexingOptions.hpp" -#include "ActsExamples/Reconstruction/ReconstructionBase.hpp" -#include "ActsExamples/TruthTracking/ParticleSelector.hpp" -#include "ActsExamples/TruthTracking/ParticleSmearing.hpp" -#include "ActsExamples/Vertexing/IterativeVertexFinderAlgorithm.hpp" - -#include - -using namespace Acts::UnitLiterals; -using namespace ActsExamples; - -int main(int argc, char* argv[]) { - // setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addRandomNumbersOptions(desc); - Options::addPythia8Options(desc); - Options::addParticleSelectorOptions(desc); - Options::addVertexingOptions(desc); - Options::addMagneticFieldOptions(desc); - Options::addOutputOptions(desc, OutputFormat::DirectoryOnly); - Options::addParticleSmearingOptions(desc); - auto vars = Options::parse(desc, argc, argv); - if (vars.empty()) { - return EXIT_FAILURE; - } - - // basic setup - auto logLevel = Options::readLogLevel(vars); - auto rnd = - std::make_shared(Options::readRandomNumbersConfig(vars)); - Sequencer sequencer(Options::readSequencerConfig(vars)); - - // Setup the magnetic field - auto magneticField = Options::readMagneticField(vars); - - // setup event generator - EventGenerator::Config evgen = Options::readPythia8Options(vars, logLevel); - evgen.outputParticles = "particles_generated"; - evgen.randomNumbers = rnd; - sequencer.addReader(std::make_shared(evgen, logLevel)); - - // pre-select particles - ParticleSelector::Config selectParticles = - Options::readParticleSelectorConfig(vars); - selectParticles.inputParticles = evgen.outputParticles; - selectParticles.outputParticles = "particles_selected"; - // smearing only works with charge particles for now - selectParticles.removeNeutral = true; - selectParticles.absEtaMax = vars["vertexing-eta-max"].as(); - selectParticles.rhoMax = vars["vertexing-rho-max"].as() * 1_mm; - selectParticles.ptMin = vars["vertexing-pt-min"].as() * 1_MeV; - sequencer.addAlgorithm( - std::make_shared(selectParticles, logLevel)); - - // Run the particle smearing - auto particleSmearingCfg = setupParticleSmearing( - vars, sequencer, rnd, selectParticles.outputParticles); - - // find vertices - IterativeVertexFinderAlgorithm::Config findVertices; - findVertices.bField = magneticField; - findVertices.inputTrackParameters = particleSmearingCfg.outputTrackParameters; - findVertices.outputProtoVertices = "protovertices"; - sequencer.addAlgorithm( - std::make_shared(findVertices, logLevel)); - - return sequencer.run(); -} diff --git a/Examples/Run/Vertexing/Pythia8/VertexFitterExample.cpp b/Examples/Run/Vertexing/Pythia8/VertexFitterExample.cpp deleted file mode 100644 index 51b1eaa68cd..00000000000 --- a/Examples/Run/Vertexing/Pythia8/VertexFitterExample.cpp +++ /dev/null @@ -1,92 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2016-2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Definitions/Units.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Options/ParticleSelectorOptions.hpp" -#include "ActsExamples/Options/Pythia8Options.hpp" -#include "ActsExamples/Options/VertexingOptions.hpp" -#include "ActsExamples/Reconstruction/ReconstructionBase.hpp" -#include "ActsExamples/TruthTracking/ParticleSelector.hpp" -#include "ActsExamples/TruthTracking/ParticleSmearing.hpp" -#include "ActsExamples/TruthTracking/TruthVertexFinder.hpp" -#include "ActsExamples/Vertexing/VertexFitterAlgorithm.hpp" - -#include - -using namespace Acts::UnitLiterals; -using namespace ActsExamples; - -int main(int argc, char* argv[]) { - // setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addRandomNumbersOptions(desc); - Options::addPythia8Options(desc); - Options::addParticleSelectorOptions(desc); - Options::addVertexingOptions(desc); - Options::addMagneticFieldOptions(desc); - Options::addOutputOptions(desc, OutputFormat::DirectoryOnly); - Options::addParticleSmearingOptions(desc); - auto vars = Options::parse(desc, argc, argv); - if (vars.empty()) { - return EXIT_FAILURE; - } - - // basic setup - auto logLevel = Options::readLogLevel(vars); - auto rnd = - std::make_shared(Options::readRandomNumbersConfig(vars)); - Sequencer sequencer(Options::readSequencerConfig(vars)); - - // Setup the magnetic field - auto magneticField = Options::readMagneticField(vars); - - // setup event generator - EventGenerator::Config evgen = Options::readPythia8Options(vars, logLevel); - evgen.outputParticles = "particles_generated"; - evgen.randomNumbers = rnd; - sequencer.addReader(std::make_shared(evgen, logLevel)); - - // pre-select particles - ParticleSelector::Config selectParticles = - Options::readParticleSelectorConfig(vars); - selectParticles.inputParticles = evgen.outputParticles; - selectParticles.outputParticles = "particles_selected"; - // smearing only works with charge particles for now - selectParticles.removeNeutral = true; - selectParticles.absEtaMax = vars["vertexing-eta-max"].as(); - selectParticles.rhoMax = vars["vertexing-rho-max"].as() * 1_mm; - selectParticles.ptMin = vars["vertexing-pt-min"].as() * 1_MeV; - sequencer.addAlgorithm( - std::make_shared(selectParticles, logLevel)); - - // Run the particle smearing - auto particleSmearingCfg = setupParticleSmearing( - vars, sequencer, rnd, selectParticles.outputParticles); - - // find true primary vertices w/o secondary particles - TruthVertexFinder::Config findVertices; - findVertices.inputParticles = selectParticles.outputParticles; - findVertices.outputProtoVertices = "protovertices"; - findVertices.excludeSecondaries = true; - sequencer.addAlgorithm( - std::make_shared(findVertices, logLevel)); - - // fit vertices using the Billoir fitter - VertexFitterAlgorithm::Config fitVertices; - fitVertices.bField = magneticField; - fitVertices.inputTrackParameters = particleSmearingCfg.outputTrackParameters; - fitVertices.inputProtoVertices = findVertices.outputProtoVertices; - sequencer.addAlgorithm( - std::make_shared(fitVertices, logLevel)); - - return sequencer.run(); -} diff --git a/Examples/Run/Vertexing/TrackReaderVertexingPerformanceWriterExample.cpp b/Examples/Run/Vertexing/TrackReaderVertexingPerformanceWriterExample.cpp deleted file mode 100644 index 07fa24e960a..00000000000 --- a/Examples/Run/Vertexing/TrackReaderVertexingPerformanceWriterExample.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020-2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -/// @file Find vertices using truth particle information as input -/// -/// Reads truth particles from TrackMl files and use the truth information -/// to generate smeared track parameters. Use this pseudo-reconstructed -/// tracks as the input to the vertex finder. - -#include "Acts/Definitions/Units.hpp" -#include "ActsExamples/Framework/Sequencer.hpp" -#include "ActsExamples/Io/Performance/VertexPerformanceWriter.hpp" -#include "ActsExamples/Io/Root/RootParticleReader.hpp" -#include "ActsExamples/Io/Root/RootTrackSummaryReader.hpp" -#include "ActsExamples/Options/CommonOptions.hpp" -#include "ActsExamples/Options/MagneticFieldOptions.hpp" -#include "ActsExamples/Options/ParticleSelectorOptions.hpp" -#include "ActsExamples/Options/VertexingOptions.hpp" -#include "ActsExamples/Printers/TrackParametersPrinter.hpp" -#include "ActsExamples/TruthTracking/ParticleSelector.hpp" -#include "ActsExamples/TruthTracking/TrackParameterSelector.hpp" -#include "ActsExamples/Utilities/Paths.hpp" -#include "ActsExamples/Vertexing/AdaptiveMultiVertexFinderAlgorithm.hpp" - -#include - -using namespace Acts::UnitLiterals; -using namespace ActsExamples; - -int main(int argc, char* argv[]) { - // setup and parse options - auto desc = Options::makeDefaultOptions(); - Options::addSequencerOptions(desc); - Options::addRandomNumbersOptions(desc); - Options::addVertexingOptions(desc); - Options::addInputOptions(desc); - Options::addMagneticFieldOptions(desc); - Options::addOutputOptions(desc, OutputFormat::DirectoryOnly); - Options::addParticleSelectorOptions(desc); - auto vars = Options::parse(desc, argc, argv); - if (vars.empty()) { - return EXIT_FAILURE; - } - - // basic setup - auto logLevel = Options::readLogLevel(vars); - auto rnd = - std::make_shared(Options::readRandomNumbersConfig(vars)); - Sequencer sequencer(Options::readSequencerConfig(vars)); - - auto inputDir = vars["input-dir"].as(); - auto outputDir = - ensureWritableDirectory(vars["output-dir"].as()); - - // Setup the magnetic field - auto magneticField = Options::readMagneticField(vars); - - RootParticleReader::Config particleReaderConfig; - particleReaderConfig.particleCollection = "allTruthParticles"; - particleReaderConfig.filePath = inputDir + "/particles_initial.root"; - particleReaderConfig.treeName = "particles"; - sequencer.addReader(std::make_shared( - particleReaderConfig, Acts::Logging::INFO)); - - // add additional particle selection - auto select = Options::readParticleSelectorConfig(vars); - select.inputParticles = particleReaderConfig.particleCollection; - select.outputParticles = "detectorAcceptanceSelectedTruthParticles"; - sequencer.addAlgorithm( - std::make_shared(select, logLevel)); - - RootTrackSummaryReader::Config trackSummaryReader; - trackSummaryReader.outputTracks = "fittedTrackParameters"; - trackSummaryReader.outputParticles = "associatedTruthParticles"; - trackSummaryReader.filePath = inputDir + "/tracksummary_fitter.root"; - sequencer.addReader( - std::make_shared(trackSummaryReader, logLevel)); - - // Apply some primary vertexing selection cuts - TrackParameterSelector::Config trackSelectorConfig; - trackSelectorConfig.inputTrackParameters = trackSummaryReader.outputTracks; - trackSelectorConfig.outputTrackParameters = "selectedTracks"; - trackSelectorConfig.absEtaMax = vars["vertexing-eta-max"].as(); - trackSelectorConfig.loc0Max = vars["vertexing-rho-max"].as() * 1_mm; - trackSelectorConfig.ptMin = vars["vertexing-pt-min"].as() * 1_MeV; - sequencer.addAlgorithm( - std::make_shared(trackSelectorConfig, logLevel)); - - // find vertices - AdaptiveMultiVertexFinderAlgorithm::Config findVertices; - findVertices.bField = magneticField; - findVertices.inputTrackParameters = trackSelectorConfig.outputTrackParameters; - findVertices.outputProtoVertices = "fittedProtoVertices"; - findVertices.outputVertices = "fittedVertices"; - sequencer.addAlgorithm(std::make_shared( - findVertices, logLevel)); - - // write track parameters from fitting - VertexPerformanceWriter::Config vertexWriterConfig; - vertexWriterConfig.inputAllTruthParticles = - particleReaderConfig.particleCollection; - vertexWriterConfig.inputSelectedTruthParticles = select.outputParticles; - vertexWriterConfig.inputAssociatedTruthParticles = - trackSummaryReader.outputParticles; - vertexWriterConfig.inputTracks = trackSummaryReader.outputTracks; - vertexWriterConfig.inputVertices = findVertices.outputVertices; - vertexWriterConfig.filePath = outputDir + "/vertexperformance_AMVF.root"; - vertexWriterConfig.treeName = "amvf"; - sequencer.addWriter( - std::make_shared(vertexWriterConfig, logLevel)); - - return sequencer.run(); -} diff --git a/docs/getting_started.md b/docs/getting_started.md index 3b87ee2588b..56b550d6458 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -204,7 +204,7 @@ $ pip install -r docs/requirements.txt :::{tip} It is **strongly recommended** to use a [virtual environment](https://realpython.com/python-virtual-environments-a-primer/) for -this purpose! For example, run +this purpose! For example, run ```console $ python -m venv docvenv @@ -229,7 +229,7 @@ $ cmake --build --target docs The default option includes the Doxygen, Sphinx, and the Breathe extension, i.e. the source code information can be used in the manually written documentation. An attempt is made to pull in symbols that are cross-referenced from -other parts of the documentation. This is not guaranteed to work: in case +other parts of the documentation. This is not guaranteed to work: in case of errors you will need to manually pull in symbols to be documented. [doxygen]: https://doxygen.nl/ @@ -291,7 +291,6 @@ components. | ACTS_BUILD_EXAMPLES_HEPMC3 | Build HepMC3-based code in the examples
type: `bool`, default: `OFF` | | ACTS_BUILD_EXAMPLES_PYTHIA8 | Build Pythia8-based code in the examples
type: `bool`, default: `OFF` | | ACTS_BUILD_EXAMPLES_PYTHON_BINDINGS | Build python bindings for the examples
type: `bool`, default: `OFF` | -| ACTS_BUILD_EXAMPLES_BINARIES | Build the examples binaries (deprecated)
type: `bool`, default: `OFF` | | ACTS_USE_SYSTEM_PYBIND11 | Use a system installation of pybind11
type: `bool`, default: `ACTS_USE_SYSTEM_LIBS -> OFF` | | ACTS_USE_EXAMPLES_TBB | Use Threading Building Blocks library in
the examples
type: `bool`, default: `ON` | | ACTS_BUILD_ANALYSIS_APPS | Build Analysis applications in the
examples
type: `bool`, default: `OFF` | @@ -350,7 +349,7 @@ The following environment variables might be useful. ## The OpenDataDetector -ACTS comes packaged with a detector modeled using DD4hep that can be used to test your algorithms. It comes equipped with a magnetic field file as well as an already built material map. +ACTS comes packaged with a detector modeled using DD4hep that can be used to test your algorithms. It comes equipped with a magnetic field file as well as an already built material map. It is available via the git submodule feature by performing the following steps ([`git lfs`](https://git-lfs.github.com/) need to be installed on your machine): ```console @@ -358,7 +357,7 @@ $ git submodule init $ git submodule update ``` -To use it, you will then need to build ACTS with the `ACTS_BUILD_ODD` option and then point either `LD_LIBRARY_PATH` on Linux or +To use it, you will then need to build ACTS with the `ACTS_BUILD_ODD` option and then point either `LD_LIBRARY_PATH` on Linux or `DYLD_LIBRARY_PATH` and `DD4HEP_LIBRARY_PATH` on MacOs to the install path of the ODD factory (for example: `build/thirdparty/OpenDataDetector/factory`). You can now use the ODD in the python binding by using: