Index: /trunk/WuerzburgSoft/Thomas/mphys/Changelog
===================================================================
--- /trunk/WuerzburgSoft/Thomas/mphys/Changelog	(revision 1461)
+++ /trunk/WuerzburgSoft/Thomas/mphys/Changelog	(revision 1462)
@@ -1,3 +1,13 @@
                                                                   -*-*- END -*-*-
+ 2002/06/29: Thomas Bretz
+
+   * MCascade.[h,cc]:
+     - replaces draw by fIsBatch, using gROOT->IsBatch in addition.
+
+   * MFit.h:
+     - added default=0 to SetParameter for min and max
+
+
+
  2002/06/29: Thomas Bretz
 
Index: /trunk/WuerzburgSoft/Thomas/mphys/MCascade.cc
===================================================================
--- /trunk/WuerzburgSoft/Thomas/mphys/MCascade.cc	(revision 1461)
+++ /trunk/WuerzburgSoft/Thomas/mphys/MCascade.cc	(revision 1462)
@@ -292,5 +292,6 @@
         Esum += ProcessGammas(fListGammas, fListElectrons, weight);
 
-        fListGammas.ForEach(MPhoton, Fill)(fHist, fDisplayIndex, weight);
+        if (!fIsBatch)
+            fListGammas.ForEach(MPhoton, Fill)(fHist, fDisplayIndex, weight);
         fListGammas.Delete();
 
@@ -355,4 +356,6 @@
 void MCascade::Run(TString filename, Bool_t draw)
 {
+    fIsBatch = gROOT->IsBatch() ? kFALSE : draw;
+
     cout << "R = " << fSrcR << "kpc" << endl;
     cout << "Z = " << fSrcZ << endl;
@@ -371,5 +374,5 @@
     TCanvas *c=NULL;
 
-    if (draw)
+    if (!fIsBatch)
     {
         fHist.SetMinimum(pow(fELo, fSpectralIndex+fDisplayIndex)/100);
@@ -409,5 +412,5 @@
 
     TTimer timer("gSystem->ProcessEvents();", 333, kFALSE);
-    if (draw)
+    if (!fIsBatch)
         timer.TurnOn();
 
@@ -426,5 +429,7 @@
             Double_t E = GetEnergy();
             Double_t weight = pow(E, fSpectralIndex);
-            histsrc.Fill(E, pow(E, fDisplayIndex) * weight);
+
+            if (!fIsBatch)
+                histsrc.Fill(E, pow(E, fDisplayIndex) * weight);
 
             cout << "--> " << n << ". " << Form("%d: %3.1e", (int)(starttime+fRuntime-TStopwatch::GetRealTime()), E) << flush;
@@ -432,5 +437,5 @@
             ProcessPrimaryGamma(E, weight);
 
-            if (!draw)
+            if (fIsBatch)
                 continue;
 
@@ -458,5 +463,5 @@
     // ------------------------------
 
-    if (draw)
+    if (!fIsBatch)
     {
         c->Clear();
Index: /trunk/WuerzburgSoft/Thomas/mphys/MCascade.h
===================================================================
--- /trunk/WuerzburgSoft/Thomas/mphys/MCascade.h	(revision 1461)
+++ /trunk/WuerzburgSoft/Thomas/mphys/MCascade.h	(revision 1462)
@@ -46,4 +46,6 @@
     TH1D fHist; //!
 
+    Bool_t fIsBatch; //!
+
     Double_t GetEnergy();
     TFile *OpenFile(TString fFilename);
Index: /trunk/WuerzburgSoft/Thomas/mphys/MFit.h
===================================================================
--- /trunk/WuerzburgSoft/Thomas/mphys/MFit.h	(revision 1461)
+++ /trunk/WuerzburgSoft/Thomas/mphys/MFit.h	(revision 1462)
@@ -89,5 +89,5 @@
 
     void Print(Option_t *opt="") const;
-    void SetParameter(Int_t n, TString name, Double_t start, Double_t min, Double_t max);
+    void SetParameter(Int_t n, TString name, Double_t start, Double_t min=0, Double_t max=0);
 
     Double_t GetParameter(Int_t n) const;
