| 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 | #
|
|---|
| 36 | BASEPATH=/data/MAGIC/Period015
|
|---|
| 37 | ROOTDIR=rootdata2
|
|---|
| 38 |
|
|---|
| 39 | DATES=`ls -d -1 $BASEPATH/$ROOTDIR/20* | cut -d/ -f6 '-'`
|
|---|
| 40 | select DATE in $DATES "Exit"; do
|
|---|
| 41 | break
|
|---|
| 42 | done
|
|---|
| 43 | if [ "$DATE" = "Exit" ]
|
|---|
| 44 | then
|
|---|
| 45 | exit
|
|---|
| 46 | fi
|
|---|
| 47 |
|
|---|
| 48 | INDIR=$BASEPATH/$ROOTDIR/$DATE/
|
|---|
| 49 | OUTDIR=$BASEPATH/calibdata/$DATE/
|
|---|
| 50 | if [ ! -d $OUTDIR ]
|
|---|
| 51 | then
|
|---|
| 52 | echo $DATE
|
|---|
| 53 | mkdir $OUTDIR
|
|---|
| 54 | fi
|
|---|
| 55 |
|
|---|
| 56 | PEDFILES=`ls -1 $INDIR/*_P_*.root | cut -d_ -f4 '-'`
|
|---|
| 57 |
|
|---|
| 58 | MARSFILE=./marsconfig
|
|---|
| 59 | LOGFILE=$OUTDIR/Pedestal.log
|
|---|
| 60 |
|
|---|
| 61 | TIME=`date`
|
|---|
| 62 | echo "-----------------------------------------------------------------" > $LOGFILE
|
|---|
| 63 | echo " PEDESTAL calc started $TIME" >> $LOGFILE
|
|---|
| 64 | echo "-----------------------------------------------------------------" >> $LOGFILE
|
|---|
| 65 |
|
|---|
| 66 | #
|
|---|
| 67 | # For each pedestal file, create the "marsconfig" data card file
|
|---|
| 68 | # and run the macro "stdPed.C" in root using batch mode
|
|---|
| 69 | #
|
|---|
| 70 | for I in $PEDFILES
|
|---|
| 71 | do
|
|---|
| 72 | echo "inpath: $INDIR" > $MARSFILE
|
|---|
| 73 | echo "outpath: $OUTDIR" >> $MARSFILE
|
|---|
| 74 | echo "pedfile001: $I" >> $MARSFILE
|
|---|
| 75 | root -b -q stdPed.C >> $LOGFILE
|
|---|
| 76 | done
|
|---|