Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems using MDI_o1_v01 #421

Closed
1 task done
danieljeans opened this issue Jan 21, 2025 · 3 comments
Closed
1 task done

problems using MDI_o1_v01 #421

danieljeans opened this issue Jan 21, 2025 · 3 comments
Assignees
Labels

Comments

@danieljeans
Copy link
Contributor

Check duplicate issues.

  • Checked for duplicates

Goal

Hi,

I'm having problems using the CAD-based models of the FCCee MDI under MDI_o1_v01 .

I get an error like:

Compact ERROR ++ FAILED to convert subdetector: Beampipe_STL: Cannot find a material referenced by name:DefaultMaterial

It seems the specified materials are not being picked up correctly, and being replaced by "DefaultMaterial"?
I found the discussion , as far as I can see from that discussion, the current code follows the recommendations.

I believe that I could use these models several months ago (~September 2024), but I'm afraid I cannot remember in exactly which setup...

Thanks for your help,
Cheers,
Daniel.

Operating System and Version

RH9

compiler

gcc11.4.1

The version of the key4hep stack

/cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh -r 2025-01-20

Package Version

latest k4geo and/or dd4hep

Reproducer

A minimal example:

$ source /cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh -r 2025-01-20

$ wget https://fccsw.web.cern.ch/fccsw/filesForSimDigiReco/MDI/MDI_o1_v01/stl_files/Pipe_240430/AlBeMet162_30042024.stl

$ cat << EOF > gg.xml
<lccdd>
  <includes>
    <gdmlFile  ref="\${K4GEO}/FCCee/CLD/compact/CLD_o4_v05/elements.xml"/>
    <gdmlFile  ref="\${K4GEO}/FCCee/CLD/compact/CLD_o4_v05/materials.xml"/>
  </includes>
  <define>
    <constant name="world_side"             value="30*m"/>
    <constant name="world_x"                value="world_side/2"/>
    <constant name="world_y"                value="world_side/2"/>
    <constant name="world_z"                value="world_side/2"/>
  </define>
  <detectors>
    <detector name="Beampipe_STL" type="DD4hep_TestShape_Creator">
      <check>
        <shape type="CAD_MultiVolume" ref="AlBeMet162_30042024.stl"
               unit="mm" material="AlBeMet162">
          <volume id="0" name="s1" vis="AlBeMet_vis" material="AlBeMet162">
            <position x="0*cm"  y="0*cm"  z="0*cm"/>
            <rotation x="0*rad" y="0*rad" z="0*rad"/>
          </volume>
        </shape>
      </check>
    </detector>
  </detectors>
</lccdd>
EOF


$ geoDisplay -print VERBOSE -input gg.xml

...
DetElementObject VERB +++ Created new DetElementObject('Beampipe_STL', -1)
TestShape DEBUG +++ Create shape: Beampipe_STL build type is: BUILD_DEFAULT
Compact ERROR ++ FAILED to convert subdetector: Beampipe_STL: Cannot find a material referenced by name:DefaultMaterial
terminate called after throwing an instance of 'std::runtime_error'
what(): Cannot find a material referenced by name:DefaultMaterial
Aborted

Additional context

No response

@atolosadelgado atolosadelgado self-assigned this Jan 21, 2025
@atolosadelgado
Copy link
Collaborator

Hi @danieljeans

Thanks for reporting this issue!

I think by adding the DefaultMaterial to CLD material XML file is enough. I am testing it now :)

@danieljeans
Copy link
Contributor Author

danieljeans commented Jan 22, 2025

@atolosadelgado thanks, adding a DefaultMaterial definition seems to fix this problem.

I checked using g4MaterialScan that the actual material used is indeed the requested one (e.g. AlBeMet162 for the beampipe) rather than the DefaultMaterial.

Every model which uses CAD shapes should ensure that a DefaultMaterial is defined!
How about a common description of elements and common materials in k4geo which all models could use?
It seems there is a lot of unnecessary duplication at present...

@doloresgarcia
Copy link

doloresgarcia commented Jan 24, 2025

I wanted to report that using the latest version of ke4geo and key4hep (03-10-2024) I was able to build with the IDEA-01-v03 with the CAD beampipe and use it to generate some data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants