Index: /trunk/MagicSoft/Mars/mhist/MHEffectiveOnTime.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHEffectiveOnTime.cc	(revision 4926)
+++ /trunk/MagicSoft/Mars/mhist/MHEffectiveOnTime.cc	(revision 4927)
@@ -102,5 +102,5 @@
 // --------------------------------------------------------------------------
 //
-// Default Constructor. It sets name and title of the histogram.
+// Default Constructor. It initializes all histograms.
 //
 MHEffectiveOnTime::MHEffectiveOnTime(const char *name, const char *title)
@@ -263,4 +263,8 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Fit a single Delta-T distribution. See source code for more details
+//
 Bool_t MHEffectiveOnTime::FitH(TH1D *h, Double_t *res, Bool_t paint) const
 {
@@ -368,6 +372,16 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Fit a all bins of the distribution in theta. Store the result in the
+// Theta-Histograms
+//
 void MHEffectiveOnTime::FitThetaBins()
 {
+    fHEffOnTheta.Reset();
+    fHProbTheta.Reset();
+    fHLambda.Reset();
+    fHN0.Reset();
+
     const TString name = Form("CalcTheta%d", (UInt_t)gRandom->Uniform(999999999));
 
@@ -413,4 +427,9 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Fit the single-time-bin histogram. Store the result in the
+// Time-Histograms
+//
 void MHEffectiveOnTime::FitTimeBin()
 {
@@ -477,4 +496,7 @@
     }
 
+    //
+    // If this is the first call we have to initialize the time-histogram
+    //
     if (fLastTime==MTime())
     {
@@ -493,4 +515,7 @@
     }
 
+    //
+    // Fill time difference into the histograms
+    //
     const Double_t dt = *time-fLastTime;
 
@@ -500,4 +525,7 @@
     fLastTime = *time;
 
+    //
+    // If we reached the event number limit for the time-bins fit the histogram
+    //
     if (fH1DeltaT.GetEntries()>=fNumEvents)
         FitTimeBin();
@@ -506,4 +534,9 @@
 }
 
+// --------------------------------------------------------------------------
+//
+//  Fit the theta projections of the 2D histogram and the 1D Delta-T
+// distribution
+//
 Bool_t MHEffectiveOnTime::Finalize()
 {
@@ -516,4 +549,8 @@
 }
 
+// --------------------------------------------------------------------------
+//
+//  Paint the integral and the error on top of the histogram
+//
 void MHEffectiveOnTime::PaintText(Double_t val, Double_t error) const
 {
@@ -524,4 +561,8 @@
 }
 
+// --------------------------------------------------------------------------
+//
+//  Prepare painting the histograms
+//
 void MHEffectiveOnTime::Paint(Option_t *opt)
 {
