PadmeDAQ - PADME-Experiment/padme-fw GitHub Wiki

PadmeDAQ is the program in charge of:

  • reading data from a single CAEN V1742 ADC board
  • applying the CAEN corrections (if required)
  • applying the zero-suppression algorithm (if required)
  • sending the data to the Merger process
  • (optional) writing the data to an output file in DAQ Event Format

It is usually started by the Run Control but can be run in standalone mode with the command

PadmeDAQ.exe -c <config file>

where <config file> contains a list of configuration parameters in the form "parameter value" or "parameter channel value".

The available parameters are:

Parameter Default value Description
quit_file run/quit "Quit" tag file: when found PadmeDAQ will stop DAQ and exit
start_file run/start "Start" tag file: when found PadmeDAQ will start DAQ (SW controlled DAQ only)
initok_file run/initok.b00 "Init OK" tag file, created by PadmeDAQ when initialization is succesfully completed (used by RunControl)
initfail_file run/initfail.b00 "Init Fail" tag file, created by PadmeDAQ when initialization fails (used by RunControl)
lock_file run/lock.b00 Lock file created when PadmeDAQ starts. Used to avoid multiple copies of PadmeDAQ reading the same board
data_file data/daq_b00 Template used to create the DAQ Event format filenames with path (absolute or relative to current dir)). The actual filename will include the file opening time, e.g. data/daq_b00_2015_11_06_18_12_32
run_number 0 Run number. If =0 the run is considered dummy and will not be logged in the DB
run_type TEST Run type. Can be TEST, DAQ, or COSMIC
total_daq_time 0 Time to run the DAQ in seconds. If 0 the DAQ will run forever (use quit_file or CTRL-C to stop it)
board_id 0 Id of board to read. Used to select the correct CONET2 channel
startdaq_mode 0 Method used to start/stop the run. 0: SW controlled (use start_file/quit_file) - 1: S_IN controlled - 2: first trigger controlled (not implemented yet)
drs4_sampfreq 2 DRS4 chip sampling frequency - 0: 5GHz - 1: 2.5GHz - 2: 1GHz
trigger_mode 1 Trigger mode. 0: external trigger (not precise) - 1: fast trigger (preferred) - 2: SW trigger (not implemented yet)
trigger_iolevel NIM Trigger IO level used. Can be NIM or TTL
group_enable_mask 0xf 4 bits mask to choose which channel groups will be read
channel_enable_mask 0xffffffff 32 bits mask to choose which channel will be written to output file
offset_global 0x5600 Global DC offset (used for all channels unless offset_ch is specified)
offset_ch [ch] [=offset_global] Per channel DC offset
post_trigger_size 65 Start time of DAQ window wrt trigger time
max_num_events_blt 128 Maximum number of events to keep in the board buffer
drs4corr_enable 1 Control application of DRS4 corrections from CAEN. 0:disabled - 1:enabled
zero_suppression 0 Choose zero-suppresion mode and algorithm to apply - Parameter value is 100*mode+algorithm with mode=(0:rejection,1:flagging) and algorithm=(0:off,1-15:algorithm to use)
zs1_head 80 (zero_suppression=1) First [zs1_head] samples are used to compute [mean] and [RMS]
zs1_tail 30 (zero_suppression=1) Last [zs1_tail] samples are ignored when applying zero-suppression
zs1_nsigma 3. (zero_suppression=1) Threshold set at [mean]-[zs1_nsigma]*[RMS]
zs1_nabovethr 4 (zero_suppression=1) Require at least [zs1_nabovethr] consecutive samples above threshold to accept the event
daq_loop_delay 100000 Delay in usec between two consecutive polls of the board for new events
file_max_duration 900 Maximum duration in sec for an output file. After this time the output file is closed and a new one is opened
file_max_size 1073741824 (=1GiB) Maximum size in Bytes for an output file. When this size is reached the output file is closed and a new one is opened
file_max_events 100000 Maximum number of events to write to an output file. After these events are written the output file is closed and a new one is opened