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

[feature] Support of DD4hep geometry input #639

Open
bartosik-hep opened this issue Mar 18, 2024 · 12 comments
Open

[feature] Support of DD4hep geometry input #639

bartosik-hep opened this issue Mar 18, 2024 · 12 comments

Comments

@bartosik-hep
Copy link

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.

@EdwardMoyse
Copy link
Collaborator

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

@bartosik-hep
Copy link
Author

bartosik-hep commented Mar 18, 2024

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?

@EdwardMoyse
Copy link
Collaborator

EdwardMoyse commented Mar 18, 2024

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"

@DraTeots
Copy link
Collaborator

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

@EdwardMoyse
Copy link
Collaborator

Very nice!

@DraTeots
Copy link
Collaborator

DraTeots commented Mar 24, 2024

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
Copy link
Collaborator

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!

@bartosik-hep
Copy link
Author

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

@DraTeots
Copy link
Collaborator

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.

@bartosik-hep
Copy link
Author

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

@DraTeots
Copy link
Collaborator

DraTeots commented Apr 17, 2024

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.

@EdwardMoyse
Copy link
Collaborator

Just a quick ping to ask on progress on this?

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

No branches or pull requests

3 participants