]>
Commit | Line | Data |
---|---|---|
e886738f | 1 | #!/bin/bash |
2 | ||
8797f8b6 | 3 | run= |
4 | #pass=/alice/data/LHC10h_000139172_p2 | |
5 | pass= | |
e886738f | 6 | mc=0 |
7 | mode="full" | |
8 | nev=1234566789 | |
9 | workers=26 | |
10 | ROPT="" | |
11 | listfile="" | |
8797f8b6 | 12 | offset=500000 |
e886738f | 13 | debug=kTRUE |
14 | option="SAVE" #FIXME:set option | |
15 | suffix="" | |
39eb6410 | 16 | fitFolder="LHC10h_000137161_p1_5plus" |
17 | fitBin="00" | |
18 | partID=1 | |
19 | task=no | |
20 | fit=no | |
80d04512 | 21 | usePID=kTRUE |
8797f8b6 | 22 | binMin=0 |
99c77a9a | 23 | binMax=10 |
8797f8b6 | 24 | ihist=0 |
e886738f | 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: | |
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 | 69 | ENDOFGUIDE |
70 | ||
71 | } | |
72 | ||
8797f8b6 | 73 | while 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) | |
99c77a9a | 92 | #fitBin=`printf %2.2d $OPTARG` |
93 | fitBin=$OPTARG | |
e886738f | 94 | ;; |
80d04512 | 95 | i) |
96 | usePID=kFALSE | |
97 | ;; | |
e886738f | 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) | |
8797f8b6 | 114 | #Int_t Nev = |
e886738f | 115 | mc=kTRUE |
116 | ;; | |
117 | g) | |
118 | mode=$OPTARG | |
119 | ;; | |
120 | p) | |
121 | pass=$OPTARG | |
39eb6410 | 122 | partID=$OPTARG |
123 | ;; | |
124 | x) | |
125 | suffix=$OPTARG | |
e886738f | 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 | ||
39eb6410 | 145 | if [ "$task" = "yes" ] |
e886738f | 146 | then |
39eb6410 | 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 | |
e886738f | 156 | |
39eb6410 | 157 | echo "Run list: $runlist" |
158 | ||
e886738f | 159 | |
39eb6410 | 160 | if [ "$runMode" = "2" ] |
161 | then | |
8797f8b6 | 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\) | |
39eb6410 | 164 | else |
165 | for run in $runlist | |
166 | do | |
8797f8b6 | 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\) | |
39eb6410 | 169 | done |
170 | fi | |
171 | elif [ "$fit" = "yes" ] | |
172 | then | |
99c77a9a | 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\) | |
39eb6410 | 175 | else |
176 | give_help | |
e886738f | 177 | fi |
39eb6410 | 178 | |
179 | ||
180 |