]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/SPECTRA/LambdaK0PbPb/run.sh
Added method to refit the ESD VertexTracks and redo track DCA's
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / LambdaK0PbPb / run.sh
1 #!/bin/bash
2
3 run=
4 #pass=/alice/data/LHC10h_000139172_p2
5 pass=
6 mc=0
7 mode="full"
8 nev=1234566789
9 workers=26
10 ROPT=""
11 listfile=""
12 offset=500000
13 debug=kTRUE
14 option="SAVE" #FIXME:set option
15 suffix=""
16 fitFolder="LHC10h_000137161_p1_5plus"
17 fitBin="00"
18 partID=1
19 task=no
20 fit=no
21 usePID=kTRUE
22 binMin=0
23 binMax=10
24 ihist=0
25 give_help() {
26
27 cat <<ENDOFGUIDE
28 This scripts runs the the physics selection and centrality on a specified run/dataset
29
30 Available options:
31  * Run the task *
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
46   -x <suffix>                  Add extra suffix to files 
47   -i                           Disable PID cuts
48   -c min,max                   First and last centrality bins to process 
49                                (As defined in AddTaskLambdaK0PbPb)
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]
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 
69 ENDOFGUIDE
70
71 }
72
73 while getopts "r:hd:mg:p:n:w:t:l:f:b:x:ic:s:" opt; do
74   case $opt in
75     s)
76     ihist=$OPTARG     
77     ;;
78     c)
79       bins=$OPTARG
80       binMax=${bins#*,}
81       binMin=${bins%,*}
82       ;;
83     r)
84       runMode=$OPTARG
85       task=yes
86       ;;
87     f) 
88       fitFolder=$OPTARG
89       fit=yes
90       ;;
91     b)
92       #fitBin=`printf %2.2d $OPTARG`
93       fitBin=$OPTARG
94       ;;
95     i)
96       usePID=kFALSE
97       ;;
98     d)
99       run=$OPTARG
100       ;;
101     l)
102       listfile=$OPTARG
103       ;;
104     t)
105       ROPT=$OPTARG
106       ;;
107     n)
108       nev=$OPTARG
109       ;;
110     w)
111       workers=$OPTARG
112       ;;
113     m)
114     #Int_t Nev =
115       mc=kTRUE
116       ;;
117     g) 
118       mode=$OPTARG
119       ;;
120     p)
121       pass=$OPTARG
122       partID=$OPTARG
123       ;;
124     x)
125       suffix=$OPTARG
126       ;;
127     h)
128       give_help
129       exit 1
130       ;;
131     \?)
132       echo "Invalid option: -$OPTARG" >&2
133       give_help
134       exit 1
135       ;;
136     :)
137       echo "Option -$OPTARG requires an argument." >&2
138       give_help
139       exit 1
140       ;;
141   esac
142 done
143
144
145 if [ "$task" = "yes" ]
146     then
147     runlist=$run
148     if [ "$listfile" != "" ]
149     then
150         runlist=""
151         while read line
152         do
153             runlist="$runlist $line"
154         done < $listfile        
155     fi
156
157     echo "Run list: $runlist"
158     
159
160     if [ "$runMode" = "2" ]
161     then
162         echo root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,$option,$suffix,$workers,\"$mode\",$binMin,$binMax\)
163         root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,\"$option\",\"$suffix\",$workers,\"$mode\",$binMin,$binMax\)
164     else
165         for run in $runlist 
166         do
167             echo root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,$option,\"$suffix\",$workers,\"$mode\",$binMin,$binMax\)
168             root $ROPT run.C\(\"$run\",\"$pass\",$nev,$offset,$debug,$runMode,$mc,$usePID,\"$option\",\"$suffix\",$workers,\"$mode\",$binMin,$binMax\)
169         done
170     fi
171 elif [ "$fit" = "yes" ]
172 then    
173 #    root FitSpectrum.C\(\"./output/$fitFolder/lambdak0_${fitBin}.root\",\"clambdak0Histo_${fitBin}\",\"$suffix\",${ihist},$partID\)
174     root FitSpectrum.C\(\"./output10binsNew/$fitFolder/lambdak0_${fitBin}.root\",\"clambdak0Histo_${fitBin}\",\"$suffix\",${ihist},$partID\)
175 else
176     give_help
177 fi
178
179
180