Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #! /bin/sh
0002 
0003 # this is an example which pretends to step through 10 
0004 # high voltage values and is taking data for each setting.
0005 # this script generates a run-specific description file with
0006 # text and numbers which we add to the begin-run event twice,
0007 # once as a file device in packet 910, and once as a "filenumbers" 
0008 # device, which is extracting the numbers in the file. The former is
0009 # easier for humans to read, the latter is easier for the analysis code
0010 # to get hold of. 
0011 # This demonstrates - 
0012 # - a fully automated run sequence
0013 # - adding external information to the begin-run event 
0014 
0015 D=`pwd`
0016 
0017 if ! rcdaq_client daq_list_readlist | grep -q 'Event Type: 9 Subevent id: 911'
0018 then
0019 
0020 rcdaq_client create_device device_file 9 910 ${D}/description.txt
0021 rcdaq_client create_device device_filenumbers  9 911 ${D}/description.txt
0022 
0023 fi
0024 
0025 rcdaq_client daq_list_readlist
0026 
0027 sleep 5;
0028 
0029 INITIAL_RUN=$1
0030 
0031 [ -n "$INITIAL_RUN" ] || INITIAL_RUN=1000
0032 
0033 RUN=$INITIAL_RUN
0034 
0035 for highvoltage  in $( seq 1500 10 1600 ) ; do
0036 
0037 # here you would do something to actually set the HV
0038 
0039  cat >> ${D}/description.txt <<EOF
0040 This is Run $RUN with the High Voltage set to 
0041 $highvoltage
0042 This uses sample number
0043 5
0044 of the calorimeter.
0045 EOF
0046 
0047  echo "starting run $RUN with High Voltage set to $highvoltage"
0048 
0049  rcdaq_client daq_begin $RUN
0050  
0051  # just a placeholder for some useful run end
0052  sleep 5;
0053  rm -f ${D}/description.txt
0054  rcdaq_client daq_end
0055 
0056  # now go to the next run number
0057  RUN=`expr $RUN + 1`
0058 
0059 done