TestBeam in the Offline

This page describes the offline software developed in order to analyze test beam data in our offline framework, NOvASoft. It specifically relates to the combining of beamline and detector data, and doesn't go into specific details of either system. For more information on this, see Beamline in the Offline for beamline information, and the NOvA wiki for information on all the software developed for the other NOvA detectors, which will be used also in test beam.

Overview of the data flow

The detector and the beamline data are collected separately using two independent DAQ systems (referred to as 'Detector (or NOvA) DAQ' and 'Beamline DAQ'). They save data to two separate output files and operate entirely decoupled. The link between the data in each is the TDU timestamp, which stamps each trigger recorded by each system with the 64-bit NOvA time.

The merging of the data streams happens during the first stage of offline processing, when the raw data files are processed in NOvASoft and reformatted using NOvASoft data products.

Merging data files

The first stage in data processing is to produce an output data file which has been 'merged', i.e. contains both detector and beamline information. This is a non-trivial process which has been implemented as follows:
  • the detector data file is used as the 'main' data file, which is run over as normal to produce an output file with offline-formatted data in;
  • the beamline files which correspond in time to detector data file are assumed to already be in the working directory. The art job makes no attempt to look them up or copy them across, this must be done before running the job;
  • the beamline data will then also be unpacked and added to the relevant trigger in the detector data stream, corresponding to the TDU timestamps.

Assuming the relevant beamline data files are in the working directory, this is run simply as

nova -c testbeam2rawdigitjob.fcl -s <input detector file>

TDU offset

The detector DAQ applies an offset to the triggers which are made, to account for the time it takes the trigger to reach the detector from the beamline. This 'times in' the two systems. The offline code needs to know what this offset is to ensure the same triggers can be reconciled between the two systems when unpacking the events.

This is set in in the file DAQ2RawDigit/testbeam/testbeam2rawdigit.fcl. To change locally, the parameter can be set in a locally configured job fhicl with the line

source.BeamlineUnpack.TDUOffset: <offset> 


This is still being developed but has found to work well for test data taken during commissioning. Beamline data runs 2705 and 2706 were taken at the same time as detector run 100005 (the beamline run was stopped and started again to simulate realistic data-taking conditions!), so these files may be used to test if required. Copies of the files are in /nova/ana/users/wallbank/TestBeam/.


cd <working directory>
cp /nova/ana/users/wallbank/TestBeam/lariat_r002705_0001.root .
cp /nova/ana/users/wallbank/TestBeam/lariat_r002706_0001.root .
cp /nova/ana/users/wallbank/TestBeam/testbeam_r00100005_s00_Beamline.raw .
nova -c testbeam2rawdigitjob.fcl -s testbeam_r00100005_s00_Beamline.raw

should get an output file with combined detector and beamline data, offline-formatted!

Viewing events with the Event Display

Once you have a root file, you can look through events in the event display with

nova -c evd_tb.fcl -s <root file>

This will be automatically colored by time instead of charge. If you want to change the automatic time range, copy the .fcl file locally and edit the last line.