Get logical volume for G4 replica converted to VGM

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.

Maybe @agheata can give some hints…

Hi,

I’m not very familiar with VGM internals, but the G4PVReplica maps to divisions in ROOT geometry. It might be that the way these are converted from G4 to ROOT is implemented such that it does not preserve the logical volume representing the division “cell”. You should ask the author of VGM: ivana.hrivnacova@cern.ch

Best, Andrei

Dear Nicola,

The logical volume, corresponding to a replica division, which was used in G4PVReplica() should exist under the same name as TGeoVolume. Did you try to access your Root volume via:
gGeoManager->FindVolumeFast( “siStripLogical”);

I checked with the VGM test, where I modified G4PVDivision with G4PVReplica, that the replica cell volume can be accessed via its name introduced in Geant4 geometry.

If the above does not work for you, could you post the the code where you define your replica?

Best regards,

Hi Ivana, thank you very much for your suggestion. I have been able to recover the name of the G4 logical volume corresponding to the single strip by looking at the name of the TGeoVolume associated to the TGeoNode of the single strip. Your suggestion led me in the right direction.
Thanks again.

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