Index: trunk/WuerzburgSoft/Thomas/mphys/Changelog
===================================================================
--- trunk/WuerzburgSoft/Thomas/mphys/Changelog	(revision 1474)
+++ trunk/WuerzburgSoft/Thomas/mphys/Changelog	(revision 1475)
@@ -1,4 +1,11 @@
                                                                   -*-*- END -*-*-
- 2002/06/29: Thomas Bretz
+ 2002/08/02: Thomas Bretz
+
+   * MCascade.[h,cc]:
+     - doesn't overwrite existing files anymore
+
+
+
+ 2002/07/29: Thomas Bretz
 
    * MCascade.[h,cc]:
@@ -10,5 +17,5 @@
 
 
- 2002/06/29: Thomas Bretz
+ 2002/07/29: Thomas Bretz
 
    * MElectron.[h,cc]:
@@ -52,5 +59,5 @@
 
 
- 2002/06/26: Thomas Bretz
+ 2002/07/26: Thomas Bretz
 
    * MParticle.[h,cc]:
@@ -73,5 +80,5 @@
 
 
- 2002/06/21: Thomas Bretz
+ 2002/07/21: Thomas Bretz
 
    * MElectron.cc:
Index: trunk/WuerzburgSoft/Thomas/mphys/MCascade.cc
===================================================================
--- trunk/WuerzburgSoft/Thomas/mphys/MCascade.cc	(revision 1474)
+++ trunk/WuerzburgSoft/Thomas/mphys/MCascade.cc	(revision 1475)
@@ -84,5 +84,11 @@
 TFile *MCascade::OpenFile(TString fFilename)
 {
-    TFile *fFile = new TFile(fFilename, "RECREATE", "Intergalactic cascade", 9);
+    TFile *fFile = new TFile(fFilename, "CREATE", "Intergalactic cascade", 9);
+
+    if (fFile->IsZombie())
+    {
+        delete fFile;
+        return NULL;
+    }
 
     Write("Setup");
@@ -342,5 +348,5 @@
 void MCascade::SetEnergyBins(Int_t n, Double_t lo, Double_t hi)
 {
-    fNumBins = n;      // number of bins produced in energy spectrum
+    fNumBins = n;  // number of bins produced in energy spectrum
 
     fELo = lo;     // lower limit of displayed spectrum
@@ -357,4 +363,14 @@
 {
     fIsBatch = gROOT->IsBatch() ? kFALSE : draw;
+
+    // ------------------------------
+
+    cout << "Output File '" << filename << "'... " << flush;
+
+    TFile *file=OpenFile(filename);
+    if (!file)
+        return;
+
+    // ------------------------------
 
     cout << "R = " << fSrcR << "kpc" << endl;
@@ -403,10 +419,4 @@
     // ------------------------------
 
-    cout << "Output File... " << flush;
-
-    TFile *file=OpenFile(filename);
-
-    // ------------------------------
-
     cout << "Timers... " << flush;
 
