Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 2564)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 2565)
@@ -56,4 +56,11 @@
    * mona.cc:
      - updated
+
+   * manalysis/MEventRate.[h,cc], manalysis/MEventRateCalc.[h,cc]:
+     - added
+
+   * manalysis/AnalysisLinkDef.h, manalysis/Makefile:
+     - added MEventRateCalc
+     - added MEventRate
 
 
Index: /trunk/MagicSoft/Mars/NEWS
===================================================================
--- /trunk/MagicSoft/Mars/NEWS	(revision 2564)
+++ /trunk/MagicSoft/Mars/NEWS	(revision 2565)
@@ -28,4 +28,12 @@
 
   - changed name of MTime in the event trees from MRawEvtTime to MTime
+
+  - added displaying the sector indices to the mars event display
+
+  - Magic Online Analysis (MOnA) implemented in a first version
+    (see mona.cc, MOnlineDump and MOnlineDisplay)
+
+  - added classes to calculate event rate
+    (preliminary: MEventRateCalc, MEventRate)
 
 
Index: /trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h	(revision 2564)
+++ /trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h	(revision 2565)
@@ -38,9 +38,10 @@
 #pragma link C++ class MMatrixLoop+;
 
-#pragma link C++ class MPedCalcPedRun+;
-
 #pragma link C++ class MSigmabar+;
 #pragma link C++ class MSigmabarCalc+;
 #pragma link C++ class MSigmabarParam+;
+
+#pragma link C++ class MEventRate+;
+#pragma link C++ class MEventRateCalc+;
 
 #pragma link C++ class MCT1PadSchweizer+;
Index: /trunk/MagicSoft/Mars/manalysis/MEventRate.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MEventRate.cc	(revision 2565)
+++ /trunk/MagicSoft/Mars/manalysis/MEventRate.cc	(revision 2565)
@@ -0,0 +1,49 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz, 11/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2000-2003
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MEventRate                                                              //
+//                                                                         //
+// Storage Container for the estimated energy                              //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+#include "MEventRate.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MEventRate);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+// Default constructor.
+//
+MEventRate::MEventRate(const char *name, const char *title) : fRate(-1)
+{
+    fName  = name  ? name  : "MEventRate";
+    fTitle = title ? title : "Storage container for the event rate [Hz]";
+}
Index: /trunk/MagicSoft/Mars/manalysis/MEventRate.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MEventRate.h	(revision 2565)
+++ /trunk/MagicSoft/Mars/manalysis/MEventRate.h	(revision 2565)
@@ -0,0 +1,23 @@
+#ifndef MARS_MEventRate
+#define MARS_MEventRate
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+class MEventRate : public MParContainer
+{
+private:
+    Double_t fRate; // [Hz] Event rate
+
+public:
+    MEventRate(const char *name=NULL, const char *title=NULL);
+
+    void SetRate(Double_t r) { fRate = r; }
+    Double_t GetRate() const { return fRate; }
+
+    ClassDef(MEventRate, 1) // Storage Container for the event rate
+};
+
+#endif
+
Index: /trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc	(revision 2565)
+++ /trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc	(revision 2565)
@@ -0,0 +1,127 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz, 11/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: MAGIC Software Development, 2002-2003
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//
+//  MEventRateCalc
+//
+//
+//  Input Containers:
+//    MTime
+//
+//  Output Containers:
+//    MEventRate
+//
+//////////////////////////////////////////////////////////////////////////////
+#include "MEventRateCalc.h"
+
+#include "MParList.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MTime.h"
+#include "MEventRate.h"
+
+ClassImp(MEventRateCalc);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+// Default constructor.
+//
+MEventRateCalc::MEventRateCalc(const char *name, const char *title)
+    : fNumEvents(10000)
+{
+    fName  = name  ? name  : "MEventRateCalc";
+    fTitle = title ? title : "Calculate trigger rate";
+
+    //AddToBranchList("MRawEvtData.fHiGainPixId");
+    //AddToBranchList("MRawEvtData.fLoGainPixId");
+    //AddToBranchList("MRawEvtData.fHiGainFadcSamples");
+    //AddToBranchList("MRawEvtData.fLoGainFadcSamples");
+
+    //SetDefaultWeights();
+}
+
+// --------------------------------------------------------------------------
+//
+// The PreProcess searches for the following input containers:
+//  - MRawRunHeader
+//  - MRawEvtData
+//  - MPedestalCam
+//
+// The following output containers are also searched and created if
+// they were not found:
+//  - MCerPhotEvt
+//
+Int_t MEventRateCalc::PreProcess(MParList *pList)
+{
+    fTime = (MTime*)pList->FindObject("MTime");
+    if (!fTime)
+    {
+        *fLog << err << "MTime not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fRate = (MEventRate*)pList->FindCreateObj("MEventRate");
+    if (!fRate)
+        return kFALSE;
+
+    fEvtNumber = 0;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Calculate the integral of the FADC time slices and store them as a new
+// pixel in the MCerPhotEvt container.
+//
+#include <TSystem.h>
+Int_t MEventRateCalc::Process()
+{
+    fTime->SetTime(gSystem->Now());
+
+    const ULong_t exec = GetNumExecutions();
+
+    if (fEvtNumber>0)
+    {
+        if (exec<fEvtNumber)
+            return kTRUE;
+
+        const Double_t rate = (Double_t)fNumEvents/(*fTime - fEvtTime);
+
+        *fLog << inf << "Event Rate [Hz]: " << rate << endl;
+
+        fRate->SetRate(rate);
+        fRate->SetReadyToSave();
+    }
+
+    fEvtNumber = exec+fNumEvents;
+    fEvtTime   = *fTime;
+
+    return kTRUE;
+}
Index: /trunk/MagicSoft/Mars/manalysis/MEventRateCalc.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MEventRateCalc.h	(revision 2565)
+++ /trunk/MagicSoft/Mars/manalysis/MEventRateCalc.h	(revision 2565)
@@ -0,0 +1,35 @@
+#ifndef MARS_MEventRateCalc
+#define MARS_MEventRateCalc
+
+#ifndef MARS_MTask
+#include "MTask.h"
+#endif
+#ifndef MARS_MTime
+#include "MTime.h"
+#endif
+
+class MEventRate;
+
+class MEventRateCalc : public MTask
+{
+    MTime      *fTime;  //!
+    MEventRate *fRate;  //!
+
+    ULong_t fEvtNumber; //!
+    MTime   fEvtTime;   //!
+
+    UInt_t  fNumEvents;
+
+    Int_t PreProcess(MParList *pList);
+    Int_t Process();
+
+public:
+    MEventRateCalc(const char *name=NULL, const char *title=NULL);
+
+    void SetNumEvents(ULong_t num) { fNumEvents = num; }
+
+    ClassDef(MEventRateCalc, 0)// Task to calculate event rates
+};
+ 
+
+#endif
Index: /trunk/MagicSoft/Mars/manalysis/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/Makefile	(revision 2564)
+++ /trunk/MagicSoft/Mars/manalysis/Makefile	(revision 2565)
@@ -52,7 +52,8 @@
            MCerPhotAnal2.cc \
 	   MCerPhotCalc.cc \
-	   MPedCalcPedRun.cc \
            MBlindPixels.cc \
            MBlindPixelCalc.cc \
+           MEventRate.cc \
+           MEventRateCalc.cc \
 	   MSigmabar.cc \
 	   MSigmabarParam.cc \
