Index: /trunk/Mars/Changelog
===================================================================
--- /trunk/Mars/Changelog	(revision 10280)
+++ /trunk/Mars/Changelog	(revision 10281)
@@ -18,4 +18,32 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2011/04/04 Thomas Bretz
+
+   * mreport/MReportFileRead.cc:
+     - added a missing delete
+
+   * mhflux/MHEnergyEst.cc, mhist/MHCamera.cc:
+     - fixed some crashes with newer root versiony in which
+       GetFunction("gaus") after an unsuccessfull fit might return
+       NULL
+
+   * mastro/MAstroCatalog.cc:
+     - added the missing marker color for the dot
+
+   * mpointing/MPointingDevCalc.cc:
+     - added some comments
+
+   * mmain/MEventDisplay.cc:
+     - renamed some local variables to avoid using the same name twice
+
+   * mgeom/MGeomCam.cc:
+     - for convenience a margin of 0 in HitFrame is allowed to
+       switch off the detection also with 0
+
+   * mbase/MThread.h:
+     - added missing argument to call of fThread.Run()
+
+
 
  2011/03/10 Thomas Bretz
@@ -44,5 +72,5 @@
 
 
- 2011/02/21 Daniela Dorner
+ 2011/02/21 Thomas Bretz
 
    * mcalib/MCalibrateData.cc mcalib/MCalibrationBlindPix.cc
Index: /trunk/Mars/mastro/MAstroCatalog.cc
===================================================================
--- /trunk/Mars/mastro/MAstroCatalog.cc	(revision 10280)
+++ /trunk/Mars/mastro/MAstroCatalog.cc	(revision 10281)
@@ -1,5 +1,3 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MAstroCatalog.cc,v 1.34 2009-10-26 14:31:17 tbretz Exp $
-! --------------------------------------------------------------------------
 !
 ! *
@@ -865,4 +863,6 @@
     // draw star on the camera display
     TMarker *tip=new TMarker(x, y, kDot);
+    tip->SetMarkerColor(col);
+
     TAttMarker::Copy(*tip);
 
@@ -1471,5 +1471,5 @@
 // Handle keyboard events.
 //
-void MAstroCatalog::ExecuteEventKbd(Int_t keycode, Int_t keysym)
+void MAstroCatalog::ExecuteEventKbd(Int_t /*keycode*/, Int_t keysym)
 {
     Double_t dra =0;
Index: /trunk/Mars/mgeom/MGeomCam.cc
===================================================================
--- /trunk/Mars/mgeom/MGeomCam.cc	(revision 10280)
+++ /trunk/Mars/mgeom/MGeomCam.cc	(revision 10281)
@@ -432,5 +432,5 @@
 Bool_t MGeomCam::HitFrame(MQuaternion p, const MQuaternion &u, Double_t margin) const
 {
-    if (margin<=0)
+    if (margin<0)
         return HitFrame(p, u);
 
Index: /trunk/Mars/mhflux/MHEnergyEst.cc
===================================================================
--- /trunk/Mars/mhflux/MHEnergyEst.cc	(revision 10280)
+++ /trunk/Mars/mhflux/MHEnergyEst.cc	(revision 10281)
@@ -254,7 +254,12 @@
     *fLog << " RMS   of Delta E/E: " << Form("%4.2f%%",  100*h->GetRMS()) << endl;
     *fLog << "Results from Histogram-Fit:" << endl;
-    *fLog << " Bias  of Delta E/E: " << Form("%+4.2f%%", 100*f->GetParameter(1)) << endl;
-    *fLog << " Sigma of Delta E/E: " << Form("%4.2f%%",  100*f->GetParameter(2)) << endl;
-    *fLog << " Res   of Delta E/E: " << Form("%4.2f%%",  100*TMath::Hypot(f->GetParameter(1), f->GetParameter(2))) << endl;
+    if (!f)
+        *fLog << " <fit did not succeed>" << endl;
+    else
+    {
+        *fLog << " Bias  of Delta E/E: " << Form("%+4.2f%%", 100*f->GetParameter(1)) << endl;
+        *fLog << " Sigma of Delta E/E: " << Form("%4.2f%%",  100*f->GetParameter(2)) << endl;
+        *fLog << " Res   of Delta E/E: " << Form("%4.2f%%",  100*TMath::Hypot(f->GetParameter(1), f->GetParameter(2))) << endl;
+    }
 
     delete h;
@@ -341,9 +346,15 @@
                 }
 
-                hx->Fit("gaus", "Q", "", -0.25, 1.0);
-                hx->GetFunction("gaus")->SetLineColor(kBlue);
-                hx->GetFunction("gaus")->SetLineWidth(2);
-                gPad=NULL;
-                gStyle->SetOptFit(101);
+                if (hx->GetEntries()>0)
+                {
+                    hx->Fit("gaus", "Q", "", -0.25, 1.0);
+                    if (hx->GetFunction("gaus"))
+                    {
+                        hx->GetFunction("gaus")->SetLineColor(kBlue);
+                        hx->GetFunction("gaus")->SetLineWidth(2);
+                        gPad=NULL;
+                        gStyle->SetOptFit(101);
+                    }
+                }
             }
         }
Index: /trunk/Mars/mhist/MHCamera.cc
===================================================================
--- /trunk/Mars/mhist/MHCamera.cc	(revision 10280)
+++ /trunk/Mars/mhist/MHCamera.cc	(revision 10281)
@@ -2323,5 +2323,6 @@
     case 4:
         obj2->Fit("pol0", "Q");
-        obj2->GetFunction("pol0")->SetLineColor(kBlue);
+        if (obj2->GetFunction("pol0"))
+            obj2->GetFunction("pol0")->SetLineColor(kBlue);
         break;
 
@@ -2331,5 +2332,6 @@
     default:
         obj2->Fit("gaus", "Q");
-        obj2->GetFunction("gaus")->SetLineColor(kBlue);
+        if (obj2->GetFunction("gaus"))
+            obj2->GetFunction("gaus")->SetLineColor(kBlue);
         break;
     }
@@ -2402,5 +2404,6 @@
     obj2->SetBit(kCanDelete);
     obj2->Fit("pol0","Q","");
-    obj2->GetFunction("pol0")->SetLineWidth(1);
+    if (obj2->GetFunction("pol0"))
+        obj2->GetFunction("pol0")->SetLineWidth(1);
 /*
     if (GetGeomCam().InheritsFrom("MGeomCamMagic"))
Index: /trunk/Mars/mmain/MEventDisplay.cc
===================================================================
--- /trunk/Mars/mmain/MEventDisplay.cc	(revision 10280)
+++ /trunk/Mars/mmain/MEventDisplay.cc	(revision 10281)
@@ -1,5 +1,3 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MEventDisplay.cc,v 1.70 2009-02-18 12:06:39 tbretz Exp $
-! --------------------------------------------------------------------------
 !
 ! *
@@ -361,5 +359,5 @@
         MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd;
 
-        MCalibrationPatternDecode *decode = new MCalibrationPatternDecode;
+        MCalibrationPatternDecode *patdecode = new MCalibrationPatternDecode;
 
         MPedestalSubtract *pedsub1  = new MPedestalSubtract("PedSubstract1");
@@ -385,5 +383,5 @@
         tlist->AddToList(pdnsb);
 
-        tlist->AddToList(decode);
+        tlist->AddToList(patdecode);
 
         tlist->AddToList(pedsub1);   // Produce arrays
Index: /trunk/Mars/mpointing/MPointingDevCalc.cc
===================================================================
--- /trunk/Mars/mpointing/MPointingDevCalc.cc	(revision 10280)
+++ /trunk/Mars/mpointing/MPointingDevCalc.cc	(revision 10281)
@@ -301,4 +301,8 @@
 // model. However, M2 shows a slight offset.
 //
+// [2010-11-11 M. Garcz.]
+//
+// Last night, TPoints for M2 taken without target
+//
 // [2010-11-18 M. Garcz.]
 //
Index: /trunk/Mars/mreport/MReportFileRead.cc
===================================================================
--- /trunk/Mars/mreport/MReportFileRead.cc	(revision 10280)
+++ /trunk/Mars/mreport/MReportFileRead.cc	(revision 10281)
@@ -114,5 +114,5 @@
 // --------------------------------------------------------------------------
 //
-// Add a new MReport* to the list (eg 'Drive' will add MReportDrive)
+// Add a new MReport* to the list. The name is the class name (eg MReportDrive)
 // For convinience the object is created as a MReportHelp object.
 //
@@ -122,5 +122,8 @@
 
     if (!help->GetReport())
+    {
+        delete help;
         return kFALSE;
+    }
 
     if (GetReport(help->GetName()))
@@ -203,5 +206,8 @@
             continue;
 
+        // Check for MReport{str(0,pos)}
         rep = GetReportHelp(str(0,pos));
+
+        // Remove this part from the string
         if (GetReport(rep))
             str.Remove(0, pos);
