Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You do not have to use this exact directory, but it is recommended to have a dedicated directory for online reconstruction configuration and data files. The instructions in this documentation will generally assume that you are working within this directory.

The updated online reconstruction tools are currently on a branch of HPS Java, which you can checkout and build using a this command such as:

Code Block
languagebash
themeMidnight
git clone https://github.com/JeffersonLab/hps-java
cd hps-java
git checkout online-recon-dev
mvn clean install -DskipTests

Now, you should can install the online reconstruction scripts into your work area:

Code Block
languagebash
themeMidnight
# Go into online recon module within the hps-java project
cd online-recon

# Install the online recon run scripts to your work dir
mvn install -DskipTests -DskipCheckstyle -DassembleDirectory=/scratch

# Optionally add the script directory to the path.
export PATH=/scratch/bin:$PATH

The online reconstruction run scripts should now be installed to the /scratch/bin directory, and you should be ready to test the client and server.

...

Info
titleET Software

The server cannot startup without connecting to an ET ring. If you are testing the tools outside of the counting house where this is not provided, then follow the instructions towards the end of this documentation under "ET Software" for installing and running the ET software, along with a data producer, starting at "Installing ET Software". 

TODO: Provide internal link to these instructions.

an ET ring and data producer. 

The connection parameters for your local ET ring need to be specified in an initial server config file like this:

...

These settings provide the hostname where the ET ring is running, the port it is using used for accepting connections, and the name of the buffer file. These need to exactly match the settings on the your actual ET ring or the server will fail to startup. Currently, these cannot be changed once the server is started, so you should make sure they are correct before starting up the server..

Once you have Once you have confirmed that the ET ring is running and your configuration file is valid, you may launch the server as a background process using a command such as:

Code Block
languagebash
themeMidnight
hps-recon-server --host localhost --port 22222 -w $PWD/stations -c my.cfg &

...

Code Block
languagebash
themeMidnight
hps-recon-client

This will open a prompt that allows you to send commands to the server and see the results in your terminal.

Info
titleConsole
Whenever you see online> in a code block, you should run the command in the online reconstruction console rather than your system shell.

...

Code Block
languagebash
themeMidnight
GENERAL

    help - print general information
    help [cmd] - print information for specific command
    exit - quit the console

SETTINGS

    port [port] - set the server port
    host [host]- set the server hostname
    file [filename] - write server output to a file
    append [true|false] - true to append to output file or false to overwrite
    terminal - redirect server output back to the terminal

COMMANDS

    config - Set new server configuration properties
    create - Create a new station
    list - List station information in JSON format
    log - Tail log file of station (hit any key to stop tailing)
    remove - Remove a station that is inactive
    save - Save the current set of plots to a ROOT or AIDA file
    set - Set a configuration property
    shutdown - Shutdown the server
    start - Start a station that is inactive
    status - Show server and station status
    stop - Stop a station

You can also get help for a specific command using:

Code Block
languagebash
themeMidnight
online> help [command]

For instance:

Code Block
languagebash
themeMidnight
online> help create

This will show you the syntax for using that specific command.

If the server was started with a custom port, If the server was started with a custom port, or it is running on a particular remote host, these can be specified like:

...

By default, output from the server read by the client is printed to the console, but it can instead be saved to a log file using commands such asfile:

Code Block
themeMidnight
online> file client.log
online> append true

Configuration of the online reconstruction stations can be set performed using the set command:

Code Block
themeMidnight
# lcsim detector name for conditions
online>set lcsim.detector HPS-PhysicsRun2016-Pass2

# run number for conditions
online>set lcsim.run 7798

# lcsim steering resource
online>set lcsim.steering /org/hps/steering/recon/PhysicsRun2016OnlineRecon.lcsim

The above will configure the stations to run on 2016 data. The detector, run, and steering parameters are all required for running an online reconstruction station.

Once the configuration is set properly, a single station can A single station with the above configuration can now be created using a command like:

...

Many of the online recon commands are similar in that they take no arguments (usually meaning all stations or all stations in a certain state) or a space-delimited list of station IDs, as in the above example.

Once a station is started, it will process events from the ET ring or sit in wait mode waiting for more data to appear. A station that has been started is said to be in the active state. In order to process data, you would now start the DAQ or the EVIO file producer (covered below).

The current status of the stations and the ET ring system can be checked using:

Code Block
themeMidnight
online>status

...

To exit from the log streaming mode, simply hit any key on your keyboard.

This command will stop all the active stationsStop all jobs:

Code Block
themeMidnight
online>stop

Stop You may also stop stations by their ID:

Code Block
themeMidnight
online>stop 1 2 3

Remove all All inactive stations (active stations need to be stopped first before they are removable).can be removed using:

Code Block
themeMidnight
online>remove
online>remove

Removing a station deletes its work directory and completely removes it from the online reconstruction server.

Similar to the stop command, you can also remove stations using their IDsRemove stations by ID:

Code Block
themeMidnight
online>remove 1 2 3

...

You can use rootbrowse command to look at the plots saved in the ROOT format.

When Finally, when you'll all done, shutdown the server using a command like:

...

This will wait 5 seconds before stopping and destroying all stations and cleanly shutting down the server and its connection to the ET ringand destroying all stations and cleanly shutting down the server and its connection to the ET ring.

Warning
titleShutting Down the Server
You should always stop the server using the shutdown command, rather than killing its system process. Using a command like kill -9 on the server process may result in the system processes for the stations not being deactivated properly, forcing you to kill them manually.

Client Command Line

Now you can connect to the running server using the online recon client:

...

Code Block
languagebash
hps-recon-client --host localhost my.cmd

Viewing Plots

...

Showing Plots in a Java Web Application

Setup the Web Application

First, install Apache Tomcat and start it (not covered here). I have used the 9.0.41 release, but any recent version should work fine.

Download Next, download and build the webapp from githubOnline Recon Web App:

Code Block
themeMidnight
git clone https://github.com/JeremyMcCormick/hps-online-recon-webapp
cd hps-online-recon-webapp
mvn clean install war:war -DskipTests

Now go to the Tomcat manager webpage, usually which is typically at:
http://localhost:8080/manager/html

Click Choose File in the manager and select the war file at hps-online-recon-webapp/target/HPSRecon.jar which you just built.

Click Deploy to start the webapp. If there is a previous installation of the war file, then first click on Undeploy under Applications to remove it, or this step will fail.

...

Code Block
languagexml
themeMidnight
<context-param>
    <param-name>hps.online.recon.connection</param-name>
    <param-value>//localhost:3001/HPSRecon</param-value>
</context-param>

Should the settings on the AIDA server 's settings be changed, this MUST differ from this, the setting must be updated and the webapp redeployed.

...

View the Plots in the Browser

Anyone can view the combined plots in a webpage, provided the aggregator is running and the URL is accessible.

Go to the webpage to view the plots, which would typically be:

http://localhost:8080/HPSRecon/

If there is an error, probably error on this page, it is likely that the online reconstruction server is not running.

...

They are organized by folders (directories) in the aida AIDA tree.

Click on one of the plots to show it:

You may also click one of the directories to show a paginated set of thumbnails.

Viewing plots in JAS3

The remote AIDA tree can be viewed in real-time using JAS3 as a client.

...

Plots should refresh automatically (every 2s by default).

Click on the combined or remote plots in the tree and style them interactively...



TODO: Run Show how to run a Java main() or Jython script to create AIDA plot pages/regions/styles/etc. from the remote tree data.

ET Software

Installing the ET Software

If you are running outside Hall B for testing purposes, the CODA ET project software is required for creating running a local ET ring and using a producer to stream EVIO files onto it. (This is not needed for actual data runs in Hall B.)

Code Block
languagebash
themeMidnight
# downloadDownload and untar sources
https://coda.jlab.org/drupal/system/files/et-16.1.tgz
tar -zxvf et-16.1.tgz

# fixFix up build files (for some reason this seems isto be needed even with Python 2?)
cd et-16.1.GIT
2to3-2.7 -w ./coda.py ./SConstruct
autopep8 -i SConstruct
autopep8 -i coda.py

# buildBuild it
export CODA=`pwd`
scons install

# setupSetup the environment (needneeds to be dodone thisevery everytimetime you run)
export LD_LIBRARY_PATH=${CODA}/Linux-x86_64/lib
export PATH=${CODA}/Linux-x86_64/bin:${CODA}/Linux-x86_64/bin/examples:$PATH

The scons command may not be present in your environment (installation is not covered here ).FIXME: The ET installation requires some hacking of the build files. (Checkin to git fork?)but it should be available in your Linux package manager).

Running the ET Ring

If you are testing and not taking data from a run then you need to start your own ET server to provide EVIO events, Start the ET ring using a command likesuch as:

Code Block
languagebash
themeMidnight
et_start -rb 8000000 -sb 8000000 -nd -p 11111 -f /tmp/ETBuffer -s 20000 -n 1000 -v -d

This starts the ET ring on port 11111 and uses a "standard" location for the swap file (buffer).

The -s argument specifics the max event size.

The -n argument is how many events can be present in the ET ring at once (???).

The other settings are mainly to try and improve the network performance of the tool by setting generous read/write buffers and using the TCP "no delay" flag.

Experiment with these to find the settings that seem to work best for your machine.

...

The text file contains a list of EVIO files that should be compatible with the settings on the client/server your configuration settings (e.g. 2016 data for the example settings from above).

These settings need to match those of the ET start ring from above, or you will not be able to connect.

TODO: Experiment with using broadcast mode to pickup any running ET rings.

Miscellaneous

...

Creating Plots

Plotting Drivers and Steering Files

x

Starting a New Run

TODO: Playbook for starting a new run from scratch

...