diff --git a/DDCore/src/Shapes.cpp b/DDCore/src/Shapes.cpp index 9786e02e0589084099a1cce37b83797167fb0ec2..a048a5fb333648ab500a0fd960b21b851d89eebd 100644 --- a/DDCore/src/Shapes.cpp +++ b/DDCore/src/Shapes.cpp @@ -1061,6 +1061,7 @@ INSTANTIATE(TGeoHype); INSTANTIATE(TGeoTrap); INSTANTIATE(TGeoTrd1); INSTANTIATE(TGeoTrd2); +INSTANTIATE(TGeoCtub); INSTANTIATE(TGeoScaledShape); INSTANTIATE(TGeoCompositeShape); diff --git a/DDDetectors/compact/SiD/SiD_VertexConfig.xml b/DDDetectors/compact/SiD/SiD_VertexConfig.xml index 0952978b9ffbfdf6ef6203af970a0b55b2dccce4..5338f5dec3d57c6df33d2a0ed9929077af484b2c 100644 --- a/DDDetectors/compact/SiD/SiD_VertexConfig.xml +++ b/DDDetectors/compact/SiD/SiD_VertexConfig.xml @@ -18,6 +18,8 @@ <!-- Definition of the used visualization attributes --> <display> + <vis name="VertexSupportVis" alpha="1.0" r=".4" g=".4" b=".6" drawingStyle="wireframe" showDaughters="false" visible="true"/> + <vis name="VertexCableVis" alpha="1.0" r=".5" g=".5" b=".8" drawingStyle="solid" showDaughters="false" visible="true"/> <vis name="SiVertexModuleVis" alpha="1.0" r="1" g="1" b="0.6" drawingStyle="wireframe" showDaughters="true" visible="true"/> <vis name="SiVertexSensitiveVis" alpha="1.0" r="1" g="0.2" b="0.2" drawingStyle="solid" showDaughters="true" visible="true"/> <vis name="SiVertexPassiveVis" alpha="1.0" r="0" g="0.2" b="1" drawingStyle="solid" showDaughters="true" visible="true"/> diff --git a/DDDetectors/compact/SiD/SiD_VertexSupport.xml b/DDDetectors/compact/SiD/SiD_VertexSupport.xml index 512b2c492001c5b949f2ca256d56dc7a4676e7e1..54c0ea1ab0fcab04ae17408751502a436786a9ee 100644 --- a/DDDetectors/compact/SiD/SiD_VertexSupport.xml +++ b/DDDetectors/compact/SiD/SiD_VertexSupport.xml @@ -9,7 +9,7 @@ <comment>Vertex Detector Supports and Readout</comment> - <detector name="VertexBarrelSupports" type="DD4hep_MultiLayerTracker" vis="SupportVis" reflect="true"> + <detector name="VertexBarrelSupports" type="DD4hep_MultiLayerTracker" vis="VertexSupportVis" reflect="true"> <comment>Double-walled Carbon Fiber support tube</comment> @@ -20,7 +20,7 @@ <slice material = "CarbonFiber" thickness ="VXD_CF_support"/> </layer> </detector> - <detector name="VertexEndSupports" type="DD4hep_DiskTracker" reflect="true" vis="SupportVis"> + <detector name="VertexEndSupports" type="DD4hep_DiskTracker" reflect="true" vis="VertexSupportVis"> <layer id="7" inner_r = "(86.88*cm - CentralBeamPipe_zmax)*bp_cone_slope + CentralBeamPipe_rmax + VertexEndcap_offset" inner_z = "86.88*cm" outer_r = "16.87*cm"> <slice material = "CarbonFiber" thickness = "VXD_CF_support" /> </layer> @@ -29,7 +29,7 @@ </layer> </detector> - <detector name="VertexReadout" type="DD4hep_DiskTracker" reflect="true" vis="CableVis"> + <detector name="VertexReadout" type="DD4hep_DiskTracker" reflect="true" vis="VertexCableVis"> <comment>Readout and Cabling</comment> @@ -86,7 +86,7 @@ </layer> </detector> - <detector name="VXDcableZforwardBarrel" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="CableVis"> + <detector name="VXDcableZforwardBarrel" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="VertexCableVis"> <material name="Copper"/> <zplane rmin = "(CentralBeamPipe_rmax)" rmax = "(CentralBeamPipe_rmax + VertexCableThickness)" @@ -96,7 +96,7 @@ z="CentralBeamPipe_zmax"/> </detector> - <detector name="VXDcableZbackwardBarrel" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="CableVis"> + <detector name="VXDcableZbackwardBarrel" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="VertexCableVis"> <material name="Copper"/> <zplane rmin = "(CentralBeamPipe_rmax)" rmax = "(CentralBeamPipe_rmax + VertexCableThickness)" @@ -106,7 +106,7 @@ z="-CentralBeamPipe_zmax"/> </detector> - <detector name="VXDcableZbackwardOuter" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="CableVis"> + <detector name="VXDcableZbackwardOuter" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="VertexCableVis"> <material name="Copper"/> <zplane rmin = "((tracking_region_zmax - CentralBeamPipe_zmax)*bp_cone_slope + CentralBeamPipe_rmax)" rmax = "((tracking_region_zmax - CentralBeamPipe_zmax)*bp_cone_slope + CentralBeamPipe_rmax + 0.004*cm)" @@ -116,7 +116,7 @@ z="-(VertexService_zmax + 0.01*cm)"/> </detector> - <detector name="VXDcableZbackwardInner" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="CableVis"> + <detector name="VXDcableZbackwardInner" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="VertexCableVis"> <material name="Copper"/> <zplane rmin="CentralBeamPipe_rmax" rmax="CentralBeamPipe_rmax + VertexCableThickness" @@ -126,7 +126,7 @@ z="-(VertexService_zmin - 0.01*cm)"/> </detector> - <detector name="VXDcableZforwardOuter" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="CableVis"> + <detector name="VXDcableZforwardOuter" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="VertexCableVis"> <material name="Copper"/> <zplane rmin = "((tracking_region_zmax - CentralBeamPipe_zmax)*bp_cone_slope + CentralBeamPipe_rmax)" rmax = "((tracking_region_zmax - CentralBeamPipe_zmax)*bp_cone_slope + CentralBeamPipe_rmax + 0.004*cm)" @@ -136,7 +136,7 @@ z="VertexService_zmax + 0.01*cm"/> </detector> - <detector name="VXDcableZforwardInner" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="CableVis"> + <detector name="VXDcableZforwardInner" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="VertexCableVis"> <material name="Copper"/> <zplane rmin="(VertexService_zmin - 0.01*cm - CentralBeamPipe_zmax)*bp_cone_slope + CentralBeamPipe_rmax" rmax="(VertexService_zmin - 0.01*cm - CentralBeamPipe_zmax)*bp_cone_slope + CentralBeamPipe_rmax + VertexCableThickness" @@ -146,7 +146,7 @@ z="CentralBeamPipe_zmax"/> </detector> - <detector name="VXDserviceZbackward" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="CableVis"> + <detector name="VXDserviceZbackward" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="VertexCableVis"> <material name="G10"/> <zplane rmin = "(VertexService_zmax - CentralBeamPipe_zmax)*bp_cone_slope + CentralBeamPipe_rmax" rmax="(VertexService_zmax - CentralBeamPipe_zmax)*bp_cone_slope + CentralBeamPipe_rmax + VertexServiceThickness" @@ -156,7 +156,7 @@ z="-VertexService_zmin"/> </detector> - <detector name="VXDserviceZforward" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="CableVis"> + <detector name="VXDserviceZforward" type="DD4hep_PolyconeSupport" insideTrackingVolume="true" vis="VertexCableVis"> <material name="G10"/> <zplane rmin = "(VertexService_zmin - CentralBeamPipe_zmax)*bp_cone_slope + CentralBeamPipe_rmax" rmax="(VertexService_zmin - CentralBeamPipe_zmax)*bp_cone_slope + CentralBeamPipe_rmax + VertexServiceThickness" diff --git a/DDG4/src/Geant4AssemblyVolume.cpp b/DDG4/src/Geant4AssemblyVolume.cpp index 6cae442f8ff2255fa9c4c2b0752ce2107251f12e..1adf8b5fe18518dd565aeb3a253ef73de26a0ad3 100644 --- a/DDG4/src/Geant4AssemblyVolume.cpp +++ b/DDG4/src/Geant4AssemblyVolume.cpp @@ -110,17 +110,6 @@ void Geant4AssemblyVolume::imprint(Geant4GeometryInfo& info, // ZZZ - the log. volume index inside the assembly volume // std::stringstream pvName; -#if 0 - pvName << "av_" - << m_assembly->GetAssemblyID() - << "_impr_" - << GetImprintsCount() - << "_" - << triplet.GetVolume()->GetName().c_str() - << "_pv_" - << i - << ends; -#endif pvName << "AV_" << m_assembly->GetAssemblyID() << '!' @@ -136,11 +125,6 @@ void Geant4AssemblyVolume::imprint(Geant4GeometryInfo& info, // (as we allow 3D transformation use G4ReflectionFactory to // take into account eventual reflection) // -#if 0 - printout(INFO,"Geant4Converter","++ Place %svolume %s in assembly.", - triplet.IsReflection() ? "REFLECTED " : "", - detail::tools::placementPath(new_chain).c_str()); -#endif G4PhysicalVolumesPair pvPlaced = G4ReflectionFactory::Instance()->Place( Tfinal, pvName.str().c_str(), @@ -155,6 +139,9 @@ void Geant4AssemblyVolume::imprint(Geant4GeometryInfo& info, //fPVStore.emplace_back( pvPlaced.first ); info.g4VolumeImprints[vol].emplace_back(new_chain,pvPlaced.first); #if 0 + printout(INFO,"Geant4Converter","++ Place %svolume %s in assembly.", + triplet.IsReflection() ? "REFLECTED " : "", + detail::tools::placementPath(new_chain).c_str()); cout << " Assembly:Parent:" << parent->GetName() << " " << node->GetName() << " " << (void*)node << " G4:" << pvName.str() << " Daughter:" << detail::tools::placementPath(new_chain) << endl; diff --git a/examples/ClientTests/compact/CaloEndcapReflection.xml b/examples/ClientTests/compact/CaloEndcapReflection.xml index e1a27dd90f6a7ec2f4f1a083978552cbfcd72c67..33e3f7ac6aee22585e5c051404ba7b7a9e679d4f 100644 --- a/examples/ClientTests/compact/CaloEndcapReflection.xml +++ b/examples/ClientTests/compact/CaloEndcapReflection.xml @@ -63,7 +63,6 @@ <sensitive type="calorimeter"/> <reflect type="Z"/> </detector> - </detectors> <!-- Definition of the readout segmentation/definition --> @@ -115,7 +114,7 @@ <comment>Beampipe</comment> <include ref="${DD4hepINSTALL}/DDDetectors/compact/SiD/SiD_Beampipe.xml"/> - + <fields> <field name="GlobalSolenoid" type="solenoid" inner_field="5.0*tesla" diff --git a/examples/ClientTests/compact/CheckShape.xml b/examples/ClientTests/compact/CheckShape.xml index c4218c0c54a45785f0b289fa81111060ceca6ce3..4092297ae7b90dc5c2a98e28d8df25b2cd746f7d 100644 --- a/examples/ClientTests/compact/CheckShape.xml +++ b/examples/ClientTests/compact/CheckShape.xml @@ -26,7 +26,16 @@ <gdmlFile ref="${DD4hepINSTALL}/DDDetectors/compact/elements.xml"/> <gdmlFile ref="${DD4hepINSTALL}/DDDetectors/compact/materials.xml"/> </includes> + + <materials> + <material name="DefaultMaterial"> + <D value="7.85" unit="g/cm3"/> + <fraction n="0.998" ref="Fe"/> + <fraction n=".002" ref="C"/> + </material> + </materials> + <define> <constant name="world_side" value="300*cm"/> <constant name="world_x" value="world_side"/> diff --git a/examples/DDCAD/CMakeLists.txt b/examples/DDCAD/CMakeLists.txt index 895b198c6190967efca0c37779e7a5248f120ee5..a2ac8217203d44e6ee52754a94ac5e77309f73ba 100644 --- a/examples/DDCAD/CMakeLists.txt +++ b/examples/DDCAD/CMakeLists.txt @@ -58,6 +58,27 @@ foreach (test ${DDCAD_Tests}) endforeach() # # Test CAD export from a simplyfied model +dd4hep_add_test_reg( DDCAD_export_sid_vertex + COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDCAD.sh" + EXEC_ARGS geoPluginRun -input ${CLICSiDEx_INSTALL}/compact/SiD_multiple_inputs.xml + -input ${CLICSiDEx_INSTALL}/compact/SiD_Vertex.xml + -plugin DD4hep_CAD_export -output clicsid_vertex.collada + -type collada -recursive -detector /world -recursive -scale 1.0 + REGEX_PASS "Analysed 383 of 383 meshes" + REGEX_FAIL "Exception" + REGEX_FAIL "FAILED" +) +# +# Test CAD import from the exported simplyfied model +dd4hep_add_test_reg( DDCAD_import_sid_vertex + COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDCAD.sh" + EXEC_ARGS geoDisplay -input ${DDCADTests_INSTALL}/compact/Import_SiD_Vertex.xml -load -destroy + DEPENDS Persist_Conditions_Save + REGEX_PASS "Read 383 meshes" + REGEX_FAIL "Exception" +) +# +# Test CAD export from a simplyfied model dd4hep_add_test_reg( DDCAD_export_cal_endcaps COMMAND "${CMAKE_INSTALL_PREFIX}/bin/run_test_DDCAD.sh" EXEC_ARGS geoPluginRun -input ${ClientTestsEx_INSTALL}/compact/CaloEndcapReflection.xml diff --git a/examples/DDCAD/compact/Check_Shape_OBJ_spider.xml b/examples/DDCAD/compact/Check_Shape_OBJ_spider.xml index 1845a97f972dff70ba994eb4023180327c7b6d1e..a91af4b927122f44ac3a7927c8635a03c48368d4 100644 --- a/examples/DDCAD/compact/Check_Shape_OBJ_spider.xml +++ b/examples/DDCAD/compact/Check_Shape_OBJ_spider.xml @@ -15,10 +15,53 @@ <gdmlFile ref="../../ClientTests/compact/CheckShape.xml"/> </includes> + <materials> + <material name="HLeibTex"> + <D value="7.85" unit="g/cm3"/> + <fraction n="1.0" ref="Fe"/> + </material> + <material name="BeinTex"> + <D value="7.85" unit="g/cm3"/> + <fraction n="1.0" ref="Fe"/> + </material> + <material name="Augentex"> + <D value="7.85" unit="g/cm3"/> + <fraction n="1.0" ref="Fe"/> + </material> + <material name="Skin"> + <D value="7.85" unit="g/cm3"/> + <fraction n="1.0" ref="Fe"/> + </material> + </materials> + <detectors> <detector id="1" name="Shape_OBJ" type="DD4hep_TestShape_Creator"> <check vis="Shape1_vis"> - <shape type="CAD_Assembly" ref="${DD4hepExamplesINSTALL}/examples/DDCAD/models/OBJ/spider.obj" mesh="0"/> + <!-- + <shape type="CAD_Assembly" ref="${DD4hepExamplesINSTALL}/examples/DDCAD/models/OBJ/spider.obj" mesh="0" vis="Shape0_vis"/> + --> + <shape type="CAD_MultiVolume" ref="${DD4hepExamplesINSTALL}/examples/DDCAD/models/OBJ/spider.obj" unit="cm"> + <volume id="0" name="v1" material="Iron" vis="Shape3_vis"/> + <volume id="1" name="v1" material="Iron" vis="Shape3_vis"/> + <volume id="2" name="v1" material="Iron" vis="Shape1_vis"/> + <volume id="3" name="v1" material="Iron" vis="Shape1_vis"/> + <volume id="4" name="v1" material="Iron" vis="Shape1_vis"/> + <volume id="5" name="v1" material="Iron" vis="Shape1_vis"/> + <volume id="6" name="v1" material="Iron" vis="Shape1_vis"/> + <volume id="7" name="v1" material="Iron" vis="Shape1_vis"/> + <volume id="8" name="v1" material="Iron" vis="Shape1_vis"/> + <volume id="9" name="v1" material="Iron" vis="Shape1_vis"/> + <volume id="10" name="v1" material="Iron" vis="Shape1_vis"/> + <volume id="11" name="v1" material="Iron" vis="Shape5_vis"/> + <volume id="12" name="v1" material="Iron" vis="Shape5_vis"/> + <volume id="13" name="v1" material="Iron" vis="Shape5_vis"/> + <volume id="14" name="v1" material="Iron" vis="Shape5_vis"/> + <volume id="15" name="v1" material="Iron" vis="Shape5_vis"/> + <volume id="16" name="v1" material="Iron" vis="Shape5_vis"/> + <volume id="17" name="v1" material="Iron" vis="Shape5_vis"/> + <volume id="18" name="v1" material="Iron" vis="Shape5_vis"/> + </shape> + </check> <test1 type="DD4hep_Mesh_Verifier" ref="${DD4hepExamplesINSTALL}/examples/DDCAD/ref/Ref_OBJ_spider.txt" create="CheckShape_create"/> </detector> diff --git a/examples/DDCAD/compact/Import_CaloEndcap.xml b/examples/DDCAD/compact/Import_CaloEndcap.xml index a774f7a49652a647f1c68845cb508d4cc9f97448..61cc6c9fafa9293820204895282bb05e5739766e 100644 --- a/examples/DDCAD/compact/Import_CaloEndcap.xml +++ b/examples/DDCAD/compact/Import_CaloEndcap.xml @@ -19,6 +19,10 @@ <detectors> <detector id="1" name="Shape_Collada" type="DD4hep_TestShape_Creator"> <check> + <!-- + <shape type="CAD_MultiVolume" ref="./endcap.collada" unit="cm"/> + <shape type="CAD_MultiVolume" ref="./endcap.stl" unit="cm"/> + --> <shape type="CAD_MultiVolume" ref="./endcap_reflection.collada" unit="cm"/> </check> </detector>