]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG0/multPbPb/run.sh
004fef69ae4c09c969e4c76a72618b237307aebf
[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
21 give_help() {
22
23 cat <<ENDOFGUIDE
24 This scripts runs the mupliplicity analysis and the trigger study task
25
26 Available options:
27  Mode control, at least one of the following options should be used
28   -r <mode>                    Run the task
29                                Modes [default=$runmode]:
30                                   0 local
31                                   1 caf    
32                                   2 grid    
33   -c                           Run the correction
34   -s                           Run the trigger study task (by default it runs the multiplicity analysis)
35  Proof settings
36   -w nworkers                  Set the number of worker nodes
37   -n <nev>                     Number of events to be analized 
38  Misc
39   -d <dataset>                 Dataset or data collection (according to run mode) [default=$dataset]
40                                 - local mode: a single ESD file, an xml collection of files on 
41                                   grid or a text file with a ESD per line
42                                 - caf mode: a dataset
43                                 - grid mode: a directory on alien
44  Options specific to the multiplicity analysis
45   -b <bin>                     Set centrality bin [default=$centrBin]
46   -e <estimator>               Set centrality estimator [default=$centrEstimator]
47                                Available choiches:
48                                 - V0M = V0 multiplicity
49                                 - FMD = FMD raw multiplicity
50                                 - TRK = N. of tracks
51                                 - TKL = N. of tracklets
52                                 - CL0 = N. of clusters in layer 0
53                                 - V0MvsFMD = correlation between V0 and FMD
54                                 - TKLvsV0 = correlation between tracklets and V0
55                                 - ZEMvsZDC = correlation between ZEM and ZDC     
56   -o <option>                  Misc option [default=$option]
57                                Available options: 
58                                 - SAVE:     Move results to a different output folder*
59                                 - ITSsa:    Use ITSsa tracks
60                                 - TPC:      Use TPC only tracks
61                                 - NOMCKINE: Skip MC kinematics (runs way faster)
62                                 * == can be used in trigger studies task
63   -t <option>                  Command line option for root [defaul=$ropt]
64   -m                           Use this to run on Monte Carlo
65   -x  <suffix>                 Set a custom suffix in the histo manager        
66   -g                           Debug mode
67   -h                           This help
68 ENDOFGUIDE
69
70 }
71
72 while getopts "x:sr:cgmd:o:w:n:e:b:t:" opt; do
73   case $opt in
74     r)
75       run=yes
76       runmode=$OPTARG
77       ;;      
78     x)
79       customSuffix=$OPTARG
80       ;;      
81     s)
82       runTriggerStudy=yes
83       ;;      
84     c)
85       correct=yes
86       ;;      
87     g)
88       debug=kTRUE;
89       ;;
90     m)
91       isMC=kTRUE
92       ;;
93     d)
94       dataset=$OPTARG
95      ;;
96     e)
97       centrEstimator=$OPTARG
98      ;;
99     b)
100       centrBin=$OPTARG
101      ;;
102     o)
103       option=$OPTARG
104       ;;
105     t)
106       ropt=$OPTARG
107       ;;
108     w) 
109       workers=$OPTARG
110       ;;
111     n) 
112       nev=$OPTARG
113       ;;
114     h)
115       give_help
116       exit 1
117       ;;
118     \?)
119       echo "Invalid option: -$OPTARG" >&2
120       give_help
121       exit 1
122       ;;
123     :)
124       echo "Option -$OPTARG requires an argument." >&2
125       give_help
126       exit 1
127       ;;
128   esac
129 done
130
131 if [ "$run" = "$correct" ]
132     then 
133     echo "One and only one option between -r and -c must be selected"
134     give_help
135     exit 1
136 fi
137
138
139 if [ "$run" = "yes" ]
140     then
141     if [ "$runTriggerStudy" = "yes" ]
142         then
143         root $ropt runTriggerStudy.C\(\"$dataset\",$nev,$offset,$debug,$runmode,$isMC,\"$option\",$workers\)
144     else
145         root $ropt run.C\(\"$dataset\",$nev,$offset,$debug,$runmode,$isMC,$centrBin,\"$centrEstimator\",\"$option\",\"$customSuffix\",$workers\)
146     fi
147 fi
148
149 if [ "$correct" = "yes" ]
150     then
151     echo "To be implemented"
152 fi