Change of module numbers for display purposes
[u/mrichter/AliRoot.git] / ITS / macrosSDD / RunQAonSingleChunk.sh
1 #!/bin/bash
2 RUN='123456'
3 PERIOD='LHC10a'
4 PASS='pass1'
5 YEAR='2010'
6 ALICE_ITS='$ALICE_ROOT/ITS'
7 TMPPLACE='/tmp'
8 TMPFOLDER='1'
9 EXECFOLDER='$HOME/macroQAshifter'
10 MAXFILES='300'
11 FILENAME='10000137137031.300.root'
12 FULLNAME='$PWD/$FILENAME'
13 echo "Run Number   :[${RUN}]"
14 read
15 if [ "$REPLY" != "" ]; then
16 RUN=$REPLY
17 echo "Run   $RUN"
18 fi
19 echo "Period        :[${PERIOD}]"
20 read
21 if [ "$REPLY" != "" ]; then 
22 PERIOD=$REPLY
23 echo "Period  $PERIOD"
24 fi
25 echo "Pass           : [${PASS}]"
26 read
27 if [ "$REPLY" != "" ]; then
28 PASS=$REPLY
29 echo "Pass       $PASS "
30 fi
31 echo "Year      :[${YEAR}]"
32 read
33 if [ "$REPLY" != "" ]; then
34 YEAR=$REPLY
35 echo "Year    $YEAR"
36 fi
37 echo "FileName (if it is a LOCAL file, please insert the full path)      :  [${FILENAME}]"
38 read
39 if [ "$REPLY" != "" ]; then
40 FILENAME=$REPLY
41 fi
42 echo "FileName    ${FILENAME}"
43 echo "folder with macros     :[${EXECFOLDER}]"
44 read
45 if [ "$REPLY" != "" ]; then
46 EXECFOLDER=$REPLY
47 echo "Folder:    $EXECFOLDER"
48 fi
49 echo "local file or alienfile (1=local 2=alien)   :[${TMPFOLDER}]"
50 read
51 if [ "$REPLY" != "" ]; then
52 TMPFOLDER=$REPLY
53 fi
54 if [ "$TMPFOLDER" == "1" ]; then
55 FULLNAME=$FILENAME
56 else
57 FULLNAME=alien:///alice/data/${YEAR}/${PERIOD}/000${RUN}/raw/${FILENAME}
58 fi
59 echo "FullName   ${FULLNAME}"
60 if [ ls -l "run$RUN" >/dev/null 2>&1 ]; then
61 echo "directory run$RUN exists "
62 else
63 mkdir "run$RUN"
64 fi
65 cd "run$RUN"
66 if [ ls -l $PASS > /dev/null 2>&1 ]; then
67 echo "directory $PASS exixsts"
68 else
69 mkdir $PASS
70 cd $PASS
71 fi
72 time aliroot -l <<EOI|tee execQA$RUN.log
73 EOF
74 .L $EXECFOLDER/ITSQArecoparam.C++
75  ITSQArecoparam("${FULLNAME}",2,30); 
76 .q
77 EOI
78 time aliroot -l <<EOI|tee plot$RUN.log
79 .x $EXECFOLDER/PlotQASDD.C("ITS.QA.${RUN}.root");
80 .q
81 EOI
82 if [ls -l "images" >/dev/null 2>&1 ]; then
83 echo "directory images exists"
84 else
85 mkdir images
86 fi
87 mv *.ps images/.
88 cd images
89 for i in  *.ps;
90 do
91 gv $i & 
92 sleep 2
93 done
94 echo "Plots Done!!"
95 rm -rf $TMPPLACE/*.root
96 cd ../../../