TGeoManager help: node directory structure

Hi All,

I have a TGeoManager object which I use to cd to a path in the directory of nodes e.g

fGeom->cd("/world/detector/subdetector/")

fGeom is my TGeoManager object.

Can anyone tell me if it is possible, once I have changed to a desired directory, to get the number of subdirectories/objects within that directory, using the TGeoManager object or otherwise?

I wish to change into a directory which has a number of sub directories and somehow get the number of sub directories there are there. Each subdirectory has further layers, beyond the one in which I am interested, before getting to the nodes themselves.

Thanks for your help,

Ben

Hi Ben,

After:

 fGeom->cd("path");

do:

 Int_t nd = fGeom->GetCurrentNode()->GetNdaughters()
 fGeom->CdDown(i)

You can use a special iterator if searching for some specific node info:

TGeoIterator next(fGeom->GetTopVolume())
TGeoNode *current;
while ((current=next())) {
  .. do_some_checkin
}

Cheers,

Genius! Thanks agheata,

Ben