]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/Run.sh
MC sharing sub-algorithm
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / Run.sh
CommitLineData
97561a26 1#!/bin/bash
2
0bd4b00f 3ana=$ALICE_ROOT/PWG2/FORWARD/analysis2
97561a26 4nev=10000
5noanal=0
6nodraw=0
7rebin=1
8vzmin=-10
9vzmax=10
97561a26 10batch=0
11gdb=0
12proof=0
01541658 13mc=0
97561a26 14type=
15cms=900
16hhd=1
17comp=1
c389303e 18tit=
97561a26 19
20usage()
21{
22cat<<EOF
23Usage: $0 [OPTIONS]
24
25Do Pass1 and Pass2 on ESD files in current directory.
26
27Options:
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
45TYPE 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
51EOF
52}
53
54toggle()
55{
56 echo $((($1+1)%2))
57}
58
59
60while 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
83done
84
85base=`printf dndeta_%07d $nev`
86opts="-l -x"
01541658 87opts1=""
97561a26 88redir=
01541658 89if test $nodraw -lt 1 ; then
90 opts1="-q"
91fi
97561a26 92if 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 96fi
97if 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"
119fi
120
121if 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 129fi
130
131
132#
133# EOF
134#