Read the output of commands like TGeoVolume::CheckOverlaps


I would like to know the proper way to access the output of commands such as TGeoVolume::CheckOverlaps, which returns void but displays the result of the check into the console. I would like to access the information (whether there are any overlaps or not) in order to go further with my code. I have no idea how to do this from root.

I also tried to do this from outside of root via root macro_with_CheckOverlaps.C > output.txt but the output of the function is not logged into output.txt.

I guess I could eventually find a solution, since the output exists in the terminal, but I wonder what the proper way to do this would be, preferably without having to parse the output of the terminal (maybe check the nullity of some pointer? like you can do for TGeoManager::Import with gGeoManager).



@agheata can you please take a look here? Thanks!

The overlap checking is described here. You can call CheckOverlaps for a volume or for the full geometry. This is stored in TGeoManager and can be retrieved using:
gGeoManager-> GetListOfOverlaps(), you can Print() it.
If you open a browser after calling CheckOverlaps, there is a new list of “Illegal overlaps”. Double-clicking one of them will display in the current viewer, showing with markers the overlap region.

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