source: trunk/MagicSoft/Mars/mtemp/mwuerzburg/scripts/runped@ 5138

Last change on this file since 5138 was 4090, checked in by merck, 21 years ago
Merck: Changed to loop automatically over all dates
  • Property svn:executable set to *
File size: 2.2 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): Martin Merck 05/2004 <mailto:merck@astro.uni-wuerzburg.de>
21#
22# Copyright: MAGIC Software Development, 2000-2004
23#
24#
25# ========================================================================
26
27#/////////////////////////////////////////////////////////////////////////////
28#
29# runped
30#
31# This scripts runs the macro "stdPed.C" for all files of a period.
32# It writes the data card file "marsconfig" for each pedestal file which shall.
33# be processed and then calls root to execute the macro in batch mode.
34#
35#
36BASEPATH=/data/MAGIC/Period015
37ROOTDIR=rootdata2
38
39DATES=`ls -d -1 $BASEPATH/$ROOTDIR/20* | cut -d/ -f6 '-'`
40for DATE in $DATES
41do
42
43 INDIR=$BASEPATH/$ROOTDIR/$DATE/
44 OUTDIR=$BASEPATH/calibdata/$DATE/
45 if [ ! -d $OUTDIR ]
46 then
47 echo $DATE
48 mkdir $OUTDIR
49 fi
50
51 PEDFILES=`ls -1 $INDIR/*_P_*.root | cut -d_ -f4 '-'`
52
53 MARSFILE=./marsconfig
54 LOGFILE=$OUTDIR/Pedestal.log
55
56 TIME=`date`
57 echo "-----------------------------------------------------------------" > $LOGFILE
58 echo " PEDESTAL calc started $TIME" >> $LOGFILE
59 echo "-----------------------------------------------------------------" >> $LOGFILE
60
61#
62# For each pedestal file, create the "marsconfig" data card file
63# and run the macro "stdPed.C" in root using batch mode
64#
65 for I in $PEDFILES
66 do
67 echo "inpath: $INDIR" > $MARSFILE
68 echo "outpath: $OUTDIR" >> $MARSFILE
69 echo "pedfile001: $I" >> $MARSFILE
70 root -b -l -q stdPed.C >> $LOGFILE
71 done
72done
Note: See TracBrowser for help on using the repository browser.