HOWTO documentation

From GlueXWiki
Jump to: navigation, search

HOWTO Use the DAQ System

The DAQ system is generally kept running on the clon03 display(s) in the Hall-B counting house. Check first if it is there before restarting it so you don't accidentally kill a run in progress.

Killing the current DAQ processes:

To kill the current DAQ processes, ssh into the halldrun account on clonxt2 and type "kill_daq". This will kill most of the DAQ processes, but not all (e.g. the mini-SQL server is not killed).

Starting the DAQ from scratch: To start the DAQ from scratch, ssh into the halldrun account on clonxt2 and type "start_daq". (Note that this will automatically run the kill_daq script first in order to remove any stray processes before starting fresh ones.) A number of new windows will open including: RunControl Server xterm (rcServer), Event Builder xterm (coda_eb), Event Recorder xterm (coda_er), CMLOG message browser, and RunControl GUI.

After the RunControl GUI window comes up:

  1. click on "Connect"
  2. click on "Configure"
  3. select the appropriate configuration and click "OK"
  4. click "Download"
  5. click "Start Run"
  6. click "End Run" whenever you are ready to end the run.

Repeat steps 5 and 6 as needed.

If you need to change the run type, end any current run and hit "Abort". Then you will see the "Configure" button and can repeat steps 2-6.

If you have problems with the DAQ that you can't solve, then page the DAQ person on-call whose number should be written on the white board in the counting house.

HOWTO Configure the Trigger

The Trigger Supervisor module can be configured remotely from the counting house. The most common changes shift workers will need to make will be to change which triggers are enabled and what their prescale values are. This can be done using the trigConf program.

To start trigConf, log into clonxt2 under the halldrun account and type "start_trigConf". The following window will appear.


From the File menu, select open and the choose the file corresponding to the run type you desire. For example, to edit the trigger configuration for the COSMIC runs, select COSMIC.trig.

Edit the trigger settings. The triggers are defined as follows (updated on Sept.22 at 17:30, see e-Log 36):

  1. MOR
  2. BCAL N OR S
  6. Cosmic coincidence
  7. Pulser
  8. Bit 5 delayed by 16ns
  9. Bit 5 delayed by 32ns
  10. VETO
  11. BCAL S
  12. BCAL N

Prescale Values: The prescale value should be interpreted as the number of triggers that should be skipped between accepted triggers. For instance, when the prescale is set to "0", then every trigger is accepted. When the prescale is set to "1", then every other trigger is read. When the prescale is set to "2", then every 3rd event is read.

Trigger enable: When the checkbox is red and pushed in, then the that trigger is enabled. When it is up and grey, then that trigger is disabled.

Select Save from the "File" menu to save your changes.

Changes will take affect during the pre-start of the next run. This essentially means that if you save your changes when you can see the "Go" button on the RunControl window, you will need to "Abort" and then either "Prestart" or "Start Run" if you want the changes to take affect for the next run.

HOWTO Modify High Voltage

Log into the clasrun account on and run tsconnect gluex_hv.

This should establish a serial connection to the HV crate. The state of the serial connection will depend on how it was left the last time someone used it.

If the HV crate has just been rebooted you may see a message about typing "1450" whenever you hit return. In this case, type in "1450" and hit return.

If you see the "127/EDIT/1450>" prompt whenever you hit return, then type "vt100" to get into the control interface which should look something like this:


Use the menu on the left of the control interface to modify the settings.

The notaion used by the interface is where slot is a number ranging from 0 to 4 and channel ranges from 0 to 11.

Here are the channel assignments:

Slot 0   Slot 1   Slot 2   Slot 3   Slot 4   
.0 N1    .0 N13   .0 S5    .0 S17   .0 COSMIC1
.1 N2    .1 N14   .1 S6    .1 S18   .1 COSMIC2
.2 N3    .2 N15   .2 S7    .2 S19
.3 N4    .3 N16   .3 S8    .3 S20
.4 N5    .4 N17   .4 S9
.5 N6    .5 N18   .5 S10
.6 N7    .6 N19   .6 S11
.7 N8    .7 N20   .7 S12
.8 N9    .8 S1    .8 S13
.9 N10   .9 S2    .9 S14
.10 N11  .10 S3   .10 S15
.11 N12  .11 S4   .11 S16

When you are done you may wish to log out. First, exit vt100 mode by hitting "q". Then type the following sequence to exit the serial session:

Return ~ q


HOWTO Make a logbook Entry

Look here.

HOWTO Access Online Histograms

HOWTO Check the Beam

HOWTO Analyze Data Offline

The data is available in the following file formats for analysis:

  • CODA format
  • ROOT trees
  • ASCII file

CODA formatted files are what was produced by the Data Acquisition system. These are available on the JLab silo and can be read via a JANA based C++ program. Instructions for doing this are below.

ROOT trees are currently being generated (jobs are being submitted to the farm on Oct. 4th) and will likely be the format used primarily in the offline analysis.

ASCII formatted files are also available for a few select runs. These are easily generated from the CODA files, but take up about 4 times as much disk space as the ROOT trees. When compressed though, they take up about the same amount as the ROOT trees.

The following runs were (not-so-carefully) chosen as the core set of good runs. By "good", I generally mean high statistics. For more info, see the online database.


2269, 2271, 2272, 2274, 2275, 2276, 2303, 2304, 2305, 2458, 2459, 2460, 2475, 2476


2352, 2365, 2376, 2377, 2382, 2384, 2385, 2386, 2410, 2414, 2415, 2429, 2430, 2456, 2457


2306, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2322, 2323, 2324, 2332, 2333, 2334, 2335, 2336, 2337, 2338, 2339, 2340, 2341, 2342, 2343, 2344, 2346, 2347, 2348, 2349, 2350, 2353, 2354, 2361, 2362, 2363, 2367, 2368, 2369, 2371, 2372, 2373, 2374, 2375, 2378, 2379, 2380, 2381, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2395, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2412, 2413, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2431, 2432, 2433, 2434, 2435, 2436, 2439, 2440, 2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454

Obtaining ROOT and ASCII files

The ROOT and ASCII files are kept on the Hall-D work disk on the JLab CUE. They can be accessed in the /work/halld/bcal06 directory through your CUE account. If you wish to transport files offsite, you can do it through scp and an ssh tunnel in the following way:

In one terminal:

ssh -L

In a second terminal:

scp -P 12345 localhost:/work/halld/bcal06/bcal02418.ascii.gz .

where user is your jlab CUE username. The first line sets up an SSH tunnel and the second uses it to transfer the file.

ROOT Trees

Farm jobs are run to produce both a ROOT tree file (names begin with bcal_dst) and a ROOT histogram file (names begin with bcal_mon).

The bcal_dst files actually contain three trees:

  • bcal contains the event based data
  • beam contains beam realted information as read from EPICS
  • env contains Hall temperature and humidity info from EPICS

ASCII files

ASCII files essentially mirror the information in the bcal tree of the ROOT files. The format of the files is specified in a README file on the work disk.

CODA Formatted data files

One can also analyze the raw data directly using the JANA framework. It can be used to create ROOT files with customized histograms or trees. That method is described below.

To analyze raw data offline, you will need 2 things:

  1. JANA - the generic reconstruction framework
  2. bcal06 - source code specific to the BCAL beam test of 2006

Getting JANA

If you are working on the JLab CUE system, you can simply set the following environment variables:

  • setenv JLAB_HOME /group/12gev_phys/builds/latest
  • setenv PATH ${PATH}:${JLAB_HOME}/bin/${OSNAME}

where presumably, OSNAME is set to something like "Linux".

If you are going to do analysis offsite you have 2 options. This first is to just download the JANA source code which already has Linux and Darwin(PPC) binaries from the web here. Just unpack this anywhere on your system and set your JLAB_HOME environment variable to point to it.

The second option for installing JANA offsite is to checkout the source from the subversion repository and build it yourself. Here's how:

>mkdir JANA

>cd JANA

>setenv JANA_HOME $PWD

>svn co

>cd src/JANA

>make install

>cd ${JANA_HOME}/src/janadump

>make install

Make sure to set JANA_HOME in your .cshrc file as well as PATH so you don't have to set them everytime you log in.

Getting bcal06

This you will need to checkout from the Hall-D subversion repository. Here are the steps:

>mkdir bcal06 (this can be anywhere you want)

>cd bcal06

>setenv JLAB_MY $PWD

>svn co (Note: some of the source that gets checked out is only useful for online.)

>cd src/plugins

>make install


The JANA_PLUGIN_DIR environment variable is used to tell JANA a directory in which to look for plugins. At this point, you should be able to run the janadump program using a raw data file as input like this:

>janadump gluex01234_COSMIC.dat.00

Run janadump with no arguments to get a list of options. (The most useful will be the -D option.)

Writing your own analysis program

Two skelton programs exist to help you get started on processing events with JANA. For creating ROOT files, look at ${JLAB_MY}/src/bcal_root. For a more generic example that does not use ROOT, look at ${JLAB_MY}/src/bcal_ana.

HOWTO Use the Event Viewer

To use the event viewer online (i.e. to look at events as that are read by the DAQ system):

  1. Log into the halldrun account on
  2. run bcal_view like this:

>bcal_view ET:bcaltest

To use the viewer with a file, just give it the file name as its only argument:

>bcal_view gluex01234_COSMIC.dat.00

Note: If the program exits on the first event with a message about "NO MORE SOURCES" then check that your JANA_PLUGIN_DIR environment variable is set and points to a directory containing the (or similar) file.

If all goes well, you should be able to hit the "Cont" button to display continuous events which will look something like this:



  • The viewer knows nothing about the position or orientation of the beam wrt the module. The "beam" indicator is only meant to show the side of the module on which the beam enters.
  • There are a fixed number of "dots" drawn that represent the last several events. These are only meant to give some indication of where along the module the beam is hitting. The colors represent only the current event.
  • There grey dots are supposed to be on the other side of the middle set of boxes(left half of module) and are meant to give the illusion that you are seeing them through the semi-transparent plane. The black dots are either on the right half of the module, or are not obscured by the middle set of boxes.
  • The middle set of boxes are the geometric means of the values on either end.


Running under Hall B, run the 'account' Beam Time Accounting (BTA) program to enter ABU's (beam available and in use). The beam usage must be recorded hourly by the shift expert and reported to MCC prior to the end of each shift. For a test run, beam usage can be interpreted fairly liberally even when studies are underway that do not result in recordable data. The crew chief will call to ask for the numbers, which are summarized using the 'get info to MCC' button. There is a 'Help' buttom at the bottom of the page with instructions on the use of the program.

HOWTO Make a Hall Access

  1. Call MCC (7050 or 7048) and request a 'Controlled Access' for your work.
  2. Go down to the Hall-B entrance under the 'buddy system'.
  3. Call 7050 from the first phone a state the request for entrance. The MCC will switch from 'Beam Permit' to 'Controlled Access' and unlock the door.
  4. The crew should scan their user badges and then enter the lock.
  5. Pull the master key out, place in key release lock and twist. Remove keys as necessary, one per crew member.
  6. Call 7050 and give names, key numbers, show badges to camera and declare ODH status (must be current).
  7. Once inside, wear a hard hat.
  8. Work of duration 1 hour or less at the alcove can be done without a Rad Con sweep and we have unlimited duration access to the PIE tower (electronics area).

HOWTO Do a Quick Analysis

  1. ssh halldrun@clonxt2
  2. Data are stored at /mnt/raid1/halld
    cd to this directory
    data files have names like gluex-----_PRODUCTION.dat.00 and gluex-----_COSMIC.dat.00 depending on the run configuration, where ----- is the run number.
  3. There are three root analyzers available
    • bcal_mon is the "up to date" analyzer producing energy and ADC histograms for the N,S sides, trigger bits, etc.
    • bcal_dst produces trees filled with raw ADC and TDC information.
    • bcal_mon_channel produces additional energy histograms for each BCAL PMT.
      bcal_mon_channel ../gluex02301_PRODUCTION.dat.00
      (if you do this from /mnt/raid1/halld/rootfiles/ ) will produce root file "bcal_mon02301.root"
      • note: you can stop an analyser by pressing Crtl-C after any amount of events (preferably 100K or so) instead of waiting for the full data file to be analysed.
    • it is best to move this file to your own computer of choice, where ROOT exists, other than clonxt2 by typing
      " scp halldrun@clonxt2:/mnt/raid1/halld/rootfiles/bcal_mon02301.root . " from your desired computer
  4. Useful ROOT commands for the novice
    start ROOT by typing " root bcal_mon2301.root ".
    Bring up the tree browser by typing " TBrowser b; "
    You can create more than one graphics window from File->Open Canvas
    Switch the active graphics window (e.g. c1) by typing: c1->cd();
  5. Cell configuration
    1-6 is the top row from front to back
    7-12 is the middle row
    13-18 is the bottom row
  6. Other ROOT helpful commands:
    c1->Divide(1,3); divides canvas in a zone 1 3 manner
    c1_1->cd(); makes panel (1,1) the current pad
    you can then draw a plot in it using the TBrowser b; graphical interface

HOWTO Change the BCAL Cart Angle

  1. Open the cameras
    1. Front of the Detector: http://cctvpt1
    2. Back of the Detector: http://cctvpt2
  2. Run the Motion Software
    1. ssh halldrun@gluex_sc
      password d1tocome (n.b. this is long since obsolete so if you find this during a cyber-security scan, ignore it)
    2. Type BGV_Cart_Motion
    3. Enter an angle between the limits provided by the software
    4. Enter the carriage position
    5. Wait for the software to finish
    6. Record the data file name printed in the logbook