source: trunk/DataCheck/Processing/RunCallisto.sh@ 17997

Last change on this file since 17997 was 17892, checked in by Daniela Dorner, 10 years ago
improved logging
  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/bin/bash
2#
3
4source `dirname $0`/../Sourcefile.sh
5printprocesslog "INFO starting $0"
6program=RunCallisto
7step=Callisto
8
9set -C
10
11for (( i=0; i<100; i++ ))
12do
13 # get todo list
14 gettodo "1"
15
16 # get all needed variables
17 night=${primaries[0]}
18 seqid=${primaries[1]}
19 nightpath=`echo $night | cut -c 1-4`"/"`echo $night | cut -c 5-6`"/"`echo $night | cut -c 7-8`
20 seqnum=$night"_"`printf %03d $seqid`
21
22 # check if script is already running
23 lockfile=$lockpath"/lock-"$program"-"$seqnum".txt"
24 checklock continue
25 printprocesslog "INFO got todo with try #"$i
26 break
27done
28
29# get all needed paths and files
30seqfile=$seqpath"/"$nightpath"/"$seqnum".seq"
31outpath=$datapath"/callisto/"$nightpath
32makedir $outpath
33logfile=$outpath"/"$seqnum"-calibration.log"
34
35cd $mars
36
37# run callisto
38printprocesslog "INFO starting callisto.C for sequence "$seqnum
39setstatus "start"
40
41check1=`root -q -b fact/analysis/callisto.C\("\"$seqfile\""\,"\"$outpath\""\) | tee $logfile | intgrep`
42
43case $check1 in
44 0) printprocesslog "INFO callisto was successful for sequence "$seqnum" (check1=$check1)"
45 ;;
46 *) printprocesslog "ERROR callisto.C failed for sequence "$seqnum" (check1=$check1)"
47 check=$check1
48 ;;
49esac
50
51setstatus "stop"
52
53finish
54
Note: See TracBrowser for help on using the repository browser.