Print associations between volumes and medias

Hello Rooters,

I have a root geometry and, i wanted to ask if it is possible tro print all the volumes which are associated to a media?

Thank you in advance for your answer

If it helps … you can [url=https://root-forum.cern.ch/t/traversing-a-geometry/11356/3 a geometry"[/url] in order to find its specific parts (either “volumes” or “nodes”, identified by their “names”) and perform some actions for every item that has been “found” (e.g. check that it has “associated media”).

My goal is to write a file like:

Media 1
/World/daughter1/daughter2/ …
/World/daughter5/…

Media 2

I can have the mediums with the command ->GetListOfMedia() but this command doesn’t give the trees of volumes associated to the media

Unfortunately, the command GetListOfNodes() with iterator gives the first level (world_1)…

[code]TIter nextMat(geom->GetMostPf?pdes());
TObject *pMat;
i=0;
const int a=9999;
TString comp[a];
while( (pMat = nextMat()) ){
comp[i]= pMat -> GetName();
i=i+1;
cout << comp[i]<< endl;

[/code]

Do you have an idea about how to print list of nodes (/world_1/A_i/B_j …) ?

I come back to you because I still have not found a solution.
You do not have any ideas to help me ?