]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/SPECTRA/LambdaK0PbPb/run.sh
HWCF configuration: switching on deconvolution in time after fix r51236
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / LambdaK0PbPb / run.sh
CommitLineData
e886738f 1#!/bin/bash
2
8797f8b6 3run=
4#pass=/alice/data/LHC10h_000139172_p2
5pass=
e886738f 6mc=0
7mode="full"
8nev=1234566789
9workers=26
10ROPT=""
11listfile=""
8797f8b6 12offset=500000
e886738f 13debug=kTRUE
14option="SAVE" #FIXME:set option
15suffix=""
39eb6410 16fitFolder="LHC10h_000137161_p1_5plus"
17fitBin="00"
18partID=1
19task=no
20fit=no
80d04512 21usePID=kTRUE
8797f8b6 22binMin=0
23binMax=6
24ihist=0
e886738f 25give_help() {
26
27cat <<ENDOFGUIDE
28This scripts runs the the physics selection and centrality on a specified run/dataset
29
30Available options:
39eb6410 31 * Run the task *
e886738f 32 -r <mode> Run the task
33 Modes (compulsory):
34 0 local
35 1 caf
36 2 grid
37 -d <run or dataset> Run number(s) (grid) or dataset (caf) or file name (local)
38 Local filename can be an xml collection of files on alies,
39 a single esd, or a text file with an ESD filename per line
40 -m Set if runnning on MC
41 -t <rootopt> Options passed to root
42 -l <list.txt> Process sequentially all runs/dataset listed in the file
43 (one entry per line). If you use this option you don't
44 need the -d. in the case you are running on CAF, they
45 must have the same path
39eb6410 46 -x <suffix> Add extra suffix to files
80d04512 47 -i Disable PID cuts
8797f8b6 48 -c min,max First and last centrality bins to process
49 (As defined in AddTaskLambdaK0PbPb)
e886738f 50 Grid only options
51 -g <gridmode> Plugin Mode [default=$mode]
52 -p <recopass> Reconstruction pass [default=$pass]
53 CAF only options
54 -p <path> Data set path
55 -n <nev> Number of events
56 -w <workers> Number of workers [default=$workers]
39eb6410 57
58 * Fit the results *
59 -f <folder> Run the fitting macro in the subfolder of ./output
60 -b <bin> Centrality bin index [default=$fitBin]
61 -p <particleID> Fit particle defined by particleID [default=$partID]
62 0=K0
63 1=Lambda
64 2=Anti-Lambda
65 3=Lambda + Anti-Lambda,
66 4=Csi
67 6=Omega
68 -x <suffix> Add extra suffix to files
e886738f 69ENDOFGUIDE
70
71}
72
8797f8b6 73while getopts "r:hd:mg:p:n:w:t:l:f:b:x:ic:s:" opt; do
e886738f 74 case $opt in
8797f8b6 75 s)
76 ihist=$OPTARG
77 ;;
78 c)
79 bins=$OPTARG
80 binMax=${bins#*,}
81 binMin=${bins%,*}
82 ;;
e886738f 83 r)
84 runMode=$OPTARG
39eb6410 85 task=yes
86 ;;
87 f)
88 fitFolder=$OPTARG
89 fit=yes
90 ;;
91 b)
92 fitBin=`printf %2.2d $OPTARG`
e886738f 93 ;;
80d04512 94 i)
95 usePID=kFALSE
96 ;;
e886738f 97 d)
98 run=$OPTARG
99 ;;
100 l)
101 listfile=$OPTARG
102 ;;
103 t)
104 ROPT=$OPTARG
105 ;;
106 n)
107 nev=$OPTARG
108 ;;
109 w)
110 workers=$OPTARG
111 ;;
112 m)
8797f8b6 113 #Int_t Nev =
e886738f 114 mc=kTRUE
115 ;;
116 g)
117 mode=$OPTARG
118 ;;
119 p)
120 pass=$OPTARG
39eb6410 121 partID=$OPTARG
122 ;;
123 x)
124 suffix=$OPTARG
e886738f 125 ;;
126 h)
127 give_help
128 exit 1
129 ;;
130 \?)
131 echo "Invalid option: -$OPTARG" >&2
132 give_help
133 exit 1
134 ;;
135 :)
136 echo "Option -$OPTARG requires an argument." >&2
137 give_help
138 exit 1
139 ;;
140 esac
141done
142
143
39eb6410 144if [ "$task" = "yes" ]
e886738f 145 then
39eb6410 146 runlist=$run
147 if [ "$listfile" != "" ]
148 then
149 runlist=""
150 while read line
151 do
152 runlist="$runlist $line"
153 done < $listfile
154 fi
e886738f 155
39eb6410 156 echo "Run list: $runlist"
157
e886738f 158
39eb6410 159 if [ "$runMode" = "2" ]
160 then
8797f8b6 161 echo root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,$option,$suffix,$workers,\"$mode\",$binMin,$binMax\)
162 root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,\"$option\",\"$suffix\",$workers,\"$mode\",$binMin,$binMax\)
39eb6410 163 else
164 for run in $runlist
165 do
8797f8b6 166 echo root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,$option,\"$suffix\",$workers,\"$mode\",$binMin,$binMax\)
167 root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,\"$option\",\"$suffix\",$workers,\"$mode\",$binMin,$binMax\)
39eb6410 168 done
169 fi
170elif [ "$fit" = "yes" ]
171then
8797f8b6 172 root FitSpectrum.C\(\"./output/$fitFolder/lambdak0_${fitBin}.root\",\"clambdak0Histo_${fitBin}\",\"$suffix\",${ihist},$partID\)
39eb6410 173else
174 give_help
e886738f 175fi
39eb6410 176
177
178