Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7175)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7176)
@@ -21,4 +21,28 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2005/07/08 Thomas Bretz
+
+   * showplot.cc:
+     - implemented the possibility to open a root interpreter
+
+   * mbase/MMath.cc:
+     - added sanity checks in GaussProb
+
+   * mimage/MHillasExt.[h,cc]:
+     - fixed some units
+     - added Paint
+
+   * mimage/MNewImagePar.cc:
+     - fixed Print output
+
+   * mmain/MEventDisplay.cc:
+     - print a separator between two events
+     - Draw MHillasExt, too
+
+   * mmuon/MMuonCalibPar.cc, mmuon/MMuonSearchPar.cc:
+     - fixed Print output
+
+
 
  2005/06/28 Thomas Bretz
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 7175)
+++ trunk/MagicSoft/Mars/NEWS	(revision 7176)
@@ -14,4 +14,8 @@
 
    - general: MH::SetPalette offers a lot of new palettes
+
+   - showplot: got a new option to start a root interpreter, too
+
+   - mars: now displays a rough estimate of Disp and the third moment
 
    - callisto: MCalibrationHiLoCam can now be printed from its context
Index: trunk/MagicSoft/Mars/mbase/MMath.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 7175)
+++ trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 7176)
@@ -132,5 +132,13 @@
 {
     static const Double_t sqrt2 = TMath::Sqrt(2.);
-    return TMath::Erf((x-mean)/(sigma*sqrt2));
+
+    const Double_t rc = TMath::Erf((x-mean)/(sigma*sqrt2));
+
+    if (rc<0)
+        return 0;
+    if (rc>1)
+        return 1;
+
+    return rc;
 }
 
Index: trunk/MagicSoft/Mars/mimage/MHillasExt.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasExt.cc	(revision 7175)
+++ trunk/MagicSoft/Mars/mimage/MHillasExt.cc	(revision 7176)
@@ -64,4 +64,6 @@
 
 #include <TArrayF.h>
+#include <TMarker.h>
+#include <TVirtualPad.h>
 
 #include "MGeomPix.h"
@@ -218,5 +220,5 @@
     *fLog << all;
     *fLog << GetDescriptor() << endl;
-    *fLog << " - Asymmetry            = " << fAsym    << endl;
+    *fLog << " - Asymmetry      [mm]  = " << fAsym    << endl;
     *fLog << " - 3.Moment Long  [mm]  = " << fM3Long  << endl;
     *fLog << " - 3.Moment Trans [mm]  = " << fM3Trans << endl;
@@ -233,7 +235,31 @@
     *fLog << all;
     *fLog << GetDescriptor() << endl;
-    *fLog << " - Asymmetry            = " << fAsym   *geom.GetConvMm2Deg() << endl;
+    *fLog << " - Asymmetry      [deg] = " << fAsym   *geom.GetConvMm2Deg() << endl;
     *fLog << " - 3.Moment Long  [deg] = " << fM3Long *geom.GetConvMm2Deg() << endl;
     *fLog << " - 3.Moment Trans [deg] = " << fM3Trans*geom.GetConvMm2Deg() << endl;
     *fLog << " - Max.Dist       [deg] = " << fMaxDist*geom.GetConvMm2Deg() << endl;
 }
+
+// -------------------------------------------------------------------------
+//
+// Paint the 3rd moment on top of the shower. Therefor "MHillas" is needed.
+// it is searched via gPad->FindObject. If opt is not IsNull an object with
+// the name opt is searched.
+//
+void MHillasExt::Paint(Option_t *opt)
+{
+    const TString name(opt);
+
+    const MHillas *hil = dynamic_cast<const MHillas*>(gPad->FindObject(name.IsNull() ? "MHillas" : name));
+    if (!hil)
+        return;
+
+    TVector2 v(fM3Long, fM3Trans);
+    v  = v.Rotate(hil->GetDelta()+TMath::Pi());
+    v += hil->GetMean();
+
+    TMarker m;
+    m.SetMarkerColor(15);
+    m.SetMarkerStyle(kFullDotLarge);
+    m.PaintMarker(v.X(), v.Y());
+}
Index: trunk/MagicSoft/Mars/mimage/MHillasExt.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MHillasExt.h	(revision 7175)
+++ trunk/MagicSoft/Mars/mimage/MHillasExt.h	(revision 7176)
@@ -39,4 +39,6 @@
     void Print(const MGeomCam &geom) const;
 
+    void Paint(Option_t *o="");
+
     void Set(const TArrayF &arr);
 
Index: trunk/MagicSoft/Mars/mimage/MNewImagePar.cc
===================================================================
--- trunk/MagicSoft/Mars/mimage/MNewImagePar.cc	(revision 7175)
+++ trunk/MagicSoft/Mars/mimage/MNewImagePar.cc	(revision 7176)
@@ -228,15 +228,15 @@
     *fLog << all;
     *fLog << GetDescriptor() << endl;
-    *fLog << " - Leakage1       [1]   = " << fLeakage1             << endl;
-    *fLog << " - Leakage2       [1]   = " << fLeakage2             << endl;
-    *fLog << " - InnerLeakage1  [1]   = " << fInnerLeakage1        << endl;
-    *fLog << " - InnerLeakage2  [1]   = " << fInnerLeakage2        << endl;
-    *fLog << " - InnerSize      [#]   = " << fInnerSize            << " CerPhot" << endl;
-    *fLog << " - Conc           [1]   = " << fConc                 << " (ratio)" << endl;
-    *fLog << " - Conc1          [1]   = " << fConc1                << " (ratio)" << endl;
-    *fLog << " - Used Pixels    [#]   = " << fNumUsedPixels        << " Pixels" << endl;
-    *fLog << " - Core Pixels    [#]   = " << fNumCorePixels        << " Pixels" << endl;
-    *fLog << " - Used Area     [mm^2] = " << fUsedArea             << endl;
-    *fLog << " - Core Area     [mm^2] = " << fCoreArea             << endl;
+    *fLog << " - Leakage1         [1] = " << fLeakage1      << endl;
+    *fLog << " - Leakage2         [1] = " << fLeakage2      << endl;
+    *fLog << " - InnerLeakage1    [1] = " << fInnerLeakage1 << endl;
+    *fLog << " - InnerLeakage2    [1] = " << fInnerLeakage2 << endl;
+    *fLog << " - InnerSize      [phe] = " << fInnerSize     << endl;
+    *fLog << " - Conc             [1] = " << fConc          << endl;
+    *fLog << " - Conc1            [1] = " << fConc1         << endl;
+    *fLog << " - Num Used Pixels  [#] = " << fNumUsedPixels << endl;
+    *fLog << " - Num Core Pixels  [#] = " << fNumCorePixels << endl;
+    *fLog << " - Used Area     [mm^2] = " << fUsedArea      << endl;
+    *fLog << " - Core Area     [mm^2] = " << fCoreArea      << endl;
 }
 
@@ -250,13 +250,13 @@
     *fLog << all;
     *fLog << GetDescriptor() << endl;
-    *fLog << " - Leakage1       [1]   = " << fLeakage1             << endl;
-    *fLog << " - Leakage2       [1]   = " << fLeakage2             << endl;
-    *fLog << " - InnerLeakage1  [1]   = " << fInnerLeakage1        << endl;
-    *fLog << " - InnerLeakage2  [1]   = " << fInnerLeakage2        << endl;
-    *fLog << " - InnerSize      [#]   = " << fInnerSize            << " CerPhot" << endl;
-    *fLog << " - Conc           [1]   = " << fConc                 << " (ratio)" << endl;
-    *fLog << " - Conc1          [1]   = " << fConc1                << " (ratio)" << endl;
-    *fLog << " - Used Pixels    [#]   = " << fNumUsedPixels        << " Pixels" << endl;
-    *fLog << " - Core Pixels    [#]   = " << fNumCorePixels        << " Pixels" << endl;
+    *fLog << " - Leakage1         [1] = " << fLeakage1      << endl;
+    *fLog << " - Leakage2         [1] = " << fLeakage2      << endl;
+    *fLog << " - InnerLeakage1    [1] = " << fInnerLeakage1 << endl;
+    *fLog << " - InnerLeakage2    [1] = " << fInnerLeakage2 << endl;
+    *fLog << " - InnerSize      [phe] = " << fInnerSize     << endl;
+    *fLog << " - Conc             [1] = " << fConc          << endl;
+    *fLog << " - Conc1            [1] = " << fConc1         << endl;
+    *fLog << " - Num Used Pixels  [#] = " << fNumUsedPixels << endl;
+    *fLog << " - Num Core Pixels  [#] = " << fNumCorePixels << endl;
     *fLog << " - Used Area    [deg^2] = " << fUsedArea*geom.GetConvMm2Deg()*geom.GetConvMm2Deg() << endl;
     *fLog << " - Core Area    [deg^2] = " << fCoreArea*geom.GetConvMm2Deg()*geom.GetConvMm2Deg() << endl;
Index: trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 7175)
+++ trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 7176)
@@ -549,4 +549,6 @@
     // Print parameters
     //
+    *fLog << all;
+    fLog->Separator(Form("Entry %d", reader->GetNumEntry()+1));
     ((MHillas*)     plist->FindObject("MHillas"))->Print(*geom);
     ((MHillasExt*)  plist->FindObject("MHillasExt"))->Print(*geom);
@@ -603,4 +605,5 @@
     TObject *hillas1 = plist->FindObject("MHillas");
     TObject *hillas2 = plist->FindObject("MHillasSrc");
+    TObject *hillas3 = plist->FindObject("MHillasExt");
     TObject *hmuon   = plist->FindObject("MMuonSearchPar");
     for (int i=1; i<7;i++)
@@ -611,4 +614,5 @@
         hillas1->Draw();
         hillas2->Draw();
+        hillas3->Draw();
     }
 }
Index: trunk/MagicSoft/Mars/mmuon/MMuonCalibPar.cc
===================================================================
--- trunk/MagicSoft/Mars/mmuon/MMuonCalibPar.cc	(revision 7175)
+++ trunk/MagicSoft/Mars/mmuon/MMuonCalibPar.cc	(revision 7176)
@@ -74,13 +74,11 @@
 {
     *fLog << all;
-    *fLog << "Muon Parameters (" << GetName() << ")"       << endl;
-//    *fLog << " - Arc Length    [deg]   = " << fArcLength   << endl;
-    *fLog << " - Arc Phi      [deg]   = " << fArcPhi      << endl;
-    *fLog << " - Arc Width    [deg]   = " << fArcWidth    << endl;
-    *fLog << " - Chi Arc Phi  [x2/ndf]= " << fChiArcPhi   << endl;
-    *fLog << " - Chi Arc Width[x2/ndf]= " << fChiArcWidth << endl;
-//    *fLog << " - Est. I. P.    [m]     = " << fEstImpact   << endl;
-    *fLog << " - Size of muon [phe]   = " << fMuonSize    << endl;
-    *fLog << " - Peak Phi     [deg]   = " << fPeakPhi     << endl;
+    *fLog << GetDescriptor() << endl;
+    *fLog << " - Arc Phi        [deg] = " << fArcPhi      << endl;
+    *fLog << " - Arc Width      [deg] = " << fArcWidth    << endl;
+    *fLog << " - Red ChiSq Arc Phi    = " << fChiArcPhi   << endl;
+    *fLog << " - Red ChiSq Arc Width  = " << fChiArcWidth << endl;
+    *fLog << " - Size of muon   [phe] = " << fMuonSize    << endl;
+    *fLog << " - Peak Phi       [deg] = " << fPeakPhi     << endl;
 }
 
Index: trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.cc
===================================================================
--- trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.cc	(revision 7175)
+++ trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.cc	(revision 7176)
@@ -261,5 +261,5 @@
 {
     *fLog << all;
-    *fLog << "Muon Parameters (" << GetName() << ")" << endl;
+    *fLog << GetDescriptor() << endl;
     *fLog << " - Est. Radius     [mm] = " << fRadius  << endl;
     *fLog << " - Deviation       [mm] = " << fDeviation  << endl;
@@ -271,5 +271,5 @@
 {
     *fLog << all;
-    *fLog << "Muon Parameters (" << GetName() << ")" << endl;
+    *fLog << GetDescriptor() << endl;
     *fLog << " - Est. Radius    [deg] = " << fRadius*geom.GetConvMm2Deg()   << endl;
     *fLog << " - Deviation      [deg] = " << fDeviation*geom.GetConvMm2Deg()   << endl;
Index: trunk/MagicSoft/Mars/showplot.cc
===================================================================
--- trunk/MagicSoft/Mars/showplot.cc	(revision 7175)
+++ trunk/MagicSoft/Mars/showplot.cc	(revision 7176)
@@ -2,5 +2,5 @@
 #include <TClass.h>
 #include <TGClient.h>
-#include <TApplication.h>
+#include <TRint.h>
 
 #include "MLog.h"
@@ -33,4 +33,5 @@
     gLog << " Root Options:" << endl;
     gLog << "   -b                        Batch mode (no graphical output to screen)" << endl<<endl;
+    gLog << "   -r                        Start the root interpreter" << endl<<endl;
     gLog << " Options: "<< endl;
     gLog.Usage();
@@ -95,4 +96,5 @@
     const Bool_t kQuit       = arg.HasOnlyAndRemove("-q");
     const Bool_t kBatch      = arg.HasOnlyAndRemove("-b");
+    const Bool_t kRoot       = arg.HasOnlyAndRemove("-r");
 
     const Int_t  kTab        = arg.GetIntAndRemove("--tab=", -1);
@@ -139,5 +141,5 @@
     }
 
-    TApplication app("showplot", &argc, argv);
+    TApplication *app = kRoot ? new TRint("showplot", &argc, argv) : new TApplication("showplot", &argc, argv);
     if (!gROOT->IsBatch() && !gClient || gROOT->IsBatch() && !kBatch)
     {
@@ -212,5 +214,6 @@
 
     // Wait until the user decides to exit the application
-    app.Run(kFALSE);
+    app->Run(kFALSE);
+    delete app;
     return 0;
 }
