Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 3597)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 3666)
@@ -333,20 +333,20 @@
 
     //
-    // Update current speed each second
-    //
-    if (fDisplay && t0-t2>(TTime)1000)
-    {
-        const Int_t speed = 1000*(num-start)/(long int)(t0-t2);
+    // Update current speed each 1.5 second
+    //
+    if (fDisplay && t0-t2>(TTime)1500)
+    {
+        const Float_t speed = 1000.*(num-start)/(long int)(t0-t2);
         TString txt = "Processing...";
         if (speed>0)
         {
             txt += " (";
-            txt += speed;
+            txt += (Int_t)speed;
             txt += "Evts/s";
             if (fNumEvents>0)
             {
                 txt += ", est: ";
-                txt += (int)((long int)(t0-t2)*fNumEvents/(60000.*(num-start)));
-                txt += "m";
+                txt += (int)((fNumEvents-num)/speed/60)+1;
+                txt += "min";
             }
             //txt += (int)fmod(entries/(1000.*(num-start)/(long int)(t0-t2)), 60);
@@ -356,5 +356,5 @@
         fDisplay->SetStatusLine1(txt);
         start = num;
-        t2 = t1;
+        t2 = t0;
     }
 
Index: trunk/MagicSoft/Mars/mbase/MMath.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 3597)
+++ trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 3666)
@@ -52,4 +52,16 @@
 // --------------------------------------------------------------------------
 //
+// Symmetrized significance - this is somehow analog to
+// SignificanceLiMaSigned
+//
+// Returns Significance(s,b) if s>b otherwise -Significance(b, s);
+// 
+Double_t MMath::SignificanceSym(Double_t s, Double_t b)
+{
+    return s>b ? Significance(s, b) : -Significance(b, s);
+}
+
+// --------------------------------------------------------------------------
+//
 //  calculates the significance according to Li & Ma
 //  ApJ 272 (1983) 317, Formula 17
@@ -58,4 +70,6 @@
 //  b                    // b: number of off events
 //  alpha = t_on/t_off;  // t: observation time
+//
+//  The significance has the same (positive!) value for s>b and b>s.
 //
 //  Returns -1 if sum<0 or alpha<0 or the argument of sqrt<0
@@ -77,2 +91,17 @@
     return l+m<0 ? -1 : TMath::Sqrt((l+m)*2);
 }
+
+// --------------------------------------------------------------------------
+//
+// Calculates MMath::SignificanceLiMa(s, b, alpha). Returns 0 if the
+// calculation has failed. Otherwise the Li/Ma significance which was
+// calculated. If s<b a negative value is returned.
+//
+Double_t MMath::SignificanceLiMaSigned(Double_t s, Double_t b, Double_t alpha)
+{
+    const Double_t sig = SignificanceLiMa(s, b, alpha);
+    if (sig<=0)
+        return 0;
+
+    return TMath::Sign(sig, s-b);
+}
Index: trunk/MagicSoft/Mars/mbase/MMath.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MMath.h	(revision 3597)
+++ trunk/MagicSoft/Mars/mbase/MMath.h	(revision 3666)
@@ -10,5 +10,7 @@
 public:
     static Double_t Significance(Double_t s, Double_t b);
+    static Double_t SignificanceSym(Double_t s, Double_t b);
     static Double_t SignificanceLiMa(Double_t s, Double_t b, Double_t alpha=1);
+    static Double_t SignificanceLiMaSigned(Double_t s, Double_t b, Double_t alpha=1);
 
     ClassDef(MMath, 0)
Index: trunk/MagicSoft/Mars/mbase/MParContainer.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 3597)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 3666)
@@ -407,12 +407,49 @@
 TMethodCall *MParContainer::GetterMethod(const char *name) const
 {
-    TClass *cls = IsA()->GetBaseDataMember(name);
+    const TString n(name);
+    const Int_t pos1 = n.First('.');
+
+    const TString part1 = pos1<0 ? n : n(0, pos1);
+    const TString part2 = pos1<0 ? TString("") : n(pos1+1, n.Length());
+
+    TClass *cls = IsA()->GetBaseDataMember(part1);
     if (cls)
     {
-        TDataMember *member = cls->GetDataMember(name);
+        TDataMember *member = cls->GetDataMember(part1);
         if (!member)
         {
-            *fLog << err << "Datamember '" << name << "' not in " << GetDescriptor() << endl;
+            *fLog << err << "Datamember '" << part1 << "' not in " << GetDescriptor() << endl;
             return NULL;
+        }
+
+        // This handles returning references of contained objects, eg
+        // class X { TObject fO; TObject &GetO() { return fO; } };
+        if (!member->IsBasic() && !part2.IsNull())
+        {
+            cls = gROOT->GetClass(member->GetTypeName());
+            if (!cls)
+            {
+                *fLog << err << "Datamember " << part1 << " [";
+                *fLog << member->GetTypeName() << "] not in dictionary." << endl;
+                return NULL;
+            }
+            if (!cls->InheritsFrom(MParContainer::Class()))
+            {
+                *fLog << err << "Datamember " << part1 << " [";
+                *fLog << member->GetTypeName() << "] does not inherit from ";
+                *fLog << "MParContainer." << endl;
+                return NULL;
+            }
+
+            const MParContainer *sub = (MParContainer*)((ULong_t)this+member->GetOffset());
+            return sub->GetterMethod(part2);
+        }
+
+        if (member->IsaPointer())
+        {
+            *fLog << warn << "Data-member " << part1 << " is a pointer..." << endl;
+            *fLog << dbginf << "Not yet implemented!" << endl;
+            //TClass *test = gROOT->GetClass(member->GetTypeName());
+            return 0;
         }
 
@@ -422,5 +459,5 @@
     }
 
-    *fLog << warn << "No standard access for '" << name << "' in ";
+    *fLog << warn << "No standard access for '" << part1 << "' in ";
     *fLog << GetDescriptor() << " or one of its base classes." << endl;
 
@@ -428,6 +465,6 @@
 
     *fLog << warn << "Trying to find MethodCall '" << ClassName();
-    *fLog << "::Get" << name << "' instead <LEAKS MEMORY>" << endl;
-    call = new TMethodCall(IsA(), (TString)"Get"+name, "");
+    *fLog << "::Get" << part1 << "' instead <LEAKS MEMORY>" << endl;
+    call = new TMethodCall(IsA(), (TString)"Get"+part1, "");
     if (call->GetMethod())
         return call;
@@ -436,6 +473,6 @@
 
     *fLog << warn << "Trying to find MethodCall '" << ClassName();
-    *fLog << "::" << name << "' instead <LEAKS MEMORY>" << endl;
-    call = new TMethodCall(IsA(), name, "");
+    *fLog << "::" << part1 << "' instead <LEAKS MEMORY>" << endl;
+    call = new TMethodCall(IsA(), part1, "");
     if (call->GetMethod())
         return call;
@@ -443,5 +480,5 @@
     delete call;
 
-    *fLog << err << "Sorry, no getter method found for " << name << endl;
+    *fLog << err << "Sorry, no getter method found for " << part1 << endl;
     return NULL;
 }
Index: trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 3597)
+++ trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 3666)
@@ -1433,5 +1433,5 @@
     //        where (eg Eventloop) first!
 
-    gLog << dbg << fName << " is on heap: " << (int)IsOnHeap() << endl;
+    //gLog << dbg << fName << " is on heap: " << (int)IsOnHeap() << endl;
 
     if (TestBit(kExitLoopOnExit) || TestBit(kExitLoopOnClose))
@@ -1443,9 +1443,9 @@
     if (fIsLocked<=0 && IsOnHeap())
     {
-        gLog << dbg << "delete " << fName << ";" << endl;
+        //gLog << dbg << "delete " << fName << ";" << endl;
         delete this;
     }
     fStatus = kFileExit;
-    gLog << dbg << fName << ".fStatus=kFileExit;" << endl;
+    //gLog << dbg << fName << ".fStatus=kFileExit;" << endl;
 }
 
Index: trunk/MagicSoft/Mars/mbase/MTask.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 3597)
+++ trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 3666)
@@ -106,5 +106,5 @@
 MTask::MTask(const char *name, const char *title)
     : fFilter(NULL), fSerialNumber(0), fIsPreprocessed(kFALSE),
-    fNumExecutions(0), fStopwatch(0)
+    fStopwatch(0)
 {
     fName  = name  ? name  : "MTask";
@@ -194,5 +194,4 @@
 Int_t MTask::CallPreProcess(MParList *plist)
 {
-    fNumExecutions = 0;
     fStopwatch->Reset();
 
@@ -240,6 +239,4 @@
         return kTRUE;
 
-    fNumExecutions++;
-
     fStopwatch->Start(kFALSE);
     const Int_t rc = Process();
@@ -346,5 +343,16 @@
 // --------------------------------------------------------------------------
 //
-//  Return total CPU execution time of task
+//  Return the total number of calls to Process(). If Process() was not
+//  called due to a set filter this is not counted.
+//
+UInt_t MTask::GetNumExecutions() const
+{
+    return (UInt_t)fStopwatch->Counter();
+}
+
+// --------------------------------------------------------------------------
+//
+//  Return total CPU execution time in seconds of calls to Process().
+//  If Process() was not called due to a set filter this is not counted.
 //
 Double_t MTask::GetCpuTime() const
@@ -355,5 +363,6 @@
 // --------------------------------------------------------------------------
 //
-//  Return total real execution time of task
+//  Return total real execution time in seconds of calls to Process().
+//  If Process() was not called due to a set filter this is not counted.
 //
 Double_t MTask::GetRealTime() const
@@ -366,4 +375,11 @@
 //  Prints the relative time spent in Process() (relative means relative to
 //  its parent Tasklist) and the number of times Process() was executed.
+//  Don't wonder if the sum of the tasks in a tasklist is not 100%,
+//  because only the call to Process() of the task is measured. The
+//  time of the support structure is ignored. The faster your analysis is
+//  the more time is 'wasted' in the support structure.
+//  Only the CPU time is displayed. This means that exspecially task
+//  which have a huge part of file i/o will be underestimated in their
+//  relative wasted time.
 //  For convinience the lvl argument results in a number of spaces at the
 //  beginning of the line. So that the structur of a tasklist can be
@@ -379,10 +395,11 @@
 
     *fLog << all << setfill(' ') << setw(lvl) << " ";
-    if (fStopwatch->CpuTime()>0 && time>0)
-        *fLog << setw(3) << (Int_t)(fStopwatch->CpuTime()/time*100+.5) << "% ";
+
+    if (GetCpuTime()>0 && time>0 && GetCpuTime()>=0.001*time)
+        *fLog << Form("%5.1f", GetCpuTime()/time*100) << "% ";
     else
-        *fLog << "     ";
+        *fLog << "       ";
     *fLog << GetDescriptor() << "\t";
-    *fLog << dec << fNumExecutions;
+    *fLog << dec << GetNumExecutions();
     if (fFilter)
         *fLog << " <" << fFilter->GetName() << ">";
Index: trunk/MagicSoft/Mars/mbase/MTask.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.h	(revision 3597)
+++ trunk/MagicSoft/Mars/mbase/MTask.h	(revision 3666)
@@ -29,7 +29,6 @@
 
     Bool_t fIsPreprocessed; //! Indicates the success of the PreProcessing (set by MTaskList)
-    UInt_t fNumExecutions;  //! Number of Excutions
 
-    TStopwatch *fStopwatch; //!
+    TStopwatch *fStopwatch; //! Count the execution time and number of executions
 
     virtual Int_t PreProcess(MParList *pList);
@@ -74,6 +73,6 @@
     // Filter functions
     virtual void SetFilter(MFilter *filter) { fFilter=filter; }
-    const MFilter *GetFilter() const      { return fFilter; }
-    MFilter *GetFilter()  { return fFilter; } // for MContinue only
+    const MFilter *GetFilter() const        { return fFilter; }
+    MFilter *GetFilter()                    { return fFilter; } // for MContinue only
 
     // Display functions
@@ -86,11 +85,11 @@
     TString AddSerialNumber(const TString &str) const { return AddSerialNumber(str, fSerialNumber); }
 
-    virtual void SetSerialNumber(Byte_t num) { fSerialNumber = num; }
-    Byte_t  GetSerialNumber() const { return fSerialNumber; }
+    virtual void SetSerialNumber(Byte_t num) { fSerialNumber = num;  }
+    Byte_t GetSerialNumber() const           { return fSerialNumber; }
 
     const char *GetDescriptor() const;
 
     // Task execution statistics
-    UInt_t GetNumExecutions() const { return fNumExecutions; }
+    UInt_t   GetNumExecutions() const;
     Double_t GetCpuTime() const;
     Double_t GetRealTime() const;
Index: trunk/MagicSoft/Mars/mbase/MTaskList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 3597)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 3666)
@@ -635,4 +635,8 @@
         if (title)
             *fLog << "\t" << fTitle;
+        if (time>=0)
+            *fLog << Form(" %5.1f", GetCpuTime()/time*100) << "%";
+        else
+            *fLog << " 100.0%";
         *fLog << endl;
     }
Index: trunk/MagicSoft/Mars/mbase/MTaskList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 3597)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 3666)
@@ -70,5 +70,5 @@
 
     void Print(Option_t *opt = "") const;
-    void PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE, Double_t time=0) const;
+    void PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE, Double_t time=-1) const;
     void SetOwner(Bool_t enable=kTRUE);
 
Index: trunk/MagicSoft/Mars/mbase/MTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 3597)
+++ trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 3666)
@@ -362,5 +362,5 @@
     const Double_t sum = (r1+r2)/(24*3600);
 
-    return fmod(sum, 1)*TMath::TwoPi()+TMath::TwoPi();
+    return fmod(sum, 1)*TMath::TwoPi();//+TMath::TwoPi();
 }
 
