]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/SPECTRA/LambdaK0PbPb/run.sh
Propagate DIMDIR/ODIR from the environment (needed by SHUTTLE and MONITOR)
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / LambdaK0PbPb / run.sh
CommitLineData
e886738f 1#!/bin/bash
2
3run=137161
4pass=pass1_5plus
5mc=0
6mode="full"
7nev=1234566789
8workers=26
9ROPT=""
10listfile=""
11offset=0
12debug=kTRUE
13option="SAVE" #FIXME:set option
14suffix=""
15
16give_help() {
17
18cat <<ENDOFGUIDE
19This scripts runs the the physics selection and centrality on a specified run/dataset
20
21Available options:
22 Mode control, at least one of the following options should be used
23 -r <mode> Run the task
24 Modes (compulsory):
25 0 local
26 1 caf
27 2 grid
28 -d <run or dataset> Run number(s) (grid) or dataset (caf) or file name (local)
29 Local filename can be an xml collection of files on alies,
30 a single esd, or a text file with an ESD filename per line
31 -m Set if runnning on MC
32 -t <rootopt> Options passed to root
33 -l <list.txt> Process sequentially all runs/dataset listed in the file
34 (one entry per line). If you use this option you don't
35 need the -d. in the case you are running on CAF, they
36 must have the same path
37 Grid only options
38 -g <gridmode> Plugin Mode [default=$mode]
39 -p <recopass> Reconstruction pass [default=$pass]
40 CAF only options
41 -p <path> Data set path
42 -n <nev> Number of events
43 -w <workers> Number of workers [default=$workers]
44ENDOFGUIDE
45
46}
47
48while getopts "r:hd:mg:p:n:w:t:l:" opt; do
49 case $opt in
50 r)
51 runMode=$OPTARG
52 ;;
53 d)
54 run=$OPTARG
55 ;;
56 l)
57 listfile=$OPTARG
58 ;;
59 t)
60 ROPT=$OPTARG
61 ;;
62 n)
63 nev=$OPTARG
64 ;;
65 w)
66 workers=$OPTARG
67 ;;
68 m)
69 mc=kTRUE
70 ;;
71 g)
72 mode=$OPTARG
73 ;;
74 p)
75 pass=$OPTARG
76 ;;
77 h)
78 give_help
79 exit 1
80 ;;
81 \?)
82 echo "Invalid option: -$OPTARG" >&2
83 give_help
84 exit 1
85 ;;
86 :)
87 echo "Option -$OPTARG requires an argument." >&2
88 give_help
89 exit 1
90 ;;
91 esac
92done
93
94
95runlist=$run
96if [ "$listfile" != "" ]
97 then
98 runlist=""
99 while read line
100 do
101 runlist="$runlist $line"
102 done < $listfile
103
104fi
105
106echo "Run list: $runlist"
107
108
109if [ "$runMode" = "2" ]
110then
111 echo root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$option,$suffix,$workers,\"$mode\"\)
112 root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,\"$option\",\"$suffix\",$workers,\"$mode\"\)
113else
114 for run in $runlist
115 do
116 echo root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$option,$suffix,$workers,\"$mode\"\)
117 root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,\"$option\",\"$suffix\",$workers,\"$mode\"\)
118 done
119fi