source: trunk/Mars/datacenter/scripts/runchimp@ 12608

Last change on this file since 12608 was 9504, checked in by Daniela Dorner, 15 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 2.9 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 04/2009 <mailto:daniela.dorner@unige.ch>
21#
22# Copyright: MAGIC Software Development, 2000-2009
23#
24#
25# ========================================================================
26#
27
28rootsys=/opt/root5.20.x86_64
29source `dirname $0`/sourcefile
30printprocesslog "INFO starting $0"
31program=chimp
32column=fChimp
33chimpdir=/home/dorner/Chimp
34export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$chimpdir/hessioxxx/lib:.
35
36set -C
37
38node=`echo $HOSTNAME | sed -e 's/compute-0-//' -e 's/[.]local//'`
39#printprocesslog "INFO $program is running on node $node"
40# get run #
41gettodo "1" $node
42run=${primaries[0]}
43
44# lock sequ
45lockfile=$lockpath/lock-$table-$column-$run.txt
46checklock
47
48printprocesslog "INFO starting $program for run $run"
49
50#get particle for file name
51particles[1]="gamma"
52particles[14]="proton"
53particles[6]="muon"
54particles[3]="electron"
55query="select fParticleTypeKEY from MCRunData where fMCRunNumber=$run"
56key=( `mysql -P 3306 -u operator --password=Ics+eMM! --host=mysql.isdc.unige.ch CTA_MC -s -e "$query"` )
57particle=${particles[$key]}
58infile=$mcpath/simtel/cta-ultra3/0.0deg/Data/${particle}_20deg_90deg_run`printf '%06d' ${run}`___cta-ultra3_desert.simtel.gz
59outfile=$mcpath/chimp/cta-ultra3/0.0deg/Data/${particle}_20deg_90deg_run`printf '%06d' ${run}`___cta-ultra3_desert.root
60outpath=$mcpath/chimp/cta-ultra3/0.0deg/Data
61logfile=$outpath/chimp_run`printf '%06d' ${run}`.log
62makedir $outpath
63chimppath=/home/dorner/data/chimp
64clusterchimppath=/state/cta/chimp
65makedir $chimppath
66
67
68setstatus "start"
69
70cd $chimpdir
71
72printprocesslog "INFO ./chimp $infile >| $logfile 2>&1 "
73./chimp $infile >| $logfile 2>&1
74check1=$?
75
76case $check1 in
77 0) printprocesslog "INFO $program finished successfully for run $run (check1=$check1)"
78# if ! cp $outfile $chimppath
79 if ! scp $outfile $clusterchimppath
80 then
81 printprocesslog "ERROR copying $outfile to $chimppath failed"
82 com=$Fchimpcp
83 check=2
84 else
85 printprocesslog "INFO copied $outfile successfully to $chimppath"
86 fi
87 ;;
88 *) printprocesslog "ERROR $program failed for run $run (check1=$check1)"
89 com=$Fchimp
90 check=$check1
91 ;;
92esac
93
94setstatus "stop"
95
96finish
97
Note: See TracBrowser for help on using the repository browser.