DAQParameters

Name

Data Acquisition parameters -- Cluster of configuration parameters for data acquisition

Synopsis

package require DAQParameters

::DAQParameters::setDefaults

::DAQParameters::environmentOverrides

::DAQParameters::getEventLogger

::DAQParameters::getEventLoggerRing

::DAQParameters::getUseNsrcsFlag

::DAQParameters::getAdditionalSourceCount

::DAQParameters::getRunNumberOverrideFlag

::DAQParameters::getUseChecksumFlag

DESCRIPTION

This package provides a cluster of configuration parameters (in the sense of Configuration). Mechanisms to set default values for these parameters are provided as well as convenience functions to fetch specific configuration values without the need to know the actual configuration variable name.

See PROCEDURES below for a description of each command supplied by this package.

PROCEDURES

::DAQParameters::setDefaults

Sets default values for each configuration value in this cluster. See DEFAULT VALUES for information about the default values for these parameters.

::DAQParameters::environmentOverrides

Applies the environment variables that normally control this part of the configuration to the parameters. See ENVIRONMENT below for more information about the the environment variables used.

::DAQParameters::getEventLogger

Returns the command that will be used to start the event logger. This is a base command string without any options. At run time the full command string is computed from this value and the other parameters in this cluster.

::DAQParameters::getEventLoggerRing

Returns the URI of the ring buffer from which the event logger will log data.

::DAQParameters::getUseNsrcsFlag

Get the value of the flag that controls whether or not the event logger is started out with the --number-of-sources option on the command line. If this value is true the flag value will be computed from the number of data sources and the value returned by ::DAQParameters::getAdditionalSourceCount command and supplied on the command line. If the value returned from this command is false this option will not be used. Note that this option cannot be used with event loggers from NSCLDAQ earlier than version 11.0.

::DAQParameters::getAdditionalSourceCount

Gets the number of additional sources to add to the number of data sources that will be supplied to the --number-of-sources eventlog flag. The purpose of that flag is to tell the event logger how many end run events to expect before considering a run over.

This value is meaningless when ::DAQParameters::getUseNsrcsFlag returns false beause in that case, the --number-of-sources option will not be added to the command line.

The dual purpose of this option is to deal with event sources that are not controlled by the ReadoutGUI that contribute end run records (positive value for the parameter), and to handle event sources that are controlled by the ReadoutGUI that don't supply end run records (negative value).

::DAQParameters::getRunNumberOverrideFlag

When true, the event logger is started with the --run flag which is given the value of the run number in the ReadoutGUI. This is intended for cases when the event logger is used with data sources that don't contribute start of run event records, or contribute start of run records with run number fields that cannot be trusted.

::DAQParameters::getUseChecksumFlag

When true, the event logger is started with the --checksum flag. If the event logger is incompatible with this option (version must be greater than 11.0-rc6), the user will be presented with an error message.

DEFAULT VALUES

The call to ::DAQParameters::setDefaults sets the values of the configuration variables as follows:

Event logger command

DAQROOT/bin/eventlog where DAQROOT is the top level installation difectory of NSCLDAQ.

Event logger ring URI

tcp://localhost//$::tcl_platform(user) Note that the Tcl global array ::tcl_platform's user element contains the name of the logged in user.

Use --number-of-sources

true

Additional data sources

0

Use --run run number override

false

Use --checksum

true

These defaults are suitable for the case of a single event source compatible with NSCLDAQ-11.x

ENVIRONMENT

Invoking ::DAQParameters::environmentOverrides looks for the following environment variables:

EVENTLOGGER

Overrides the default event logger program with its value.

EVENTLOGGER_RING

Overrides the event logger ringbuffer URI.

EVENTLOGGER_NSRCSFLAGS_SUPPORTED

If true then --number-of-sources will be used with the eventlog program.

EVENTLOGGER_UNCONTROLLED_SOURCE_COUNT

If provided contains an additional source count for use when computing the value of --number-of-sources

EVENTLOGGER_USE_GUI_RUNNUM

If true the --run option will be used to override run numbers in begin run records or, alternatively provide run numbers where none are avaialble.

EVENTLOGGER_USE_CHECKSUM_FLAG

If true the --checksum option will be used to compute an sha512 hash for the entirety of the logged data.