srs-control
Synopsis
./srs-control [-o FILENAME] [-l LOG_LEVEL] [-h]
Description
srs-control is the main program that controls the communications with SRS system, the data analysis and data writing.
Options
- -h, --help
Print the help message
- -v, --version
Show the current version
- --root-version
Show the ROOT version if used
- -a, --action
Used to perform an individual action, like switch on or off the FEC devices (“acq-on” or “acq-off”)
- Type:
string
- Default:
“all”
- -l, --log-level
Set the verbose level. Available options: “critical”, “error”, “warn”, “info”, “debug”, “trace”, “off”.
- Type:
string
- Default:
“info”
- -r, --run-time
Set the run-time of the application in seconds. If the value is larger than 0, the application will stop after the specified time. If the value is zero, the application will keep running until users use “Ctrl-C” to stop the application.
- Type:
int
- Default:
0
- -p, --print-mode
Set the data printing mode.
Available options:
speed: print the reading rate of received data.
header: print the header message of received data.
raw: print the received raw bytes.
all: print all data, including header, hit and marker data, but no raw data.
- Type:
string
- Default:
speed
- -c, --config-file
Set the JSON configuration file (more details below).
- Type:
string
- Default:
“~/.config/srs-control/config.yaml”
- -s, --split-output
Splitting the read data into multiple sinks of the same type.
- Type:
int
- Default:
1
- --dump-config
Dump the default configuration values to a file (more details below).
- Type:
string
- Default:
“~/.config/srs-control/config.yaml”
- -o, --output-files
Set the file outputs (more details below).
- Type:
list[string]
- Default:
[]
Data output to multiple files
srs-control can output received data into multiple files with different types at the same time. Currently, following output types are available:
binary
raw data if
.lmdor.binProtobuf data if
.binpb
json. File extensions:
.json(NOTE: JSON file could be very large)root. File extensions:
.root(require ROOT library)UDP socket (Protobuf + gzip). Input format:
[ip]:[port]UDP socket (Raw data). Input format:
[ip]:?[port]
Users have to use the correct file extensions to enable the corresponding outputs.
Example
To output the same data to multiple different output types at the same time:
./srs-control -o "output1.root" -o "output2.root" \
-o "output.bin" -o "output.binpb" \
-o "output.json" -o "localhost:9999"
Configuration
Additional configuration of srs-control is setup via a YAML or JSON file. It’s defined in the struct srs::Config.
Default location
By default, it reads the config file in the default location ${XDG_CONFIG_HOME}/srs-control/config.yaml. If the environment variable XDG_CONFIG_HOME is undefined, ~/.config/srs-control/config.yaml will be chosen instead. The program automatically creates the config file with default values if the file doesn’t exist. Or it can be manually generated with:
./srs-control --dump-config
Custom config file location
Alternatively, you could also use --dump-config option to dump all default values into a file located in the current folder:
./srs-control --dump-config "config.yaml"
If needed, the program option -c could also be used to specify the configuration file instead of the one in the default location:
./srs-control -c "config.yaml" -o "output.root"