Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 5082)
+++ trunk/MagicSoft/Mars/Changelog	(revision 5083)
@@ -100,4 +100,18 @@
    * mimage/MHillasSrc.[h,cc]:
      - fixed a bug in the output of DCA (wrong units)
+
+   * mhcalib/MHCalibrationChargeBlindCam.[h,cc],
+     mhcalib/MHCalibrationChargeBlindPix.cc,
+     mhcalib/MHCalibrationChargeCam.[h,cc],
+     mhcalib/MHCalibrationChargePINDiode.[h,cc],
+     mhcalib/MHCalibrationRelTimeCam.[h,cc],
+     mhcalib/MHGausEvents.[h,cc]:
+     - took out the Clone-functions. Everything here seems to be
+       a lot more stable without. I guess it is due to the change
+       away from the TClonesArrays which makes the automatic
+       streamed cloning work fine.
+     - moved the removing of TF1 from the destructor to the 
+       allocation of the objects. It seems that already before the
+       destructor can remove the objects from these list 'shit happens'
 
 
Index: trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindCam.cc	(revision 5082)
+++ trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindCam.cc	(revision 5083)
@@ -414,4 +414,5 @@
 // Deletes the TObjArray's and Clones them individually
 //
+#if 0
 TObject *MHCalibrationChargeBlindCam::Clone(const char *name) const
 {
@@ -442,4 +443,5 @@
   return cam;
 }
+#endif
 
 // -----------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindCam.h
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindCam.h	(revision 5082)
+++ trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindCam.h	(revision 5083)
@@ -48,5 +48,5 @@
 
   // Clone
-  TObject *Clone(const char *name="") const;
+  //TObject *Clone(const char *name="") const;
   
   // Draw
Index: trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindPix.cc
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindPix.cc	(revision 5082)
+++ trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindPix.cc	(revision 5083)
@@ -154,8 +154,5 @@
 
   if (fSinglePheFit)
-    {
-      gROOT->GetListOfFunctions()->Remove(fSinglePheFit);
       delete fSinglePheFit;
-    }
   
   if (fFitLegend)
@@ -556,4 +553,6 @@
       return kFALSE;
   }
+
+  gROOT->GetListOfFunctions()->Remove(fSinglePheFit);
   
   const Double_t mu_0_guess = 13.5;
Index: trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc	(revision 5082)
+++ trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc	(revision 5083)
@@ -1284,4 +1284,5 @@
 //  -  (*cam)[100].DrawClone()
 //
+#if 0
 TObject *MHCalibrationChargeCam::Clone(const char *name) const
 {
@@ -1338,4 +1339,5 @@
 
 }
+#endif
 
 // -----------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.h
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.h	(revision 5082)
+++ trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.h	(revision 5083)
@@ -105,5 +105,5 @@
   ~MHCalibrationChargeCam() {}
   
-  TObject *Clone(const char *name="") const;
+  //TObject *Clone(const char *name="") const;
 
   void SetLoGainNbins       ( const Int_t  i )       { fLoGainNbins   = i; }
Index: trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePINDiode.cc
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePINDiode.cc	(revision 5082)
+++ trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePINDiode.cc	(revision 5083)
@@ -200,4 +200,5 @@
 // the rest of the data members.
 //
+#if 0
 TObject *MHCalibrationChargePINDiode::Clone(const char *name) const
 {
@@ -221,5 +222,5 @@
   return &pix;
 }
-
+#endif
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePINDiode.h
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePINDiode.h	(revision 5082)
+++ trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePINDiode.h	(revision 5083)
@@ -66,5 +66,5 @@
   ~MHCalibrationChargePINDiode(){}
 
-  TObject *Clone(const char* name="") const;  
+//  TObject *Clone(const char* name="") const;
   
   Bool_t SetupFill(const MParList *pList);
Index: trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc	(revision 5082)
+++ trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc	(revision 5083)
@@ -175,4 +175,5 @@
 // Creates new MHCalibrationRelTimeCam
 //
+#if 0
 TObject *MHCalibrationRelTimeCam::Clone(const char *name) const
 {
@@ -223,4 +224,5 @@
 
 }
+#endif
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.h
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.h	(revision 5082)
+++ trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.h	(revision 5083)
@@ -55,5 +55,5 @@
   ~MHCalibrationRelTimeCam() {}
 
-  TObject *Clone(const char *name="") const;
+  //TObject *Clone(const char *name="") const;
 
   UInt_t GetReferencePixel() const { return fReferencePixel; }
Index: trunk/MagicSoft/Mars/mhcalib/MHGausEvents.cc
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHGausEvents.cc	(revision 5082)
+++ trunk/MagicSoft/Mars/mhcalib/MHGausEvents.cc	(revision 5083)
@@ -185,14 +185,8 @@
   // delete fits
   if (fFGausFit)
-    {
-      gROOT->GetListOfFunctions()->Remove(fFGausFit);
       delete fFGausFit; 
-    }
   
   if (fFExpFit)
-    {
-      gROOT->GetListOfFunctions()->Remove(fFExpFit);
       delete fFExpFit;
-    }
   
   // delete arrays
@@ -282,4 +276,5 @@
 // data members.
 //
+#if 0
 TObject *MHGausEvents::Clone(const char *name) const
 {
@@ -329,5 +324,5 @@
   return &pix;
 }
-
+#endif
 
 // -----------------------------------------------------------------------------
@@ -416,4 +411,5 @@
   const Double_t offset_guess = slope_guess*xmax;
 
+  gROOT->GetListOfFunctions()->Remove(fFExpFit);
   fFExpFit->SetParameters(offset_guess, slope_guess);
   fFExpFit->SetParNames("Offset","Slope");
@@ -723,4 +719,5 @@
     }
   
+  gROOT->GetListOfFunctions()->Remove(fFGausFit);
   fFGausFit->SetParameters(area_guess,mu_guess,sigma_guess);
   fFGausFit->SetParNames("Area","#mu","#sigma");
Index: trunk/MagicSoft/Mars/mhcalib/MHGausEvents.h
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHGausEvents.h	(revision 5082)
+++ trunk/MagicSoft/Mars/mhcalib/MHGausEvents.h	(revision 5083)
@@ -76,5 +76,5 @@
   ~MHGausEvents();
 
-  TObject *Clone(const char* name="") const;
+  //TObject *Clone(const char* name="") const;
   
   void Clear(Option_t *o="");
