]>
Commit | Line | Data |
---|---|---|
97561a26 | 1 | #!/bin/bash |
2 | ||
0bd4b00f | 3 | ana=$ALICE_ROOT/PWG2/FORWARD/analysis2 |
97561a26 | 4 | nev=10000 |
5 | noanal=0 | |
6 | nodraw=0 | |
7 | rebin=1 | |
8 | vzmin=-10 | |
9 | vzmax=10 | |
97561a26 | 10 | batch=0 |
11 | gdb=0 | |
12 | proof=0 | |
01541658 | 13 | mc=0 |
97561a26 | 14 | type= |
15 | cms=900 | |
16 | hhd=1 | |
17 | comp=1 | |
c389303e | 18 | tit= |
97561a26 | 19 | |
20 | usage() | |
21 | { | |
22 | cat<<EOF | |
23 | Usage: $0 [OPTIONS] | |
24 | ||
25 | Do Pass1 and Pass2 on ESD files in current directory. | |
26 | ||
27 | Options: | |
28 | -h,--help This help | |
29 | -n,--events N Number of events ($nev) | |
c389303e | 30 | -1,--pass1 Run only pass 1, no draw ($nodraw) |
31 | -2,--pass2 Run only pass 2, just draw ($noanal) | |
97561a26 | 32 | -r,--rebin N Rebin by N ($rebin) |
97561a26 | 33 | -v,--vz-min CM Minimum value of vz ($vzmin) |
34 | -V,--vz-max CM Maximum value of vz ($vzmax) | |
35 | -t,--trigger TYPE Select trigger TYPE ($type) | |
36 | -e,--energy CMS Center of mass energy ($cms) | |
37 | -b,--batch Do batch processing ($batch) | |
c389303e | 38 | -P,--proof Run in PROOF(Lite) mode ($proof) |
01541658 | 39 | -M,--mc Run over MC data ($mc) |
c389303e | 40 | -S,--title STRING Set the title string ($tit) |
97561a26 | 41 | -g,--gdb Run in GDB mode ($gdb) |
42 | -H,--hhd Do comparison to HHD ($hhd) | |
43 | -O,--other Do comparison to other ($comp) | |
44 | ||
45 | TYPE is a comma or space separated list of | |
46 | ||
47 | INEL Inelastic triggers (V0A|V0C|SPD) | |
48 | INEL>0 As above + N_ch > 0 in -0.5<eta<+0.5 | |
49 | NSD Non-single diffractive ((VOA&VOC)|N_ch > 5 -1.9<eta<+1.9) | |
50 | ||
51 | EOF | |
52 | } | |
53 | ||
54 | toggle() | |
55 | { | |
56 | echo $((($1+1)%2)) | |
57 | } | |
58 | ||
59 | ||
60 | while test $# -gt 0 ; do | |
61 | case $1 in | |
62 | -h|--help) usage ; exit 0;; | |
63 | -n|--events) nev=$2 ; shift ;; | |
c389303e | 64 | -2|--pass2) noanal=`toggle $noanal` ;; |
65 | -1|--pass1) nodraw=`toggle $nodraw` ;; | |
97561a26 | 66 | -b|--batch) batch=`toggle $batch` ;; |
c389303e | 67 | -P|--proof) proof=`toggle $proof` ;; |
01541658 | 68 | -M|--mc) mc=`toggle $mc` ;; |
97561a26 | 69 | -g|--gdb) gdb=`toggle $gdb` ;; |
70 | -H|--hhd) hhd=`toggle $hhd` ;; | |
71 | -O|--other) other=`toggle $other` ;; | |
72 | -r|--rebin) rebin=$2 ; shift ;; | |
73 | -v|--vz-min) vzmin=$2 ; shift ;; | |
74 | -V|--vz-max) vzmax=$2 ; shift ;; | |
75 | -e|--energy) cms=$2 ; shift ;; | |
c389303e | 76 | -S|--title) tit="$2" ; shift ;; |
97561a26 | 77 | -t|--type) |
78 | if test "x$type" = "x" ; then type=$2 ; else type="$type|$2"; fi | |
79 | shift ;; | |
80 | *) echo "$0: Unknown option '$1'" >> /dev/stderr ; exit 1 ;; | |
81 | esac | |
82 | shift | |
83 | done | |
84 | ||
85 | base=`printf dndeta_%07d $nev` | |
86 | opts="-l -x" | |
01541658 | 87 | opts1="" |
97561a26 | 88 | redir= |
01541658 | 89 | if test $nodraw -lt 1 ; then |
90 | opts1="-q" | |
91 | fi | |
97561a26 | 92 | if test $batch -gt 0 ; then |
01541658 | 93 | opts="-b -q $opts" |
97561a26 | 94 | redir="2>&1 | tee ${base}.log" |
0bd4b00f | 95 | echo "redir=$redir" |
97561a26 | 96 | fi |
97 | if test $noanal -lt 1 ; then | |
98 | rm -f AnalysisResult.root AliAODs.root | |
99 | rm -f fmdana.png | |
100 | ||
101 | if test $gdb -gt 0 ; then | |
102 | export PROOF_WRAPPERCMD="gdb -batch -x $ALICE_ROOT/PWG2/FORWARD/analysis2/gdb_cmds --args" | |
103 | fi | |
01541658 | 104 | echo "Running aliroot ${opts} ${opts1} ${ana}/Pass1.C\(\".\",$nev,$proof,$mc\) $redir" |
0bd4b00f | 105 | if test $batch -gt 0 ; then |
01541658 | 106 | aliroot $opts $opts1 ${ana}/Pass1.C\(\".\",$nev,$proof,$mc\) 2>&1 | tee ${base}.log |
0bd4b00f | 107 | else |
01541658 | 108 | aliroot $opts $opts1 ${ana}/Pass1.C\(\".\",$nev,$proof,$mc\) |
0bd4b00f | 109 | fi |
110 | rm -f event_stat.root \ | |
111 | EventStat_temp.root \ | |
112 | outputs_valid \ | |
113 | `printf %09d.stat $nev` | |
97561a26 | 114 | if test ! -f AnalysisResults.root || test ! -f AliAODs.root ; then |
115 | echo "Analysis failed" | |
116 | exit 1 | |
117 | fi | |
118 | echo "Analysis done" | |
119 | fi | |
120 | ||
121 | if test $nodraw -lt 1 ; then | |
122 | rm -f result.root | |
c389303e | 123 | if test "x$tit" = "x" ; then |
0bd4b00f | 124 | tit="$nev events, v_{z}#in[$vzmin,$vzmax], $type" |
c389303e | 125 | fi |
0bd4b00f | 126 | tit=`echo $tit | tr ' ' '@'` |
01541658 | 127 | echo "Running aliroot ${opts} ${opts1} ${ana}/Pass2.C\(\"AliAODs.root\",\"$type\",$cms,$vzmin,$vzmax,$rebin,$hhd,$comp\)" |
0bd4b00f | 128 | aliroot ${opts} ${ana}/Pass2.C\(\"AliAODs.root\",\"$type\",$cms,$vzmin,$vzmax,$rebin,\"$tit\",$hhd,$comp\) |
97561a26 | 129 | fi |
130 | ||
131 | ||
132 | # | |
133 | # EOF | |
134 | # |