source: branches/removing_cpp11_features/fact/analysis/gain/extract_aux.sh@ 18558

Last change on this file since 18558 was 17372, checked in by tbretz, 11 years ago
Updated to use extract_aux.C
  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#!/bin/bash
2
3macro=$PWD/extract_aux.C
4outpath=$PWD/aux
5
6mkdir -p $outpath
7cp ${macro} ${outpath}
8
9where="(((fNumPedestalTrigger=3000 OR fNumPedestalTrigger=5000) AND fRunTypeKey=2) OR (fNumPedestalTrigger=10000 AND fRunTypeKey=3) OR fRunTypeKey=17)"
10wheredrs="(drs.fROI=single.fROI AND fDrsStep=2)"
11
12query="SELECT Concat(fNight, '_', fRunID, '_', (SELECT fRunID FROM RunInfo \`drs\` WHERE drs.fNight=single.fNight AND "$wheredrs" AND single.fRunID<30+drs.fRunID ORDER BY ABS(CAST(single.fRunID AS SIGNED) - CAST(drs.fRunID AS SIGNED)) ASC LIMIT 0,1)) AS num "
13query=$query" FROM RunInfo \`single\` WHERE "$where" AND fNight>20130306 ORDER BY fNight DESC"
14
15runpairs=( `mysql -u factread --password=r3adfac! --host=lp-fact factdata -s -e "$query"` )
16
17for runpair in ${runpairs[@]}
18do
19 if [ $runpair = 'NULL' ]
20 then
21 continue
22 fi
23
24 night=`echo $runpair | cut -d_ -f1`
25 run=`echo $runpair | cut -d_ -f2`
26 runnum=`printf %03d $run`
27
28 log=$outpath"/"$night"_"$runnum
29
30 outfile=$outpath/${night}_${runnum}.root
31
32 if [ -e $outfile ]
33 then
34 continue
35 fi
36
37 cd ~/Mars
38
39 cmd="ROOT_HIST=0 ${ROOTSYS}/bin/root -q -b -l ${macro}+\($night,$run,\\\"${outfile}\\\"\)"
40
41 echo "date; echo '${cmd}'; ${cmd}" | qsub -N t${night}${runnum} -q test -cwd -e ${log}".err" -o ${log}".log"
42
43 cd - > /dev/null
44done
45
46
Note: See TracBrowser for help on using the repository browser.