TRevolution.js
Hi,
One of ROOT's traditional features: you can use it on any platform. That was especially true in the past: Linux, Windows, MacOS, Solaris, AIX, HPUX - you name it: ROOT was there. But now we have a different environment: devices are getting smaller, and next to good old Linux and Windows in new cloths (Android, Windows Mobile) we have new, dedicated mobile OSes like iOS.
Is that mobile world relevant to ROOT? Yes, because ROOT consists of two parts: the number crunching and storage - that didn't change too much - and the interactive part: experiments use ROOT histograms for online quality control, PROOF and any other well-designed compute "farming" solution reports back with live histograms.
So what would it take? We could implement an iOS, an Android, and a Windows Mobile port of ROOT. Timur and Fons have done the port to iOS, a student down my corridor, Jakob Blomer, once showed that a port to Android also works. The main challenges are the GUI / windowing systems, as well as the distribution of the ROOT port onto these devices. The Android port is incomplete on the graphics part, the iOS one on the distribution part. (Just because you own an iWhatever doesn't mean Apple allows you to do with it what you want. There's a good reason for it, though: Apple knows that that's better for you.) And both iOS and Android ports are too heavy for the most common use case: looking at histograms stored in ROOT files on a web server.
The obvious solution sounded demanding: implement ROOT's I/O in JavaScript, and pipe the data into one out of many possible JavaScript visualization libraries. While for iOS and Android we were able to use ROOT's native C++ core including I/O, all of that would have to be re-implemented for JavaScript. And ROOT's I/O is famous for its simplicity of implementation and its massive documentation. Err, wait. ROOT's I/O is famous for being able to cope with all C++ constructs and doing that incredibly sturdy and fast. Right, that's what it was.
Bertrand took up that challenge and implemented a pre-alpha prototype that already gives a good feeling just how powerful this approach is: grab the HTML file, the CSS file and the JavaScript file. Edit the HTML file to point to your ROOT file(s), put everything on a web server, and you can immediately browse the histograms the ROOT file contains, live. No ROOT installation, all JavaScript. No heavy lifting, only those bits are transferred that are needed: why download the 2GB TTree of you want to check out the histogram next to it?
I was super-impressed that Bertrand managed all that within a few weeks. That it's possible at all, actually. And how useful the result is, even if Bertrand claims it's far from being ready for public use (you have been warned! Especially the visualization part is now under active development).
I think his work will rapidly change the way the experiments do their online monitoring, the way people run analyses - check your intermediary results, live! - and possibly also the way you, our uses, see ROOT: not stuck in the dark origins of C++, but creatively making use of new technologies like your cell phone. We hope you'll like it - I do.
Cheers,

Edit 2013-01-15: updated CSS and JavaScript links.
Amazing! Any updates since
Hi,The latest version of
The latest version of the code is available at http://root.cern.ch/js, and you can also check it out of svn, from http://root.cern.ch/svn/root/trunk/js/JSRootIO
Cheers, Bertrand.
plot branch content
Re: Branches, node.js
Hi Ilija!
Plotting branches means that javascript has to do the histogramming. And once you do that you probably want to have expressions. And once you do that you probably also want to have something similar to TTree::Draw()... While all of this is possible Bertrand focusses for now on displaying histograms and graphs (and, big news: he's currently working on displaying TCanvases, with all histograms / graphs that it contains!)
Let's see how it is used and where development will go from here!
Regarding node.js: nothing planned; and I'm afraid I don't see a realistic application for that, probably because of my limited imagination... What's you idea here?
Cheers, Axel.
Looks prety nice
Hi. Has there been any
RE: Has there been any
Hi Adam,
Thanks for your interest in this project! I'm still working on it... And the latest "public" demo version is still available there. It will be updated from time to time, to reflect latest changes.
Cheers, Bertrand.
The best ROOT feature ever
Re: Best feature ever
Hi Ricardo,
Thanks for your enthusiastic comment! I like cherries and cake: can we meet to discuss what exactly you envision? Are you at CERN or will you be here soon? Let me know (axel@cern.ch)!
Cheers, Axel
Slightly scary, but very
Re: Scary but useful
Hi Peter,
Thanks for your comment! That dynamic interaction and the low overhead for publishing histograms were two of the main reasons to do this. Yes, your servers will just send out bytes, and apache is pretty good at that.
Note that we are just entering this new world - we have no experience with publishing this code / API properly, to make it usable by many possible applications while keeping the most common case (displaying histograms of a root file) as simple as possible. Luckily we have a wizard of Javascript right down the corridor; I hope he can help us with that.
Nevertheless, I'd really appreciate if you could contact Bertrand.Bellenot@cern and discuss how you'd like to use his code; this would definitely help with defining the interfaces.
Cheers, Axel.
Nice!
Re: Everywhere
Hi Gordon,
Thanks for trying it out! The main concerns people had in the beginning (and I'm rephrasing "why people thought the idea was nuts" here) were bandwidth and latency for getting the data, as well as CPU power for unzipping and unboxing, i.e. converting raw bytes into structured data members. It's great to see it works for accessing a 1GB ROOT file sitting in Asia from CERN. Or for rendering histograms on a Windows phone - any phone.
Now let's see how we can use it and what the next step could be!
Cheers, Axel
Array and TRevolution.js
Visualization of arrays
Hi,
Visualization is only implemented for TH1 and TH2, not for TArray. If I were you I'd just store a TH1D or TH1F to the ROOT file instead of a TArrayD or TArrayF.
Cheers, Axel
Hi, Thanks for your reply. In
Re: Web-based Data Overview
Hi,
Bertrand has been working on your example :-) Can you try with the newest snapshot from the URL mentioned in the blog post?
Note that we are planning on providing this through a JavaScript API, i.e. you will be able to link in the needed CSS and Javascript files into your (in the future minimal) HTML file. We will post the details once Bertrand publishes this project.
Cheers, Axel.
Excellent!
ALICE Online Monitoring?
Hi Barth,
Thanks for your enthusiastic reaction! We definitely need to hear about your use case - can you give a few details be email? Bertrand or I will call you next week to discuss.
Cheers, Axel.
Brilliant
Re: WebSockets
Hi Siu
Thanks for checking out the implementation and thanks even more for your suggestion!
I didn't find WebSockets very tempting for this job: we don't need true bidirectional communication, the amount of chunks requested is rather small, and the standard is still both in flux and not widely implemented. What's your killer argument for WebSockets that I am overlooking?
Cheers, Axel
websockets
Excellent work !!! we wait
Thanks!
Hi Jan,
Thanks! Bertrand is continuously improving this at the moment, e.g. today. We will announce when it's available for production use - but until then you can always take a current snapshot, no need to wait!
Cheers, Axel.
Hi Axel, long time ! :) +1
Documentation
Hi Seb,
Thanks for your thumbs up! Remember that this feature is unreleased - it's too early to expect user-targeted documentation for it :-) Bertrand does comment most of his code, though. Once we release it there will of course be proper documentation.
We did target only histograms for now, expecting that they make up the majority of the actual use cases. All other are "nice to have" but by far not as essential.
Cheers, Axel.
re-hi, thanks four answer. I
Thanks, Axel! Very nice post
Blackberry
Hi Andy!
Thanks for your applause :-) TBlackberry sounds like a high investment into a... ehrm... sinking ship. It can do JavaScript, right? Right!? ;-)
Cheers, Axel.