Working on the electron cut
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / ChargedHadrons / multPbPb / run.sh
CommitLineData
a23f7c97 1#!/bin/bash
2
3# defaults
4isMC=kFALSE
5run=no
6correct=no
7nev=-1
8offset=0
eef42d18 9debug=kFALSE
a23f7c97 10runmode=1
54b31d6a 11dataset=/alice/sim/LHC10f8a_130844
a23f7c97 12ropt="-l"
abd808b9 13option="DCA,SAVE"
a23f7c97 14workers=26
15analysismode=9; #SPD + field on
bfae2924 16centrBin=-1
54b31d6a 17centrEstimator="V0M"
9d173aad 18runTriggerStudy=no
e0376287 19customSuffix=""
eef42d18 20ntrackletsTrigger=50
21rejectBGV0Trigger=kFALSE
3b8cbf2d 22useTrackCentralityCut=0
eef42d18 23trackMin=0
24trackMax=100
72491d7c 25dataDir=""
26mcDir=""
27vzMin=-10
28vzMax=10
29etaMin=-0.5
30etaMax=0.5
31npart=381.188
9441cdaa 32weakFactor=-1
bcf2601a 33useSingleBin=kTRUE
2b42cee2 34#OUTPATH=output.BAK2010
35OUTPATH=output
a23f7c97 36
37give_help() {
38
39cat <<ENDOFGUIDE
e0376287 40This scripts runs the mupliplicity analysis and the trigger study task
a23f7c97 41
42Available options:
43 Mode control, at least one of the following options should be used
44 -r <mode> Run the task
45 Modes [default=$runmode]:
46 0 local
47 1 caf
5ad99723 48 2 grid (remeber to set run list)
49 3 prooflite
72491d7c 50 -c <data,mc> Run the correction data and MC are names of the folders.
51 ./output/ is added automatically in front of the folder names
9d173aad 52 -s Run the trigger study task (by default it runs the multiplicity analysis)
a23f7c97 53 Proof settings
84bad6b8 54 -w nworkers Set the number of worker nodes (0 == 1 worker per node)
5ad99723 55 -n <nev> Number of events to be analized
56 Grid Settings
57 -u <runs> Runs to be processed in the data folder
a23f7c97 58 Misc
59 -d <dataset> Dataset or data collection (according to run mode) [default=$dataset]
e0376287 60 - local mode: a single ESD file, an xml collection of files on
61 grid or a text file with a ESD per line
62 - caf mode: a dataset
5ad99723 63 - grid mode: a directory on alien (don't forget the run list)
bcf2601a 64 -h This help
9d173aad 65 Options specific to the multiplicity analysis
bcf2601a 66 -l Run over all centrality bins
67 -o <option> Misc option [default=$option]
68 Available options:
69 - SAVE: Move results to a different output folder*
70 - DCA: Use DCA cut with global tracks
71 - ITSsa: Use ITSsa tracks
72 - TPC: Use TPC only tracks
73 - NOMCKINE: Skip MC kinematics (runs way faster)
5ad99723 74 - NoElectrons: apply cuts to reject electrons in the rec sample,
75 exclude electrons by PDG code in the MC sample
bcf2601a 76 * == can be used in trigger studies task
77 -t <option> Command line option for root [defaul=$ropt]
78 -m Use this to run on Monte Carlo
79 -x <suffix> Set a custom suffix in the histo manager
80 -g Debug mode
81 == The following options are only valid if running on a single bin ==
54b31d6a 82 -b <bin> Set centrality bin [default=$centrBin]
83 -e <estimator> Set centrality estimator [default=$centrEstimator]
84 Available choiches:
85 - V0M = V0 multiplicity
86 - FMD = FMD raw multiplicity
87 - TRK = N. of tracks
88 - TKL = N. of tracklets
89 - CL0 = N. of clusters in layer 0
90 - V0MvsFMD = correlation between V0 and FMD
91 - TKLvsV0 = correlation between tracklets and V0
92 - ZEMvsZDC = correlation between ZEM and ZDC
eef42d18 93 -y <min,max> Select centrality based on "good tracks" rather than on centrality
94 estimator [off by default]
72491d7c 95 -0 <min,max> Select centrality based on v0 amplitude range rather than on centrality
96 estimator [off by default]
97 -2 <min,max> Select centrality based on SPD outer layer clusters rather than on centrality
3b8cbf2d 98 estimator [off by default]
eef42d18 99
100 Options specific to the trigger study task
101 -k <ntracklets> Max number of tracklets to fill eta and pt
102 distributions [default=$ntrackletsTrigger]
103 -v Reject BG with the V0
72491d7c 104 Options specific for the corrections
105 -z <zmin,zmax> Change vertex Z range [default = $vzMin,$vzMax]
106 -a <etamin,etamax> Change eta range [default = $etaMin,$etaMax]
107 -p <npart> Number of participants, used only for dNdeta/npart [default=$npart]
9441cdaa 108 -k <weakFrac> Scale ration secondaries from strangeness/all rec by this factor [default=$weakFactor]
bfae2924 109 -b <bin> Set centrality bin to be corrected. Only valid if you processed multiple
110 bins at one (it changes the suffix of the multPbPbtracks.root file). It it's -1,
111 a file without suffix is searched for. This options applyies both to the data and to the
112 MC file. [default=$centrBin]
a23f7c97 113ENDOFGUIDE
114
115}
116
5ad99723 117while getopts "x:sr:c:gmd:o:w:n:e:b:t:k:vy:0:2:hz:a:lp:u:" opt; do
a23f7c97 118 case $opt in
119 r)
120 run=yes
121 runmode=$OPTARG
122 ;;
bcf2601a 123 l)
124 useSingleBin=kFALSE
5ad99723 125 ;;
126 u)
127 runList=$OPTARG
128 ;;
eef42d18 129 y)
3b8cbf2d 130 useTrackCentralityCut=1
131 trackMin=${OPTARG%%,*}
132 trackMax=${OPTARG##*,}
133 ;;
134 0)
135 useTrackCentralityCut=2
eef42d18 136 trackMin=${OPTARG%%,*}
137 trackMax=${OPTARG##*,}
138 ;;
72491d7c 139 2)
140 useTrackCentralityCut=3
141 trackMin=${OPTARG%%,*}
142 trackMax=${OPTARG##*,}
143 ;;
e0376287 144 x)
145 customSuffix=$OPTARG
146 ;;
72491d7c 147 p)
148 npart=$OPTARG
149 ;;
eef42d18 150 k)
151 ntrackletsTrigger=$OPTARG
9441cdaa 152 weakFactor=$OPTARG
eef42d18 153 ;;
9d173aad 154 s)
155 runTriggerStudy=yes
156 ;;
eef42d18 157 v)
158 rejectBGV0Trigger=kTRUE
159 ;;
a23f7c97 160 c)
161 correct=yes
abd808b9 162 dataDir="./$OUTPATH/${OPTARG%%,*}"
163 mcDir="./$OUTPATH/${OPTARG##*,}"
72491d7c 164 ;;
165 z)
166 vzMin=${OPTARG%%,*}
167 vzMax=${OPTARG##*,}
168 ;;
169 a)
170 etaMin=${OPTARG%%,*}
171 etaMax=${OPTARG##*,}
a23f7c97 172 ;;
173 g)
174 debug=kTRUE;
175 ;;
176 m)
177 isMC=kTRUE
178 ;;
179 d)
180 dataset=$OPTARG
181 ;;
54b31d6a 182 e)
183 centrEstimator=$OPTARG
184 ;;
185 b)
186 centrBin=$OPTARG
187 ;;
a23f7c97 188 o)
189 option=$OPTARG
190 ;;
191 t)
192 ropt=$OPTARG
193 ;;
194 w)
195 workers=$OPTARG
196 ;;
197 n)
198 nev=$OPTARG
199 ;;
200 h)
201 give_help
202 exit 1
203 ;;
204 \?)
205 echo "Invalid option: -$OPTARG" >&2
206 give_help
207 exit 1
208 ;;
209 :)
210 echo "Option -$OPTARG requires an argument." >&2
211 give_help
212 exit 1
213 ;;
214 esac
215done
216
217if [ "$run" = "$correct" ]
218 then
219 echo "One and only one option between -r and -c must be selected"
220 give_help
221 exit 1
222fi
223
54b31d6a 224
a23f7c97 225if [ "$run" = "yes" ]
226 then
9d173aad 227 if [ "$runTriggerStudy" = "yes" ]
228 then
eef42d18 229 root $ropt runTriggerStudy.C\(\"$dataset\",$nev,$offset,$debug,$runmode,$isMC,$ntrackletsTrigger,$rejectBGV0Trigger,\"$option\",$workers\)
9d173aad 230 else
5ad99723 231 root $ropt run.C\(\"$dataset\",$nev,$offset,$debug,$runmode,$isMC,$centrBin,\"$centrEstimator\",$useTrackCentralityCut,$trackMin,$trackMax,\"$option\",\"$customSuffix\",$workers,$useSingleBin,\"$runList\"\)
9d173aad 232 fi
54b31d6a 233fi
234
235if [ "$correct" = "yes" ]
236 then
bfae2924 237 root $ropt correct.C+\(\"$dataDir\",\"$mcDir\",$vzMin,$vzMax,$etaMin,$etaMax,$npart,$weakFactor,$centrBin\);
a23f7c97 238fi