diff --git a/DDG4/tpython/DDPython.C b/DDG4/tpython/DDPython.C index f44fe4fbd25b3d490409644166ffed4bdf5a0a4a..29fdec92bcddebf0c93f3504cdaf0345043b5cb9 100644 --- a/DDG4/tpython/DDPython.C +++ b/DDG4/tpython/DDPython.C @@ -18,7 +18,8 @@ // FRamework include files #include "DDG4/Python/DDPython.h" -struct dd4hepPython { +class dd4hepPython { +public: static void setMainThread() { dd4hep::DDPython::setMainThread(); } diff --git a/DDTest/CMakeLists.txt b/DDTest/CMakeLists.txt index 481351e019e5ca84bb96ecf6ab578486847e9128..f2fef37f891ff86bca845982f2445380f1fb4b3c 100644 --- a/DDTest/CMakeLists.txt +++ b/DDTest/CMakeLists.txt @@ -12,6 +12,7 @@ add_library(DDTest INTERFACE) add_library(DD4hep::DDTest ALIAS DDTest) +find_package(Python REQUIRED COMPONENTS Interpreter) target_include_directories(DDTest INTERFACE include) foreach(TEST_NAME diff --git a/examples/CLICSiD/CMakeLists.txt b/examples/CLICSiD/CMakeLists.txt index 3408dff9444c34ff7285e23bc281c0e4c99a6c9c..ed6128fd33b8a66f8e4f1a141d1f4ee724b25abc 100644 --- a/examples/CLICSiD/CMakeLists.txt +++ b/examples/CLICSiD/CMakeLists.txt @@ -18,6 +18,7 @@ IF(NOT TARGET DD4hep::DDCore) ENDIF() dd4hep_set_compiler_flags() +find_package(Python REQUIRED COMPONENTS Interpreter) #========================================================================== set(CLICSiDEx_INSTALL ${CMAKE_INSTALL_PREFIX}/examples/CLICSiD) @@ -61,14 +62,14 @@ endforeach() # ROOT Geometry overlap checks dd4hep_add_test_reg( CLICSiD_check_geometry_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_CLICSiD.sh" - EXEC_ARGS python ${DD4hep_ROOT}/bin/checkGeometry --compact=file:${DD4hep_ROOT}/DDDetectors/compact/SiD.xml + EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/bin/checkGeometry --compact=file:${DD4hep_ROOT}/DDDetectors/compact/SiD.xml # This takes too long --full=true --ntracks=10 --option=o --vx=0 --vy=0 --vz=0 REGEX_PASS " Execution finished..." ) # # ROOT Geometry overlap checks dd4hep_add_test_reg( CLICSiD_check_overlaps_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_CLICSiD.sh" - EXEC_ARGS python ${DD4hep_ROOT}/bin/checkOverlaps --compact=file:${DD4hep_ROOT}/DDDetectors/compact/SiD.xml + EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/bin/checkOverlaps --compact=file:${DD4hep_ROOT}/DDDetectors/compact/SiD.xml --tolerance=0.1 REGEX_PASS " Execution finished..." ) # @@ -136,7 +137,7 @@ if (DD4HEP_USE_GEANT4) foreach(script testDDPython CLICMagField CLICPhysics CLICRandom CLICSiDScan) dd4hep_add_test_reg( CLICSiD_DDG4_${script}_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_CLICSiD.sh" - EXEC_ARGS python ${CLICSiDEx_INSTALL}/scripts/${script}.py + EXEC_ARGS ${Python_EXECUTABLE} ${CLICSiDEx_INSTALL}/scripts/${script}.py REGEX_PASS "TEST_PASSED" REGEX_FAIL "Exception;EXCEPTION;ERROR" ) endforeach(script) @@ -144,21 +145,21 @@ if (DD4HEP_USE_GEANT4) # Write GDML from Geant4 using UI #dd4hep_add_test_reg( CLICSiD_DDG4_GDML_LONGTEST # COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_CLICSiD.sh" - # EXEC_ARGS python ${CLICSiDEx_INSTALL}/scripts/CLIC_GDML.py + # EXEC_ARGS ${Python_EXECUTABLE} ${CLICSiDEx_INSTALL}/scripts/CLIC_GDML.py # REGEX_PASS "G4GDML. Writing 'CLICSiD.gdml' done !" # REGEX_FAIL "Exception;EXCEPTION;ERROR" ) # # Material scan dd4hep_add_test_reg( CLICSiD_DDG4_g4material_scan_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_CLICSiD.sh" - EXEC_ARGS python ${DD4hep_ROOT}/bin/g4MaterialScan --compact=${DD4hep_ROOT}/DDDetectors/compact/SiD.xml + EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/bin/g4MaterialScan --compact=${DD4hep_ROOT}/DDDetectors/compact/SiD.xml "--position=0,0,0" "--direction=0,1,0" REGEX_PASS " Terminate Geant4 and delete associated actions." ) # # Geometry scan dd4hep_add_test_reg( CLICSiD_DDG4_g4geometry_scan_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_CLICSiD.sh" - EXEC_ARGS python ${DD4hep_ROOT}/bin/g4GeometryScan --compact=${DD4hep_ROOT}/DDDetectors/compact/SiD.xml + EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/bin/g4GeometryScan --compact=${DD4hep_ROOT}/DDDetectors/compact/SiD.xml "--position=0,0,0" "--direction=0,1,0" REGEX_PASS " +856 +2374\.8789 +3000\.000 +. +0\.00,3000\.00, *0\.00. +Path:\"/world\" +Shape:G4Box +Mat:Air" ) # diff --git a/examples/ClientTests/CMakeLists.txt b/examples/ClientTests/CMakeLists.txt index 27cc4870b05322ff70cc2b4fc3df9fded30b84a7..e4897fbe7fae3569b6eed4a12ca3255ba1f95027 100644 --- a/examples/ClientTests/CMakeLists.txt +++ b/examples/ClientTests/CMakeLists.txt @@ -18,6 +18,7 @@ IF(NOT TARGET DD4hep::DDCore) ENDIF() dd4hep_set_compiler_flags() +find_package(Python REQUIRED COMPONENTS Interpreter) #========================================================================== if(TARGET XercesC::XercesC) SET(OPT_XERCESC XercesC::XercesC) @@ -312,7 +313,7 @@ foreach (test Assemblies BoxTrafos CaloEndcapReflection LheD_tracker MagnetField if (DD4HEP_USE_GEANT4) dd4hep_add_test_reg( ClientTests_g4material_scan_${test}_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" - EXEC_ARGS python ${DD4hep_ROOT}/bin/g4MaterialScan --compact=file:${ClientTestsEx_INSTALL}/compact/${test}.xml + EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/bin/g4MaterialScan --compact=file:${ClientTestsEx_INSTALL}/compact/${test}.xml "--position=0,0,0" "--direction=0,1,0" REGEX_PASS " Terminate Geant4 and delete associated actions." ) endif(DD4HEP_USE_GEANT4) @@ -333,14 +334,14 @@ foreach (test BoxTrafos CaloEndcapReflection IronCylinder MiniTel SiliconBlock N # ROOT Geometry checks dd4hep_add_test_reg( ClientTests_check_geometry_${test}_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" - EXEC_ARGS python ${DD4hep_ROOT}/bin/checkGeometry --compact=file:${ClientTestsEx_INSTALL}/compact/${test}.xml + EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/bin/checkGeometry --compact=file:${ClientTestsEx_INSTALL}/compact/${test}.xml --full=true --ntracks=10 REGEX_PASS " Execution finished..." ) # # ROOT Geometry overlap checks dd4hep_add_test_reg( ClientTests_check_overlaps_${test}_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" - EXEC_ARGS python ${DD4hep_ROOT}/bin/checkOverlaps --compact=file:${ClientTestsEx_INSTALL}/compact/${test}.xml + EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/bin/checkOverlaps --compact=file:${ClientTestsEx_INSTALL}/compact/${test}.xml --tolerance=0.1 REGEX_PASS " Execution finished..." ) endforeach() @@ -352,7 +353,7 @@ if (DD4HEP_USE_GEANT4) # Test Setting temperature and pressure to material dd4hep_add_test_reg( ClientTests_sim_Check_Temp_Pressure_Air COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" - EXEC_ARGS python ${ClientTestsEx_INSTALL}/scripts/Check_Air.py + EXEC_ARGS ${Python_EXECUTABLE} ${ClientTestsEx_INSTALL}/scripts/Check_Air.py -geometry ${ClientTestsEx_INSTALL}/compact/Check_Air.xml batch REGEX_PASS "Imean: 85.538 eV temperature: 333.33 K pressure: 2.22 atm" REGEX_FAIL "Exception;EXCEPTION;ERROR;Error;FATAL" ) @@ -360,7 +361,7 @@ if (DD4HEP_USE_GEANT4) # Geant4 test with gdml input file (LHCb:FT) dd4hep_add_test_reg( ClientTests_g4_gdml_detector COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" - EXEC_ARGS python ${DD4hep_ROOT}/bin/g4GeometryScan --compact=${ClientTestsEx_INSTALL}/compact/GdmlDetector.xml + EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/bin/g4GeometryScan --compact=${ClientTestsEx_INSTALL}/compact/GdmlDetector.xml --position=200,200,-2000 --direction=0,0,1 REGEX_PASS " 122 2777.0000 5200.000 " REGEX_FAIL "Exception;EXCEPTION;ERROR;Error;FATAL" ) @@ -368,7 +369,7 @@ if (DD4HEP_USE_GEANT4) # Geant4 test with gdml input file (LHCb:MT) dd4hep_add_test_reg( ClientTests_g4_gdml_MT COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" - EXEC_ARGS python ${DD4hep_ROOT}/bin/g4GeometryScan --compact=${ClientTestsEx_INSTALL}/compact/MT.xml + EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/bin/g4GeometryScan --compact=${ClientTestsEx_INSTALL}/compact/MT.xml --position=200,200,7900 --direction=0,0,1 REGEX_PASS " 15 2777.0000 4210.000 " REGEX_FAIL "Exception;EXCEPTION;ERROR;Error;FATAL" ) @@ -376,28 +377,28 @@ if (DD4HEP_USE_GEANT4) # Geant4 test if production cuts are processed dd4hep_add_test_reg( ClientTests_sim_MiniTel_prod_cuts COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" - EXEC_ARGS python ${ClientTestsEx_INSTALL}/scripts/MiniTelRegions.py batch + EXEC_ARGS ${Python_EXECUTABLE} ${ClientTestsEx_INSTALL}/scripts/MiniTelRegions.py batch REGEX_PASS "minitel_region_1: Set cut \\[gamma/0\\] = 5.000" REGEX_FAIL "Exception;EXCEPTION;ERROR;Error" ) # # Geant4 test if production cuts are processed dd4hep_add_test_reg( ClientTests_sim_MiniTel_limitset COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" - EXEC_ARGS python ${ClientTestsEx_INSTALL}/scripts/MiniTelRegions.py batch + EXEC_ARGS ${Python_EXECUTABLE} ${ClientTestsEx_INSTALL}/scripts/MiniTelRegions.py batch REGEX_PASS "LimitSet: Particle type: mu- PDG: 13 : 3.000000" REGEX_FAIL "Exception;EXCEPTION;ERROR;Error" ) # # Test of an example user analysis creating an N-tuple instead of an output file with events dd4hep_add_test_reg( ClientTests_sim_UserAnalysis COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" - EXEC_ARGS python ${ClientTestsEx_INSTALL}/scripts/MiniTelEnergyDeposits.py batch + EXEC_ARGS ${Python_EXECUTABLE} ${ClientTestsEx_INSTALL}/scripts/MiniTelEnergyDeposits.py batch REGEX_PASS "Entries : 200 " REGEX_FAIL "Exception;EXCEPTION;ERROR;Error" ) # # Test of an example user analysis creating an N-tuple instead of an output file with events dd4hep_add_test_reg( ClientTests_sim_TrackingRegion COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" - EXEC_ARGS python ${ClientTestsEx_INSTALL}/scripts/TrackingRegion.py batch + EXEC_ARGS ${Python_EXECUTABLE} ${ClientTestsEx_INSTALL}/scripts/TrackingRegion.py batch REGEX_PASS "Placement tracking_volume_1 not converted \\[Veto'ed for simulation\\]" REGEX_FAIL "Exception;EXCEPTION;ERROR;Error" ) # @@ -405,7 +406,7 @@ if (DD4HEP_USE_GEANT4) foreach(script Assemblies LheD_tracker MiniTel MiniTel_hepmc NestedDetectors ) dd4hep_add_test_reg( ClientTests_sim_${script} COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" - EXEC_ARGS python ${ClientTestsEx_INSTALL}/scripts/${script}.py batch + EXEC_ARGS ${Python_EXECUTABLE} ${ClientTestsEx_INSTALL}/scripts/${script}.py batch REGEX_PASS NONE REGEX_FAIL "Exception;EXCEPTION;ERROR;Error" ) endforeach(script) @@ -414,7 +415,7 @@ if (DD4HEP_USE_GEANT4) foreach(script MultiCollections MultiSegmentations MultiSegmentCollections ) dd4hep_add_test_reg( ClientTests_sim_${script} COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_ClientTests.sh" - EXEC_ARGS python ${ClientTestsEx_INSTALL}/scripts/MultiCollections.py + EXEC_ARGS ${Python_EXECUTABLE} ${ClientTestsEx_INSTALL}/scripts/MultiCollections.py -compact ${ClientTestsEx_INSTALL}/compact/${script}.xml -batch REGEX_PASS NONE REGEX_FAIL "Exception;EXCEPTION;ERROR;Error" ) diff --git a/examples/ClientTests/compact/FCCmachine/FCCee_DectMaster.xml b/examples/ClientTests/compact/FCCmachine/FCCee_DectMaster.xml index a3164bd967aa76b8cab0e482473b38df0560baa9..2d28cf23cc65f948f2443795fa73ee1ee4ec8692 100644 --- a/examples/ClientTests/compact/FCCmachine/FCCee_DectMaster.xml +++ b/examples/ClientTests/compact/FCCmachine/FCCee_DectMaster.xml @@ -3,8 +3,6 @@ xmlns:xs="http://www.w3.org/2001/XMLSchema" xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/compact/1.0/compact.xsd"> - - <info name="FCCDectMaster" title="FCCee Machine Elements geometry master file" author="Niloufar Alipour Tehrani (adapted: G Ganis)" @@ -20,6 +18,7 @@ <gdmlFile ref="${DD4hepINSTALL}/DDDetectors/compact/elements.xml"/> <gdmlFile ref="${DD4hepINSTALL}/DDDetectors/compact/materials.xml"/> </includes> + <materials> <material name="beam" state="gas"> <P unit="pascal" value="6.25e-06"/> @@ -36,7 +35,6 @@ <D type="density" unit="g/cm3" value="7.874" /> <composite n="1" ref="Fe" /> </material> - </materials> <define> diff --git a/examples/DDCMS/CMakeLists.txt b/examples/DDCMS/CMakeLists.txt index ba410fb50d10e92cdfffac60f2c152c31f48241e..4cad85088b507e3fcc143dcf6422baae003f80cc 100644 --- a/examples/DDCMS/CMakeLists.txt +++ b/examples/DDCMS/CMakeLists.txt @@ -22,7 +22,7 @@ IF(NOT TARGET DD4hep::DDCore) ENDIF() dd4hep_set_compiler_flags() -# +find_package(Python REQUIRED COMPONENTS Interpreter) #========================================================================== # CLHEP dependent stuff if(NOT TARGET CLHEP::CLHEP) @@ -176,7 +176,7 @@ dd4hep_add_test_reg( DDCMS_VolumeMgrTest_TOB # Dump CMS detector element tree of SD TOB dd4hep_add_test_reg( DDCMS_Geant4_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDCMS.sh" - EXEC_ARGS python ${CMAKE_CURRENT_SOURCE_DIR}/scripts/CMSTrackerSim.py batch test numevents 2 + EXEC_ARGS ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/CMSTrackerSim.py batch test numevents 2 REGEX_PASS "\\+\\+\\+ Finished run 0 after 2 events \\(2 events in total\\)" REGEX_FAIL "Exception;EXCEPTION;ERROR;FAILED" ) diff --git a/examples/DDCMS/data/cms_tracker.xml b/examples/DDCMS/data/cms_tracker.xml index d4fed8f560c2d0b2c1bbaef4025c792a066cefbe..fea92ef2c558e0ad268210dea06a0fdd2b8f3e42 100644 --- a/examples/DDCMS/data/cms_tracker.xml +++ b/examples/DDCMS/data/cms_tracker.xml @@ -13,6 +13,7 @@ <Include ref="trackermaterial.xml"/> <Include ref="tibtidcommonmaterial.xml"/> + <Include ref="tobmaterial.xml"/> <Include ref="cmsextent.xml"/> <Include ref="cavernData.xml"/> @@ -157,7 +158,6 @@ <Include ref="tibtidservicesb.xml"/> <Include ref="tibtidservicesf.xml"/> - <Include ref="tobmaterial.xml"/> <Include ref="tobmodpar.xml"/> <Include ref="tobrodpar.xml"/> <Include ref="tobmodule0.xml"/> diff --git a/examples/DDDigi/CMakeLists.txt b/examples/DDDigi/CMakeLists.txt index d660e26c1f705344976f65d1e8cd93baa2dacbdd..974a1b66494d7639bad70e18263209de53ad94f2 100644 --- a/examples/DDDigi/CMakeLists.txt +++ b/examples/DDDigi/CMakeLists.txt @@ -18,6 +18,7 @@ IF(NOT TARGET DD4hep::DDCore) ENDIF() dd4hep_set_compiler_flags() +find_package(Python REQUIRED COMPONENTS Interpreter) #========================================================================== dd4hep_configure_output () @@ -33,7 +34,7 @@ dd4hep_configure_scripts (DDDigi DEFAULT_SETUP WITH_TESTS) # Test basic processing chain dd4hep_add_test_reg(DDDigi_framework COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDDigi.sh" - EXEC_ARGS python ${DDDigiexamples_INSTALL}/scripts/TestFramework.py + EXEC_ARGS ${Python_EXECUTABLE} ${DDDigiexamples_INSTALL}/scripts/TestFramework.py REGEX_PASS "\\+\\+\\+ 10 Events out of 10 processed." REGEX_FAIL "Error;ERROR;Exception" ) diff --git a/examples/DDG4/CMakeLists.txt b/examples/DDG4/CMakeLists.txt index e33e16ea68debd903b54dbd6493e3a87d3f41c03..26372512c305233f1f8fd2ee243d45f02c06f759 100644 --- a/examples/DDG4/CMakeLists.txt +++ b/examples/DDG4/CMakeLists.txt @@ -18,6 +18,7 @@ IF(NOT TARGET DD4hep::DDCore) ENDIF() dd4hep_set_compiler_flags() +find_package(Python REQUIRED COMPONENTS Interpreter) #========================================================================== set(DDG4examples_INSTALL ${CMAKE_INSTALL_PREFIX}/examples/DDG4) @@ -50,14 +51,14 @@ if (DD4HEP_USE_GEANT4) # Test HepMC input reader dd4hep_add_test_reg( DDG4_HepMC_reader COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDG4.sh" - EXEC_ARGS python ${DD4hep_ROOT}/examples/DDG4/examples/readHEPMC.py + EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/examples/DDG4/examples/readHEPMC.py ${DDG4examples_INSTALL}/data/hepmc_geant4.dat REGEX_PASS "Geant4InputAction\\[Input\\]: Event 10 Error when moving to event - EOF") # # Test HepMC input reader with slightly non-standard HEPMC file dd4hep_add_test_reg( DDG4_HepMC_reader_minbias COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDG4.sh" - EXEC_ARGS python ${DD4hep_ROOT}/examples/DDG4/examples/readHEPMC.py + EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/examples/DDG4/examples/readHEPMC.py ${DDG4examples_INSTALL}/data/LHCb_MinBias_HepMC.txt REGEX_PASS "Geant4InputAction\\[Input\\]: Event 27 Error when moving to event - EOF") endif() diff --git a/examples/DDG4_MySensDet/CMakeLists.txt b/examples/DDG4_MySensDet/CMakeLists.txt index 86f670b8599c324bedd03bd8da2f13fc186dc3ef..c894a0424edbe344bcdb5175e23b23e9b6ffc7b9 100644 --- a/examples/DDG4_MySensDet/CMakeLists.txt +++ b/examples/DDG4_MySensDet/CMakeLists.txt @@ -18,6 +18,7 @@ IF(NOT TARGET DD4hep::DDCore) ENDIF() dd4hep_set_compiler_flags() +find_package(Python REQUIRED COMPONENTS Interpreter) #========================================================================== if(NOT TARGET Geant4::Interface) dd4hep_print("Not creating DDG4_MySensDet tests") @@ -53,14 +54,14 @@ if (DD4HEP_USE_GEANT4) # Geant4 material scan. From position=0,0,0 to end-of-world dd4hep_add_test_reg( DDG4_MySensDet_g4material_scan_SiliconBlock_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDG4_MySensDet.sh" - EXEC_ARGS python ${DD4hep_ROOT}/bin/g4MaterialScan --compact=file:${CMAKE_INSTALL_PREFIX}/examples/ClientTests/compact/SiliconBlock.xml + EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/bin/g4MaterialScan --compact=file:${CMAKE_INSTALL_PREFIX}/examples/ClientTests/compact/SiliconBlock.xml "--position=0,0,0" "--direction=0,1,0" REGEX_PASS " Terminate Geant4 and delete associated actions." ) dd4hep_add_test_reg( DDG4_MySensDet_sim_SiliconBlock_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDG4_MySensDet.sh" - EXEC_ARGS python ${DDG4_MySensDet_INSTALL}/scripts/MyTrackerSD_sim.py + EXEC_ARGS ${Python_EXECUTABLE} ${DDG4_MySensDet_INSTALL}/scripts/MyTrackerSD_sim.py --compact=file:${CMAKE_INSTALL_PREFIX}/examples/ClientTests/compact/SiliconBlock.xml REGEX_PASS NONE REGEX_FAIL "Exception;EXCEPTION;ERROR;Error" ) diff --git a/examples/LHeD/CMakeLists.txt b/examples/LHeD/CMakeLists.txt index 0d34a57a3f4e54d2ae512ef617dee2735b4ec594..6ccb786f5fab2243571543b6d1fd9169832fe2e6 100644 --- a/examples/LHeD/CMakeLists.txt +++ b/examples/LHeD/CMakeLists.txt @@ -18,6 +18,7 @@ IF(NOT TARGET DD4hep::DDCore) ENDIF() dd4hep_set_compiler_flags() +find_package(Python REQUIRED COMPONENTS Interpreter) #========================================================================== set(LHeDEx_INSTALL ${CMAKE_INSTALL_PREFIX}/examples/LHeD) dd4hep_install_dir( src compact scripts sim DESTINATION ${LHeDEx_INSTALL} ) @@ -68,14 +69,14 @@ endforeach() # ROOT Geometry overlap checks dd4hep_add_test_reg( LHeD_check_geometry_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh" - EXEC_ARGS python ${DD4hep_ROOT}/bin/checkGeometry --compact=file:${LHeDEx_INSTALL}/compact/compact.xml + EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/bin/checkGeometry --compact=file:${LHeDEx_INSTALL}/compact/compact.xml # This takes too long --full=true --ntracks=10 --option=o --vx=0 --vy=0 --vz=0 REGEX_PASS " Execution finished..." ) # # ROOT Geometry overlap checks dd4hep_add_test_reg( LHeD_check_overlaps_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh" - EXEC_ARGS python ${DD4hep_ROOT}/bin/checkOverlaps --compact=file:${LHeDEx_INSTALL}/compact/compact.xml + EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/bin/checkOverlaps --compact=file:${LHeDEx_INSTALL}/compact/compact.xml --tolerance=0.1 REGEX_PASS " Execution finished..." ) # @@ -87,7 +88,7 @@ if (DD4HEP_USE_GEANT4) foreach(script LHeDMagField LHeDPhysics LHeDRandom LHeDScan) dd4hep_add_test_reg( LHeD_DDG4_${script}_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh" - EXEC_ARGS python ${LHeDEx_INSTALL}/scripts/${script}.py + EXEC_ARGS ${Python_EXECUTABLE} ${LHeDEx_INSTALL}/scripts/${script}.py REGEX_PASS "TEST_PASSED" REGEX_FAIL "Exception;EXCEPTION;ERROR" ) endforeach(script) @@ -95,7 +96,7 @@ if (DD4HEP_USE_GEANT4) # Material scan dd4hep_add_test_reg( LHeD_DDG4_g4material_scan_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh" - EXEC_ARGS python ${DD4hep_ROOT}/bin/g4MaterialScan --compact=file:${LHeDEx_INSTALL}/compact/compact.xml + EXEC_ARGS ${Python_EXECUTABLE} ${DD4hep_ROOT}/bin/g4MaterialScan --compact=file:${LHeDEx_INSTALL}/compact/compact.xml "--position=0,0,0" "--direction=0,1,0" REGEX_PASS " Terminate Geant4 and delete associated actions." ) # diff --git a/examples/Persistency/CMakeLists.txt b/examples/Persistency/CMakeLists.txt index 00fa85a284bc8c606c493fb4beac05ad5bf87f97..6e6f3f120e3c8964e3c5364f272c939209a0a7c1 100644 --- a/examples/Persistency/CMakeLists.txt +++ b/examples/Persistency/CMakeLists.txt @@ -18,6 +18,7 @@ IF(NOT TARGET DD4hep::DDCore) ENDIF() dd4hep_set_compiler_flags() +find_package(Python REQUIRED COMPONENTS Interpreter) #========================================================================== if(TARGET XercesC::XercesC) SET(OPT_XERCESC XercesC::XercesC) @@ -219,7 +220,7 @@ if (DD4HEP_USE_GEANT4) # Test restoring geometry from ROOT file and start Geant4 dd4hep_add_test_reg( Persist_CLICSiD_Geant4_LONGTEST COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_Persistency.sh" - EXEC_ARGS python ${CMAKE_CURRENT_SOURCE_DIR}/../CLICSiD/scripts/CLICSiD_LoadROOTGeo.py batch + EXEC_ARGS ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../CLICSiD/scripts/CLICSiD_LoadROOTGeo.py batch DEPENDS Persist_CLICSiD_Save_LONGTEST REGEX_PASS "\\+\\+\\+ Finished run 0 after 10 events \\(10 events in total\\)" REGEX_FAIL "Exception;EXCEPTION;ERROR"