phoenix icon indicating copy to clipboard operation
phoenix copied to clipboard

[feature] Support of DD4hep geometry input

Open bartosik-hep opened this issue 1 year ago • 12 comments

From the code it doesn't seem like geometry input in DD4hep format is supported. Is it something being worked on or considered for the near future?

Many future experiments are using it to describe their geometries and the present ones are also migrating to DD4hep, so it would have been great for the experiment-agnostic event visualization tool to support it.

bartosik-hep avatar Mar 18 '24 09:03 bartosik-hep

Hi, I'm going from memory here, so take this with a pinch of salt, but my understanding of supporting DD4HEP was that this wasn't really feasible, since DD4HEP in use in a real detector is typically going to be a mixture of xml and C++ i.e. you cannot just open an XML file, you need the code in order to parse it.

That said, we do have instructions about how to turn ROOT TGeo into something Phoenix understands: https://github.com/HSF/phoenix/blob/main/guides/developers/convert-gdml-to-gltf.md#concert-root-to-gltf

EdwardMoyse avatar Mar 18 '24 10:03 EdwardMoyse

Thank you for the hint, @EdwardMoyse I know that this workflow of conversion to .gltf causes the loss of sensitive-element identifiers that makes association of hits with their corresponding detector elements impossible. Yet in the manual it is written that among others Phoenix supports loading .root files containing 3D objects. So does it mean that a TGeo geometry stored in a root file can be loaded directly, without conversion to .gltf?

bartosik-hep avatar Mar 18 '24 14:03 bartosik-hep

Kind of - I think it's probably a bit rudimentary.

But for example, I went to the Playground (https://hepsoftwarefoundation.org/phoenix/#/playground) and tried to import the root geometry shipped with Phoenix, and when the popup appeared asking for "Enter object name in ROOT file", I typed "simple1"

This gives the following: image

So something works, but I don't know if anyone uses this in "production"

EdwardMoyse avatar Mar 18 '24 14:03 EdwardMoyse

EIC ePIC detector uses DD4Hep and we export root and gdml geometry in CI. Experimenting, I tried to open those files directly

this.eventDisplay.loadRootGeometry('assets/epic_dirc_only.root', "default", "default", "", 10);

Note scale 10, it is important to convert from cm. Here is our DIRC detector as an example

image

DraTeots avatar Mar 21 '24 04:03 DraTeots

Very nice!

EdwardMoyse avatar Mar 22 '24 05:03 EdwardMoyse

I need to say, that converting to gltf and working with gltf provides much nicer experience and results. Especially using Blender for GLTF and other tools. But I don't think it is a problem of Phoenix but rather how how one sets up a pipeline to convert from dd4hep to geometry and import to phoenix. Currently just working with format designed for 3d in WebGL to render in WebGL and professional tools designed to work with 3D just work better than Cern ROOT geometry ported to javascript (with all my respect to Sergey Linev and all developers, they do amazing job).

I will write the full steps and ways to work with DD4HEP data in the end of my experiments

image

DraTeots avatar Mar 24 '24 23:03 DraTeots

DD4Hep plugin with custom stepping action exporting track steps to phoenix format. image

And here are optical photons 2024-03-26 02_17_31-Firebird - Vivaldi

It is fun!

DraTeots avatar Mar 27 '24 04:03 DraTeots

@DraTeots this is really interesting... Is this plugin available as part of some public repository to see the code? It would be very useful.

bartosik-hep avatar Mar 27 '24 14:03 bartosik-hep

Yes, I am making them public. Give me a day or two as I have to separate my pile of experiments to more sane projects and communicate with EIC software and computing where to better put them (presumably github.com/eic). I'll let you know here as it is alive.

DraTeots avatar Mar 27 '24 15:03 DraTeots

Thank you! Very much looking forward to it...

bartosik-hep avatar Mar 27 '24 15:03 bartosik-hep

Sorry for a long absence. Unfortunately didn't have time before the APS and vacation. Now I am back and will update on this soon.

DraTeots avatar Apr 17 '24 07:04 DraTeots

Just a quick ping to ask on progress on this?

EdwardMoyse avatar Sep 18 '24 05:09 EdwardMoyse

I think this isn't really a Phoenix issue now, given the conversation moved to a DD4HEP plugin. So closing.

EdwardMoyse avatar Nov 30 '24 11:11 EdwardMoyse