Rootana javascript displays: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
Line 34: Line 34:
https://midastestdaq.triumf.ca/CS/webdisplay
https://midastestdaq.triumf.ca/CS/webdisplay


The html and javascript source for this page is available in rootana/examples/html.
The html and javascript source for this page is available in rootana/examples/html. If you want to use this example display you need to set up a custom page; a reminder about [https://midas.triumf.ca/MidasWiki/index.php//Custom_ODB_tree#Keys_in_the_.2FCustom_tree setting up custom pages].  You can see the particular configuration for the test page here
 
https://midastestdaq.triumf.ca/Custom


Features of this webdisplay include
Features of this webdisplay include

Revision as of 10:26, 3 May 2017

Introduction

We are exploring ways of being able to view rootana histograms and plots on webpages, rather than in custom GUIs. The current scheme is based on building webpages based on data served up by the ROOT web server : THttpServer.

The rootana analyzer has a command line option to allow the initialization of a THttpServer. For instance, you can try doing

 /ana.exe -r8088 

with the programs in rootana/examples; this start the program with an instance of the THttpServer on port 8088.

We have a test MIDAS instance available here (username/pwd: testdaq/testdaq)

https://midastestdaq.triumf.ca/

The default browser (the one that ROOT provides) for the rootana histograms is available here

https://midastestdaq.triumf.ca//rootana/

Note that we have proxied both the MIDAS server and the THttpServer through APACHE in this case. So, for instance, the apache ssl.conf file was tweaked to include the following proxy instructions:

Redirect permanent /rootana http://midastestdaq.triumf.ca/rootana/
ProxyPass /rootana/ http://midastestdaq.triumf.ca:8088/ retry=1
ProxyPass /      http://midastestdaq.triumf.ca:8081/ retry=1

You can use the above link to explore the histograms created by the rootana program and plot them. You can see that I have histograms being filled with datafrom V792 (charge) and V1720 (waveforms); note that this is just simulated data.

Custom web display

In addition to providing a way to browse and plot the histograms, the THttpServer also provides direct access to the histogram data in JSON format. Based on this ability we have made a javascript webpage that requests the histogram data from rootana using the THttpServer and plots them using the dygraph plotting package. The webpage is available here (username/pwd: testdaq/testdaq)

https://midastestdaq.triumf.ca/CS/webdisplay

The html and javascript source for this page is available in rootana/examples/html. If you want to use this example display you need to set up a custom page; a reminder about setting up custom pages. You can see the particular configuration for the test page here

https://midastestdaq.triumf.ca/Custom

Features of this webdisplay include

  • The ability to overlay multiple histograms or show two histograms side-by-side.
  • The webpage is configured by a JSON configuration file called generic_rootana_setup.json; this defines which histograms to create buttons to look at. The example configuration file shows how to define histograms that have multiple copies for different channels, as well as stand-alone histograms. You can see the example configuration file here:

https://midastestdaq.triumf.ca/CS/generic_rootana_setup.json

  • The ability to send reset commands back to the rootana program. Note that this resets the histograms for everyone, which may not be an annoying feature.
  • All transfers are done with asynchronous Promise-style AJAX transfers.
  • When requesting multiple histograms to overlay or plot side-by-side, all the histograms are requested in a single AJAX transfer. This ensures that you are looking at histograms that are updated at the same time, important when, for instance, plotting waveforms from a particular event.

The example page has two different schemes for actually plotting the data:

All these plotting packages seem to work reasonably well. I present the plots with all the packages, so users can compare between them and chose which they prefer.

Known problems

In addition to the general weakness of the html/javascript/css coding, there are some specific problems that still remain with this webpage.

  1. The webpage currently only works for looking at the histograms online. You could run rootana on a file and use this webpage to look at the plots; but I don't know how to get the webpage to tell rootana to only process one event at a time, so this isn't so useful. But maybe the idea of using a webpage to look at a particular file doesn't make much sense anyway.
  2. When you pause the webpage, you can't switch between different channels, display types, etc. That is because the webpage only has the information for the histogram that it is currently plotting; it doesn't have information for any other histograms, so can't show them without un-pausing.


I guess that these problems are probably problems that we also had with roody (not sure about i). They may be problems that are inherent to trying to decouple the generation of the histograms from their display.

There are also the following problems that are specific to the JSROOT style plots (hopefully fixed soon):

  • the overlay plotting doesn't work
  • the multiple plots are made with multiple AJAX transfers, so the data is not necessarily from the same event.