]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/scripts/OCDBscan/jdl/HowTo-CalibSummary.txt
Creation of the calibration summary files on Alien
[u/mrichter/AliRoot.git] / TPC / scripts / OCDBscan / jdl / HowTo-CalibSummary.txt
1 NOTE: for all the steps, you need a valid alien certificate (obviously ;-) )
2 alien-token-init
3 source /tmp/gclient_env_$USERID
4
5
6 +++++++ STEP 1 +++++++++++++
7
8 Create a run.list file which contains the run number in which you 
9 are interested in:
10
11 see for example: $ALICE_ROOT/TPC/scripts/OCDBscan/makeRunList.sh
12
13 ####################
14 #!/bin/sh
15 # find a list of runs which have the following OCDB entries
16 # GRP, HV, ALTRO
17
18 prefix=/alice/data/2010/OCDB/
19
20 alien_find $prefix/GRP/GRP/Data Run > grpAlien.txt
21 alien_find $prefix/TPC/Calib/HighVoltage Run > hvAlien.txt
22 alien_find $prefix/TPC/Calib/AltroConfig Run > altroAlien.txt
23
24 cat grpAlien.txt | sed s/_/\ /g | gawk '{ print $2}' | sort > grp.txt
25 cat hvAlien.txt | sed s/_/\ /g | gawk '{ print $2}'  | sort > hv.txt
26 cat altroAlien.txt | sed s/_/\ /g | gawk '{ print $2}'  | sort > altro.txt
27
28 for run in `cat hv.txt | sort`; do
29    grun=`cat grp.txt | grep -c $run`
30    arun=`cat altro.txt | grep -c $run`   
31    if [ $grun -gt 0 ] && [ $arun -gt 0 ]; then
32       echo $run
33    fi 
34 done > runList.txt
35 # clean up
36 rm grpAlien.txt hvAlien.txt altroAlien.txt grp.txt hv.txt altro.txt
37
38 ###################
39
40 +++++++ STEP 2 +++++++++++++
41
42 Submit the alienjobs (one job per run)
43 but skip already existing entries ...
44 Note1: PATHtoOUTPUT is usually defined in your jdl!
45
46 Note2: check your job status with e.g. `alien_ps`
47
48
49 ####################
50 #!/bin/sh
51 # submit an alienjob per entry in the runList.txt
52
53 PATHtoOUTPUT="/alice/cern.ch/user/s/srossegg/CalibSummary/output/"
54
55 for RUN in `cat runList.txt`; do
56 alien_find $PATHtoOUTPUT run$RUN        
57     entry=`alien_find $PATHtoOUTPUT run$RUN`
58     if [ "$entry" = "" ]
59        then
60        echo "Submitting job to produce the calib summary for run $RUN"
61        alien_submit CalibSummary.jdl $RUN
62     else
63        echo "The calib summary for run $RUN was already created! Skipping entry ..."
64     fi
65
66 done;
67
68 ###################
69
70 +++++++ STEP 3 +++++++++++++
71
72 print a list of all the produced calibSummary entries and copy them to 
73 a local directory (if wished)
74
75 ###################
76 #!/bin/sh
77 # list and copy the created calibSummary files ...
78
79 PATHtoOUTPUT="/alice/cern.ch/user/s/srossegg/CalibSummary/output/"
80 alien_find $PATHtoOUTPUT calibSum
81
82 # copy them to one direcotory
83 ENTRIES=`alien_find $PATHtoOUTPUT calibSum | grep calibSum`
84 COPYPATH="./"
85 for ENTRY in $ENTRIES; do
86     alien_cp alien:$ENTRY $COPYPATH 
87 done;
88
89 ##### don't do the following if you are not sure #######
90
91 # or delete the entries on alien
92 ENTRIES=`alien_find $PATHtoOUTPUT calibSum | grep calibSum`
93 for ENTRY in $ENTRIES; do
94     alien_erase $ENTRY
95 done;
96
97 ###################