]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGPP/CalibMacros/CPass0/test/mergeMakeOCDBUser.sh
test/runCPass0User.sh
[u/mrichter/AliRoot.git] / PWGPP / CalibMacros / CPass0 / test / mergeMakeOCDBUser.sh
1 # Script for testing of the mergemakeOCDB on the grid for user purposes
2 # To be used in case the standard production failed or was not automatically validated
3 # Output objects are writn to the predefined path:
4
5
6 # Parameters for macro:
7 # 1  -   alien user dir name                 - e.g  /m/miranov/
8 # 2  -   input directory with data to merge  - e.g /alice/data/2011/LHC11h/000169926/cpass0_HLT/
9 # 3  -   run number                          - e.g run number 169926
10 # 4  -   OCDB output path                    - alien://folder=/alice/cern.ch/user/m/miranov/CPass0/169926
11 # Example:
12 # run=170572
13 # AlienName=/m/miranov/
14 # $ALICE_ROOT/PWGPP/CalibMacros/CPass0/test/mergeMakeOCDBUser.sh $AlienName /alice/data/2011/LHC11h/000$Run/cpass0_HLT/  $Run alien://folder=/alice/cern.ch/user/m/miranov/CPass0/$Run
15 #
16 # authors:   marian.ivanov#cern.ch, mikolaj.krzewicki@cern.ch 
17
18 AlienName=$1
19 InputDataDir=$2
20 Run=$3
21 OCDBPath=$4
22 InputMacros=$ALICE_ROOT/PWGPP/CalibMacros/CPass0/
23
24 echo xxxxxxxxxxxxxxxxxxxxxxxxxx
25 echo SETUP
26 echo AlienName=$1
27 echo InputDataDir=$2
28 echo Run=$3
29 echo OCDBPath=$4
30 echo InputMacros=$ALICE_ROOT/PWGPP/CalibMacros/CPass0/
31 echo xxxxxxxxxxxxxxxxxxxxxxxxxx
32
33 #
34 # 1. copy macroses and sh to the predefiend alien directory
35 #
36 OutputMacros=`echo /alice/cern.ch/user/j/jotwinow/CPass0/MergeCalibration/ | sed s_\/j\/jotwinow\/_$AlienName\_ `
37 alien_mkdir -p  $OutputMacros
38
39 for lfile in `ls $InputMacros/{*C,*sh,*jdl} | grep -v AddTask`; do
40     bname=`basename $lfile`  
41     echo  Copping alien_cp -n $lfile alien://$OutputMacros/$bname 
42     alien_cp -n $lfile alien://$OutputMacros/$bname
43 done
44 #
45 # 2. Copy shell script and jdl
46 #
47 OutputBin=`echo  /alice/cern.ch/user/j/jotwinow/bin/ | sed s_\/j\/jotwinow\/_$AlienName\_ `
48 echo alien_cp -n $InputMacros/mergeMakeOCDB.sh  alien://$OutputBin/mergeMakeOCDB.sh
49 alien_cp -n  $InputMacros/mergeMakeOCDB.sh  alien://$OutputBin/mergeMakeOCDB.sh
50 cat $InputMacros/mergeMakeOCDB.jdl | sed "s_/j/jotwinow/_${AlienName}_g" > mergeMakeOCDB.jdl
51 echo alien_cp -n mergeMakeOCDB.jdl alien://$OutputMacros/mergeMakeOCDB.jdl
52 alien_cp -n mergeMakeOCDB.jdl alien://$OutputMacros/mergeMakeOCDB.jdl
53
54 #
55 # 3. Copy validation switch off return value - job will alway finish
56 #
57 cat $InputMacros/validationMerging.sh |  sed "s_exit \$error_exit 0_" > validationMerging.sh
58 echo alien_cp  -n validationMerging.sh  alien:///$OutputMacros/validationMerging.sh
59 alien_cp  -n validationMerging.sh  alien:///$OutputMacros/validationMerging.sh
60 #
61 # 4. Submit job
62 #
63 echo alien_submit alien:///$OutputMacros/mergeMakeOCDB.jdl $InputDataDir $Run $OCDBPath
64 alien_submit alien:///$OutputMacros/mergeMakeOCDB.jdl $InputDataDir $Run $OCDBPath &
65 echo Alien job submitted $!
66