Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-02 08:21:08

0001 #! /bin/sh
0002 
0003 
0004 # the following line identifies this script as one to be 
0005 # listed in the configuration GUI
0006 
0007 # --RCDAQGUI
0008 
0009 # lines starting with the "--SC" tag are short comments 
0010 # (can be only one, later ones override earlier ones)
0011 
0012 # --SC Top Level setup script with a random device
0013 
0014 
0015 # lines starting with the "--SC" tag are long comments 
0016 
0017 # --LC This setup script is part of the RCDAQ distribution. 
0018 # --LC It uses the random device (i.e. no particular hardware) 
0019 # --LC and can run on any machine to give RCDAQ a spin.
0020 # --LC It can serve as a template to develop your own setups.
0021 
0022 # we need the $0 as absolute path b/c we pass it on to a "file" device further down
0023 MYSELF=$(readlink -f $0)
0024 
0025 # we figure out if a server is already running
0026 if ! rcdaq_client daq_status > /dev/null 2>&1 ; then
0027 
0028     echo "No rcdaq_server running, starting... log goes to $HOME/rcdaq.log"
0029     rcdaq_server > $HOME/rcdaq.log 2>&1 &
0030     sleep 2
0031 
0032     # see if we have an elog command (ok, this is a weak test but 
0033     # at least it tells us that elog is installed.)
0034     ELOG=$(which elog 2>/dev/null)
0035     [ -n "$ELOG" ]  && rcdaq_client elog localhost 666 RCDAQLog
0036 
0037 fi
0038 
0039 # remember this is an executable script. We
0040 # have the full power of a shell script at our
0041 # fingertips.
0042 
0043 rcdaq_client daq_clear_readlist
0044 
0045 # we add this very file to the begin-run event
0046 rcdaq_client create_device device_file 9 900 "$MYSELF"
0047 
0048 # make the first randown device trigger enabled
0049 rcdaq_client create_device device_random 1 1001 64 0 4096 1
0050 rcdaq_client create_device device_random 1 1002 32 0 2048
0051 
0052 # we add some artificial deadtime to slow down a bit
0053 rcdaq_client create_device device_deadtime 1 0 20000
0054 
0055 rcdaq_client daq_list_readlist
0056 rcdaq_client daq_status -l
0057 
0058 
0059 
0060 
0061 
0062 
0063