Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8672)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8673)
@@ -19,9 +19,32 @@
                                                  -*-*- END OF LINE -*-*-
 
+ 2007/08/17 Thomas Bretz
+
+   * sponde.cc:
+     - removed switch for simple and accurate mode
+
+   * mbase/MMath.cc:
+     - fixed a problem in LiMaExc which could result in NaN
+       (if signal and background is 0)
+
+   * mbase/MStatusDisplay.cc:
+     - remove canvases in batch-mode from the global list of canvases,
+       this could result in crahses if two canvases in the display
+       had the same name
+
+   * mhflux/MHCollectionArea.[h,cc]:
+     - output the maximum impact found in Finalize
+
+   * mhflux/MHEnergyEst.cc:
+     - made the y-axis in the Eest vs Emc plot logarithmic
+
+
+
  2007/08/16 Markus Meyer
 
    * resources/calibration.rc:
      - update of muon calibration factors for the periods 41 to 50
-     .
+
+
 
  2007/08/15 Thomas Bretz
Index: /trunk/MagicSoft/Mars/mbase/MMath.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 8672)
+++ /trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 8673)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.36 2007-06-19 11:14:33 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.37 2007-08-17 10:53:48 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -153,5 +153,11 @@
     Double_t sN = s + alpha*alpha*b;
 
-    return Ns<0 || sN<0 ? 0 : Ns/TMath::Sqrt(sN);
+    if (Ns<0 || sN<0)
+        return 0;
+
+    if (Ns==0 && sN==0)
+        return 0;
+
+    return Ns/TMath::Sqrt(sN);
 }
 
Index: /trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 8672)
+++ /trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 8673)
@@ -1010,4 +1010,12 @@
 TCanvas &MStatusDisplay::AddTab(const char *name)
 {
+    /*
+    if (HasCanvas(name))
+    {
+        *fLog << warn;
+        *fLog << "WARNING - A canvas '" << name << "' is already existing in the Status Display." << endl;
+        *fLog << "          This can cause unexpected crahes!" << endl;
+    }*/
+
     if (gROOT->IsBatch())
     {
@@ -1017,4 +1025,7 @@
 
         TCanvas *c = new TCanvas(name, name, -cw, ch);
+
+        gROOT->GetListOfCanvases()->Remove(c);
+
         fBatch->Add(c);
         return *c;
@@ -1342,4 +1353,8 @@
     if (!c)
         return kFALSE;
+
+    // If you encounter unexpected crashes here, check if
+    // a canvas is existing twice in the list or has been
+    // deleted by accident. (Check AddTab)
 
     if (gROOT->IsBatch())
Index: /trunk/MagicSoft/Mars/mhflux/MHCollectionArea.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhflux/MHCollectionArea.cc	(revision 8672)
+++ /trunk/MagicSoft/Mars/mhflux/MHCollectionArea.cc	(revision 8673)
@@ -284,5 +284,5 @@
         //                         GetCollectionAreaEff(),
         //                         GetCollectionAreaAbs(), fMcAreaRadius);
-        const TString txt = Form("A_{abs}=%.0fm^{2}  r=%.0fm",
+        const TString txt = Form("r_{max}=%.0fm --> A_{max}=%.0fm^{2}",
                                  GetCollectionAreaAbs(), fMcAreaRadius);
 
@@ -457,2 +457,11 @@
     return kTRUE;
 }
+
+Bool_t MHCollectionArea::Finalize()
+{
+    *fLog << all << "Maximum simulated impact found: " << fMcAreaRadius << "m" << endl;
+
+    CalcEfficiency();
+
+    return kTRUE;
+}
Index: /trunk/MagicSoft/Mars/mhflux/MHCollectionArea.h
===================================================================
--- /trunk/MagicSoft/Mars/mhflux/MHCollectionArea.h	(revision 8672)
+++ /trunk/MagicSoft/Mars/mhflux/MHCollectionArea.h	(revision 8673)
@@ -44,5 +44,5 @@
     Bool_t ReInit(MParList *pList);
     Bool_t Fill(const MParContainer *par, const Stat_t weight=1);
-    Bool_t Finalize() { CalcEfficiency(); return kTRUE; }
+    Bool_t Finalize();
 
     void Draw(Option_t *option="");
Index: /trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc	(revision 8672)
+++ /trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc	(revision 8673)
@@ -504,4 +504,5 @@
 
     pad2->cd(1);
+    gPad->SetLogy();
     h = MakePlot(fHEnergy, "xy");
     h->SetXTitle("E_{mc} [GeV]");
Index: /trunk/MagicSoft/Mars/sponde.cc
===================================================================
--- /trunk/MagicSoft/Mars/sponde.cc	(revision 8672)
+++ /trunk/MagicSoft/Mars/sponde.cc	(revision 8673)
@@ -52,6 +52,6 @@
     gLog << "   --refill                  Refill the excess histogram from result file" << endl;
     gLog << "                             (usefull to change the binning)" << endl;
-    gLog << "   --accurate                Fill original energy/theta distribution from data" << endl;
-    gLog << "                             (do not weight the histogram)" << endl;
+//    gLog << "   --accurate                Fill original energy/theta distribution from data" << endl;
+//    gLog << "                             (do not weight the histogram)" << endl;
     gLog << "   --raw-mc                  Use the mc sample as it is" << endl << endl;
     gLog << " Options:" << endl;
@@ -121,5 +121,5 @@
 
     const Bool_t  kRefill        =  arg.HasOnlyAndRemove("--refill");
-    const Bool_t  kSimple        = !arg.HasOnlyAndRemove("--accurate");
+//    const Bool_t  kSimple        = !arg.HasOnlyAndRemove("--accurate");
     const Bool_t  kRawMc         =  arg.HasOnlyAndRemove("--raw-mc");
 
@@ -224,5 +224,5 @@
 
     job.EnableRefilling(kRefill);
-    job.EnableSimpleMode(kSimple);
+//    job.EnableSimpleMode(kSimple);
     job.EnableRawMc(kRawMc);
 
