Version 1 (modified by tbretz, 19 months ago) (diff)


The Event Viewer is a tool which allows to display raw data and manipulate raw data from a web browser. It is ideal to develop new algorithms without recompiling any code or writing a new framework. The disadvantage is that it is quite tedious to install. Here are some instructions.

First, you need to checkou FACT++:

[0] scn checkout

Instructions how to compile FACT++ can be found here: InstallingFACT++. Compiling it with the TOOLS_ONLY option is enough.

Now, you need to make sure that a web-server is installed, PHP is installed and the corresponding web-server configuration is set. For Ubuntu that means installing apache2, php and libapache2.mod-php.

Usually, the default directory for user web-content is /home/user/public_html. When you think you have identified where you can put web-contents, I suggest to test if everything works properly.

Put a file info.php with the following contents there.


Now, open your browser and browse that file through your web-server, e.g. http://localhost/~user/info.php. If you see the contents of the file, you still have to work on your configuration. If you see some nice table with php information, everything is ok.

In newer Ubuntu versions, php for local directories is turned off. You need to enable it by commenting the follwing in /etc/apache2/mods-enabled/php7.0.conf

# Running PHP scripts in user directories is disabled by default
# To re-enable PHP in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
#<IfModule mod_userdir.c>
#    <Directory /home/*/public_html>
#        php_admin_flag engine Off
#    </Directory>

The next challenge is to get V8Js running, the V8 interface for PHP. You can use pecl to install it:

[1] sudo pecl install v8js

You will see some downloads and how pecl tries to configure the compilation. As V8Js requires a quite recent V8 library and current systems still come with a rather old one, you might see an error like this:

checking for libv8_libplatform... configure: error: could not find libv8_libplatform library
ERROR: `/tmp/pear/temp/v8js/configure --with-php-config=/usr/bin/php-config --with-v8js' failed

if this is the case, you need to install a recent version of V8. In case of Ubuntu (>=16.04), you can do that with

[2] sudo add-apt-repository ppa:pinepain/libv8
[3] sudo apt-get update
[4] sudo apt install v8-6.6 v8-6.6-dev

You need to install the libraries and the developer files. Now you can run [1] again providing the correct installation path (in the case of the PPA, this is /opt/libv8-6.6) and everything should run through.

Then you have to configure apache to use the new extension by adding to your php.ini (in Ubuntu it is found at /etc/php/7.0/apache2/php.ini).

Now, reload the apache configuration

[5] sudo service apache2 reload

I sugget to like the viewer directory in your public_html directory, e.g.

[6] cd ~/public_html
[7] ln -s [your-FACT++-directory]/www/viewer

You should now be able to access the viewer from your web-browser as http://localhost/~user/viewer/. Ideally without getting an error (except that no files could be found)

If that goes well, as a last step, you have to change the path to the FACT++ tool getevent and the paths to your data. As you will most likely only want to display raw data (Monte Carlo data and calibrated data needs special preparation), just add the path to your raw data three times.