Display tracks with JSROOT and THttpServer

Dear ROOT experts,

Currently our event viewer consists of a ROOT macro that spawns a TEve event viewer where a TGeoManager geometry is added. Tracks are added via multiple instances of TEveStraightLineSet and TEvePointSet (no need for curved tracks, so we don’t use TEveTrack). I am working on migrating this system into a web based version using JSROOT / THttpServer.

I have managed to create an HttpServer and register a TGeoManager object, which I can correctly visualize in the browser. I haven’t been able to correctly render any other object such as a TEveStraightLineSet. I haven’t found any examples / tutorials that do this, only some that create the tracks via JSROOT, but not registering them via THttpServer.

My goal would be to achieve something like: Read a ROOT file, being able to draw multiple tracks on top of the geometry.



TEveStraightLineSet class does not yet supported by JSROOT, but can be implemented very easy.
The only problem - I am in vacations now and can implement it only in 10 days from now.
Please open issue on Issues · root-project/jsroot · GitHub



Can provide ROOT file with your geometry and with correspondent TEveStraightLineSet object.
Then I can try to implement support for them.


1 Like

Hello @linev, thanks for your reply.

I can provide you a ROOT file with the TGeoManager geometry and my event representation objects (TEveStraightLineSet for tracks and point set for “hits”).

However after doing some research I am not sure this option is the best solution to my application, as I need to be able to browse between events. I would need to store the event representation in some kind of container (std::vector) and have a way to browse between this events (I thought via a callback from a button in THttpServer) to update the “Current event” in the heap. Would it be possible in this case to render the new event without having to render the geometry again? I have not found any examples of this.

I have also seen you are working towards some javascript based event viewer, but could not find much information about this, do you mind giving a quick update on this project? is it being actively developed? would it be possible to test it? Thanks.


Did you check how tutorials/http/httpgeom.C macro is working?
It shows simple way to regularly update geometry with some tracks.
It re-render complete scene, but in case of simple geometry it does not make big difference.

To make functionality with extra buttons and adding/removing new tracks you need to make some JavaScript/HTML code, which will invoke methods from TGeoPainter class - which is still private and not very well documented.
Of course, I will help with it - taking into account my vacations in August.

Yes, there is REve - web-based event display in ROOT, successor of EVE.
There are several tutorials like tutorials/eve7/event_demo.C or tutorials/eve7/collection_proxies.C
Project is rapidly developed now and you can contact @matevz and @alja to get more details about it.
If you plan to implement sophisticated event display - I would really encourage to try it.


1 Like

In the tutorials/eve7/event_demo.C you can see that static objects are added in the geometry scene and the dynamic in the event scene.
The tutorials/eve7/collection_proxies.C demo is more complex because it reads data directly from vector structures and builds objects for graphic and table scenes. Ideally the demo would have been split in event generation and scene updates to be more readable.

The tutorials are at the moment the most helpful information. The web based event display (REve) is still in rapid development and ROOT::Experimenal namespace.

Thanks to both. I will find some time to try this out in depth and see if I can use the examples as building blocks for my visualizer. I will keep you updated with the results!

@alja @linev I couldn’t run any of the examples on my ROOT installation, I remember this also happened in the past when I was curious about eve7. I only found this ROOT 7 - ROOT as help.

Could you provide some tips on how to run the examples? Do you need to build ROOT with some particular compilation flag besides c++ >= 14?

My ROOT installation:

lobis@sultan2:~/opt/root/install/tutorials/eve7$ root-config --version
lobis@sultan2:~/opt/root/install/tutorials/eve7$ root-config --cflags
-pthread -std=c++17 -m64 -I/home/lobis/opt/root/install/include

I cannot find the headers requiered in the examples (root [2] #include <ROOT/REveBox.hxx> ROOT_prompt_2:1:10: fatal error: 'ROOT/REveBox.hxx' file not found) for ROOT: ROOT::Experimental::REveBox Class Reference.

Perhaps I need to use the experimental namespace in some way to import them but not sure (why aren’t the examples using this namespace in this case?).

If I run an example I get the following:

lobis@sultan2:~/opt/root/install/tutorials/eve7$ root $ROOTSYS/tutorials/eve7/box.C
  | Welcome to ROOT 6.25/01                        https://root.cern |
  | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Jul 26 2021, 15:29:00                 |
  | From heads/master@v6-25-01-1693-g6de8aef9e9                      |
  | With c++ (Debian 8.3.0-6) 8.3.0                                  |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |

root [0]
Processing /home/lobis/opt/root/install/tutorials/eve7/box.C...
In file included from input_line_8:1:
/home/lobis/opt/root/install/tutorials/eve7/box.C:9:10: fatal error: 'ROOT/REveBox.hxx' file not found
#include <ROOT/REveBox.hxx>
root [1]



You have to compile ROOT with -Droot7=ON -Dwebgui=ON options.


Thanks, I wish this was more clearly specified in ROOT 7 - ROOT

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