DAQ for a CAEN V1730 digitizer with waveform firmware
DAQ software for a CAEN V1730 digitizer with waveform recording firmware. Software assumes connection through a V1718 VME-USB Bridge
This software is based on the CAEN wavedump example program
For instructions on setting up a virtual machine, see here.
Download the repository using this command:
git clone https://github.com/samdejong86/CAEN-v1730-DAQ.git
Requires the CAEN Digitizer libraries. Install in this order:
If the tar files containing the libraries are placed in the drivers directory, run source CAEN_driver_install.sh as root in that directory to automatically install the libraries.
NOTE JUNE 2023: Due to changes in the CAEN libraries, this automatic script no longer works. Manual installation is required instead.
Note: Updates to your system may break the CAEN libraries. If the DAQ software stops working, try reinstalling the VME and USB libraries.
Requires ROOT (available here). You may need these libraries:
ROOT can also be installed with
sudo yum install -y epel-release && sudo yum install root
If you are getting an error about ‘shape.h’, try:
ln -s /usr/include/X11/extensions/shapeproto.h /usr/include/X11/extensions/shape.h
Once these are installed, use make to build the software.
Run sudo make install
to install the software system wide.
usage: CAENdaq [-h] [-v] [-x XMLFILE] [--xmlout XMLFILE] [-q] [w0] [w1]
[w2] [w3] ... [-o FILE] [-r RECLEN] [-n NUM] [-d DURATION]
[--posttrigger VAL] [--polarity0 POLARITY] ...
[--threshold0 THRESHOLD] ... [--trslope0 POLARITY] ...
Reads waveforms from a CAEN V1730 digitizer.
Mandatory arguments to long options are mandatory for short options too.
-h, --help Show this help message and exit
-v, --verbose Prints verbose setup information
-x XMLFILE, --xml XMLFILE Use settings in XMLFILE. This
overrides other command line settings
--xmlout XMLFILE Save settings to xml file
-q, --quit Used with --xmlout. Quits program after
saving settings
--tutorial Open the tutorial in a web browser
The following options can also be set using an XML file, with the
long options as the XML tags:
-w <CH>, --ch <CH> Record the waveform on CH
Valid options are 0-7
-o FILE, --outfile FILE Save waveform to FILE
-n NUM, --saveInterval After NUM events, save a temporary file.
At the end of the run, these will be merged
-r RECLEN, --reclen RECLEN Set number of samples recorded to RECLEN
-d DURATION, --duration DURATION
Duration of the run. If an integer is
specified, that many events are recorded.
If a time is specified in HH:MM:SS format
the daq will run for that long. Acquisition
starts automatically.
If not used, daq must be started manually
--polarity<CH> POLARITY Set pulse polarity of channel CH
Valid options are POSITIVE or NEGATIVE
--threshold<CH> THRESHOLD Set the trigger threshold of channel CH
in ADC counts
--trslope<CH> POLARITY Trigger slope. Can be POSITIVE or NEGATIVE
--posttrigger VAL Set the post trigger
--triggermode MODE Set the trigger mode. Valid options are AND
and OR.
--coincidencewindow WINDOW Set the length of the coincidence window, in
multiples of 8ns. Maximum value is 15.
To display the DAQ command line parameters, run
CAENdaq -h
There are two ways to set the digitizer parameters: through the command line, or via an XML file. A simple run example is:
CAENdaq --outfile FILE.root --duration 1000 --ch 0 --polarity0 POSITIVE --threshold0 100 --trslope0 POSITIVE
These same parameters can be set via an xml file:
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<polarity0>
POSITIVE
</polarity0>
<threshold0>
100
</threshold0>
<trslope0>
POSITIVE
</trslope0>
</Active>
</xml>
which can be run with this command:
CAENdaq -x XMLFILE.xml
assuming the xml file is named XMLFILE.xml. Any other command line arguments which set digitizer settings will be ignored if an xml file is specified.
Note that the xml tags are the same as the command line options, eg:
--outfile FILE.root
on the command line is equivalent to
<outfile>
FILE.root
</outfile>
in the xml file.
--xmlout
command line argument. This argument will take the digitizer settings set at the command line and save them as an xml file:-q
on the command line will quit the DAQ after generating the xml file.There are two ways of using the duration option.
For a positive pulse, polarity
The record length setting sets the number of samples in a waveform. A higher number will create a longer waveform.
The post trigger setting sets how much of the waveform will be after the trigger occurs. valid settings are 0 to 100. Setting this to 50 is a good rule of thumb.
If mutiple channels have threshold<CH>
set, the triggers will be combined. There are two possibe modes for combining multiple trigger channels: AND and OR. The trigger mode is set with the triggermode
setting
threshold<CH>
set. For example:triggermode
settingcoincidencewindow
can be used to set the length of the window where the coincident triggers must occur, in units of 8ns. It takes an integer less than or equal to 15. For example: When the program starts, it will create a temporary directory called FILE_<timestamp>
, where <timestamp>
is the unix time when the program started. Temporary root files containing <saveInterval>
(set by the saveInterval
parameter at the command line or in an xml file) events will be saved here.
When the program exits safely these files will be merged together, with the resulting file moved to the working directory. The temporary directory will then be removed.
If the program crashes, the temporary files will not be removed, so most of the data from the run can be recovered by looking in this directory.
There is a ROOT script included with the repository called draw.C
. This script can be used to display a waveform from a ROOT file created by the DAQ.
Usage:
root[0] .x draw.C("FILE.root", channel, event)
where channel and event are integers for the channel number and event number.
This script can also be used as an example showing how to load waveforms, for use in an analysis.
src/
source files
include/
header files
xml/*.xml
Some example settings files
icon/CAEN.png
Icon for the notification
Makefile
for building the software
draw.C
A root script for drawing waveforms
drivers/CAEN\_driver\_install.sh
A script for installing the CAEN libraries. The tar files containing the libraries must be located in the same directory as this script
img/*
Images used in the tutorial section of this document
This software used code in CAEN’s wavedump example, modified to be in an object oriented framework.