From 583d532651fd8205b3945da5a7e130c93c6237be Mon Sep 17 00:00:00 2001 From: Markus Frank <Markus.Frank@cern.ch> Date: Fri, 15 Nov 2019 14:13:15 +0100 Subject: [PATCH] Fix DDCMS examples for not having the ROOT default element table --- examples/DDCMS/data/cms_test_solids.xml | 4 +- examples/DDCMS/data/materials.xml | 175 +++++++++++------- .../src/plugins/DDCMSDetElementCreator.cpp | 2 +- .../src/plugins/DDDefinitions2Objects.cpp | 34 +++- 4 files changed, 141 insertions(+), 74 deletions(-) diff --git a/examples/DDCMS/data/cms_test_solids.xml b/examples/DDCMS/data/cms_test_solids.xml index f611803b0..790e555a3 100644 --- a/examples/DDCMS/data/cms_test_solids.xml +++ b/examples/DDCMS/data/cms_test_solids.xml @@ -3,13 +3,13 @@ <debug> <debug_shapes/> <debug_includes/> + <debug_materials/> + <debug_namespaces/> <!-- <debug_rotations/> - <debug_materials/> <debug_volumes/> <debug_constants/> - <debug_namespaces/> <debug_placements/> <debug_algorithms/> <debug_visattr/> diff --git a/examples/DDCMS/data/materials.xml b/examples/DDCMS/data/materials.xml index a159d3848..e0e4e2f27 100644 --- a/examples/DDCMS/data/materials.xml +++ b/examples/DDCMS/data/materials.xml @@ -1,77 +1,112 @@ <?xml version="1.0"?> <DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../../DetectorDescription/Schema/DDLSchema.xsd"> <MaterialSection label="materials.xml"> - <ElementaryMaterial name="Aluminium" density="2.7*g/cm3" symbol=" " atomicWeight="26.98*g/mole" atomicNumber="13"/> - <ElementaryMaterial name="TD_Aluminium" density="8.1*g/cm3" symbol=" " atomicWeight="26.98*g/mole" atomicNumber="13"/> - <ElementaryMaterial name="Antimony" density="6.679*g/cm3" symbol=" " atomicWeight="121.75*g/mole" atomicNumber="51"/> - <ElementaryMaterial name="Argon" density="1.639*mg/cm3" symbol=" " atomicWeight="39.948*g/mole" atomicNumber="18"/> - <ElementaryMaterial name="Arsenic" density="5.72*g/cm3" symbol=" " atomicWeight="74.922*g/mole" atomicNumber="33"/> - <ElementaryMaterial name="Barium" density="3.5*g/cm3" symbol=" " atomicWeight="137.33*g/mole" atomicNumber="56"/> - <ElementaryMaterial name="Beryllium" density="1.848*g/cm3" symbol=" " atomicWeight="9.0122*g/mole" atomicNumber="4"/> - <ElementaryMaterial name="Bismuth" density="9.37*g/cm3" symbol=" " atomicWeight="208.98*g/mole" atomicNumber="83"/> - <ElementaryMaterial name="Bor 10" density="2.34*g/cm3" symbol=" " atomicWeight="10*g/mole" atomicNumber="5"/> - <ElementaryMaterial name="Bor 11" density="2.34*g/cm3" symbol=" " atomicWeight="11*g/mole" atomicNumber="5"/> - <ElementaryMaterial name="Bromine" density="3.11*g/cm3" symbol=" " atomicWeight="79.904*g/mole" atomicNumber="35"/> - <ElementaryMaterial name="Cadmium" density="8.63*g/cm3" symbol=" " atomicWeight="112.41*g/mole" atomicNumber="48"/> - <ElementaryMaterial name="Calcium" density="1.55*g/cm3" symbol=" " atomicWeight="40.078*g/mole" atomicNumber="20"/> - <ElementaryMaterial name="Carbon" density="2.265*g/cm3" symbol=" " atomicWeight="12.011*g/mole" atomicNumber="6"/> - <ElementaryMaterial name="Cerium" density="6.637*g/cm3" symbol=" " atomicWeight="140.12*g/mole" atomicNumber="58"/> - <ElementaryMaterial name="Cesium" density="1.87*g/cm3" symbol=" " atomicWeight="132.9054*g/mole" atomicNumber="55"/> - <ElementaryMaterial name="Chlorine" density="1.56*g/cm3" symbol=" " atomicWeight="35.45*g/mole" atomicNumber="17"/> - <ElementaryMaterial name="Chromium" density="7.18*g/cm3" symbol=" " atomicWeight="51.996*g/mole" atomicNumber="24"/> - <ElementaryMaterial name="Cobalt" density="8.9*g/cm3" symbol=" " atomicWeight="58.933*g/mole" atomicNumber="27"/> - <ElementaryMaterial name="Copper" density="8.96*g/cm3" symbol=" " atomicWeight="63.546*g/mole" atomicNumber="29"/> - <ElementaryMaterial name="Deuterium" density="162*mg/cm3" symbol=" " atomicWeight="2.01*g/mole" atomicNumber="1"/> - <ElementaryMaterial name="Fluorine" density="1.108*g/cm3" symbol=" " atomicWeight="18.998*g/mole" atomicNumber="9"/> - <ElementaryMaterial name="Gallium" density="5.877*g/cm3" symbol=" " atomicWeight="69.723*g/mole" atomicNumber="31"/> - <ElementaryMaterial name="Germanium" density="5.323*g/cm3" symbol=" " atomicWeight="72.61*g/mole" atomicNumber="32"/> - <ElementaryMaterial name="Gold" density="18.85*g/cm3" symbol=" " atomicWeight="196.97*g/mole" atomicNumber="79"/> - <ElementaryMaterial name="Helium" density="125*mg/cm3" symbol=" " atomicWeight="4.0026*g/mole" atomicNumber="2"/> - <ElementaryMaterial name="Hydrogen" density="70.8*mg/cm3" symbol=" " atomicWeight="1.00794*g/mole" atomicNumber="1"/> - <ElementaryMaterial name="Indium" density="7.3*g/cm3" symbol=" " atomicWeight="114.82*g/mole" atomicNumber="49"/> - <ElementaryMaterial name="Iodine" density="7.3*g/cm3" symbol=" " atomicWeight="114.82*g/mole" atomicNumber="53"/> - <ElementaryMaterial name="Iron" density="7.87*g/cm3" symbol=" " atomicWeight="55.85*g/mole" atomicNumber="26"/> - <ElementaryMaterial name="Krypton" density="2.6*g/cm3" symbol=" " atomicWeight="83.8*g/mole" atomicNumber="36"/> - <ElementaryMaterial name="Lanthanum" density="6.127*g/cm3" symbol=" " atomicWeight="138.9055*g/mole" atomicNumber="57"/> - <ElementaryMaterial name="Lead" density="11.35*g/cm3" symbol=" " atomicWeight="207.19*g/mole" atomicNumber="82"/> - <ElementaryMaterial name="Lithium" density="534*mg/cm3" symbol=" " atomicWeight="6.941*g/mole" atomicNumber="3"/> - <ElementaryMaterial name="Lutecium" density="9.841*g/cm3" symbol=" " atomicWeight="174.96*g/mole" atomicNumber="71"/> - <ElementaryMaterial name="Magnesium" density="1.735*g/cm3" symbol=" " atomicWeight="24.305*g/mole" atomicNumber="12"/> - <ElementaryMaterial name="Manganese" density="7.43*g/cm3" symbol=" " atomicWeight="54.938*g/mole" atomicNumber="25"/> - <ElementaryMaterial name="Molybdenum" density="10.2*g/cm3" symbol=" " atomicWeight="95.94*g/mole" atomicNumber="42"/> - <ElementaryMaterial name="Neodymium" density="1e-22*mg/cm3" symbol=" " atomicWeight="144.24*g/mole" atomicNumber="60"/> - <ElementaryMaterial name="Neon" density="1.207*g/cm3" symbol=" " atomicWeight="20.18*g/mole" atomicNumber="10"/> - <ElementaryMaterial name="Nickel" density="8.876*g/cm3" symbol=" " atomicWeight="58.693*g/mole" atomicNumber="28"/> - <ElementaryMaterial name="Niobium" density="8.55*g/cm3" symbol=" " atomicWeight="92.906*g/mole" atomicNumber="41"/> - <ElementaryMaterial name="Nitrogen" density="808*mg/cm3" symbol=" " atomicWeight="14.007*g/mole" atomicNumber="7"/> - <ElementaryMaterial name="Oxygen" density="1.43*mg/cm3" symbol=" " atomicWeight="15.999*g/mole" atomicNumber="8"/> - <ElementaryMaterial name="Palladium" density="12*g/cm3" symbol=" " atomicWeight="106.42*g/mole" atomicNumber="46"/> - <ElementaryMaterial name="Phosphor" density="1.82*g/cm3" symbol=" " atomicWeight="30.974*g/mole" atomicNumber="15"/> - <ElementaryMaterial name="Potassium" density="860*mg/cm3" symbol=" " atomicWeight="39.098*g/mole" atomicNumber="19"/> + <ElementaryMaterial name="Vacuum" density="1e-13*mg/cm3" symbol=" " atomicWeight="1*g/mole" atomicNumber="1"/> + <ElementaryMaterial name="Deuterium" density="162*mg/cm3" symbol=" " atomicWeight="2.01*g/mole" atomicNumber="1"/> + <ElementaryMaterial name="Hydrogen" density="70.8*mg/cm3" symbol=" " atomicWeight="1.00794*g/mole" atomicNumber="1"/> + <ElementaryMaterial name="Helium" density="125*mg/cm3" symbol=" " atomicWeight="4.0026*g/mole" atomicNumber="2"/> + <ElementaryMaterial name="Lithium" density="534*mg/cm3" symbol=" " atomicWeight="6.941*g/mole" atomicNumber="3"/> + <ElementaryMaterial name="Beryllium" density="1.848*g/cm3" symbol=" " atomicWeight="9.0122*g/mole" atomicNumber="4"/> + <ElementaryMaterial name="Bor 10" density="2.34*g/cm3" symbol=" " atomicWeight="10*g/mole" atomicNumber="5"/> + <ElementaryMaterial name="Bor 11" density="2.34*g/cm3" symbol=" " atomicWeight="11*g/mole" atomicNumber="5"/> + <ElementaryMaterial name="Carbon" density="2.265*g/cm3" symbol=" " atomicWeight="12.011*g/mole" atomicNumber="6"/> + <ElementaryMaterial name="Nitrogen" density="808*mg/cm3" symbol=" " atomicWeight="14.007*g/mole" atomicNumber="7"/> + <ElementaryMaterial name="Oxygen" density="1.43*mg/cm3" symbol=" " atomicWeight="15.999*g/mole" atomicNumber="8"/> + <ElementaryMaterial name="Fluorine" density="1.108*g/cm3" symbol=" " atomicWeight="18.998*g/mole" atomicNumber="9"/> + <ElementaryMaterial name="Neon" density="1.207*g/cm3" symbol=" " atomicWeight="20.18*g/mole" atomicNumber="10"/> + + <ElementaryMaterial name="Sodium" density="969*mg/cm3" symbol=" " atomicWeight="22.99*g/mole" atomicNumber="11"/> + <ElementaryMaterial name="Magnesium" density="1.735*g/cm3" symbol=" " atomicWeight="24.305*g/mole" atomicNumber="12"/> + <ElementaryMaterial name="Aluminium" density="2.7*g/cm3" symbol=" " atomicWeight="26.98*g/mole" atomicNumber="13"/> + <ElementaryMaterial name="TD_Aluminium" density="8.1*g/cm3" symbol=" " atomicWeight="26.98*g/mole" atomicNumber="13"/> + <ElementaryMaterial name="Silicon" density="2.33*g/cm3" symbol=" " atomicWeight="28.09*g/mole" atomicNumber="14"/> + <ElementaryMaterial name="Phosphor" density="1.82*g/cm3" symbol=" " atomicWeight="30.974*g/mole" atomicNumber="15"/> + <ElementaryMaterial name="Sulfur" density="2.07*g/cm3" symbol=" " atomicWeight="32.066*g/mole" atomicNumber="16"/> + <ElementaryMaterial name="Chlorine" density="1.56*g/cm3" symbol=" " atomicWeight="35.45*g/mole" atomicNumber="17"/> + <ElementaryMaterial name="Argon" density="1.639*mg/cm3" symbol=" " atomicWeight="39.948*g/mole" atomicNumber="18"/> + <ElementaryMaterial name="Potassium" density="860*mg/cm3" symbol=" " atomicWeight="39.098*g/mole" atomicNumber="19"/> + <ElementaryMaterial name="Calcium" density="1.55*g/cm3" symbol=" " atomicWeight="40.078*g/mole" atomicNumber="20"/> + + <ElementaryMaterial name="Scandium" density="2.98*g/cm3" symbol=" " atomicWeight="44.956*g/mole" atomicNumber="21"/> + <ElementaryMaterial name="Titanium" density="4.53*g/cm3" symbol=" " atomicWeight="47.88*g/mole" atomicNumber="22"/> + <ElementaryMaterial name="Vanadium" density="6.1*g/cm3" symbol=" " atomicWeight="50.941*g/mole" atomicNumber="23"/> + <ElementaryMaterial name="Chromium" density="7.18*g/cm3" symbol=" " atomicWeight="51.996*g/mole" atomicNumber="24"/> + <ElementaryMaterial name="Manganese" density="7.43*g/cm3" symbol=" " atomicWeight="54.938*g/mole" atomicNumber="25"/> + <ElementaryMaterial name="Iron" density="7.87*g/cm3" symbol=" " atomicWeight="55.85*g/mole" atomicNumber="26"/> + <ElementaryMaterial name="Cobalt" density="8.9*g/cm3" symbol=" " atomicWeight="58.933*g/mole" atomicNumber="27"/> + <ElementaryMaterial name="Nickel" density="8.876*g/cm3" symbol=" " atomicWeight="58.693*g/mole" atomicNumber="28"/> + <ElementaryMaterial name="Copper" density="8.96*g/cm3" symbol=" " atomicWeight="63.546*g/mole" atomicNumber="29"/> + <ElementaryMaterial name="Zinc" density="7.112*g/cm3" symbol=" " atomicWeight="65.39*g/mole" atomicNumber="30"/> + + <ElementaryMaterial name="Gallium" density="5.877*g/cm3" symbol=" " atomicWeight="69.723*g/mole" atomicNumber="31"/> + <ElementaryMaterial name="Germanium" density="5.323*g/cm3" symbol=" " atomicWeight="72.61*g/mole" atomicNumber="32"/> + <ElementaryMaterial name="Arsenic" density="5.72*g/cm3" symbol=" " atomicWeight="74.922*g/mole" atomicNumber="33"/> + <ElementaryMaterial name="Selenium" density="4.78*g/cm3" symbol=" " atomicWeight="78.96*g/mole" atomicNumber="34"/> + <ElementaryMaterial name="Bromine" density="3.11*g/cm3" symbol=" " atomicWeight="79.904*g/mole" atomicNumber="35"/> + <ElementaryMaterial name="Krypton" density="2.6*g/cm3" symbol=" " atomicWeight="83.8*g/mole" atomicNumber="36"/> + <ElementaryMaterial name="Rubidium" density="1.529*g/cm3" symbol=" " atomicWeight="85.4678*g/mole" atomicNumber="37"/> + <ElementaryMaterial name="Strontium" density="2.54*g/cm3" symbol=" " atomicWeight="87.62*g/mole" atomicNumber="38"/> + <ElementaryMaterial name="Yttrium" density="4.456*g/cm3" symbol=" " atomicWeight="88.9059*g/mole" atomicNumber="39"/> + <ElementaryMaterial name="Zirconium" density="6.494*g/cm3" symbol=" " atomicWeight="91.22*g/mole" atomicNumber="40"/> + + <ElementaryMaterial name="Niobium" density="8.55*g/cm3" symbol=" " atomicWeight="92.906*g/mole" atomicNumber="41"/> + <ElementaryMaterial name="Molybdenum" density="10.2*g/cm3" symbol=" " atomicWeight="95.94*g/mole" atomicNumber="42"/> + <ElementaryMaterial name="Technetium" density="11.48*g/cm3" symbol=" " atomicWeight="98*g/mole" atomicNumber="43"/> + <ElementaryMaterial name="Ruthenium" density="12.39*g/cm3" symbol=" " atomicWeight="101.07*g/mole" atomicNumber="44"/> + <ElementaryMaterial name="Rhodium" density="12.39*g/cm3" symbol=" " atomicWeight="102.9055*g/mole" atomicNumber="45"/> + <ElementaryMaterial name="Palladium" density="12*g/cm3" symbol=" " atomicWeight="106.42*g/mole" atomicNumber="46"/> + <ElementaryMaterial name="Silver" density="10.48*g/cm3" symbol=" " atomicWeight="107.87*g/mole" atomicNumber="47"/> + <ElementaryMaterial name="Cadmium" density="8.63*g/cm3" symbol=" " atomicWeight="112.41*g/mole" atomicNumber="48"/> + <ElementaryMaterial name="Indium" density="7.3*g/cm3" symbol=" " atomicWeight="114.82*g/mole" atomicNumber="49"/> + <ElementaryMaterial name="Tin" density="7.31*g/cm3" symbol=" " atomicWeight="118.69*g/mole" atomicNumber="50"/> + + <ElementaryMaterial name="Antimony" density="6.679*g/cm3" symbol=" " atomicWeight="121.75*g/mole" atomicNumber="51"/> + <ElementaryMaterial name="Tellurium" density="6.23*g/cm3" symbol=" " atomicWeight="127.6*g/mole" atomicNumber="52"/> + <ElementaryMaterial name="Iodine" density="7.3*g/cm3" symbol=" " atomicWeight="114.82*g/mole" atomicNumber="53"/> + <ElementaryMaterial name="Xenon" density="3.057*g/cm3" symbol=" " atomicWeight="131.29*g/mole" atomicNumber="54"/> + <ElementaryMaterial name="Cesium" density="1.87*g/cm3" symbol=" " atomicWeight="132.9054*g/mole" atomicNumber="55"/> + <ElementaryMaterial name="Barium" density="3.5*g/cm3" symbol=" " atomicWeight="137.33*g/mole" atomicNumber="56"/> + <ElementaryMaterial name="Lanthanum" density="6.127*g/cm3" symbol=" " atomicWeight="138.9055*g/mole" atomicNumber="57"/> + <ElementaryMaterial name="Cerium" density="6.637*g/cm3" symbol=" " atomicWeight="140.12*g/mole" atomicNumber="58"/> <ElementaryMaterial name="Praseodymium" density="1e-22*mg/cm3" symbol=" " atomicWeight="140.9077*g/mole" atomicNumber="59"/> - <ElementaryMaterial name="Rhodium" density="12.39*g/cm3" symbol=" " atomicWeight="102.9055*g/mole" atomicNumber="45"/> - <ElementaryMaterial name="Rubidium" density="1.529*g/cm3" symbol=" " atomicWeight="85.4678*g/mole" atomicNumber="37"/> - <ElementaryMaterial name="Ruthenium" density="12.39*g/cm3" symbol=" " atomicWeight="101.07*g/mole" atomicNumber="44"/> - <ElementaryMaterial name="Scandium" density="2.98*g/cm3" symbol=" " atomicWeight="44.956*g/mole" atomicNumber="21"/> - <ElementaryMaterial name="Selenium" density="4.78*g/cm3" symbol=" " atomicWeight="78.96*g/mole" atomicNumber="34"/> - <ElementaryMaterial name="Silicon" density="2.33*g/cm3" symbol=" " atomicWeight="28.09*g/mole" atomicNumber="14"/> - <ElementaryMaterial name="Silver" density="10.48*g/cm3" symbol=" " atomicWeight="107.87*g/mole" atomicNumber="47"/> - <ElementaryMaterial name="Sodium" density="969*mg/cm3" symbol=" " atomicWeight="22.99*g/mole" atomicNumber="11"/> - <ElementaryMaterial name="Strontium" density="2.54*g/cm3" symbol=" " atomicWeight="87.62*g/mole" atomicNumber="38"/> - <ElementaryMaterial name="Sulfur" density="2.07*g/cm3" symbol=" " atomicWeight="32.066*g/mole" atomicNumber="16"/> - <ElementaryMaterial name="Tantalum" density="16.65*g/cm3" symbol=" " atomicWeight="180.9479*g/mole" atomicNumber="73"/> - <ElementaryMaterial name="Technetium" density="11.48*g/cm3" symbol=" " atomicWeight="98*g/mole" atomicNumber="43"/> - <ElementaryMaterial name="Tellurium" density="6.23*g/cm3" symbol=" " atomicWeight="127.6*g/mole" atomicNumber="52"/> - <ElementaryMaterial name="Tin" density="7.31*g/cm3" symbol=" " atomicWeight="118.69*g/mole" atomicNumber="50"/> - <ElementaryMaterial name="Titanium" density="4.53*g/cm3" symbol=" " atomicWeight="47.88*g/mole" atomicNumber="22"/> - <ElementaryMaterial name="Tungsten" density="19.3*g/cm3" symbol=" " atomicWeight="183.85*g/mole" atomicNumber="74"/> - <ElementaryMaterial name="Uranium" density="18.95*g/cm3" symbol=" " atomicWeight="238.03*g/mole" atomicNumber="92"/> - <ElementaryMaterial name="Vacuum" density="1e-13*mg/cm3" symbol=" " atomicWeight="1*g/mole" atomicNumber="1"/> - <ElementaryMaterial name="Vanadium" density="6.1*g/cm3" symbol=" " atomicWeight="50.941*g/mole" atomicNumber="23"/> - <ElementaryMaterial name="Xenon" density="3.057*g/cm3" symbol=" " atomicWeight="131.29*g/mole" atomicNumber="54"/> - <ElementaryMaterial name="Yttrium" density="4.456*g/cm3" symbol=" " atomicWeight="88.9059*g/mole" atomicNumber="39"/> - <ElementaryMaterial name="Zinc" density="7.112*g/cm3" symbol=" " atomicWeight="65.39*g/mole" atomicNumber="30"/> - <ElementaryMaterial name="Zirconium" density="6.494*g/cm3" symbol=" " atomicWeight="91.22*g/mole" atomicNumber="40"/> + <ElementaryMaterial name="Neodymium" density="1e-22*mg/cm3" symbol=" " atomicWeight="144.24*g/mole" atomicNumber="60"/> + + <ElementaryMaterial name="Promethium" density="7.22*g/cm3" symbol=" " atomicWeight="144.913*g/mole" atomicNumber="61"/> + <ElementaryMaterial name="Samarium" density="7.46*g/cm3" symbol=" " atomicWeight="150.366*g/mole" atomicNumber="62"/> + <ElementaryMaterial name="Europium" density="5.243*g/cm3" symbol=" " atomicWeight="151.964*g/mole" atomicNumber="63"/> + <ElementaryMaterial name="Gadolinium" density="7.9004*g/cm3" symbol=" " atomicWeight="157.252*g/mole" atomicNumber="64"/> + <ElementaryMaterial name="Terbium" density="8.229*g/cm3" symbol=" " atomicWeight="158.925*g/mole" atomicNumber="65"/> + <ElementaryMaterial name="Dysprosium" density="8.55*g/cm3" symbol=" " atomicWeight="162.497*g/mole" atomicNumber="66"/> + <ElementaryMaterial name="Holmium" density="8.795*g/cm3" symbol=" " atomicWeight="164.93*g/mole" atomicNumber="67"/> + <ElementaryMaterial name="Erbium" density="9.066*g/cm3" symbol=" " atomicWeight="167.256*g/mole" atomicNumber="68"/> + <ElementaryMaterial name="Thulium" density="9.321*g/cm3" symbol=" " atomicWeight="168.934*g/mole" atomicNumber="69"/> + <ElementaryMaterial name="Ytterbium" density="6.73*g/cm3" symbol=" " atomicWeight="173.038*g/mole" atomicNumber="70"/> + + <ElementaryMaterial name="Lutecium" density="9.841*g/cm3" symbol=" " atomicWeight="174.96*g/mole" atomicNumber="71"/> + <ElementaryMaterial name="Hafnium" density="13.31*g/cm3" symbol=" " atomicWeight="178.485*g/mole" atomicNumber="72"/> + <ElementaryMaterial name="Tantalum" density="16.65*g/cm3" symbol=" " atomicWeight="180.9479*g/mole" atomicNumber="73"/> + <ElementaryMaterial name="Tungsten" density="19.3*g/cm3" symbol=" " atomicWeight="183.85*g/mole" atomicNumber="74"/> + <ElementaryMaterial name="Rhenium" density="21.02*g/cm3" symbol=" " atomicWeight="186.207*g/mole" atomicNumber="75"/> + <ElementaryMaterial name="Osmium" density="22.57*g/cm3" symbol=" " atomicWeight="190.225*g/mole" atomicNumber="76"/> + <ElementaryMaterial name="Platinum" density="21.45*g/cm3" symbol=" " atomicWeight="195.078*g/mole" atomicNumber="78"/> + <ElementaryMaterial name="Gold" density="18.85*g/cm3" symbol=" " atomicWeight="196.97*g/mole" atomicNumber="79"/> + <ElementaryMaterial name="Mercury" density="13.546*g/cm3" symbol=" " atomicWeight="200.599*g/mole" atomicNumber="80"/> + + <ElementaryMaterial name="Thallium" density="11.72*g/cm3" symbol=" " atomicWeight="204.383*g/mole" atomicNumber="81"/> + <ElementaryMaterial name="Lead" density="11.35*g/cm3" symbol=" " atomicWeight="207.19*g/mole" atomicNumber="82"/> + <ElementaryMaterial name="Bismuth" density="9.37*g/cm3" symbol=" " atomicWeight="208.98*g/mole" atomicNumber="83"/> + <ElementaryMaterial name="Polonium" density="9.32*g/cm3" symbol=" " atomicWeight="208.982*g/mole" atomicNumber="84"/> + <ElementaryMaterial name="Astatine" density="9.32*g/cm3" symbol=" " atomicWeight="209.987*g/mole" atomicNumber="85"/> + <ElementaryMaterial name="Radon" density="0.00900662*g/cm3" symbol=" " atomicWeight="222.018*g/mole" atomicNumber="86"/> + <ElementaryMaterial name="Francium" density="1*g/cm3" symbol=" " atomicWeight="223.02*g/mole" atomicNumber="87"/> + <ElementaryMaterial name="Radium" density="5*g/cm3" symbol=" " atomicWeight="226.025*g/mole" atomicNumber="88"/> + <ElementaryMaterial name="Actinium" density="10.07*g/cm3" symbol=" " atomicWeight="227.028*g/mole" atomicNumber="89"/> + <ElementaryMaterial name="Thorium" density="11.72*g/cm3" symbol=" " atomicWeight="232.038*g/mole" atomicNumber="90"/> + + <ElementaryMaterial name="Protactinium" density="15.37*g/cm3" symbol=" " atomicWeight="231.036*g/mole" atomicNumber="91"/> + <ElementaryMaterial name="Uranium" density="18.95*g/cm3 " symbol=" " atomicWeight="238.03*g/mole" atomicNumber="92"/> + + <CompositeMaterial name="FPix_Thermflow" density="0.7625*g/cm3" symbol=" " method="mixture by weight"> <MaterialFraction fraction="0.3787448"> <rMaterial name="materials:Silicon"/> diff --git a/examples/DDCMS/src/plugins/DDCMSDetElementCreator.cpp b/examples/DDCMS/src/plugins/DDCMSDetElementCreator.cpp index d3a3c6389..08e351fa2 100644 --- a/examples/DDCMS/src/plugins/DDCMSDetElementCreator.cpp +++ b/examples/DDCMS/src/plugins/DDCMSDetElementCreator.cpp @@ -103,7 +103,7 @@ DDCMSDetElementCreator::DDCMSDetElementCreator(Detector& desc) : description(desc) { DetectorHelper helper(description); - silicon = helper.element("SI"); + silicon = helper.element("materials:Silicon"); if ( !silicon.isValid() ) { except("DDCMSDetElementCreator", "++ Failed to extract SILICON from the element table."); diff --git a/examples/DDCMS/src/plugins/DDDefinitions2Objects.cpp b/examples/DDCMS/src/plugins/DDDefinitions2Objects.cpp index b5adc8242..5bb806cd0 100644 --- a/examples/DDCMS/src/plugins/DDDefinitions2Objects.cpp +++ b/examples/DDCMS/src/plugins/DDDefinitions2Objects.cpp @@ -67,6 +67,7 @@ namespace dd4hep { }; class materialsection; + class elementaryelement; class elementarymaterial; class compositematerial; @@ -126,6 +127,7 @@ namespace dd4hep { /// Converter for <MaterialSection/> tags template <> void Converter<materialsection>::operator()(xml_h element) const; + template <> void Converter<elementaryelement>::operator()(xml_h element) const; template <> void Converter<elementarymaterial>::operator()(xml_h element) const; template <> void Converter<compositematerial>::operator()(xml_h element) const; @@ -212,6 +214,7 @@ template <> void Converter<vissection>::operator()(xml_h element) const { /// Converter for <MaterialSection/> tags template <> void Converter<materialsection>::operator()(xml_h element) const { Namespace _ns(_param<ParsingContext>(), element); + xml_coll_t(element, _CMU(ElementaryMaterial)).for_each(Converter<elementaryelement>(description,_ns.context,optional)); xml_coll_t(element, _CMU(ElementaryMaterial)).for_each(Converter<elementarymaterial>(description,_ns.context,optional)); xml_coll_t(element, _CMU(CompositeMaterial)).for_each(Converter<compositematerial>(description,_ns.context,optional)); } @@ -389,6 +392,28 @@ template <> void Converter<vis>::operator()(xml_h e) const { description.addVisAttribute(attr); } +/// Converter for <ElementaryMaterial/> tags +template <> void Converter<elementaryelement>::operator()(xml_h element) const { + Namespace _ns(_param<ParsingContext>()); + xml_dim_t xmat(element); + string nam = _ns.prepend(xmat.nameStr()); + TGeoManager& mgr = description.manager(); + TGeoElementTable* tab = mgr.GetElementTable(); + TGeoElement* elt1 = tab->FindElement(xmat.nameStr().c_str()); + TGeoElement* elt2 = tab->FindElement(nam.c_str()); + + if ( !elt1 || !elt2 ) { + double atomicNumber = xmat.attr<double>(_CMU(atomicNumber)); + double atomicWeight = xmat.attr<double>(_CMU(atomicWeight)); + int n = int(atomicNumber); + printout(_ns.context->debug_materials ? ALWAYS : DEBUG, "DDCMS", + "+++ Converting element %-24s atomic number: %d", + ('"'+nam+'"').c_str(), n); + elt1 = new TGeoElement(nam.c_str(),"CMS element",n,atomicWeight); + tab->AddElement(elt1); + } +} + /// Converter for <ElementaryMaterial/> tags template <> void Converter<elementarymaterial>::operator()(xml_h element) const { Namespace _ns(_param<ParsingContext>()); @@ -403,12 +428,18 @@ template <> void Converter<elementarymaterial>::operator()(xml_h element) const double atomicNumber = xmat.attr<double>(_CMU(atomicNumber)); TGeoElementTable* tab = mgr.GetElementTable(); TGeoMixture* mix = new TGeoMixture(nam.c_str(), 1, density); - TGeoElement* elt = tab->FindElement(xmat.nameStr().c_str()); + TGeoElement* elt = tab->FindElement(nam.c_str()); printout(_ns.context->debug_materials ? ALWAYS : DEBUG, "DDCMS", "+++ Converting material %-48s Density: %.3f.", ('"'+nam+'"').c_str(), density); + if ( !elt ) { + printout(WARNING,"DDCMS", + "+++ Converter<ElementaryMaterial> No element present with name:%s [FAKE IT]", + matname); + } +#if 0 if ( !elt ) { printout(WARNING,"DDCMS", "+++ Converter<ElementaryMaterial> No element present with name:%s [FAKE IT]", @@ -423,6 +454,7 @@ template <> void Converter<elementarymaterial>::operator()(xml_h element) const if ( n < 2 ) n = 2; elt = new TGeoElement((xmat.nameStr()+"-CMS").c_str(),"CMS element",n,atomicNumber); } +#endif mix->AddElement(elt, 1.0); mix->SetRadLen(0e0); /// Create medium from the material -- GitLab