ShipSoft / FairShip

SHiP experiment framework based on FairRoot
http://ship.web.cern.ch/ship/
22 stars 105 forks source link

Event display GUI missing #376

Open antonioiuliano2 opened 3 years ago

antonioiuliano2 commented 3 years ago

Version: Ubuntu 20.04 LTS

When I launch eventDisplay.py, the additional GUI which allows me to select the event is missing. However, I do not see any error and the geometry is drawn correctly.

Do you have any info on the possible cause?

Best regards, Antonio

ThomasRuf commented 3 years ago

I can reproduce the problem. The TK window does not show up anymore automatically, no idea why. You need to type SHiPDisplay.ioBar.master.mainloop() However, this takes control, and the terminal is blocked. No idea how to get back the previous behavior, have the tk window and the terminal in parallel.

olantwin commented 3 years ago

Maybe one could start the mainloop on a second thread or process? But that opens a whole new can of worms...

Is this due to a change in ROOT?

ThomasRuf commented 3 years ago

I have no clue. In principle, ROOT is not used. It is only python and tkinter. Did it worked with ship-2020?

olantwin commented 3 years ago

If we can figure out what exactly causes this regression, maybe we can figure out how to return to the previous behaviour...

antonioiuliano2 commented 3 years ago

Dear Thomas and Oliver, thank you for your answers, I have just followed Thomas' advice and recovered the GUI. However, when I try to draw an event I get the following error:

Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.8/tkinter/init.py", line 1883, in call return self.func(*args) File "/home/utente/SHIPBUILD/FairShip/macro/eventDisplay.py", line 510, in nextEvent SHiPDisplay.NextEvent(self.n) File "/home/utente/SHIPBUILD/FairShip/macro/eventDisplay.py", line 596, in NextEvent p.SetTitle(p.repr()) File "/home/utente/SHIPBUILD/sw/ubuntu1604_x86-64/FairShip/master-1/python/decorators.py", line 67, in TEvePointSetPrintOut x,y,z = ROOT.Double(),ROOT.Double(),ROOT.Double() File "/home/utente/SHIPBUILD/sw/ubuntu1604_x86-64/ROOT/ship-v6-22-02_FAIRSHIP-1/lib/ROOT/_facade.py", line 163, in _fallback_getattr raise AttributeError("Failed to get attribute {} from ROOT".format(name)) AttributeError: Failed to get attribute Double from ROOT

May it be connected?

ThomasRuf commented 3 years ago

no. Double does not exist anymore in the new ROOT version. What version of eventdisplay do you use?

antonioiuliano2 commented 3 years ago

The version from master branch, macro/eventDisplay.py. However, the call to Double() comes from python/decorators.py, and it is still present: https://github.com/ShipSoft/FairShip/blob/master/python/decorators.py (line 67):

x,y,z = ROOT.Double(),ROOT.Double(),ROOT.Double()
ThomasRuf commented 3 years ago

ok, needs to be replaced with import ctypes x,y,z = ctypes.c_double(),ctypes.c_double(),ctypes.c_double()

ThomasRuf commented 3 years ago

reading about tkinter, I am now wondering how it ever worked before. The master object should be constantly in a loop to wait for input from the GUI, which blocks the input via prompt. However, none of the ROOT GUI has this problem, like TBrowser or TEve. So, either I add an exit to the event display gui to give back control to the prompt, and the user has to give back control to the gui by typing SHiPDisplay.ioBar.master.mainloop(), or we find out how ROOT handles this.