]>
Commit | Line | Data |
---|---|---|
97561a26 | 1 | #!/bin/bash |
2 | ||
0bd4b00f | 3 | ana=$ALICE_ROOT/PWG2/FORWARD/analysis2 |
1174780f | 4 | nev=-1 |
97561a26 | 5 | rebin=1 |
6 | vzmin=-10 | |
7 | vzmax=10 | |
97561a26 | 8 | batch=0 |
9 | gdb=0 | |
10 | proof=0 | |
01541658 | 11 | mc=0 |
97561a26 | 12 | type= |
13 | cms=900 | |
14 | hhd=1 | |
15 | comp=1 | |
c389303e | 16 | tit= |
89c0bcd8 | 17 | dopass1=0 |
18 | dopass2=0 | |
19 | dopass3=0 | |
20 | pass1=MakeAOD.C | |
21 | pass2=MakedNdeta.C | |
22 | pass3=DrawdNdeta.C | |
23 | output1=forward.root | |
24 | output2=forward_dndeta.root | |
25 | gdb_script=$ALICE_ROOT/PWG2/FORWARD/analysis2/gdb_cmds | |
97561a26 | 26 | |
27 | usage() | |
28 | { | |
29 | cat<<EOF | |
30 | Usage: $0 [OPTIONS] | |
31 | ||
32 | Do Pass1 and Pass2 on ESD files in current directory. | |
33 | ||
34 | Options: | |
35 | -h,--help This help | |
89c0bcd8 | 36 | -n,--events N Number of events ($nev) |
37 | -1,--pass1 Run only pass 1, only AOD ($dopass2) | |
38 | -2,--pass2 Run only pass 2, only Hists ($dopass1) | |
39 | -D,--draw Draw results ($dopass3) | |
40 | -v,--vz-min CM Minimum value of vz ($vzmin) | |
41 | -V,--vz-max CM Maximum value of vz ($vzmax) | |
42 | -t,--trigger TYPE Select trigger TYPE ($type) | |
43 | -b,--batch Do batch processing ($batch) | |
44 | -P,--proof NWORKERS Run in PROOF(Lite) mode ($proof) | |
45 | -M,--mc Run over MC data ($mc) | |
46 | -g,--gdb Run in GDB mode ($gdb) | |
1c762251 | 47 | -E,--eloss Run energy loss script |
97561a26 | 48 | |
49 | TYPE is a comma or space separated list of | |
50 | ||
51 | INEL Inelastic triggers (V0A|V0C|SPD) | |
52 | INEL>0 As above + N_ch > 0 in -0.5<eta<+0.5 | |
53 | NSD Non-single diffractive ((VOA&VOC)|N_ch > 5 -1.9<eta<+1.9) | |
54 | ||
1174780f | 55 | If NWORKERS is 0, then the analysis will be run in local mode. |
97561a26 | 56 | EOF |
57 | } | |
58 | ||
59 | toggle() | |
60 | { | |
61 | echo $((($1+1)%2)) | |
62 | } | |
63 | ||
64 | ||
65 | while test $# -gt 0 ; do | |
66 | case $1 in | |
89c0bcd8 | 67 | -h|--help) usage ; exit 0;; |
68 | -n|--events) nev=$2 ; shift ;; | |
69 | -3|--pass3|-D|--draw) dopass3=`toggle $dopass3` ;; | |
70 | -2|--pass2|-H|--hist) dopass2=`toggle $dopass2` ;; | |
71 | -1|--pass1|-A|--aod) dopass1=`toggle $dopass1` ;; | |
72 | -b|--batch) batch=`toggle $batch` ;; | |
73 | -P|--proof) proof=$2 ; shift ;; | |
74 | -M|--mc) mc=`toggle $mc` ;; | |
75 | -g|--gdb) gdb=`toggle $gdb` ;; | |
76 | -v|--vz-min) vzmin=$2 ; shift ;; | |
77 | -V|--vz-max) vzmax=$2 ; shift ;; | |
78 | -E|--eloss) pass1=MakeELossFits.C | |
79 | pass2=scripts/ExtractELoss.C | |
80 | pass3=scripts/DrawAnaELoss.C | |
81 | output1=forward_eloss.root | |
82 | dopass2=1 | |
83 | ;; | |
97561a26 | 84 | -t|--type) |
85 | if test "x$type" = "x" ; then type=$2 ; else type="$type|$2"; fi | |
86 | shift ;; | |
87 | *) echo "$0: Unknown option '$1'" >> /dev/stderr ; exit 1 ;; | |
88 | esac | |
89 | shift | |
90 | done | |
91 | ||
1174780f | 92 | if test $nev -lt 0 ; then |
93 | base=dndeta_xxxxxxx | |
94 | else | |
95 | base=`printf dndeta_%07d $nev` | |
96 | fi | |
97561a26 | 97 | opts="-l -x" |
01541658 | 98 | opts1="" |
97561a26 | 99 | redir= |
89c0bcd8 | 100 | if test $dopass2 -gt 0 ; then |
01541658 | 101 | opts1="-q" |
102 | fi | |
97561a26 | 103 | if test $batch -gt 0 ; then |
01541658 | 104 | opts="-b -q $opts" |
97561a26 | 105 | redir="2>&1 | tee ${base}.log" |
0bd4b00f | 106 | echo "redir=$redir" |
97561a26 | 107 | fi |
89c0bcd8 | 108 | if test $dopass1 -gt 0 ; then |
109 | rm -f ${output} AliAOD.root | |
97561a26 | 110 | |
111 | if test $gdb -gt 0 ; then | |
89c0bcd8 | 112 | export PROOF_WRAPPERCMD="gdb -batch -x ${gdb_script} --args" |
97561a26 | 113 | fi |
1c762251 | 114 | echo "Running aliroot ${opts} ${opts1} ${ana}/${pass1}\(\".\",$nev,$proof,$mc\) $redir" |
0bd4b00f | 115 | if test $batch -gt 0 ; then |
1c762251 | 116 | aliroot $opts $opts1 ${ana}/${pass1}\(\".\",$nev,$proof,$mc\) 2>&1 | tee ${base}.log |
0bd4b00f | 117 | else |
1c762251 | 118 | aliroot $opts $opts1 ${ana}/${pass1}\(\".\",$nev,$proof,$mc\) |
0bd4b00f | 119 | fi |
1c762251 | 120 | fail=$? |
19abe41d | 121 | if test $fail -gt 0 ; then |
122 | echo "Return value $fail not 0" ; exit $fail | |
123 | fi | |
89c0bcd8 | 124 | if test ! -f ${output1} ; then |
125 | echo "$output1 not made" ; exit 1; | |
19abe41d | 126 | fi |
89c0bcd8 | 127 | if test ! -f AliAOD.root ; then |
19abe41d | 128 | echo "No AOD creates" ; exit 1; |
97561a26 | 129 | fi |
89c0bcd8 | 130 | echo "Pass 1 done" |
97561a26 | 131 | fi |
132 | ||
89c0bcd8 | 133 | if test $dopass2 -gt 0 ; then |
134 | rm -f ${output2} | |
135 | args="\(\".\",$nev,\"$type\",$vzmin,$vzmax,$proof\)" | |
136 | if test "x$pass1" = "xMakeELossFits.C" ; then | |
137 | args="\(\"${output1}\"\)" | |
138 | fi | |
139 | echo "Running aliroot ${opts} ${opts1} ${ana}/${pass2}.C${args}" | |
140 | aliroot ${opts} ${ana}/${pass2}.C${args} | |
141 | ||
142 | fail=$? | |
143 | if test $fail -gt 0 ; then | |
144 | echo "Return value $fail not 0" ; exit $fail | |
145 | fi | |
146 | if test ! -f ${output2} ; then | |
147 | echo "$output2 not made" ; exit 1; | |
148 | fi | |
149 | echo "Pass 2 done" | |
150 | fi | |
151 | ||
152 | if test $dopass3 -gt 0 ; then | |
0bd4b00f | 153 | tit=`echo $tit | tr ' ' '@'` |
89c0bcd8 | 154 | args="\(\"${output2}\"\)" |
155 | if test "x$pass1" = "xMakeELossFits.C" ; then | |
156 | args="\(\"${output1}\"\)" | |
157 | fi | |
158 | ||
159 | echo "Running aliroot ${opts} ${opts1} ${ana}/${pass3}.C${args}" | |
160 | aliroot ${opts} ${ana}/${pass3}.C${args} | |
97561a26 | 161 | fi |
162 | ||
163 | ||
164 | # | |
165 | # EOF | |
166 | # |