Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 6984)
+++ trunk/MagicSoft/Mars/Changelog	(revision 6985)
@@ -21,4 +21,26 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2005/04/29 Thomas Bretz
+
+   * manalysis/MEventRateCalc.cc:
+     - fixed jumps when a new run is initiated
+     - set as time a time which represents the starting point
+       of the calculation interval in all cases
+
+
+
+ 2005/04/28 Thomas Bretz
+
+   * manalysis/MMultiDimDistCalc.[h,cc]:
+     - replaced MHadronness by MParameterD
+
+   * mhflux/MHEnergyEst.cc:
+     - removed obsolete include of MEnergyEst
+
+   * mmuon/MHMuonPar.cc:
+     - fixed a type in an axis label
+
+
 
  2005/04/27 Thomas Bretz
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 6984)
+++ trunk/MagicSoft/Mars/NEWS	(revision 6985)
@@ -43,4 +43,7 @@
      different results with different compiler optimiztaion options
      due to rounding errors.
+
+   - MEventRateCalc handles the calculation of the event rate more
+     accurate now in case of the start of a new run inside a sequence
 
 
Index: trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc	(revision 6984)
+++ trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc	(revision 6985)
@@ -155,5 +155,5 @@
 Int_t MEventRateCalc::Process()
 {
-    const ULong_t exec = GetNumExecutions()-1;
+    const ULong_t exec = GetNumExecutions()-fNumFirstEvent-1;
 
     //*fLog << all << fNumFirstEvent << " " << exec << endl;
@@ -172,4 +172,8 @@
     const UInt_t cnt = n1<n2 ? n : n1-n2;
 
+    if (cnt<n/10)
+        return kTRUE;
+
+
     // Calculate the rate
     const Double_t rate = (Double_t)cnt/(fTimes[n1%n]-fTimes[n2%n]);
@@ -190,4 +194,12 @@
     fRate->SetRate(exec>1?rate:0, cnt);
     fRate->SetReadyToSave();
+
+    Double_t diff = fTimes[n1%n]- fTimes[n2%n];
+    Double_t time = fTimes[n2%n]+ (cnt-n/10.)/(n-n/10.)*diff/2;
+
+    fTimeRate->SetMean(time, time);
+
+    //if (cnt>1000)
+    //*fLog << all << *fTimeRate << " " << *fTime << " " << diff << " " << cnt << " " << n << " " << (float)(cnt-n/2)/n << endl;
 
     // Store the corresponding time
Index: trunk/MagicSoft/Mars/mjobs/MJCalib.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalib.cc	(revision 6984)
+++ trunk/MagicSoft/Mars/mjobs/MJCalib.cc	(revision 6985)
@@ -44,5 +44,4 @@
 // Sets:
 // - fDataFlag      to kIsUseRootData
-// - fRuns          to NULL
 // - fCheckedPixId  to fgCheckedPixId
 // - fPixelCheck    to kFALSE
@@ -51,6 +50,5 @@
 MJCalib::MJCalib() : fDataFlag(kIsUseRootData), fStorage(0), 
                      fIsPixelCheck(kFALSE), fIsPulsePosCheck(kFALSE),
-                     fIsHiLoCalibration(kFALSE),
-                     fRuns(NULL)
+                     fIsHiLoCalibration(kFALSE)
 {
   SetUseBlindPixel(kFALSE);
Index: trunk/MagicSoft/Mars/mjobs/MJCalib.h
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalib.h	(revision 6984)
+++ trunk/MagicSoft/Mars/mjobs/MJCalib.h	(revision 6985)
@@ -48,6 +48,4 @@
     Bool_t fIsHiLoCalibration;          // Choose to calibrate the high-gain vs. low-gains
     
-    MRunIter *fRuns;                    // Data files, only used for test applications, default is sequence files!
-
     Bool_t CheckEnvLocal();
     Byte_t GetDataFlag() { return fDataFlag; }
@@ -59,6 +57,4 @@
 
     MJCalib();
-
-    void SetInput(MRunIter *iter) { fRuns = iter; }
 
     Bool_t IsUseRawData()  const { return fDataFlag==kIsUseRawData;  }
