source: branches/Mars_use_drstimefiles/datacenter/scripts/runstereo@ 18066

Last change on this file since 18066 was 9504, checked in by Daniela Dorner, 15 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 3.4 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.12.i386
29source `dirname $0`/sourcefile
30printprocesslog "INFO starting $0"
31program=ctastereo
32case $1 in
33 2) column=fStereoB
34 Fctastereo=$FctastereoB
35 outpath=$mcpath/stereoB
36 stereopath=/home/dorner/data/stereoB
37 ;;
38 3) column=fStereoC
39 Fctastereo=$FctastereoC
40 outpath=$mcpath/stereoC
41 stereopath=/home/dorner/data/stereoC
42 ;;
43 7) column=fStereoG
44 Fctastereo=$FctastereoG
45 outpath=$mcpath/stereoG
46 stereopath=/home/dorner/data/stereoG
47 ;;
48 *) printprocesslog "ERROR Unknown commandline option $1"
49 finish
50 ;;
51esac
52bcnmars=/home/dorner/Mars.BCN.2009.03.27.cvs
53
54set -C
55
56node=`echo $HOSTNAME | sed -e 's/compute-0-//' -e 's/[.]local//'`
57printprocesslog "INFO $program (for column $column) is running on node $node"
58# get run #
59gettodo "1" $node
60run=${primaries[0]}
61
62# lock sequ
63lockfile=$lockpath/lock-$table-$column-$run.txt
64checklock
65
66printprocesslog "INFO starting $program for run $run"
67
68#get particle for file name
69particles[1]="gamma"
70particles[14]="proton"
71particles[6]="muon"
72particles[3]="electron"
73query="select fParticleTypeKEY from MCRunData where fMCRunNumber=$run"
74key=( `mysql -P 3306 -u operator --password=Ics+eMM! --host=mysql.isdc.unige.ch CTA_MC -s -e "$query"` )
75particle=${particles[$key]}
76infile=$mcpath/chimp/cta-ultra3/0.0deg/Data/${particle}_20deg_90deg_run${run}___cta-ultra3_desert_I.root
77inpath=$mcpath/star
78infile=$inpath/${particle}_20deg_90deg_run${run}___cta-ultra3_desert_I.root
79outfile=$outpath/${particle}_20deg_90deg_run${run}___cta-ultra3_desert_S.root
80makedir $stereopath
81logfile=$outpath/CTAstereo_run${run}.log
82makedir $outpath
83
84setstatus "start"
85
86cd $bcnmars
87
88printprocesslog "INFO starting: root -q -b macros/CTAstereoSub.C\("\"$infile\""\,"\"$outpath"\"\,"$1"\) | tee $logfile | intgrep"
89check1=`root -q -b macros/CTAstereoSub.C\(\""$infile\""\,\""$outpath\""\,$1\) 2>&1 | tee $logfile | intgrep`
90
91case $check1 in
92 1) printprocesslog "INFO $program finished successfully for run $run (check1=$check1)"
93 if ! cp $outfile $stereopath
94 then
95 printprocesslog "ERROR copying $outfile to $starpath failed"
96 com=$Fctastereocp
97 check=2
98 else
99 printprocesslog "INFO copied $outfile successfully to $starpath"
100 fi
101 ;;
102 *) printprocesslog "ERROR $program failed for run $run (check1=$check1)"
103 com=$Fctastereo
104 check=$check1
105 ;;
106esac
107
108setstatus "stop"
109
110finish
111
Note: See TracBrowser for help on using the repository browser.