]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG0/multPbPb/run.sh
CreateAlienHandlerTrigger:
[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=kFALSE
23 trackMin=0
24 trackMax=100
25
26 give_help() {
27
28 cat <<ENDOFGUIDE
29 This scripts runs the mupliplicity analysis and the trigger study task
30
31 Available options:
32  Mode control, at least one of the following options should be used
33   -r <mode>                    Run the task
34                                Modes [default=$runmode]:
35                                   0 local
36                                   1 caf    
37                                   2 grid    
38   -c                           Run the correction
39   -s                           Run the trigger study task (by default it runs the multiplicity analysis)
40  Proof settings
41   -w nworkers                  Set the number of worker nodes
42   -n <nev>                     Number of events to be analized 
43  Misc
44   -d <dataset>                 Dataset or data collection (according to run mode) [default=$dataset]
45                                 - local mode: a single ESD file, an xml collection of files on 
46                                   grid or a text file with a ESD per line
47                                 - caf mode: a dataset
48                                 - grid mode: a directory on alien
49  Options specific to the multiplicity analysis
50   -b <bin>                     Set centrality bin [default=$centrBin]
51   -e <estimator>               Set centrality estimator [default=$centrEstimator]
52                                Available choiches:
53                                 - V0M = V0 multiplicity
54                                 - FMD = FMD raw multiplicity
55                                 - TRK = N. of tracks
56                                 - TKL = N. of tracklets
57                                 - CL0 = N. of clusters in layer 0
58                                 - V0MvsFMD = correlation between V0 and FMD
59                                 - TKLvsV0 = correlation between tracklets and V0
60                                 - ZEMvsZDC = correlation between ZEM and ZDC     
61   -y <min,max>                 Select centrality based on "good tracks" rather than on centrality
62                                estimator [off by default]
63   -o <option>                  Misc option [default=$option]
64                                Available options: 
65                                 - SAVE:     Move results to a different output folder*
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   -h                           This help
75
76  Options specific to the trigger study task
77   -k <ntracklets>              Max number of tracklets to fill eta and pt 
78                                distributions [default=$ntrackletsTrigger]
79   -v                           Reject BG with the V0
80 ENDOFGUIDE
81
82 }
83
84 while getopts "x:sr:cgmd:o:w:n:e:b:t:k:vy:" opt; do
85   case $opt in
86     r)
87       run=yes
88       runmode=$OPTARG
89       ;;      
90     y)
91       useTrackCentralityCut=kTRUE
92       trackMin=${OPTARG%%,*}
93       trackMax=${OPTARG##*,}
94       ;;      
95     x)
96       customSuffix=$OPTARG
97       ;;      
98     k)
99       ntrackletsTrigger=$OPTARG
100       ;;      
101     s)
102       runTriggerStudy=yes
103       ;;      
104     v)
105       rejectBGV0Trigger=kTRUE
106       ;;      
107     c)
108       correct=yes
109       ;;      
110     g)
111       debug=kTRUE;
112       ;;
113     m)
114       isMC=kTRUE
115       ;;
116     d)
117       dataset=$OPTARG
118      ;;
119     e)
120       centrEstimator=$OPTARG
121      ;;
122     b)
123       centrBin=$OPTARG
124      ;;
125     o)
126       option=$OPTARG
127       ;;
128     t)
129       ropt=$OPTARG
130       ;;
131     w) 
132       workers=$OPTARG
133       ;;
134     n) 
135       nev=$OPTARG
136       ;;
137     h)
138       give_help
139       exit 1
140       ;;
141     \?)
142       echo "Invalid option: -$OPTARG" >&2
143       give_help
144       exit 1
145       ;;
146     :)
147       echo "Option -$OPTARG requires an argument." >&2
148       give_help
149       exit 1
150       ;;
151   esac
152 done
153
154 if [ "$run" = "$correct" ]
155     then 
156     echo "One and only one option between -r and -c must be selected"
157     give_help
158     exit 1
159 fi
160
161
162 if [ "$run" = "yes" ]
163     then
164     if [ "$runTriggerStudy" = "yes" ]
165         then
166         root $ropt runTriggerStudy.C\(\"$dataset\",$nev,$offset,$debug,$runmode,$isMC,$ntrackletsTrigger,$rejectBGV0Trigger,\"$option\",$workers\)
167     else
168         root $ropt run.C\(\"$dataset\",$nev,$offset,$debug,$runmode,$isMC,$centrBin,\"$centrEstimator\",$useTrackCentralityCut,$trackMin,$trackMax,\"$option\",\"$customSuffix\",$workers\)
169     fi
170 fi
171
172 if [ "$correct" = "yes" ]
173     then
174     echo "To be implemented"
175 fi