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