diff --git a/DDCore/CMakeLists.txt b/DDCore/CMakeLists.txt index 5d2f73cf5d38e7c794cbde00b896029ebdb3cbd5..4078194af5f33be7f230de5afc97b16e5ee2be59 100644 --- a/DDCore/CMakeLists.txt +++ b/DDCore/CMakeLists.txt @@ -89,7 +89,7 @@ endif() dd4hep_add_plugin(DDCorePlugins SOURCES src/plugins/*.cpp USES DDCore) # This plugins depends on the ROOT GDML readers. Hence, extra library -IF(TARGET ROOT::Gdml2) +IF(TARGET ROOT::Gdml) dd4hep_print("|++> Found Root::GDML: Creating DDGDMLPlugins") dd4hep_add_plugin(DDGDMLPlugins SOURCES src/gdml/*.cpp diff --git a/DDCore/src/DD4hepRootPersistency.cpp b/DDCore/src/DD4hepRootPersistency.cpp index 7c8e70ceed5c65ce02ff9316c368700d40b350df..90ca4f7d5007a1c9e8584beec6a0cb816dc31fb4 100644 --- a/DDCore/src/DD4hepRootPersistency.cpp +++ b/DDCore/src/DD4hepRootPersistency.cpp @@ -150,7 +150,7 @@ int DD4hepRootPersistency::load(Detector& description, const char* fname, const } DetectorData* tar_data = dynamic_cast<DetectorData*>(&description); DetectorData* src_data = dynamic_cast<DetectorData*>(source); - if( tar_data != nullptr && src_data != nullptr ){ + if( tar_data != nullptr && src_data != nullptr ) { tar_data->adoptData(*src_data,false); TTimeStamp stop; printout(ALWAYS,"DD4hepRootPersistency", diff --git a/examples/ClientTests/src/MiniTel.cpp b/examples/ClientTests/src/MiniTel.cpp index 7583008ae83115d719725871806034dabff84933..2c3b9279f3aa21a38bedcc013a46c3a9d173e826 100644 --- a/examples/ClientTests/src/MiniTel.cpp +++ b/examples/ClientTests/src/MiniTel.cpp @@ -119,12 +119,15 @@ static Ref_t create_detector(Detector &description, xml_h e, SensitiveDetector s pv2 = assembly.placeVolume(m_volume,Transform3D(Rotation3D(1., 0., 0., 0., 1., 0., 0., 0., -1.), Position(det_x,det_y,-det_z))); } - xml_comp_t dtctr = x_det; - if ( dtctr.isSensitive() ) { + if ( x_det.isSensitive() ) { + DetElement side_0(sdet,"side_0",x_det.id()); // Set volume attributes sens.setType("tracker"); pv1.addPhysVolID("side",0); + side_0.setPlacement(pv1); if ( pv2.isValid() ) { + DetElement side_1(sdet,"side_1",x_det.id()); + side_1.setPlacement(pv2); pv2.addPhysVolID("side",1); } } diff --git a/examples/OpticalSurfaces/CMakeLists.txt b/examples/OpticalSurfaces/CMakeLists.txt index fb0b7398865ca68643ecf8730d8837ce175735c9..c9a7dd8f2d4a8e49763a9cbead74651bb145cba3 100644 --- a/examples/OpticalSurfaces/CMakeLists.txt +++ b/examples/OpticalSurfaces/CMakeLists.txt @@ -63,29 +63,34 @@ dd4hep_add_test_reg( Surfaces_read_MaterialProperties REGEX_FAIL " ERROR ;EXCEPTION;Exception" ) # -#---Testing: Load OpNovice and dump it to GDML -dd4hep_add_test_reg( Surfaces_OpNovice_write_gdml - COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_OpticalSurfaces.sh" - EXEC_ARGS geoPluginRun -volmgr -destroy - -compact file:${OpticalSurfaces_INSTALL}/compact/OpNovice.xml - -plugin DD4hep_ROOTGDMLExtract -output OpNovice.gdml -path /world/BubbleDevice - REGEX_PASS "File OpNovice.gdml saved" - REGEX_FAIL " ERROR ;EXCEPTION;Exception" - ) -# -# -if ( "${ROOT_VERSION}" VERSION_GREATER_EQUAL "6.20.00" ) - # - #---Testing: Load GDML and dump volumes - dd4hep_add_test_reg( Surfaces_OpNovice_read_gdml +# This plugins depends on the ROOT GDML readers. Hence, extra library +IF(TARGET ROOT::Gdml) + #---Testing: Load OpNovice and dump it to GDML + dd4hep_add_test_reg( Surfaces_OpNovice_write_gdml COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_OpticalSurfaces.sh" EXEC_ARGS geoPluginRun -volmgr -destroy - -compact file:${OpticalSurfaces_INSTALL}/compact/OpNovice_gdml.xml - -print INFO -destroy -volmgr - -plugin DD4hep_ROOTGDMLParse -input OpNovice.gdml -path /world/BubbleDevice - -plugin DD4hep_VolumeDump - REGEX_PASS "\\+\\+\\+ Checked 5 physical volume placements." + -compact file:${OpticalSurfaces_INSTALL}/compact/OpNovice.xml + -plugin DD4hep_ROOTGDMLExtract -output OpNovice.gdml -path /world/BubbleDevice + REGEX_PASS "File OpNovice.gdml saved" REGEX_FAIL " ERROR ;EXCEPTION;Exception" + ) + # + # + if ( "${ROOT_VERSION}" VERSION_GREATER_EQUAL "6.19.01" ) + # + #---Testing: Load GDML and dump volumes + dd4hep_add_test_reg( Surfaces_OpNovice_read_gdml + COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_OpticalSurfaces.sh" + EXEC_ARGS geoPluginRun -volmgr -destroy + -compact file:${OpticalSurfaces_INSTALL}/compact/OpNovice_gdml.xml + -print INFO -destroy -volmgr + -plugin DD4hep_ROOTGDMLParse -input OpNovice.gdml -path /world/BubbleDevice + -plugin DD4hep_VolumeDump + REGEX_PASS "\\+\\+\\+ Checked 5 physical volume placements." + REGEX_FAIL " ERROR ;EXCEPTION;Exception" ) -endif() + endif() +ELSE() + dd4hep_print("ROOT does not include GDML, not building OpticalSurfaces GDML tests") +ENDIF() # diff --git a/examples/Persistency/CMakeLists.txt b/examples/Persistency/CMakeLists.txt index 1e6642dcc65e6ee0ee7199a6b1b5e077466d59f4..49296ec3bf5dc648536d98320b9e2fde0a40b92e 100644 --- a/examples/Persistency/CMakeLists.txt +++ b/examples/Persistency/CMakeLists.txt @@ -69,7 +69,7 @@ dd4hep_add_test_reg( Persist_MiniTel_Restore_VolMgr1_LONGTEST -plugin DD4hep_RootLoader MiniTel_geometry.root -plugin DD4hep_CheckVolumeManager DEPENDS Persist_MiniTel_Save_LONGTEST - REGEX_PASS "\\+\\+\\+ PASSED Checked 10 VolumeManager contexts. Num.Errors: 0" + REGEX_PASS "\\+\\+\\+ PASSED Checked 20 VolumeManager contexts. Num.Errors: 0" REGEX_FAIL " ERROR ;EXCEPTION;Exception;FAILED;TStreamerInfo" ) # @@ -80,7 +80,7 @@ dd4hep_add_test_reg( Persist_MiniTel_Restore_Nominal_LONGTEST -plugin DD4hep_RootLoader MiniTel_geometry.root -plugin DD4hep_CheckNominals DEPENDS Persist_MiniTel_Save_LONGTEST - REGEX_PASS "\\+\\+\\+ PASSED Checked 10 DetElements. Num.Errors: 0" + REGEX_PASS "\\+\\+\\+ PASSED Checked 20 DetElements. Num.Errors: 0" REGEX_FAIL " ERROR ;EXCEPTION;Exception;FAILED;TStreamerInfo" ) #