source: releases/Mars.2014.05.26/datacenter/scripts/runcallisto_mc@ 18027

Last change on this file since 18027 was 10041, checked in by Daniela Dorner, 14 years ago
lock in db instead of lockfile
  • Property svn:executable set to *
File size: 2.8 KB
Line 
1#!/bin/sh
2#
3# ========================================================================
4#
5# *
6# * This file is part of MARS, the MAGIC Analysis and Reconstruction
7# * Software. It is distributed to you in the hope that it can be a useful
8# * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
9# * It is distributed WITHOUT ANY WARRANTY.
10# *
11# * Permission to use, copy, modify and distribute this software and its
12# * documentation for any purpose is hereby granted without fee,
13# * provided that the above copyright notice appear in all copies and
14# * that both that copyright notice and this permission notice appear
15# * in supporting documentation. It is provided "as is" without express
16# * or implied warranty.
17# *
18#
19#
20# Author(s): Daniela Dorner 07/2010 <mailto:daniela.dorner@unige.ch>
21# Christian Farnier 07/2010 <mailto:christian.farnier@unige.ch>
22#
23# Copyright: MAGIC Software Development, 2000-2010
24#
25#
26# ========================================================================
27#
28# This script is launching the calibration of mc sequences.
29#
30
31source `dirname $0`/sourcefile
32printprocesslog "INFO starting $0"
33program=callisto
34step=Callisto
35
36set -C
37
38# get sequence #
39numchanged=0
40while (( 0 < 21 ))
41do
42 if ! [ $numchanged -eq 1 ]
43 then
44 if ! [ "$sequence" = "" ] && ! [ "$cereskey" = "" ]
45 then
46 printprocesslog "INFO $program for sequence $sequence cereskey $cereskey is already running => request new number "
47 fi
48 gettodo "1"
49 sequence=${primaries[0]}
50 cereskey=${primaries[1]}
51 if [ "$sequence" = "" ] || [ "$cereskey" = "" ]
52 then
53 printprocesslog "INFO nothing to do for $program "
54 fi
55 else
56 printprocesslog "INFO starting $program for sequence $sequence cereskey $cereskey"
57 break
58 fi
59 setstatus "start"
60done
61
62cd $mars
63
64# run calibration for sequence
65
66# define files and paths
67sequfile="$mcsequpath/`printf %08d $sequence | cut -c 1-4`/sequence`printf %08d $sequence`.txt"
68outpath=$mcpath/$program/`printf %03d $cereskey`/`printf %08d $sequence | cut -c 1-4`/`printf %08d $sequence | cut -c 5-8`
69makedir $outpath
70log=$outpath/$program`printf %08d $sequence`
71callistorc=$setuppath/$program/`printf %03d $cereskey`/callisto.rc
72inpath=$mcpath/ceres/`printf %03d $cereskey`/`printf %08d $sequence | cut -c 1-4`/`printf %08d $sequence | cut -c 5-8`
73
74command="./callisto -b -q -v4 -f --out=$outpath --ind=$inpath --log=$log.log --html=$log.html --config=$callistorc $sequfile"
75printprocesslog "INFO executing "$command
76$command
77check1=$?
78
79case $check1 in
80 0) printprocesslog "INFO $program finished successfully for sequence $sequence cereskey $cereskey (return code $check1)"
81 ;;
82 *) printprocesslog "ERROR $program failed for sequence $sequence cereskey $cereskey (return code $check1)"
83 check=$check1
84 ;;
85esac
86
87setstatus "stop"
88
89finish
90
Note: See TracBrowser for help on using the repository browser.