forked from qi-feng/dqm_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
analyze_hilolist.scr
executable file
·54 lines (44 loc) · 3.22 KB
/
analyze_hilolist.scr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
#$1 Runlist with date, run number and laser number
datadir=/raid/reedbuck/veritas/data
lcl="$PWD"
{
while read date data laser laseragain laseragain2 laseragain3; do
sgeFile=$lcl'/VEGAS_hilo'$data'.pbs'
echo "#"PBS -l walltime=10:00:00 >$sgeFile
#echo "#"PBS -l pvmem=5gb >>$sgeFile
echo cd $lcl >>$sgeFile
if [ ! -f $data"st1_hilo.root" ]; then
echo "Running VEGAS stage 1 for data $datadir/d$date/$data.cvbf"
echo /raid/biggams/qfeng/veritas/vegas-v2_5_4/bin/vaStage1 -LGDL_LoGainRatioPostUpgrade=1.0 -LGDL_LoGainRatioPreUpgrade=1.0 -LGDL_LoGainRatio=1.0 -Stage1_RunMode=data $datadir/d$date/$data.cvbf $data"st1_hilo.root" > $data"st1_hilo.log" >>$sgeFile
else
echo "VEGAS stage 1 data root file $data"st1_hilo.root" exists."
fi
laser_date=$(mysql VERITAS -h romulus.ucsc.edu -u readonly <<<"SELECT db_start_time FROM tblRun_Info where run_id=$laser;");
read dbname laserdate lasertime <<<$(IFS=" "; echo $laser_date)
read -ra laserdate <<< $(echo "$laserdate" |sed 's/-//g')
if [ ! -f "${laser}st1_flasher.root" ]; then
echo "Running VEGAS stage 1 for flasher $datadir/d$laserdate/$laser.cvbf"
echo /raid/biggams/qfeng/veritas/vegas-v2_5_4/bin/vaStage1 -Stage1_RunMode=flasher $datadir/d$laserdate/$laser.cvbf "${laser}st1_flasher.root >${laser}st1_flasher.log" >>$sgeFile
else
echo "VEGAS stage 1 flaser file ${laser}st1_flasher.root exists."
fi
if [ ! -f $data"st2_hilo_highWindow7lowWindow7.root" ]; then
echo "Running VEGAS stage 2 for data ${data}st1_hilo.root with 7-sample window"
echo cp "${data}st1_hilo.root ${data}st2_hilo_highWindow7lowWindow7.root" >>$sgeFile
echo /raid/biggams/qfeng/veritas/vegas-v2_5_4/bin/vaStage2 -TW_HighGainWindowWidth=7 -TW_LowGainWindowWidth=7 -LGDL_LoGainRatioPostUpgrade=1.0 -LGDL_LoGainRatioPreUpgrade=1.0 -LGDL_LoGainRatio=1.0 -G_NumEventsToAnalyse=12000 -Stage2_WriteCalibratedEvents=true $datadir/d$date/$data.cvbf "${data}st2_hilo_highWindow7lowWindow7.root ${laser}st1_flasher.root > ${data}st2_hilo_highWindow7lowWindow7.log" >>$sgeFile
else
echo "VEGAS stage 2 7-sample data root file ${data}st2_hilo_highWindow7lowWindow7.root exists."
fi
if [ ! -f $data.st2_hilo_highWindow16lowWindow16.root ]; then
echo "Running VEGAS stage 2 for data ${data}st1_hilo.root with 16-sample window"
echo cp "${data}st1_hilo.root ${data}st2_hilo_highWindow16lowWindow16.root" >>$sgeFile
echo /raid/biggams/qfeng/veritas/vegas-v2_5_4/bin/vaStage2 -TW_HighGainWindowWidth=16 -TW_LowGainWindowWidth=16 -LGDL_LoGainRatioPostUpgrade=1.0 -LGDL_LoGainRatioPreUpgrade=1.0 -LGDL_LoGainRatio=1.0 -G_NumEventsToAnalyse=12000 -Stage2_WriteCalibratedEvents=true $datadir/d$date/$data.cvbf "${data}st2_hilo_highWindow16lowWindow16.root ${laser}st1_flasher.root > ${data}st2_hilo_highWindow16lowWindow16.log" >>$sgeFile
else
echo "VEGAS stage 2 16-sample data root file $data.st2_hilo_highWindow16lowWindow16.root exists."
fi
chmod 700 $sgeFile
qsub -l nodes=reedbuck -q batch -V -e 'VEGAS_hilo'$data'.err' -o 'VEGAS_hilo'$data'.log' $sgeFile
done
} <$1
echo "Done!"