Skip to content
Snippets Groups Projects
Commit e9f0a3f3 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

Use ActsDD4hep instead of Acts; Acts::UnitConstants::mm == 1

parent a57c5861
No related branches found
No related tags found
1 merge request!103Use ActsDD4hep instead of Acts; Acts::UnitConstants::mm == 1
Pipeline #31272 passed
Pipeline: athena

#31273

    ...@@ -12,7 +12,14 @@ SET(CMAKE_CXX_STANDARD 17) ...@@ -12,7 +12,14 @@ SET(CMAKE_CXX_STANDARD 17)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
    find_package(DD4hep REQUIRED COMPONENTS DDCore DDG4) find_package(DD4hep REQUIRED COMPONENTS DDCore DDG4)
    find_package(Acts REQUIRED COMPONENTS Core PluginTGeo PluginDD4hep ) find_package(ActsDD4hep)
    if(ActsDD4hep_FOUND)
    add_compile_definitions(USE_ACTSDD4HEP)
    set(ActsDD4hep ActsDD4hep::ActsDD4hep)
    else()
    find_package(Acts REQUIRED COMPONENTS Core PluginIdentification PluginTGeo PluginDD4hep)
    set(ActsDD4hep ActsCore ActsPluginDD4hep)
    endif()
    #----------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------
    set(a_lib_name IP6) set(a_lib_name IP6)
    ...@@ -41,10 +48,10 @@ dd4hep_add_plugin(${a_lib_name} ...@@ -41,10 +48,10 @@ dd4hep_add_plugin(${a_lib_name}
    src/ZeroDegreeCalorimeterEcalWSciFi_geo.cpp src/ZeroDegreeCalorimeterEcalWSciFi_geo.cpp
    src/ZeroDegreeCalorimeterEcal_geo.cpp src/ZeroDegreeCalorimeterEcal_geo.cpp
    src/ZeroDegreeCalorimeterSampling_geo.cpp src/ZeroDegreeCalorimeterSampling_geo.cpp
    USES ActsCore ActsPluginDD4hep ROOT::Core ROOT::Gdml USES ${ActsDD4hep} ROOT::Core ROOT::Gdml
    ) )
    target_link_libraries(${a_lib_name} target_link_libraries(${a_lib_name}
    PUBLIC DD4hep::DDCore DD4hep::DDRec DD4hep::DDG4 PUBLIC DD4hep::DDCore DD4hep::DDRec DD4hep::DDG4
    ) )
    #----------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------
    ......
    #include <map> #include <map>
    #include "DD4hep/DetFactoryHelper.h" #include "DD4hep/DetFactoryHelper.h"
    #if defined(USE_ACTSDD4HEP)
    #include "ActsDD4hep/ActsExtension.hpp"
    #else
    #include "Acts/Plugins/DD4hep/ActsExtension.hpp" #include "Acts/Plugins/DD4hep/ActsExtension.hpp"
    #include "Acts/Definitions/Units.hpp" #endif
    using namespace std; using namespace std;
    using namespace dd4hep; using namespace dd4hep;
    ......
    ...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
    #include "XML/Layering.h" #include "XML/Layering.h"
    #include "XML/Utilities.h" #include "XML/Utilities.h"
    #if defined(USE_ACTSDD4HEP)
    #include "ActsDD4hep/ActsExtension.hpp"
    #else
    #include "Acts/Plugins/DD4hep/ActsExtension.hpp" #include "Acts/Plugins/DD4hep/ActsExtension.hpp"
    #include "Acts/Definitions/Units.hpp" #endif
    using namespace std; using namespace std;
    using namespace dd4hep; using namespace dd4hep;
    using namespace dd4hep::rec; using namespace dd4hep::rec;
    ......
    ...@@ -11,8 +11,11 @@ ...@@ -11,8 +11,11 @@
    #include "TMath.h" #include "TMath.h"
    #include <XML/Helper.h> #include <XML/Helper.h>
    #include "Acts/Definitions/Units.hpp" #if defined(USE_ACTSDD4HEP)
    #include "ActsDD4hep/ActsExtension.hpp"
    #else
    #include "Acts/Plugins/DD4hep/ActsExtension.hpp" #include "Acts/Plugins/DD4hep/ActsExtension.hpp"
    #endif
    using namespace std; using namespace std;
    using namespace dd4hep; using namespace dd4hep;
    ...@@ -61,10 +64,10 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * ...@@ -61,10 +64,10 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens *
    // Add extension for the beampipe // Add extension for the beampipe
    //Acts::ActsExtension* sdExtension = new Acts::ActsExtension(); //Acts::ActsExtension* sdExtension = new Acts::ActsExtension();
    //sdExtension->addType("beampipe", "layer"); //sdExtension->addType("beampipe", "layer");
    //sdExtension->addValue(0.001 * Acts::UnitConstants::mm, "r_min", "envelope"); //sdExtension->addValue(0.001, "r_min", "envelope"); // Acts::UnitConstants::mm == 1
    //sdExtension->addValue(0.001 * Acts::UnitConstants::mm, "r_max", "envelope"); //sdExtension->addValue(0.001, "r_max", "envelope"); // Acts::UnitConstants::mm == 1
    //sdExtension->addValue(0.001 * Acts::UnitConstants::mm, "z_min", "envelope"); //sdExtension->addValue(0.001, "z_min", "envelope"); // Acts::UnitConstants::mm == 1
    //sdExtension->addValue(0.001 * Acts::UnitConstants::mm, "z_max", "envelope"); //sdExtension->addValue(0.001, "z_max", "envelope"); // Acts::UnitConstants::mm == 1
    //sdet.addExtension<Acts::ActsExtension>(sdExtension); //sdet.addExtension<Acts::ActsExtension>(sdExtension);
    ...@@ -82,10 +85,10 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens * ...@@ -82,10 +85,10 @@ static Ref_t create_detector(Detector& det, xml_h e, SensitiveDetector /* sens *
    //beamPipeExtension->addType("beampipe", "beampipe"); //beamPipeExtension->addType("beampipe", "beampipe");
    //beamPipeExtension->addType("passive cylinder", "layer"); //beamPipeExtension->addType("passive cylinder", "layer");
    beamPipeExtension->addType("beampipe", "layer"); beamPipeExtension->addType("beampipe", "layer");
    beamPipeExtension->addValue(0.001 * Acts::UnitConstants::mm, "r_min", "envelope"); beamPipeExtension->addValue(0.001, "r_min", "envelope"); // Acts::UnitConstants::mm == 1
    beamPipeExtension->addValue(0.001 * Acts::UnitConstants::mm, "r_max", "envelope"); beamPipeExtension->addValue(0.001, "r_max", "envelope"); // Acts::UnitConstants::mm == 1
    beamPipeExtension->addValue(0.001 * Acts::UnitConstants::mm, "z_min", "envelope"); beamPipeExtension->addValue(0.001, "z_min", "envelope"); // Acts::UnitConstants::mm == 1
    beamPipeExtension->addValue(0.001 * Acts::UnitConstants::mm, "z_max", "envelope"); beamPipeExtension->addValue(0.001, "z_max", "envelope"); // Acts::UnitConstants::mm == 1
    central_det.addExtension<Acts::ActsExtension>(beamPipeExtension); central_det.addExtension<Acts::ActsExtension>(beamPipeExtension);
    // TODO add material binning // TODO add material binning
    ......
    ...@@ -2,9 +2,12 @@ ...@@ -2,9 +2,12 @@
    #include "DD4hep/DetFactoryHelper.h" #include "DD4hep/DetFactoryHelper.h"
    #include "XML/Utilities.h" #include "XML/Utilities.h"
    #include "XML/Layering.h" #include "XML/Layering.h"
    #include "Acts/Plugins/DD4hep/ActsExtension.hpp"
    #include "Acts/Definitions/Units.hpp"
    #if defined(USE_ACTSDD4HEP)
    #include "ActsDD4hep/ActsExtension.hpp"
    #else
    #include "Acts/Plugins/DD4hep/ActsExtension.hpp"
    #endif
    using namespace std; using namespace std;
    using namespace dd4hep; using namespace dd4hep;
    using namespace dd4hep::detail; using namespace dd4hep::detail;
    ......
    ...@@ -4,7 +4,11 @@ ...@@ -4,7 +4,11 @@
    #include "DDRec/Surface.h" #include "DDRec/Surface.h"
    #include "DDRec/DetectorData.h" #include "DDRec/DetectorData.h"
    //#if defined(USE_ACTSDD4HEP)
    //#include "ActsDD4hep/ActsExtension.hpp"
    //#else
    //#include "Acts/Plugins/DD4hep/ActsExtension.hpp" //#include "Acts/Plugins/DD4hep/ActsExtension.hpp"
    //#endif
    using namespace std; using namespace std;
    using namespace dd4hep; using namespace dd4hep;
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment