Dear ROOTers,
I would like to display the geometry of the detector with JSROOT. The problem is that some of the detectors are not visible. I figured out that such objects have “emtpy checkbox” in TBrowser, however I can’t change this visiblity. I tried something like topNode->GetDaughter()->SetVisibility(kTRUE) but after opening new file (with changed geoemtry) in TBrowser such object still is not visible (have empty checkbox).
I suppose that solution is simple but I cannot find it.
ROOT Version: Not Provided Platform: Not Provided Compiler: Not Provided
JSROOT requires that visibility flag is set already in ROOT file - this is most easy way.
Normally one does: gGeoMaganager->GetVolume("name")->SetVisibility(kTRUE);
If it does not help - can you provide reproducer macro?
However exported files (via mother->Write()) are still not visible.
Edit: I created function for save geometry in Event Display, I see in “Geometry scene” that those functions make visible node but not the volume. geom3.root.zip (2,6 MB)
First of all, your macro does not work for me.
Problem that you tries to store part of geometry without TGeoManager - in many cases it does not work correctly.
But I can understand your problem now. It is kVisOnScreen bit which is assigned for very few volumes in geometry. JSROOT search first for such bits and if found displays only these volumes.
There is “no_screen” draw option for geometry which let ignore these bits. In your case:
“no_screen” option exists since a while in JSROOT, in “dev” version I just add it to default context menu that it can be easily used in interactive mode. I also add possibility to easily expand TGeoNodeMatrix object which you store in the file.
But again - I recommend to store TGeoManager object
as far as I can see ClearVisibleVolumes is protected
Sorry, oversees it. Then just call gGeoManager->SetVisLevel(4);, it automatically should remove visibility bits as well.
I look at your examples and still - some detectors are not visible
Either visibility is not set or there are too many volumes and JSROOT cuts drawing of so many elements. You can try to add “all” to draw options like opt=no_screen;black;all
Hi,
it seems to not help, I also tried geoManager->ClearAttributes() but still thes objects have some flag “not visible” also in event display I cannot change property “VisVolume”. I think it’s fixed somewhere in EventDiplay because when I try to change visibility of these volumes I get warning “Info in TGeoManager::SetVisLevel: Automatic visible depth disabled”.
Please try to draw geometry before calling SetVisLevel.
Only then painter object is created, it can reset visibility bits.
Or you can apply attached macro - reset_vis.C (327 Bytes)