]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/Run.sh
Added event inspector and energy distribution fitter.
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / Run.sh
CommitLineData
97561a26 1#!/bin/bash
2
3nev=10000
4noanal=0
5nodraw=0
6rebin=1
7vzmin=-10
8vzmax=10
9ncutbins=1
10correctioncut=0.1
11batch=0
12gdb=0
13proof=0
14type=
15cms=900
16hhd=1
17comp=1
18
19usage()
20{
21cat<<EOF
22Usage: $0 [OPTIONS]
23
24Do Pass1 and Pass2 on ESD files in current directory.
25
26Options:
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
44TYPE 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
50EOF
51}
52
53toggle()
54{
55 echo $((($1+1)%2))
56}
57
58
59while 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
82done
83
84base=`printf dndeta_%07d $nev`
85opts="-l -x"
86redir=
87if test $batch -gt 0 ; then
88 opts="-l -b -q -x"
89 redir="2>&1 | tee ${base}.log"
90fi
91if 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"
105fi
106
107if 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\)
110fi
111
112
113#
114# EOF
115#