]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/Run.sh
Fixed bug in the computation of dip angle value
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / Run.sh
1 #!/bin/bash 
2
3 nev=10000
4 noanal=0
5 nodraw=0
6 rebin=1
7 vzmin=-10
8 vzmax=10
9 ncutbins=1
10 correctioncut=0.1
11 batch=0
12 gdb=0
13 proof=0
14 type=
15 cms=900
16 hhd=1
17 comp=1
18
19 usage()
20 {
21 cat<<EOF
22 Usage: $0 [OPTIONS]
23
24 Do Pass1 and Pass2 on ESD files in current directory.  
25
26 Options:
27         -h,--help               This help                  
28         -n,--events N           Number of events           ($nev)
29         -N,--no-analysis        Do not analyse, just draw  ($noanal)
30         -D,--no-draw            Do not draw, just analysis ($nodraw)
31         -r,--rebin N            Rebin by N                 ($rebin)
32         -c,--n-cut-bins N       Number of cut bins         ($ncutbins)
33         -C,--correction-cut V   Cut on secondary corr,     ($correctioncut)
34         -v,--vz-min CM          Minimum value of vz        ($vzmin)
35         -V,--vz-max CM          Maximum value of vz        ($vzmax)
36         -t,--trigger TYPE       Select trigger TYPE        ($type)
37         -e,--energy CMS         Center of mass energy      ($cms)
38         -b,--batch              Do batch processing        ($batch)
39         -p,--proof              Run in PROOF(Lite) mode    ($proof)
40         -g,--gdb                Run in GDB mode            ($gdb)
41         -H,--hhd                Do comparison to HHD       ($hhd)
42         -O,--other              Do comparison to other     ($comp)
43
44 TYPE is a comma or space separated list of 
45  
46   INEL        Inelastic triggers (V0A|V0C|SPD)
47   INEL>0      As above + N_ch > 0 in -0.5<eta<+0.5
48   NSD         Non-single diffractive ((VOA&VOC)|N_ch > 5 -1.9<eta<+1.9)
49
50 EOF
51 }
52
53 toggle()
54 {
55     echo $((($1+1)%2))
56 }
57
58
59 while test $# -gt 0 ; do
60     case $1 in 
61         -h|--help)           usage            ; exit 0;; 
62         -n|--events)         nev=$2           ; shift ;; 
63         -N|--no-analysis)    noanal=`toggle $noanal`   ;; 
64         -D|--no-draw)        nodraw=`toggle $nodraw`   ;; 
65         -b|--batch)          batch=`toggle $batch`   ;; 
66         -p|--proof)          proof=`toggle $proof`   ;; 
67         -g|--gdb)            gdb=`toggle $gdb`   ;; 
68         -H|--hhd)            hhd=`toggle $hhd`   ;; 
69         -O|--other)          other=`toggle $other`   ;; 
70         -r|--rebin)          rebin=$2         ; shift ;; 
71         -v|--vz-min)         vzmin=$2         ; shift ;; 
72         -V|--vz-max)         vzmax=$2         ; shift ;; 
73         -e|--energy)         cms=$2           ; shift ;;
74         -c|--n-cut-bins)     ncutbins=$2      ; shift ;; 
75         -C|--correction-cut) correctioncut=$2 ; shift ;;
76         -t|--type)           
77             if test "x$type" = "x" ; then type=$2 ; else type="$type|$2"; fi
78             shift ;;
79         *) echo "$0: Unknown option '$1'" >> /dev/stderr ; exit 1 ;;
80     esac
81     shift
82 done 
83
84 base=`printf dndeta_%07d $nev`
85 opts="-l -x"
86 redir=
87 if test $batch -gt 0 ; then 
88     opts="-l -b -q -x" 
89     redir="2>&1 | tee ${base}.log"
90 fi 
91 if test $noanal -lt 1 ; then 
92     rm -f AnalysisResult.root AliAODs.root
93     rm -f fmdana.png
94
95     if test $gdb -gt 0 ; then 
96         export PROOF_WRAPPERCMD="gdb -batch -x $ALICE_ROOT/PWG2/FORWARD/analysis2/gdb_cmds --args"
97     fi
98     aliroot $opts $ALICE_ROOT/PWG2/FORWARD/analysis2/Pass1.C\(\".\",$nev,$ncutbins,$correctioncut,$proof\) $redir 
99     rm -f event_stat.root EventStat_temp.root outputs_valid
100     if test ! -f AnalysisResults.root || test ! -f AliAODs.root ; then 
101         echo "Analysis failed" 
102         exit 1
103     fi
104     echo "Analysis done"
105 fi
106
107 if test $nodraw -lt 1 ; then
108     rm -f result.root 
109     aliroot ${opts} $ALICE_ROOT/PWG2/FORWARD/analysis2/Pass2.C\(\"AliAODs.root\",\"$type\",$cms,$vzmin,$vzmax,$rebin,\"Run\ 118506,\ $nev\ Events,\ v_{z}#in[$vzmin,$vzmax],\ $type\",$hhd,$comp\)
110 fi
111
112
113 #
114 # EOF
115 #