]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis/Run.sh
Fixed references from PWG2 -> PWGLF - very efficiently done using ETags.
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis / Run.sh
CommitLineData
601f27d9 1#!/bin/sh
2
3nev=10000
4noanal=0
5nodraw=0
6rebin=1
7vzmin=-10
8vzmax=10
9type=
10cms=900
11
12usage()
13{
14cat<<EOF
15Usage: $0 [OPTIONS]
16
17Run analysis and visualize it using HHD analysis code
18
19Options:
20 -h,--help This help
21 -N,--no-analysis Do not analyse, just draw ($noanal)
22 -D,--no-draw Do not draw, just analysis ($nodraw)
23 -n,--events N Number of events ($nev)
24 -r,--rebin N Rebin by N ($rebin)
25 -v,--vz-min CM Minimum value of vz ($vzmin)
26 -V,--vz-max CM Maximum value of vz ($vzmax)
27 -t,--trigger TYPE Select trigger TYPE ($type)
28 -e,--energy CMS Center of mass energy ($cms)
29
30TYPE is one of
31
32 INEL
33 INEL>0
34 NSD
35EOF
36}
37
38while test $# -gt 0 ; do
39 case $1 in
40 -h|--help) usage ; exit 0;;
41 -n|--events) nev=$2 ; shift ;;
42 -N|--no-analysis) noanal=$((($noanal+1)%2)) ;;
43 -D|--no-draw) nodraw=$((($nodraw+1)%2)) ;;
44 -r|--rebin) rebin=$2 ; shift ;;
45 -v|--vz-min) vzmin=$2 ; shift ;;
46 -V|--vz-max) vzmax=$2 ; shift ;;
47 -e|--energy) cms=$2 ; shift ;;
48 -t|--type) type="$2" ; shift ;;
49 *) echo "$0: Unknown option '$1'" >> /dev/stderr ; exit 1 ;;
50 esac
51 shift
52done
53
54base=`printf hhd_%07d $nev`
55
56keep_file()
57{
58 file=$1
59 if test -f $file ; then
60 mv $file ${file}.keep
61 fi
62}
63restore_file()
64{
65 file=$1
66 if test -f ${file}.keep ; then
67 mv ${file}.keep ${file}
68 fi
69}
70
71if test $noanal -lt 1 ; then
72 keep_file AnalysisResult.root
73 keep_file AliAODs.root
74
75 aliroot -l -b -q -x RunManager.C\(\".\",$nev\) 2>&1 | tee $base.log
76
77 if test ! -f AnalysisResults.root ; then
78 echo "Analysis failed"
79 restore_file AnalysisResult.root
80 restore_file AliAODs.root
81 exit 1
82 fi
83 echo "Analysis done"
84 rm -f event_stat.root EventStat_temp.root outputs_valid
85 mv AnalysisResults.root ${base}_hists.root
86 if test -f AliAODs.root ; then
87 mv AliAODs.root ${base}_aods.root
88 fi
89 restore_file AnalysisResult.root
90 restore_file AliAODs.root
91fi
92
93
94if test $nodraw -lt 1 ; then
95 rm -f fmd_dNdeta_mult.root
96
97 samp=0
98 tt=`echo $type | tr '[a-z]' '[A-Z]'`
99 case "x$tt" in
100 "xINEL") n="inel"; s="" ; samp=0 ;;
101 "xINEL>0") n="inelgt0"; s="_NSD"; samp=4 ; echo "Using NSD for $tt";;
102 "xNSD") n="nsd"; s="_NSD"; samp=4 ;;
103 *) echo "Unknown type $tt" > /dev/stderr ; exit 1 ;;
104 esac
105
106 aliroot -l -b -q -x \
bd6f5206 107 $ALICE_ROOT/PWGLF/FORWARD/analysis/drawdNdeta.C\(\"${base}_hists.root\",$samp,$rebin,$vzmin,$vzmax,1,$cms\)
601f27d9 108 tmin=`printf %+03d $vzmin | tr '+-' 'pm'`
109 tmax=`printf %+03d $vzmax | tr '+-' 'pm'`
110 out=`printf "hhd_%04dGeV_%s-%scm_rb%02d_%s.root" $cms $tmin $tmax $rebin $n`
111 mv fmd_dNdeta_mult${s}.root $out
112
113 mv fmdana.png `basename $out .root`.png
114fi
115#
116# EOF
117#