diff --git a/Algorithms/CMakeLists.txt b/Algorithms/CMakeLists.txt index 148e97935c72d623c45b065bf8268abcab615b6b..a9131529eda70dbc4309492fd0aa1d8e03fbaa69 100644 --- a/Algorithms/CMakeLists.txt +++ b/Algorithms/CMakeLists.txt @@ -1,6 +1,5 @@ add_subdirectory(Digitization) add_subdirectory(Fatras) add_subdirectory(Generators) -add_subdirectory(MaterialMapping) -add_subdirectory(ParticleGun) +#add_subdirectory(MaterialMapping) add_subdirectory(Propagation) diff --git a/Algorithms/MaterialMapping/CMakeLists.txt b/Algorithms/MaterialMapping/CMakeLists.txt index 63f151b27fbac81ca97d2b67070a74bac52f6cdc..081d29199caaf9ca6f4b8d7ea3b06614025353f5 100644 --- a/Algorithms/MaterialMapping/CMakeLists.txt +++ b/Algorithms/MaterialMapping/CMakeLists.txt @@ -1,8 +1,8 @@ file(GLOB_RECURSE src_files "src/MaterialMapping.cpp") -if (USE_GEANT4) - SET(src_files "src/GeantinoRecording.cpp" ${src_files}) - include(${Geant4_USE_FILE}) -endif() +#if (USE_GEANT4) +# SET(src_files "src/GeantinoRecording.cpp" ${src_files}) +# include(${Geant4_USE_FILE}) +#endif() add_library(ACTFWMaterialMapping SHARED ${src_files}) target_include_directories(ACTFWMaterialMapping PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/> $<INSTALL_INTERFACE:include>) diff --git a/Algorithms/Propagation/include/ACTFW/Propagation/PropagationAlgorithm.ipp b/Algorithms/Propagation/include/ACTFW/Propagation/PropagationAlgorithm.ipp index fc06ee1363ac8feb2e30c37047e4b9a3c605ea04..a4b5a1a31eb9b262794dab2f9d003d3575ba4956 100644 --- a/Algorithms/Propagation/include/ACTFW/Propagation/PropagationAlgorithm.ipp +++ b/Algorithms/Propagation/include/ACTFW/Propagation/PropagationAlgorithm.ipp @@ -205,18 +205,14 @@ PropagationAlgorithm<propagator_t>::execute( } // Write the propagation step data to the event store - if (context.eventStore.add(m_cfg.propagationStepCollection, - std::move(propagationSteps)) - == FW::ProcessCode::ABORT) { - return FW::ProcessCode::ABORT; - } + context.eventStore.add(m_cfg.propagationStepCollection, + std::move(propagationSteps)); // Write the recorded material to the event store - if (m_cfg.recordMaterialInteractions - && context.eventStore.add(m_cfg.propagationMaterialCollection, - std::move(recordedMaterial)) - == FW::ProcessCode::ABORT) { - return FW::ProcessCode::ABORT; + if (m_cfg.recordMaterialInteractions){ + context.eventStore.add(m_cfg.propagationMaterialCollection, + std::move(recordedMaterial)); + } return ProcessCode::SUCCESS; diff --git a/Core/include/ACTFW/Writers/ISurfaceMaterialWriter.hpp b/Core/include/ACTFW/Writers/ISurfaceMaterialWriter.hpp deleted file mode 100644 index 6dbe7485e32da5a8936129d77496a7aa37983389..0000000000000000000000000000000000000000 --- a/Core/include/ACTFW/Writers/ISurfaceMaterialWriter.hpp +++ /dev/null @@ -1,44 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2017 Acts project team -// -// 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/. - -/////////////////////////////////////////////////////////////////// -// ISurfaceMaterialWriter.h -/////////////////////////////////////////////////////////////////// - -#pragma once - -#include <memory> -#include "ACTFW/Framework/IService.hpp" -#include "ACTFW/Framework/ProcessCode.hpp" - -namespace Acts { -class SurfaceMaterial; -class GeometryID; -} - -namespace FW { - -/// @class ISurfaceMaterialWriter -/// -/// Interface class for writing out the material -/// - -class ISurfaceMaterialWriter : public IService -{ -public: - /// Virtual destructor - virtual ~ISurfaceMaterialWriter() = default; - - /// Writes out the material map of the layer - virtual FW::ProcessCode - write(const Acts::ISurfaceMaterial& material, - const Acts::GeometryID& geoID, - const std::string& name) - = 0; -}; -} diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt index ffefb57d880b47f960762aff6de106e1c20f7033..984562012edb67216171d270a291d18aaf193371 100644 --- a/Examples/CMakeLists.txt +++ b/Examples/CMakeLists.txt @@ -6,8 +6,7 @@ add_subdirectory(EventGenerator) add_subdirectory_if(Fatras USE_PYTHIA8) add_subdirectory(Geometry) add_subdirectory(HelloWorld) -add_subdirectory(MaterialMapping) -add_subdirectory(ParticleGun) +#add_subdirectory(MaterialMapping) add_subdirectory(Propagation) add_subdirectory(RandomNumbers) add_subdirectory(WhiteBoard) diff --git a/Examples/Common/include/ACTFW/Common/GeometryOptions.hpp b/Examples/Common/include/ACTFW/Common/GeometryOptions.hpp deleted file mode 100644 index 8c64bd34048ed853f65b57e2d64795b4cbcc44f3..0000000000000000000000000000000000000000 --- a/Examples/Common/include/ACTFW/Common/GeometryOptions.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018 Acts project team -// -// 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 <cstdlib> -#include <iostream> -#include <utility> -#include "ACTFW/Utilities/Options.hpp" - -namespace po = boost::program_options; - -namespace FW { -namespace Options { - - /// the options for the geometry building with 'geo-' prefix - template <typename aopt_t> - void - addGeometryOptions(aopt_t& opt) - { - opt.add_options()("geo-surface-loglevel", - po::value<size_t>()->default_value(3), - "The outoput log level for the surface building.")( - "geo-layer-loglevel", - po::value<size_t>()->default_value(3), - "The output log level for the layer building.")( - "geo-volume-loglevel", - po::value<size_t>()->default_value(3), - "The output log level for the volume building.")( - "geo-subdetectors", - po::value<read_strings>()->multitoken()->default_value({{}}), - "Sub detectors for the output writing"); - } -} // namespace Options -} // namespace FW diff --git a/Examples/Common/include/ACTFW/Common/InputOptions.hpp b/Examples/Common/include/ACTFW/Common/InputOptions.hpp deleted file mode 100644 index 332cac1226c3657e310386eafba138d82e9b4610..0000000000000000000000000000000000000000 --- a/Examples/Common/include/ACTFW/Common/InputOptions.hpp +++ /dev/null @@ -1,45 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018 Acts project team -// -// 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 <cstdlib> -#include <iostream> -#include <utility> -#include "ACTFW/Utilities/Options.hpp" - -namespace po = boost::program_options; - -namespace FW { -namespace Options { - - /// @brief the common output options that are added to the - /// job options - /// - /// @tparam aopt_t Type of the options object, bound to boost API - /// @param [in] opt The options object for attaching specific options - template <typename aopt_t> - void - addInputOptions(aopt_t& opt) - { - // Add specific options for this example - opt.add_options()("input-dir", - po::value<std::string>()->default_value(""), - "Input directory location.")( - "input-root", - po::value<bool>()->default_value(false), - "Switch on to write '.root' output file(s).")( - "input-files", - po::value<std::string>()->default_value(""), - "The input file list, comma separated if needed.")( - "input-collection", - po::value<std::string>()->default_value(""), - "The input collection to be read."); - } -} // namespace Options -} // namespace FW \ No newline at end of file diff --git a/Examples/Common/include/ACTFW/Common/MaterialOptions.hpp b/Examples/Common/include/ACTFW/Common/MaterialOptions.hpp deleted file mode 100644 index db21a5499be705b6c47d7026f216b6ecc982135f..0000000000000000000000000000000000000000 --- a/Examples/Common/include/ACTFW/Common/MaterialOptions.hpp +++ /dev/null @@ -1,160 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2019 Acts project team -// -// 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 <fstream> -#include "ACTFW/Plugins/Json/JsonGeometryConverter.hpp" -#include "ACTFW/Plugins/Json/JsonMaterialDecorator.hpp" -#include "Acts/Detector/TrackingVolume.hpp" -#include "Acts/Material/IMaterialDecorator.hpp" -#include "Acts/Surfaces/Surface.hpp" - -namespace po = boost::program_options; - -namespace FW { - -/// @brief standard material wiper -/// -/// It removes the material of surfaces/volumes if configured -/// to do so -class MaterialWiper : public Acts::IMaterialDecorator -{ -public: - /// Create a material wiper - /// - /// @param sf is the surface wiping directive - /// @param vol is the volume wiping directive - MaterialWiper(bool sf = true, bool vol = true) - : m_wipeSurfaceMaterial(sf), m_wipeVolumeMaterial(vol) - { - } - - /// Decorate a surface - /// - /// @param surface the non-cost surface that is decorated - void - decorate(Acts::Surface& surface) const final - { - if (m_wipeSurfaceMaterial) { - surface.assignSurfaceMaterial(nullptr); - } - } - - /// Decorate a TrackingVolume - /// - /// @param volume the non-cost volume that is decorated - void - decorate(Acts::TrackingVolume& volume) const final - { - if (m_wipeVolumeMaterial) { - volume.assignVolumeMaterial(nullptr); - } - } - -private: - bool m_wipeSurfaceMaterial{true}; - bool m_wipeVolumeMaterial{true}; -}; - -namespace Options { - - /// The options for the material loading - template <typename aopt_t> - void - addMaterialOptions(aopt_t& opt) - { - opt.add_options()("mat-type", - po::value<size_t>()->default_value(1), - "The type for the material: 0 - none, 1 - " - "building, 2 - reading")( - "mat-input-file", - po::value<std::string>()->default_value(""), - "The filename for the material, auto-detects loading plugin")( - "mat-output-file", - po::value<std::string>()->default_value(""), - "The filename for the material, auto-detects loading plugin")( - "mat-input-sensitives", - po::value<bool>()->default_value(true), - "Input the sensitive surface material description.")( - "mat-input-approaches", - po::value<bool>()->default_value(true), - "Input the approach surface material description")( - "mat-input-representing", - po::value<bool>()->default_value(true), - "Input the layer representing surface material description")( - "mat-input-boundaries", - po::value<bool>()->default_value(true), - "Input the lboundary surface material description")( - "mat-input-volume", - po::value<bool>()->default_value(true), - "Input the volume material description")( - "mat-output-data", - po::value<bool>()->default_value(true), - "Otuput the data field of material description.")( - "mat-output-sensitives", - po::value<bool>()->default_value(true), - "Otuput the sensitive surface material description.")( - "mat-output-approaches", - po::value<bool>()->default_value(true), - "Otuput the approach surface material description")( - "mat-output-representing", - po::value<bool>()->default_value(true), - "Otuput the layer representing surface material description")( - "mat-output-boundaries", - po::value<bool>()->default_value(true), - "Otuput the lboundary surface material description")( - "mat-output-volume", - po::value<bool>()->default_value(true), - "Otuput the volume material description"); - } - - /// Read the material decorator - /// - /// @tparam amap_t Type of the options map - /// - /// @param[in] vm Map to be read in - template <typename amap_t> - std::shared_ptr<const Acts::IMaterialDecorator> - readMaterialDecorator(const amap_t& vm) - { - - auto mType = vm["mat-type"].template as<size_t>(); - if (mType == 0) { - return std::make_shared<const MaterialWiper>(true, true); - } else if (mType == 2) { - // determine the file name and type - auto mFileName = vm["mat-input-file"].template as<std::string>(); - if (mFileName.find(".root") != std::string::npos) { - - } else if (mFileName.find(".json") != std::string::npos) { - // the material writer - FW::Json::JsonGeometryConverter::Config jmConverterCfg( - "JsonGeometryConverter", Acts::Logging::INFO); - jmConverterCfg.processSensitives - = vm["mat-input-sensitives"].template as<bool>(); - jmConverterCfg.processApproaches - = vm["mat-input-approaches"].template as<bool>(); - jmConverterCfg.processRepresenting - = vm["mat-input-representing"].template as<bool>(); - jmConverterCfg.processBoundaries - = vm["mat-input-boundaries"].template as<bool>(); - jmConverterCfg.processVolumes - = vm["mat-input-volume"].template as<bool>(); - auto jsonDecorator - = std::make_shared<const FW::Json::JsonMaterialDecorator>( - jmConverterCfg, mFileName); - return jsonDecorator; - } - } - - return nullptr; - } - -} // namespace -} // namespace diff --git a/Examples/Common/include/ACTFW/Common/OutputOptions.hpp b/Examples/Common/include/ACTFW/Common/OutputOptions.hpp deleted file mode 100644 index c59f75bcd10b6776fa636915048ab90b1b90b0ed..0000000000000000000000000000000000000000 --- a/Examples/Common/include/ACTFW/Common/OutputOptions.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2018 Acts project team -// -// 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 <cstdlib> -#include <iostream> -#include <utility> -#include "ACTFW/Utilities/Options.hpp" - -namespace po = boost::program_options; - -namespace FW { -namespace Options { - - /// @brief the common output options that are added to the - /// job options - /// - /// @tparam aopt_t Type of the options object, bound to boost API - /// @param [in] opt The options object for attaching specific options - template <typename aopt_t> - void - addOutputOptions(aopt_t& opt) - { - // Add specific options for this example - opt.add_options()("output-dir", - po::value<std::string>()->default_value(""), - "Output directory location.")( - "output-root", - po::value<bool>()->default_value(false), - "Switch on to write '.root' output file(s).")( - "output-csv", - po::value<bool>()->default_value(false), - "Switch on to write '.csv' output file(s).")( - "output-obj", - po::value<bool>()->default_value(false), - "Switch on to write '.obj' ouput file(s).")( - "output-json", - po::value<bool>()->default_value(false), - "Switch on to write '.json' ouput file(s).")( - "output-txt", - po::value<bool>()->default_value(false), - "Switch on to write '.txt' ouput file(s)."); - } -} // namespace Options -} // namespace FW \ No newline at end of file diff --git a/Examples/Fatras/CMakeLists.txt b/Examples/Fatras/CMakeLists.txt index 3e366cb91d059edd47a76bf29c074aa495e8d9ee..1c598a2327c231a19a9c02ec6f0c79576c5e64d7 100644 --- a/Examples/Fatras/CMakeLists.txt +++ b/Examples/Fatras/CMakeLists.txt @@ -9,83 +9,67 @@ set(_common_libraries ACTFWFatras ACTFWObjPlugin ACTFWRootPlugin + ACTFWTxtPlugin ActsFrameworkGenerators ActsFrameworkPythia8) # Generic detector add_executable(ACTFWGenericFatrasExample src/GenericFatrasExample.cpp) - -target_include_directories(ACTFWGenericFatrasExample PRIVATE ${Boost_INCLUDE_DIRS}) -target_link_libraries(ACTFWGenericFatrasExample PRIVATE ActsCore FatrasCore) -target_link_libraries(ACTFWGenericFatrasExample PRIVATE ACTFramework ACTFWExamplesCommon) -target_link_libraries(ACTFWGenericFatrasExample PRIVATE ACTFWFatras ACTFWReadEvgen ACTFWParticleGun ACTFWDigitization) -target_link_libraries(ACTFWGenericFatrasExample PRIVATE ACTFWBFieldPlugin ACTFWPluginPythia8) -target_link_libraries(ACTFWGenericFatrasExample PRIVATE ACTFWObjPlugin ACTFWJsonPlugin ACTFWRootPlugin ACTFWCsvPlugin ACTFWTxtPlugin) -target_link_libraries(ACTFWGenericFatrasExample PRIVATE ACTFWGenericDetector) - -target_link_libraries(ACTFWGenericFatrasExample PRIVATE ${Boost_LIBRARIES}) - -install(TARGETS ACTFWGenericFatrasExample RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +target_include_directories(ACTFWGenericFatrasExample PRIVATE + ${Boost_INCLUDE_DIRS}) +target_link_libraries(ACTFWGenericFatrasExample PRIVATE + ${_common_libraries} + ACTFWGenericDetector) +install( + TARGETS ACTFWGenericFatrasExample + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) # Generic detector with IOV based alignment add_executable(ACTFWAlignedFatrasExample src/AlignedFatrasExample.cpp) -target_include_directories(ACTFWAlignedFatrasExample PRIVATE ${Boost_INCLUDE_DIRS}) -target_link_libraries(ACTFWAlignedFatrasExample PRIVATE ActsCore FatrasCore) -target_link_libraries(ACTFWAlignedFatrasExample PRIVATE ACTFramework ACTFWExamplesCommon) -target_link_libraries(ACTFWAlignedFatrasExample PRIVATE ACTFWFatras ACTFWReadEvgen ACTFWParticleGun ACTFWDigitization) -target_link_libraries(ACTFWAlignedFatrasExample PRIVATE ACTFWBFieldPlugin ACTFWPluginPythia8) -target_link_libraries(ACTFWAlignedFatrasExample PRIVATE ACTFWObjPlugin ACTFWJsonPlugin ACTFWRootPlugin ACTFWCsvPlugin ACTFWTxtPlugin) -target_link_libraries(ACTFWAlignedFatrasExample PRIVATE ACTFWContextualDetector) - -target_link_libraries(ACTFWAlignedFatrasExample PRIVATE ${Boost_LIBRARIES}) - -install(TARGETS ACTFWAlignedFatrasExample RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +target_include_directories(ACTFWAlignedFatrasExample PRIVATE + ${Boost_INCLUDE_DIRS}) +target_link_libraries(ACTFWAlignedFatrasExample PRIVATE + ${_common_libraries} + ACTFWContextualDetector) +install( + TARGETS ACTFWAlignedFatrasExample + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) # Generic detector with Payload based alignment add_executable(ACTFWPayloadFatrasExample src/PayloadFatrasExample.cpp) -target_include_directories(ACTFWPayloadFatrasExample PRIVATE ${Boost_INCLUDE_DIRS}) -target_link_libraries(ACTFWPayloadFatrasExample PRIVATE ActsCore FatrasCore) -target_link_libraries(ACTFWPayloadFatrasExample PRIVATE ACTFramework ACTFWExamplesCommon) -target_link_libraries(ACTFWPayloadFatrasExample PRIVATE ACTFWFatras ACTFWReadEvgen ACTFWParticleGun ACTFWDigitization) -target_link_libraries(ACTFWPayloadFatrasExample PRIVATE ACTFWBFieldPlugin ACTFWPluginPythia8) -target_link_libraries(ACTFWPayloadFatrasExample PRIVATE ACTFWObjPlugin ACTFWJsonPlugin ACTFWRootPlugin ACTFWCsvPlugin ACTFWTxtPlugin) -target_link_libraries(ACTFWPayloadFatrasExample PRIVATE ACTFWContextualDetector) - -target_link_libraries(ACTFWPayloadFatrasExample PRIVATE ${Boost_LIBRARIES}) - -install(TARGETS ACTFWPayloadFatrasExample RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - +target_include_directories(ACTFWPayloadFatrasExample PRIVATE + ${Boost_INCLUDE_DIRS}) +target_link_libraries(ACTFWPayloadFatrasExample PRIVATE + ${_common_libraries} + ACTFWContextualDetector) +install( + TARGETS ACTFWPayloadFatrasExample + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) # TGEO based detector if (USE_TGEO) add_executable(ACTFWTGeoFatrasExample src/TGeoFatrasExample.cpp) - - target_include_directories(ACTFWTGeoFatrasExample PRIVATE ${Boost_INCLUDE_DIRS}) - target_link_libraries(ACTFWTGeoFatrasExample PRIVATE ActsCore FatrasCore) - target_link_libraries(ACTFWTGeoFatrasExample PRIVATE ACTFramework ACTFWExamplesCommon) - target_link_libraries(ACTFWTGeoFatrasExample PRIVATE ACTFWFatras ACTFWReadEvgen ACTFWParticleGun ACTFWDigitization) - target_link_libraries(ACTFWTGeoFatrasExample PRIVATE ACTFWBFieldPlugin ACTFWPluginPythia8) - target_link_libraries(ACTFWTGeoFatrasExample PRIVATE ACTFWObjPlugin ACTFWJsonPlugin ACTFWRootPlugin ACTFWCsvPlugin ACTFWTxtPlugin) - target_link_libraries(ACTFWTGeoFatrasExample PRIVATE ACTFWTGeoDetector) - - target_link_libraries(ACTFWTGeoFatrasExample PRIVATE ${Boost_LIBRARIES}) - - install(TARGETS ACTFWTGeoFatrasExample RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + target_include_directories(ACTFWTGeoFatrasExample PRIVATE + ${Boost_INCLUDE_DIRS}) + target_link_libraries(ACTFWTGeoFatrasExample PRIVATE + ${_common_libraries} + ACTFWTGeoDetector) + install( + TARGETS ACTFWTGeoFatrasExample + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() # DD4hep detector if (USE_DD4HEP) add_executable(ACTFWDD4hepFatrasExample src/DD4hepFatrasExample.cpp) - target_include_directories(ACTFWDD4hepFatrasExample PRIVATE ${DD4hep_INCLUDE_DIRS}) - target_include_directories(ACTFWDD4hepFatrasExample PRIVATE ${Boost_INCLUDE_DIRS}) - target_link_libraries(ACTFWDD4hepFatrasExample PRIVATE ActsCore FatrasCore) - target_link_libraries(ACTFWDD4hepFatrasExample PRIVATE ACTFramework ACTFWExamplesCommon) - target_link_libraries(ACTFWDD4hepFatrasExample PRIVATE ACTFWFatras ACTFWReadEvgen ACTFWParticleGun ACTFWDigitization) - target_link_libraries(ACTFWDD4hepFatrasExample PRIVATE ACTFWBFieldPlugin ACTFWPluginPythia8) - target_link_libraries(ACTFWDD4hepFatrasExample PRIVATE ACTFWObjPlugin ACTFWJsonPlugin ACTFWRootPlugin ACTFWCsvPlugin ACTFWTxtPlugin) - target_link_libraries(ACTFWDD4hepFatrasExample PRIVATE ACTFWDD4hepDetector) - target_link_libraries(ACTFWDD4hepFatrasExample PRIVATE ${DD4hep_LIBRARIES}) - target_link_libraries(ACTFWDD4hepFatrasExample PRIVATE ${Boost_LIBRARIES}) - - install(TARGETS ACTFWDD4hepFatrasExample RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + target_include_directories(ACTFWDD4hepFatrasExample PRIVATE + ${Boost_INCLUDE_DIRS} + ${DD4hep_INCLUDE_DIRS}) + target_link_libraries(ACTFWDD4hepFatrasExample PRIVATE + ${_common_libraries} + ACTFWDD4hepDetector + ${DD4hep_LIBRARIES}) + install( + TARGETS ACTFWDD4hepFatrasExample + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/Examples/Fatras/src/detail/FatrasDigitizationBase.hpp b/Examples/Fatras/src/detail/FatrasDigitizationBase.hpp index f2ba6874bbdd4605e12fbde97a94a3fa37106cc2..76ac55a6652ca72f4a5dd5887752f0fded0f9876 100644 --- a/Examples/Fatras/src/detail/FatrasDigitizationBase.hpp +++ b/Examples/Fatras/src/detail/FatrasDigitizationBase.hpp @@ -86,7 +86,7 @@ setupDigitization(vmap_t& vm, auto clusteWriterTxt = std::make_shared<FW::Txt::TxtPlanarClusterWriter>( clusterWriterTxtConfig); // Add to the sequencer - sequencer.addWriters({clusteWriterTxt}); + sequencer.addWriter(clusteWriterTxt); } // Write digitsation output as OBJ files diff --git a/Examples/Fatras/src/detail/FatrasExampleBase.hpp b/Examples/Fatras/src/detail/FatrasExampleBase.hpp index 5d0bf929097c54a53b145e3ed91a2f9ca5944a88..25bbb7cba34ea796f31181d7cc8447812275a518 100644 --- a/Examples/Fatras/src/detail/FatrasExampleBase.hpp +++ b/Examples/Fatras/src/detail/FatrasExampleBase.hpp @@ -13,10 +13,6 @@ #include <boost/program_options.hpp> #include "ACTFW/Barcode/BarcodeSvc.hpp" -#include "ACTFW/Common/CommonOptions.hpp" -#include "ACTFW/Common/GeometryOptions.hpp" -#include "ACTFW/Common/MaterialOptions.hpp" -#include "ACTFW/Common/OutputOptions.hpp" #include "ACTFW/Digitization/DigitizationOptions.hpp" #include "ACTFW/Fatras/FatrasOptions.hpp" #include "ACTFW/Framework/Sequencer.hpp" @@ -27,8 +23,7 @@ #include "ACTFW/Plugins/Csv/CsvParticleWriter.hpp" #include "ACTFW/Random/RandomNumbersOptions.hpp" #include "ACTFW/Random/RandomNumbersSvc.hpp" -#include "ACTFW/ReadEvgen/ReadEvgenOptions.hpp" -#include "Acts/Material/IMaterialDecorator.hpp" + #include "FatrasDigitizationBase.hpp" #include "FatrasEvgenBase.hpp" #include "FatrasSimulationBase.hpp" @@ -51,36 +46,19 @@ fatrasExample(int argc, options_setup_t& optionsSetup, geometry_setup_t& geometrySetup) { - - // Create the config object for the sequencer - FW::Sequencer::Config seqConfig; - // Now create the sequencer - FW::Sequencer sequencer(seqConfig); - // Declare the supported program options. - po::options_description desc("Allowed options"); - // Add the Common options - FW::Options::addCommonOptions<po::options_description>(desc); - // Add the geometry options - FW::Options::addGeometryOptions<po::options_description>(desc); - // Add the material options - FW::Options::addMaterialOptions<po::options_description>(desc); - // Add the particle gun options - FW::Options::addParticleGunOptions<po::options_description>(desc); - // Add the Pythia 8 options - FW::Options::addPythia8Options<po::options_description>(desc); - // Add the evgen options - FW::Options::addEvgenReaderOptions<po::options_description>(desc); - // Add the random number options - FW::Options::addRandomNumbersOptions<po::options_description>(desc); - // Add the bfield options - FW::Options::addBFieldOptions<po::options_description>(desc); - // Add the fatras options - FW::Options::addFatrasOptions<po::options_description>(desc); - // Add the digization options - FW::Options::addDigitizationOptions<po::options_description>(desc); - // Add the output options - FW::Options::addOutputOptions<po::options_description>(desc); - // Add program specific options: input / output + using boost::program_options::value; + + // setup and parse options + auto desc = FW::Options::makeDefaultOptions(); + FW::Options::addSequencerOptions(desc); + FW::Options::addGeometryOptions(desc); + FW::Options::addParticleGunOptions(desc); + FW::Options::addPythia8Options(desc); + FW::Options::addRandomNumbersOptions(desc); + FW::Options::addBFieldOptions(desc); + FW::Options::addFatrasOptions(desc); + FW::Options::addDigitizationOptions(desc); + FW::Options::addOutputOptions(desc); desc.add_options()("evg-input-type", value<std::string>()->default_value("pythia8"), "Type of evgen input 'gun', 'pythia8'"); @@ -109,11 +87,8 @@ fatrasExample(int argc, // Add it to the sequencer sequencer.addService(barcodeSvc); - // Material loading from external source - auto mDecorator = FW::Options::readMaterialDecorator<po::variables_map>(vm); - // Create the geometry and the context decorators - auto geometry = geometrySetup(vm, mDecorator); + auto geometry = geometrySetup(vm, nullptr); auto tGeometry = geometry.first; auto contextDecorators = geometry.second; diff --git a/Examples/Fatras/src/detail/FatrasSimulationBase.hpp b/Examples/Fatras/src/detail/FatrasSimulationBase.hpp index e50f9beefa6753fa0cc8767c5b730d2c15a89d98..90c65405d0bccacfa29c798111c36aad9375f7fd 100644 --- a/Examples/Fatras/src/detail/FatrasSimulationBase.hpp +++ b/Examples/Fatras/src/detail/FatrasSimulationBase.hpp @@ -19,7 +19,6 @@ #include "ACTFW/Plugins/Csv/CsvParticleWriter.hpp" #include "ACTFW/Plugins/Root/RootParticleWriter.hpp" #include "ACTFW/Plugins/Root/RootSimHitWriter.hpp" -#include "ACTFW/Plugins/Txt/TxtParticleWriter.hpp" #include "ACTFW/Random/RandomNumbersSvc.hpp" #include "ACTFW/Utilities/Paths.hpp" #include "Acts/Detector/TrackingGeometry.hpp" @@ -194,21 +193,6 @@ setupSimulationAlgorithm( std::make_shared<FW::Csv::CsvParticleWriter>(pWriterCsvConfig)); } - // Write simulation information as Txt files - std::shared_ptr<FW::Txt::TxtParticleWriter> pWriterTxt = nullptr; - if (vm["output-txt"].template as<bool>()) { - FW::Txt::TxtParticleWriter::Config pWriterTxtConfig; - pWriterTxtConfig.collection = fatrasConfig.simulatedEventCollection; - pWriterTxtConfig.outputDir = outputDir; - pWriterTxtConfig.outputTrkFileName = "tracks.txt"; - pWriterTxtConfig.outputVtxFileName = "vertices.txt"; - pWriterTxtConfig.barcodeSvc = barcodeSvc; - auto pWriterTxt - = std::make_shared<FW::Txt::TxtParticleWriter>(pWriterTxtConfig); - - sequencer.addWriters({pWriterTxt}); - } - // Write simulation information as ROOT files std::shared_ptr<FW::Root::RootParticleWriter> pWriterRoot = nullptr; if (vm["output-root"].template as<bool>()) { diff --git a/Examples/Geometry/src/detail/GeometryExampleBase.hpp b/Examples/Geometry/src/detail/GeometryExampleBase.hpp index bbc4e2bda1b523ca82fb9741c0e4958f1724e742..612c32211c512d9bbd129a594d9239f501f9ca6a 100644 --- a/Examples/Geometry/src/detail/GeometryExampleBase.hpp +++ b/Examples/Geometry/src/detail/GeometryExampleBase.hpp @@ -11,6 +11,7 @@ #include <memory> #include <string> #include <vector> + #include "ACTFW/Framework/AlgorithmContext.hpp" #include "ACTFW/Framework/IContextDecorator.hpp" #include "ACTFW/Framework/WhiteBoard.hpp" @@ -18,15 +19,13 @@ #include "ACTFW/Plugins/Csv/CsvSurfaceWriter.hpp" #include "ACTFW/Plugins/Csv/CsvTrackingGeometryWriter.hpp" #include "ACTFW/Plugins/Csv/CsvWriterOptions.hpp" -#include "ACTFW/Plugins/Json/JsonGeometryConverter.hpp" #include "ACTFW/Plugins/Obj/ObjSurfaceWriter.hpp" #include "ACTFW/Plugins/Obj/ObjTrackingGeometryWriter.hpp" #include "ACTFW/Plugins/Obj/ObjWriterOptions.hpp" +#include "ACTFW/Plugins/Json/JsonGeometryConverter.hpp" #include "ACTFW/Utilities/Options.hpp" #include "ACTFW/Utilities/Paths.hpp" #include "Acts/Detector/TrackingGeometry.hpp" -#include "Acts/Material/IMaterialDecorator.hpp" -#include "Acts/Plugins/Json/lib/json.hpp" #include "Acts/Utilities/GeometryContext.hpp" template <typename options_setup_t, typename geometry_setup_t> @@ -36,20 +35,12 @@ processGeometry(int argc, options_setup_t& optionsSetup, geometry_setup_t& geometrySetup) { - - // Declare the supported program options. - po::options_description desc("Allowed options"); - // Add the standard/common options - FW::Options::addCommonOptions<po::options_description>(desc); - // Add options for the Obj writing - FW::Options::addObjWriterOptions<po::options_description>(desc); - // Add the geometry options - FW::Options::addGeometryOptions<po::options_description>(desc); - // Add the geometry options - FW::Options::addMaterialOptions<po::options_description>(desc); - // Add the output options - FW::Options::addOutputOptions<po::options_description>(desc); - + // setup and parse options + auto desc = FW::Options::makeDefaultOptions(); + FW::Options::addSequencerOptions(desc); + FW::Options::addGeometryOptions(desc); + FW::Options::addObjWriterOptions(desc); + FW::Options::addOutputOptions(desc); // Add specific options for this geometry optionsSetup(desc); auto vm = FW::Options::parse(desc, argc, argv); @@ -58,13 +49,11 @@ processGeometry(int argc, } // Now read the standard options - auto logLevel = FW::Options::readLogLevel<po::variables_map>(vm); - auto nEvents = FW::Options::readNumberOfEvents<po::variables_map>(vm); - - // Material loading from external source - auto mDecorator = FW::Options::readMaterialDecorator<po::variables_map>(vm); - - auto geometry = geometrySetup(vm, mDecorator); + auto logLevel = FW::Options::readLogLevel(vm); + // TODO Check whether this truly needs to be event-based. If yes switch to + // Sequencer-based tool, otherwise remove. + auto nEvents = FW::Options::readSequencerConfig(vm).events; + auto geometry = geometrySetup(vm, nullptr); auto tGeometry = geometry.first; auto contextDecorators = geometry.second; @@ -80,136 +69,107 @@ processGeometry(int argc, for (size_t ievt = 0; ievt < nEvents; ++ievt) { - // Setup the event and algorithm context - FW::WhiteBoard eventStore( - Acts::getDefaultLogger("EventStore#" + std::to_string(0), logLevel)); - size_t ialg = 0; - - // The geometry context - FW::AlgorithmContext context(ialg, ievt, eventStore); - - /// Decorate the context - for (auto& cdr : contextDecorators) { - if (cdr->decorate(context) != FW::ProcessCode::SUCCESS) - throw std::runtime_error("Failed to decorate event context"); - } - - std::string geoContextStr = ""; - if (contextDecorators.size() > 0) { - // 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<std::string>(); - - // OBJ output - if (vm["output-obj"].as<bool>()) { - // The writers - std::vector<std::shared_ptr<FW::Obj::ObjSurfaceWriter>> subWriters; - std::vector<std::shared_ptr<std::ofstream>> subStreams; - // Loop and create the obj output writers per defined sub detector - for (auto sdet : subDetectors) { - // Sub detector stream - auto sdStream = std::shared_ptr<std::ofstream>(new std::ofstream); - std::string sdOutputName - = FW::joinPaths(outputDir, sdet + geoContextStr + ".obj"); - sdStream->open(sdOutputName); - // Object surface writers - FW::Obj::ObjSurfaceWriter::Config sdObjWriterConfig - = FW::Options::readObjSurfaceWriterConfig( - vm, sdet, surfaceLogLevel); - sdObjWriterConfig.outputStream = sdStream; - // Let's not write the layer surface when we have misalignment - if (contextDecorators.size() > 0) { - sdObjWriterConfig.outputLayerSurface = false; - } - auto sdObjWriter - = std::make_shared<FW::Obj::ObjSurfaceWriter>(sdObjWriterConfig); - // Push back - subWriters.push_back(sdObjWriter); - subStreams.push_back(sdStream); - } - - // Configure the tracking geometry writer - auto tgObjWriterConfig = FW::Options::readObjTrackingGeometryWriterConfig( - vm, "ObjTrackingGeometryWriter", volumeLogLevel); - - tgObjWriterConfig.surfaceWriters = subWriters; - auto tgObjWriter = std::make_shared<FW::Obj::ObjTrackingGeometryWriter>( - tgObjWriterConfig); - - // Write the tracking geometry object - tgObjWriter->write(context, *tGeometry); - - // Close the output streams - for (auto sStreams : subStreams) { - sStreams->close(); - } - } - - // CSV output - if (vm["output-csv"].as<bool>()) { - - auto csvStream = std::shared_ptr<std::ofstream>(new std::ofstream); - std::string csvOutputName = "Detector" + geoContextStr + ".csv"; - csvStream->open(csvOutputName); - - FW::Csv::CsvSurfaceWriter::Config sfCsvWriterConfig - = FW::Options::readCsvSurfaceWriterConfig(vm, "CsvSurfaceWriter"); - sfCsvWriterConfig.outputStream = csvStream; - auto sfCsvWriter - = std::make_shared<FW::Csv::CsvSurfaceWriter>(sfCsvWriterConfig); - - // Configure the tracking geometry writer - FW::Csv::CsvTrackingGeometryWriter::Config tgCsvWriterConfig - = FW::Options::readCsvTrackingGeometryWriterConfig( - vm, "CsvTrackingGeometryWriter"); - tgCsvWriterConfig.surfaceWriter = sfCsvWriter; - tgCsvWriterConfig.layerPrefix = "\n"; - // The tracking geometry writer - auto tgCsvWriter = std::make_shared<FW::Csv::CsvTrackingGeometryWriter>( - tgCsvWriterConfig); - - // Write the tracking geometry object - tgCsvWriter->write(context, *(tGeometry.get())); - - // Close the file - csvStream->close(); - } - - // OBJ output - if (vm["output-json"].as<bool>()) { - - /// The name of the output file - std::string fileName = vm["mat-output-file"].template as<std::string>(); - // the material writer - FW::Json::JsonGeometryConverter::Config jmConverterCfg( - "JsonGeometryConverter", Acts::Logging::INFO); - jmConverterCfg.processSensitives - = vm["mat-output-sensitives"].template as<bool>(); - jmConverterCfg.processApproaches - = vm["mat-output-approaches"].template as<bool>(); - jmConverterCfg.processRepresenting - = vm["mat-output-representing"].template as<bool>(); - jmConverterCfg.processBoundaries - = vm["mat-output-boundaries"].template as<bool>(); - jmConverterCfg.processVolumes - = vm["mat-output-volume"].template as<bool>(); - jmConverterCfg.writeData = vm["mat-output-data"].template as<bool>(); - - FW::Json::JsonGeometryConverter jmConverter(jmConverterCfg); - - auto jout = jmConverter.trackingGeometryToJson(*(tGeometry.get())); - // write prettified JSON to another file - std::string jsonOutputName = fileName + geoContextStr + ".json"; - std::ofstream ofj(jsonOutputName); - ofj << std::setw(4) << jout << std::endl; - } - } - - return 0; -} + // Setup the event and algorithm context + FW::WhiteBoard eventStore( + Acts::getDefaultLogger("EventStore#" + std::to_string(0), logLevel)); + size_t ialg = 0; + + // The geometry context + FW::AlgorithmContext context(ialg, ievt, eventStore); + + /// Decorate the context + for (auto& cdr : contextDecorators) { + if (cdr->decorate(context) != FW::ProcessCode::SUCCESS) + throw std::runtime_error("Failed to decorate event context"); + } + + std::string geoContextStr = ""; + if (contextDecorators.size() > 0) { + // 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<std::string>(); + + // OBJ output + if (vm["output-obj"].as<bool>()) { + // The writers + std::vector<std::shared_ptr<FW::Obj::ObjSurfaceWriter>> subWriters; + std::vector<std::shared_ptr<std::ofstream>> subStreams; + // Loop and create the obj output writers per defined sub detector + for (auto sdet : subDetectors) { + // Sub detector stream + auto sdStream = std::shared_ptr<std::ofstream>(new std::ofstream); + std::string sdOutputName + = FW::joinPaths(outputDir, sdet + geoContextStr + ".obj"); + sdStream->open(sdOutputName); + // Object surface writers + FW::Obj::ObjSurfaceWriter::Config sdObjWriterConfig + = FW::Options::readObjSurfaceWriterConfig( + vm, sdet, surfaceLogLevel); + sdObjWriterConfig.outputStream = sdStream; + // Let's not write the layer surface when we have misalignment + if (contextDecorators.size() > 0) { + sdObjWriterConfig.outputLayerSurface = false; + } + auto sdObjWriter + = std::make_shared<FW::Obj::ObjSurfaceWriter>(sdObjWriterConfig); + // Push back + subWriters.push_back(sdObjWriter); + subStreams.push_back(sdStream); + } + + // Configure the tracking geometry writer + auto tgObjWriterConfig = FW::Options::readObjTrackingGeometryWriterConfig( + vm, "ObjTrackingGeometryWriter", volumeLogLevel); + + tgObjWriterConfig.surfaceWriters = subWriters; + auto tgObjWriter = std::make_shared<FW::Obj::ObjTrackingGeometryWriter>( + tgObjWriterConfig); + + // Write the tracking geometry object + tgObjWriter->write(context, *tGeometry); + + // Close the output streams + for (auto sStreams : subStreams) { + sStreams->close(); + } + } + + // CSV output + if (vm["output-csv"].as<bool>()) { + + auto csvStream = std::shared_ptr<std::ofstream>(new std::ofstream); + std::string csvOutputName = "Detector" + geoContextStr + ".csv"; + csvStream->open(csvOutputName); + + FW::Csv::CsvSurfaceWriter::Config sfCsvWriterConfig + = FW::Options::readCsvSurfaceWriterConfig(vm, "CsvSurfaceWriter"); + sfCsvWriterConfig.outputStream = csvStream; + auto sfCsvWriter + = std::make_shared<FW::Csv::CsvSurfaceWriter>(sfCsvWriterConfig); + + // Configure the tracking geometry writer + FW::Csv::CsvTrackingGeometryWriter::Config tgCsvWriterConfig + = FW::Options::readCsvTrackingGeometryWriterConfig( + vm, "CsvTrackingGeometryWriter"); + tgCsvWriterConfig.surfaceWriter = sfCsvWriter; + tgCsvWriterConfig.layerPrefix = "\n"; + // The tracking geometry writer + auto tgCsvWriter = std::make_shared<FW::Csv::CsvTrackingGeometryWriter>( + tgCsvWriterConfig); + + // Write the tracking geometry object + tgCsvWriter->write(context, *(tGeometry.get())); + + // Close the file + csvStream->close(); + } + } + + return 0; + } diff --git a/Examples/Propagation/src/detail/PropagationExampleBase.hpp b/Examples/Propagation/src/detail/PropagationExampleBase.hpp index 2de6c678ccd3f9041b00c06727192b15f2766786..ed62400d8e695fc413f1a72367c058140fb66e70 100644 --- a/Examples/Propagation/src/detail/PropagationExampleBase.hpp +++ b/Examples/Propagation/src/detail/PropagationExampleBase.hpp @@ -9,12 +9,11 @@ #pragma once #include <memory> + #include <boost/program_options.hpp> -#include "ACTFW/Common/CommonOptions.hpp" -#include "ACTFW/Common/GeometryOptions.hpp" -#include "ACTFW/Common/MaterialOptions.hpp" -#include "ACTFW/Common/OutputOptions.hpp" + #include "ACTFW/Framework/Sequencer.hpp" +#include "ACTFW/Options/CommonOptions.hpp" #include "ACTFW/Plugins/BField/BFieldOptions.hpp" #include "ACTFW/Plugins/BField/ScalableBField.hpp" #include "ACTFW/Plugins/Obj/ObjPropagationStepsWriter.hpp" @@ -29,7 +28,6 @@ #include "Acts/MagneticField/ConstantBField.hpp" #include "Acts/MagneticField/InterpolatedBFieldMap.hpp" #include "Acts/MagneticField/SharedBField.hpp" -#include "Acts/Material/IMaterialDecorator.hpp" #include "Acts/Propagator/EigenStepper.hpp" #include "Acts/Propagator/Propagator.hpp" #include "Acts/Propagator/StraightLineStepper.hpp" @@ -48,11 +46,11 @@ /// @return a process code template <typename sequencer_t, typename bfield_t> FW::ProcessCode -setupPropagation(sequencer_t& sequencer, - bfield_t bfield, - po::variables_map& vm, - std::shared_ptr<FW::RandomNumbersSvc> randomNumberSvc, - std::shared_ptr<const Acts::TrackingGeometry> tGeometry) +setupPropgation(sequencer_t& sequencer, + bfield_t bfield, + boost::program_options::variables_map& vm, + std::shared_ptr<FW::RandomNumbersSvc> randomNumberSvc, + std::shared_ptr<const Acts::TrackingGeometry> tGeometry) { // Get the log level auto logLevel = FW::Options::readLogLevel(vm); @@ -132,29 +130,14 @@ propagationExample(int argc, options_setup_t& optionsSetup, geometry_setup_t& geometrySetup) { - - // Create the config object for the sequencer - FW::Sequencer::Config seqConfig; - // Now create the sequencer - FW::Sequencer sequencer(seqConfig); - - // Declare the supported program options. - po::options_description desc("Allowed options"); - // Add the common options - FW::Options::addCommonOptions<po::options_description>(desc); - // Add the geometry options - FW::Options::addGeometryOptions<po::options_description>(desc); - // Add the material options - FW::Options::addMaterialOptions<po::options_description>(desc); - // Add the bfield options - FW::Options::addBFieldOptions<po::options_description>(desc); - // Add the random number options - FW::Options::addRandomNumbersOptions<po::options_description>(desc); - // Add the fatras options - FW::Options::addPropagationOptions<po::options_description>(desc); - // Add the output options - FW::Options::addOutputOptions<po::options_description>(desc); - + // setup and parse options + auto desc = FW::Options::makeDefaultOptions(); + FW::Options::addSequencerOptions(desc); + FW::Options::addGeometryOptions(desc); + FW::Options::addBFieldOptions(desc); + FW::Options::addRandomNumbersOptions(desc); + FW::Options::addPropagationOptions(desc); + FW::Options::addOutputOptions(desc); // Add specific options for this geometry optionsSetup(desc); auto vm = FW::Options::parse(desc, argc, argv); @@ -162,14 +145,11 @@ propagationExample(int argc, return EXIT_FAILURE; } - // Now read the standard options - auto logLevel = FW::Options::readLogLevel<po::variables_map>(vm); - auto nEvents = FW::Options::readNumberOfEvents<po::variables_map>(vm); - - // Material loading from external source - auto mDecorator = FW::Options::readMaterialDecorator<po::variables_map>(vm); + FW::Sequencer sequencer(FW::Options::readSequencerConfig(vm)); - auto geometry = geometrySetup(vm, mDecorator); + // Now read the standard options + auto logLevel = FW::Options::readLogLevel(vm); + auto geometry = geometrySetup(vm, nullptr); auto tGeometry = geometry.first; auto contextDecorators = geometry.second; @@ -194,24 +174,24 @@ propagationExample(int argc, // Straight line stepper was chosen setupStraightLinePropgation(sequencer, vm, randomNumberSvc, tGeometry); } else if (field2D) { - // Define the interpolated b-field: 2D + // Define the interpolated b-field using BField = Acts::SharedBField<InterpolatedBFieldMap2D>; BField fieldMap(field2D); - setupPropagation(sequencer, fieldMap, vm, randomNumberSvc, tGeometry); + setupPropgation(sequencer, fieldMap, vm, randomNumberSvc, tGeometry); } else if (field3D) { - // Define the interpolated b-field: 3D + // Define the interpolated b-field using BField = Acts::SharedBField<InterpolatedBFieldMap3D>; BField fieldMap(field3D); - setupPropagation(sequencer, fieldMap, vm, randomNumberSvc, tGeometry); + setupPropgation(sequencer, fieldMap, vm, randomNumberSvc, tGeometry); } else if (vm["bf-context-scalable"].template as<bool>()) { using SField = FW::BField::ScalableBField; SField fieldMap(*std::get<std::shared_ptr<SField>>(bField)); - setupPropagation(sequencer, fieldMap, vm, randomNumberSvc, tGeometry); + setupPropgation(sequencer, fieldMap, vm, randomNumberSvc, tGeometry); } else { // Create the constant field using CField = Acts::ConstantBField; CField fieldMap(*std::get<std::shared_ptr<CField>>(bField)); - setupPropagation(sequencer, fieldMap, vm, randomNumberSvc, tGeometry); + setupPropgation(sequencer, fieldMap, vm, randomNumberSvc, tGeometry); } // --------------------------------------------------------------------------------- diff --git a/Plugins/Json/CMakeLists.txt b/Plugins/Json/CMakeLists.txt index da107b3e79f04fff3a43087385ca1b852f3f09c7..a5a24ba70022a607c59165c89d00b3de63394911 100644 --- a/Plugins/Json/CMakeLists.txt +++ b/Plugins/Json/CMakeLists.txt @@ -1,4 +1,4 @@ -set(srcs src/JsonGeometryConverter.cpp src/JsonMaterialWriter.cpp) +set(srcs src/JsonGeometryConverter.cpp) add_library(ACTFWJsonPlugin SHARED ${srcs}) target_include_directories(ACTFWJsonPlugin PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>) diff --git a/Plugins/Json/include/ACTFW/Plugins/Json/JsonMaterialWriter.hpp b/Plugins/Json/include/ACTFW/Plugins/Json/JsonMaterialWriter.hpp index 5abda487541854aeae017c763d55de0d5b806947..648bce06c68350b689bc2d2f044f926a7a73880d 100644 --- a/Plugins/Json/include/ACTFW/Plugins/Json/JsonMaterialWriter.hpp +++ b/Plugins/Json/include/ACTFW/Plugins/Json/JsonMaterialWriter.hpp @@ -15,7 +15,6 @@ #include <mutex> #include "ACTFW/Framework/ProcessCode.hpp" #include "ACTFW/Plugins/Json/JsonGeometryConverter.hpp" -#include "ACTFW/Writers/IWriterT.hpp" #include "Acts/Material/ISurfaceMaterial.hpp" #include "Acts/Material/IVolumeMaterial.hpp" #include "Acts/Utilities/Definitions.hpp" @@ -40,7 +39,7 @@ namespace Json { /// /// @brief Writes out Detector material maps /// using the Json Geometry converter - class JsonMaterialWriter : public FW::IWriterT<Acts::DetectorMaterialMaps> + class JsonMaterialWriter { public: @@ -50,11 +49,10 @@ namespace Json { JsonMaterialWriter(const JsonGeometryConverter::Config& cfg); /// Virtual destructor - ~JsonMaterialWriter() override; + ~JsonMaterialWriter(); /// Framework name() method - std::string - name() const final override; + std::string name() const; /// Interface method which writes out the MaterialTrack entities /// @@ -62,7 +60,7 @@ namespace Json { /// @param ism is the indexed surface material FW::ProcessCode write(const AlgorithmContext& context, - const Acts::DetectorMaterialMaps& detMaterial) final override; + const Acts::DetectorMaterialMaps& detMaterial); private: /// The config class of the converter diff --git a/Plugins/Json/src/JsonMaterialWriter.cpp b/Plugins/Json/src/JsonMaterialWriter.cpp index df259b28985ef8b59f8ff4adf71cbea63fca854c..65a678e9693067dcfac88f834d03603de5c08d2b 100644 --- a/Plugins/Json/src/JsonMaterialWriter.cpp +++ b/Plugins/Json/src/JsonMaterialWriter.cpp @@ -16,7 +16,6 @@ FW::Json::JsonMaterialWriter::JsonMaterialWriter( const FW::Json::JsonGeometryConverter::Config& cfg) - : FW::IWriterT<Acts::DetectorMaterialMaps>(), m_cfg(cfg) { // Validate the configuration if (m_cfg.name.empty()) { @@ -30,7 +29,6 @@ FW::Json::JsonMaterialWriter::~JsonMaterialWriter() FW::ProcessCode FW::Json::JsonMaterialWriter::write( - const AlgorithmContext& /*context*/, const Acts::DetectorMaterialMaps& detMaterial) { diff --git a/Plugins/Root/CMakeLists.txt b/Plugins/Root/CMakeLists.txt index d42916c88c209ef680286298127ed564b3e5bd65..07ad4d6b76dc4fbdf49ba99d8a38f336fd8deee5 100644 --- a/Plugins/Root/CMakeLists.txt +++ b/Plugins/Root/CMakeLists.txt @@ -1,29 +1,7 @@ -Examples/Propagation/src/detail/PropagationExampleBase.hppset(srcs include/ACTFW/Plugins/Root/RootExCellWriter.hpp - include/ACTFW/Plugins/Root/RootExCellWriter.ipp - include/ACTFW/Plugins/Root/RootPlanarClusterWriter.hpp - include/ACTFW/Plugins/Root/RootMaterialReader.hpp - include/ACTFW/Plugins/Root/RootMaterialWriter.hpp - include/ACTFW/Plugins/Root/RootMaterialTrackReader.hpp - include/ACTFW/Plugins/Root/RootMaterialTrackWriter.hpp - include/ACTFW/Plugins/Root/RootPropagationStepsWriter.hpp - include/ACTFW/Plugins/Root/RootParticleWriter.hpp - include/ACTFW/Plugins/Root/RootSimHitWriter.hpp - src/RootMaterialReader.cpp - src/RootMaterialWriter.cpp - src/RootMaterialTrackReader.cpp - src/RootMaterialTrackWriter.cpp - src/RootPlanarClusterWriter.cpp - src/RootParticleWriter.cpp - src/RootSimHitWriter.cpp - src/RootPropagationStepsWriter.cpp) - -add_library(ACTFWRootPlugin SHARED ${srcs}) -target_include_directories(ACTFWRootPlugin PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>) -target_include_directories(ACTFWRootPlugin PUBLIC ${ROOT_INCLUDE_DIRS}) -target_link_libraries(ACTFWRootPlugin PUBLIC ActsCore ActsDigitizationPlugin IdentificationPlugin) # ActsMaterialPlugin) -target_link_libraries(ACTFWRootPlugin PUBLIC ACTFramework ACTFWPropagation) -target_link_libraries(ACTFWRootPlugin PUBLIC ${ROOT_LIBRARIES}) -target_link_libraries(ACTFWRootPlugin PUBLIC Threads::Threads) +set(sources src/RootPlanarClusterWriter.cpp + src/RootParticleWriter.cpp + src/RootSimHitWriter.cpp + src/RootPropagationStepsWriter.cpp) add_library(ACTFWRootPlugin SHARED ${sources}) target_include_directories( diff --git a/Plugins/Root/include/ACTFW/Plugins/Root/RootMaterialReader.hpp b/Plugins/Root/include/ACTFW/Plugins/Root/RootMaterialReader.hpp index 9a168519e866b466623e8c8e883464d6a5537566..b732fbf3fbf6ecbfcbcd709f1616ba4710db6cd2 100644 --- a/Plugins/Root/include/ACTFW/Plugins/Root/RootMaterialReader.hpp +++ b/Plugins/Root/include/ACTFW/Plugins/Root/RootMaterialReader.hpp @@ -11,7 +11,6 @@ #include <map> #include <mutex> #include "ACTFW/Framework/ProcessCode.hpp" -#include "ACTFW/Readers/IReaderT.hpp" #include "Acts/Detector/TrackingVolume.hpp" #include "Acts/Material/IMaterialDecorator.hpp" #include "Acts/Material/ISurfaceMaterial.hpp" @@ -42,7 +41,7 @@ namespace Root { /// /// @brief Read the collection of SurfaceMaterial from a file in order to /// load it onto the TrackingGeometry - class RootMaterialReader : public FW::IReaderT<Acts::DetectorMaterialMaps> + class RootMaterialReader { public: /// @class Config @@ -106,11 +105,11 @@ namespace Root { RootMaterialReader(const Config& cfg); /// Virtual destructor - ~RootMaterialReader() override; + ~RootMaterialReader(); /// Framework name() method std::string - name() const final override; + name() const; /// Read method /// diff --git a/Plugins/Root/include/ACTFW/Plugins/Root/RootMaterialWriter.hpp b/Plugins/Root/include/ACTFW/Plugins/Root/RootMaterialWriter.hpp index 908771049846f267d7b69663f441cd0e667fb500..817191a5811c56d0594714e3b5f981493b1d5ddc 100644 --- a/Plugins/Root/include/ACTFW/Plugins/Root/RootMaterialWriter.hpp +++ b/Plugins/Root/include/ACTFW/Plugins/Root/RootMaterialWriter.hpp @@ -15,7 +15,6 @@ #include <map> #include <mutex> #include "ACTFW/Framework/ProcessCode.hpp" -#include "ACTFW/Writers/IWriterT.hpp" #include "Acts/Material/ISurfaceMaterial.hpp" #include "Acts/Material/IVolumeMaterial.hpp" #include "Acts/Utilities/Definitions.hpp" @@ -46,7 +45,7 @@ namespace Root { /// It writes out a MaterialTrack which is usually generated from /// Geant4 material mapping - class RootMaterialWriter : public FW::IWriterT<Acts::DetectorMaterialMaps> + class RootMaterialWriter { public: @@ -110,11 +109,11 @@ namespace Root { RootMaterialWriter(const Config& cfg); /// Virtual destructor - ~RootMaterialWriter() override; + ~RootMaterialWriter(); /// Framework name() method std::string - name() const final override; + name() const; /// Interface method which writes out the MaterialTrack entities /// @@ -122,7 +121,7 @@ namespace Root { /// @param detMaterial are the detector material maps FW::ProcessCode write(const AlgorithmContext& context, - const Acts::DetectorMaterialMaps& detMaterial) final override; + const Acts::DetectorMaterialMaps& detMaterial); private: /// The config class