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