I wrote a small converter utility for translating a Geant4 geometry to a Root geometry using VGM. The utility is very simple:
- it builds the G4 geometry
- it imports the G4 world volume using a Geant4GM::Factory
- it exports the geometry to a RootGM::Factory
- it saves the geometry on a Root file with gGeoManager->Export
The problem I have is when applying this procedure to G4 geometries with replicated volumes. To be specific, I model a silicon microstrip sensor as follows:
- a single Si strip whose logical is called “siStripLogical”
- a Si sensor whose logical is called “siSensorLogical”
- a G4PVReplica called “siStrips” which replicates the strip inside the sensor.
When opening the Root file with the geometry I’d need to recover the name of the Si strip logical, namely “siStripLogical”; however it’s not clear to me how to do it. Browsing the geometry with TBrowser I see that the physical elements (the “siStrips”) are grouped under “siSensorLogical”, while it seems that nowhere in the geometry I can find some reference to the original single strip logical volume (“siStripLogical”).
Is what I want to do feasible or is the reference to the single-element logical volume completely lost in the Root geometry? Thanks.