All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbndpoms_runnumber_injector.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 #source.firstSubRun: 1
4 #Subrun follows $PROCESS+1
5 #After every 100 subruns, a new run is started
6 export NSUBRUNSPERRUN=100
7 
8 while :; do
9  case $1 in
10  -h|-\?|--help)
11  show_help # Display a usage synopsis.
12  exit
13  ;;
14  --fcl) # Takes an option argument; ensure it has been specified.
15  if [ "$2" ]; then
16  FCL="$2"
17  shift
18  else
19  echo "$0 ERROR: fcl requires a non-empty option argument."
20  exit 1
21  fi
22  ;;
23 # --file=?*)
24 # file=${1#*=} # Delete everything up to "=" and assign the remainder.
25 # ;;
26 # --file=) # Handle the case of an empty --file=
27 # echo 'ERROR: "--file" requires a non-empty option argument.'
28 # ;;
29  -v|--verbose)
30  verbose=$((verbose + 1)) # Each -v adds 1 to verbosity.
31  ;;
32  --) # End of all options.
33  shift
34  break
35  ;;
36  -?*)
37  printf "$0 WARN: Unknown option (ignored): %s\n" "$1" >&2
38  ;;
39  *) # Default case: No more options, so break out of the loop.
40  break
41  esac
42  shift
43 done
44 
45 if [ -z "$FCL" ]; then
46  echo "$0 ERROR: fcl is mandatory"
47  exit 2
48 fi
49 
50 #We need to extract what the default run number is. Let's get this from running lar and dumping the config
51 lar --debug-config lar_config_dump.txt -c $FCL
52 DEFAULTRUN=`grep -r "firstRun" lar_config_dump.txt`
53 #THis line is of the form firstRun: RUN
54 #We need to extract RUN
55 #Delimit on the colon
56 IFS=\: read -a DEFAULTRUNARRAY <<<"$DEFAULTRUN"
57 #Extract the run number
58 DEFAULTRUN=${DEFAULTRUNARRAY[1]}
59 #Get the subrun candidate number. We will need to do some modulo arithmetic to work out the actual run and subrun numbers
60 let "SUBRUNCANDIDATE= $PROCESS +1"
61 #Calculate how much to increment the run by
62 RUNINCREMENT=$((SUBRUNCANDIDATE/NSUBRUNSPERRUN))
63 #Calculate the run number
64 let "RUNNUMBER= $DEFAULTRUN + $RUNINCREMENT"
65 #Now the subrun
66 SUBRUNNUMBER=$((SUBRUNCANDIDATE%NSUBRUNSPERRUN))
67 echo "#Metadata injection by $0" >> $FCL
68 echo "source.firstRun: $RUNNUMBER" >> $FCL
69 echo "source.firstSubRun: $SUBRUNNUMBER" >> $FCL
process_name standard_reco_uboone fcl
process_name opflash particleana ie ie ie z
#define the
shift
Definition: fcl_checks.sh:26
usage
Definition: doGit.sh:21
then echo Sam station was not specified(use option--sam_station)." exit 1 fi if [ x$SAM_GROUP
process_name gaushit a
while getopts h
v let verbose
FCL
Definition: condor_lar.sh:205
then shift fi
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
then echo echo For and will not be changed by echo further linking echo echo B echo The symbol is in the uninitialized data multiple common symbols may appear with the echo same name If the symbol is defined the common echo symbols are treated as undefined references For more echo details on common see the discussion of warn common echo in *Note Linker options
echo Invalid option
Definition: TrainMVA.sh:17
then echo find_global_symbol finds mangled or demangled symbols in libraries echo within LD_LIBRARY_PATH match any symbol that echo contains name echo Default
shift break
Definition: just_cmake.sh:60