For installation instuctions, see the README
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.
The xml files used by the DAQ software can be created using a text editior, or by using the will produce mySettings.xml, which will look like this: Adding XML File Generation
--xmlout
command line argument. This argument will take the digitizer settings set at the command line and save them as an xml file:
CAENdaq --outfile myfile.root --duration 3000 --ch 4 --polarity4 NEGATIVE --threshold4 100 --trslope4 NEGATIVE --xmlout mySettings.xml
<xml>
<Active>
<outfile>
myfile.root
</outfile>
<duration>
3000
</duration>
<ch4>
1
</ch4>
<polarity4>
NEGATIVE
</polarity4>
<threshold4>
100
</threshold4>
<trslope4>
NEGATIVE
</trslope4>
</Active>
</xml>
-q
on the command line will quit the DAQ after generating the xml file.
There are two ways of using the duration option.
If an integer is used as the parameter, that many events will be recorded. Example command:
CAENdaq --duration 1000
or in XML:
<duration>
1000
</duration>
will collect 1000 events before closing
If a time is specified in HH:MM:SS, events will be collected for that amount of time. Example command:
CAENdaq --duration 01:30:00
or in XML:
<duration>
01:30:00
</duration>
will collect events for 90 minutes before closing
For a positive pulse, polarity
Trigger will occur when the signal rises above 100. The red line is the trigger point.
Example command line arguments:
CAENdaq -o FILE.root -d 1000 --ch 0 --polarity0 POSITIVE --threshold0 100 --trslope0 POSITIVE
Example xml file (xml/PositivePulsePositiveTrigger.xml)
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<polarity0>
POSITIVE
</polarity0>
<threshold0>
100
</threshold0>
<trslope0>
POSITIVE
</trslope0>
</Active>
</xml>
Trigger will occur when the signal falls below 100. The red line is the trigger point.
Example command line arguments:
CAENdaq -o FILE.root -d 1000 --ch 0 --polarity0 POSITIVE --threshold0 100 --trslope0 NEGATIVE
Example xml file (xml/PositivePulseNegativeTrigger.xml)
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
<ch0>
1
</ch0>
<polarity0>
POSITIVE
</polarity0>
<threshold0>
100
</threshold0>
<trslope0>
NEGATIVE
</trslope0>
</Active>
</xml>
Trigger will occur when the signal rises above 100. The red line is the trigger point.
Example command line arguments:
CAENdaq -o FILE.root -d 1000 --ch 0 --polarity0 NEGATIVE --threshold0 100 --trslope0 POSITIVE
Example xml file xml/NegativePulsePositiveTrigger.xml)
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<polarity0>
NEGATIVE
</polarity0>
<threshold0>
100
</threshold0>
<trslope0>
POSITIVE
</trslope0>
</Active>
</xml>
Trigger will occur when the signal falls below 100. The red line is the trigger point.
Example command line arguments:
CAENdaq -o FILE.root -d 1000 --ch 0 --polarity0 NEGATIVE --threshold0 100 --trslope0 NEGATIVE
Example xml file (xml/NegativePulseNegativeTrigger.xml)
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<polarity0>
NEGATIVE
</polarity0>
<threshold0>
100
</threshold0>
<trslope0>
NEGATIVE
</trslope0>
</Active>
</xml>
The record length setting sets the number of samples in a waveform. A higher number will create a longer waveform.
In this example the record length is set to 512 samples.
Example command line arguments:
CAENdaq -o FILE.root -d 1000 --ch 0 --reclen 512 --threshold0 100
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<reclen>
512
</reclen>
<threshold0>
100
</threshold0>
</Active>
</xml>
In this example the record length is set to 1024 samples (the default).
Example command line arguments:
CAENdaq -o FILE.root -d 1000 --ch 0 --reclen 1024 --threshold0 100
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<reclen>
1024
</reclen>
<threshold0>
100
</threshold0>
</Active>
</xml>
In this example the record length is set to 2048 samples.
Example command line arguments:
CAENdaq -o FILE.root -d 1000 --ch 0 --reclen 2048 --threshold0 100
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<reclen>
2048
</reclen>
<threshold0>
100
</threshold0>
</Active>
</xml>
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.
Example command line arguments:
CAENdaq -o FILE.root -d 1000 --ch 0 --posttrigger 0 --threshold0 100
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<posttrigger>
0
</posttrigger>
<threshold0>
100
</threshold0>
</Active>
</xml>
Example command line arguments:
CAENdaq -o FILE.root -d 1000 --ch 0 --posttrigger 25 --threshold0 100
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<posttrigger>
25
</posttrigger>
<threshold0>
100
</threshold0>
</Active>
</xml>
Example command line arguments:
CAENdaq -o FILE.root -d 1000 --ch 0 --posttrigger 50 --threshold0 100
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<posttrigger>
50
</posttrigger>
<threshold0>
100
</threshold0>
</Active>
</xml>
Example command line arguments:
CAENdaq -o FILE.root -d 1000 --ch 0 --posttrigger 75 --threshold0 100
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<posttrigger>
75
</posttrigger>
<threshold0>
100
</threshold0>
</Active>
</xml>
Example command line arguments:
CAENdaq -o FILE.root -d 1000 --ch 0 --posttrigger 100 --threshold0 100
<xml>
<Active>
<duration>
1000
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<posttrigger>
100
</posttrigger>
<threshold0>
100
</threshold0>
</Active>
</xml>
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
Triggering will only occur when the trigger conditions are satisfied on all channels with threshold<CH>
set. For example:
CAENdaq -o FILE.root -d1000 --ch 0 --ch 1 --polarity0 POSITIVE --polarity1 POSITIVE --threshold0 100 --threshold1 100 \\
--trslope0 POSITIVE --trslope1 POSITIVE --triggermode AND
<xml>
<Active>
<duration>
00:01:00
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<polarity0>
POSITIVE
</polarity0>
<threshold0>
100
</threshold0>
<trslope0>
POSITIVE
</trslope0>
<ch1>
1
</ch1>
<polarity1>
POSITIVE
</polarity1>
<threshold1>
100
</threshold1>
<trslope1>
POSITIVE
</trslope1>
<triggermode>
AND
</triggermode>
</Active>
</xml>
This will trigger when both channel 0 and channel 1 go above 100 ADC counts.
Note: AND is the default setting for the triggermode
setting
The coincidencewindow
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:
CAENdaq --triggermode AND --coincidencewindow 12
or in XML:
<triggermode>
AND
</triggermode>
<coincidencewindow>
12
</coincidencewindow>
will require a trigger on each trigger enabled channel within 96ns. The default value for this parameter is 10, or 80ns.
Triggering will occur when the trigger conditions are satisfied on any channel. For example:
CAENdaq -o FILE.root -d1000 --ch 0 --ch 2 --polarity0 POSITIVE --polarity2 POSITIVE --threshold0 100 --threshold2 100 \\
--trslope0 POSITIVE --trslope2 POSITIVE --triggermode OR
<xml>
<Active>
<duration>
00:01:00
</duration>
<outfile>
FILE.root
</outfile>
<ch0>
1
</ch0>
<polarity0>
POSITIVE
</polarity0>
<threshold0>
100
</threshold0>
<trslope0>
POSITIVE
</trslope0>
<ch2>
1
</ch2>
<polarity2>
POSITIVE
</polarity2>
<threshold2>
100
</threshold2>
<trslope2>
POSITIVE
</trslope2>
<triggermode>
OR
</triggermode>
</Active>
</xml>
will trigger when either of channel 0 or channel 2 go abouve 100 ADC counts
The digitizer channels are paired together: 0&1, 2&3, 4&5, 6&7. If the triggermode is set to OR and triggering is enabled on both channels of a pair, the even channel is ignored and only the odd channel has a trigger applied. If OR triggering on multiple channels is required, the trigger must be applied on channels from seperate pairs. This is due to a limitation on the digitizer firmware.
For example:
CAENdaq -o FILE.root -d1000 --ch 0 --ch 1 --threshold0 100 --threshold1 100 --triggermode OR
will only apply the trigger to channel 1, but
CAENdaq -o FILE.root -d1000 --ch 0 --ch 2 --threshold0 100 --threshold2 100 --triggermode OR
will apply the trigger correctly to both channel 0 and channel 2
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.
A quick calibration was performed, yeilding this equation for converting ADC counts to mV:
[Signal (mV)] = (0.1342 ± 0.0005996)x[Signal (ADC counts)] - (1100 ± 5.399)
and for converting mV to ADC counts:
[Signal (ADC counts)]=(7.451 ± 0.0333)*[Signal (mV)] + (8203 ± 16.1)
If you are using this to determine a threshold, be aware that the value specified as the threshold<CH>
is the ADC counts above (or below) the baseline. If you are converting a threshold in ADC counts to mV, you need to add 8192 to the threshold (or subtract from 8192 if polarity<CH>
is negative) before applying the equation. If you are converting a threshold in mV to ADC counts, subtract 8192 from the result to get the value for threshold<CH>
(or subtract the result from 8192 if polarity<CH>
is negative).
A threshold of -20mV is required, with a negative polarity.
7.451 x -20mV + 8203 = 8053.98
8192 - 8053.98 = 138.02
So threshold<CH>
is set to 138, with polarity<CH>
set to NEGATIVE.
This calibration should not be trusted to high accuracy. If you require the voltage to be very accurate, you are advised to perform the calibration yourself.