CERN Accelerating science

3D model or Event display at SWAN

Dear SWAN experts,

currently, I am trying to use SWAN to prepare a HEP lecture. 

I would like to show some 3D detetor models and event display later if possible.
Diogo has pointed me to one Jupiter example: https://nbviewer.jupyter.org/github/dpiparo/swanExamples/blob/master/notebooks/Geometry_Visualisation_cpp/Geometry_Visualisation_cpp.ipynb

However, if I do it in SWAN, the session crashes. The root file is only ~30K.
TGeoManager::Import("/eos/atlas/user/l/lezhang/Teaching/geometryfile/spaceStation.root");
gGeoManager->GetTopVolume()->Draw(“ogl”);

I also tried with other inputs which show the same problem.

At your conveience, can you tell me how to solve this problem?

Thanks a lot!

Cheers,

Lei

Hey Lei Zhang @lezhang ,

For issues like crashing kernel it is better to use SNOW (https://cern.service-now.com/service-portal/function.do?name=swan)

Can you try using swan006 with 16GB and try to reproduce the problem? I will also have a look into your logs. Lets follow up in SNOW.

Thanks!

Hi Lei,
Your code also crashes on me. Why do you do Draw(“ogl”) instead of just Draw() like in the Gallery example?
Maybe someone from ROOT could help here (@etejedor).
Diogo

Hi Piotr and Diogo,

thanks for your help again. 

Indeed, if I remove “ogl”, it works! :smile: I copy that line from other script.
So, in this case, it is possible to do event display.

I also have another quesiton about the student account and will create another thread.

Thanks a lot!

Lei

Hi all,

sorry for coming back to this thread after so long.
I reallized that the “ogl” option is relevant actually.

In the standalone ROOT, if I use Draw(“ogl”), it will show a widget.
With it, I can do some options which is useful.
But, if I do “ogl” in SWAN, it will crash.

Do you have an idea how to get the widget in SWAN?

Thanks a lot!

Cheers,

Lei

P.S. in case needed, here is my code:

std::cout<<" hellow world “<<std::endl;
//TFile *inputfile = TFile::Open(”/eos/atlas/user/l/lezhang/Higgs/mumuH.root");
//TTree inputTree = (TTree)inputfile->Get(“ntEXC2_0001100”);
TGeoManager::Import("/eos/atlas/user/l/lezhang/Teaching/geometryfile/ShortTPC.gdml");
//TGeoManager::Import("/eos/atlas/user/l/lezhang/Teaching/geometryfile/spaceStation.root");
//below will crash
//gGeoManager->GetTopVolume()->Draw(“ogl”);
//below will not crash
gGeoManager->GetTopVolume()->Draw("");

Hi Lei,

The classic ROOT graphics are unfortunately not available in the notebook. You have basically two options: