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