]>
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 |
23 | binMax=6 | |
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) | |
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 | |
141 | done | |
142 | ||
143 | ||
39eb6410 | 144 | if [ "$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 | |
170 | elif [ "$fit" = "yes" ] | |
171 | then | |
8797f8b6 | 172 | root FitSpectrum.C\(\"./output/$fitFolder/lambdak0_${fitBin}.root\",\"clambdak0Histo_${fitBin}\",\"$suffix\",${ihist},$partID\) |
39eb6410 | 173 | else |
174 | give_help | |
e886738f | 175 | fi |
39eb6410 | 176 | |
177 | ||
178 |