Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 8807)
+++ trunk/MagicSoft/Mars/Changelog	(revision 8828)
@@ -18,4 +18,11 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2008/01/24 Daniel Hoehne
+
+   * scripts/preparemc:
+     - adapted to new rawfile/camera structure in /magic/montecarlo
+
+
 
  2008/01/14 Thomas Bretz
Index: trunk/MagicSoft/Mars/scripts/preparemc
===================================================================
--- trunk/MagicSoft/Mars/scripts/preparemc	(revision 8807)
+++ trunk/MagicSoft/Mars/scripts/preparemc	(revision 8828)
@@ -18,4 +18,5 @@
 #
 #   Author(s): Daniela Dorner  05/2006 <mailto:dorner@astro.uni-wuerzburg.de>
+#   Author(s): Daniel Hoehne   11/2007 <mailto:hoehne@astro.uni-wuerzburg.de>
 #
 #   Copyright: MAGIC Software Development, 2000-2007
@@ -37,7 +38,7 @@
 # - zdmin    minimum zenith distance
 # - zdmax    maximum zenith distance
-# - psf      psf (at the moment mc with psf 14 and 20 is available)
-# - modes    observation mode
-#              the explanation for the modes can be found in 
+# - psf      add. spot size before camera
+# - mode     production mode of the mcs
+#              the explanation for the modes can be found in the text and in
 #              /magic/montecarlo/rawfiles/README.txt
 # - numruns  number  of runs, that are in the sequence file, which are used 
@@ -55,5 +56,5 @@
 
 # to be set by the user
-path=/home/dorner/final_analysis
+path=~
 # path where your mc sequence and dataset files are stored
 mcoutpath=$path/mc
@@ -62,14 +63,22 @@
 
 # zenith range of your data
-zdmin=17
-zdmax=36
-# point spread function of your data
-psf=14
-# observation mode of your data
-#  for explanations see /magic/montecarlo/rawfiles/README.txt
-modes=( "02" ) 
+zdmin=7
+zdmax=25
+# additional spotsize (before camera) for the mcs. You can calculate it with Sqrt(psf(real data)*psf(real data) - 25)
+psf=15
+# production mode of your data
+#  available observation modes:  On (please leave modes empty: ""), Wobble ("W1", "W2"), Fake Wobble ("FW"), Diffuse ("Diff")
+#  you can combine these with:   high energy (harder spectrum: "HE")
+#  particle type:                "Muon", "Gamma" or "Proton"
+#  remark: first the particle, then the spectrum and the observation mode at the end: Examples mode="GammaHEFW" or "ProtonDiff" or "GammaW1"
+# please have also a look into /magic/montecarlo/rawfiles/README.txt
+# you can also use asterisks, e.g.: "GammaW*" for W1 and W2
+mode="GammaW1"
+#  epoch for which the mc were produced
+#  available epochs: MC_old MC_April_May06 MC_post_June06 MC_MuxFADCs MCMuxFADCs_NEW (last one is for Mux data with reduced fadc slices number)
+epos=( "MC_Old" ) 
 # number of runs which are in the sequence files used for training
 # please adjust this number such, that you use about 30000 Events for training
-numruns=1
+numruns=2
 
 
@@ -80,5 +89,5 @@
 if ! [ -e $mcoutpath ]
 then
-   echo "Your outpath for the mc $mcoutpathdoes not exist."
+   echo "Your outpath for the mc $mcoutpath does not exist."
    exit
 fi
@@ -100,4 +109,5 @@
 mcpath=/magic/montecarlo 
 
+
 zbinmin=`echo "scale=2 ; 100*(1 - c($zdmin*3.14/180))+1" | bc -l`
 zbinmax=`echo "scale=2 ; 100*(1 - c($zdmax*3.14/180))+1" | bc -l`
@@ -108,14 +118,53 @@
 echo "zd:   min: $zdmin max: $zdmax"
 echo "zbin: min: $zbinmin max: $zbinmax"
-echo "$numruns runs are classified as test the rest as train"
+echo "$numruns runs are classified as test, the rest as train"
 
 j=0
-for mode in $modes
+for epo in $epos
 do 
    for (( i=$zbinmin ; i < $zbinmax ; i++ ))
    do 
+      #depending on the epoch you need different P and C runs and time codes
+      case "$epo" in
+
+         "MC_up_to_April06")
+            prun=272
+            crun=273
+            time="03"
+            ;;
+         "MC_old")
+            prun=4223
+            crun=4224
+            time="03"
+            ;;
+         "MC_April_May06")
+            prun=272
+            crun=273
+            time="02"
+            ;;
+         "MC_post_June06")
+            prun=1048
+            crun=1049
+            time="02"
+            ;;
+         "MC_MuxFADCs")
+            prun=3919
+            crun=3920
+            time="01"
+            ;;
+         "MC_MuxFADCs_NEW")
+            prun=270
+            crun=271
+            time="01"
+            ;;
+         *)
+            echo "Wrong epoch $epo , please specify a valid epoch"
+            continue
+            ;;
+      esac
+
       zbin=`printf %02d $i`
-      path=$mcpath/rawfiles/19$zbin/$mode/$psf
-      runs=(`ls $path | grep Gamma | cut -d_ -f2 | sed -e 's/^0//g' -e 's/^0//g' -e 's/^0//g' -e 's/^0//g' -e 's/^0//g' -e 's/^0//g' | tr "\n" " "`)
+      path=$mcpath/rawfiles/19$zbin/$time/$psf
+      runs=(`ls $path | grep $mode | cut -d_ -f2 | sed -e 's/^0//g' -e 's/^0//g' -e 's/^0//g' -e 's/^0//g' -e 's/^0//g' -e 's/^0//g' -e 's/^0//g' | tr "\n" " "`)
       if [ "$runs" = "" ]
       then
