Reading GDML File in ROOT 6.14

Hi I was reading gdml file in ROOT 6.14.
I am using following command on terminal

TGeoManager::Import("nameof file.gdml");

It gives me error

Error: Unsupported GDML Tag Used :triangular. Please Check Geometry/Schema.
Medium: Gold, Not Yet Defined!
Solid: air_gold-SOL, Not Yet Defined!
Info in <TGeoManager::SetTopVolume>: Top volume is air_gold. Master volume is air_gold

Can you please suggest how to resolve this issue.

I have invited @agheata to have a look!

Looks like your GDML file has some errors. Can you share it?

Please find gdml files attached. (536.9 KB)

You need to use at least ROOT v6-21 when support for tessellated shapes was added. Your files are missing the material definition, which will prompt some errors. However, the ROOT GDML parser expects currently a field named “type” for each triangular facet, like in:

             <triangular vertex1="shield_aluminum_v2298" vertex2="shield_aluminum_v2241" vertex3="shield_aluminum_v2242" type="ABSOLUTE"/>

without this the triangular facets are not created. I’m adding a fix for this in the master, meanwhile you can use an editor to introduce these “type” fields in your files.

Hi, a fix for the missing “type” attribute which defaults to “ABSOLUTE” is committed now in the master, if you use this you should be able to read and visualize this geometry.

are you suggesting master version of root

No, you can only have this new fix now by compiling the master branch of ROOT from GIT: since there is no tag on that

Hi When I do make -j 8 it giving me error on xrootd?
I don’t understand how to resolve this.

Hi, have a look at the instruction at:
You can try to disable xrootd support by passing -Dxrootd=OFF to the cmake command

Thanks, I am now able to read & visualise the geometry in gdml using root.
Thank you very much for all your support.

Can you give me some idea OR Hint is there master version of Geant4 is also available so that I should read these gdml files in geant4 framework.
As I have to use these gdml file there in Geant4 for performing the simulation with proton beam on these geometry. Because existing geant4 (v geant4.10.05) are not be able to read :slight_smile:
Attached is the error

The problem is not that you use a wrong version of Geant4, but that your files do contain errors. The volumes you create declare that they use some material, but the material definition is missing. For example, your file shield_aluminum.gdml reads at the end:

        <volume name="shield_aluminum">
            <materialref ref="Aluminum"/>
            <solidref ref="shield_aluminum-SOL"/>

but “Aluminum” was never defined. You should have, just after the “position” tags something like below:

      <position name="shield_aluminum_v13953" unit="mm" x="-1579.333" y="-754.2489" z="-1507.848"/>

    <material name="Aluminum" Z="13">
      <D unit="g/cm3" value="2.7"/>
      <atom unit="g/mole" value="26.98"/>

otherwise the Geant4 parser doesn’t know what “Aluminum” means. The ROOT reader just gives you a warning. The same for the other file.

Thanks Agheata
I tried to add those lines to define the material in the gdml file as you suggested.
I am trying to read and visualise that gdml file in persistency/gdml/G01 example in Geant4.
But still see blank screen without any geometry (see attachment)
I dont understand why?

Is the problem in showing solid, OR geometry is too small?
I am not sure just guessing?

I saw the below message (with verbosity error) at the time of compiling the gdml file in Geant4 under gdml example G01

Visualization verbosity changed to errors (2)
/tracking/storeTrajectory 2
Attributes available for modeling and filtering with
  "/vis/modeling/trajectories/create/drawByAttribute" and
  "/vis/filtering/trajectories/create/attributeFilter" commands:
  Event ID (EventID): G4int
  Run ID (RunID): G4int
  Charge (Ch): unit: e+ (G4double)
  Track ID (ID): G4int
  Initial kinetic energy (IKE): G4BestUnit (G4double)
  Initial momentum magnitude (IMag): G4BestUnit (G4double)
  Initial momentum (IMom): G4BestUnit (G4ThreeVector)
  No. of points (NTP): G4int
  PDG Encoding (PDG): G4int
  Parent ID (PID): G4int
  Particle Name (PN): G4String
  Auxiliary Point Position (Aux): G4BestUnit (G4ThreeVector)
  Step Position (Pos): G4BestUnit (G4ThreeVector)
Visualization verbosity changed to warnings (3)

But I dont know how to fix it. Only I see the blank screen from Geat4, no geometry

May be it is a question for the Geant 4 forum ?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.