Index: trunk/MagicSoft/Mars/mbase/MParContainer.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 2461)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 2470)
@@ -163,4 +163,19 @@
 // --------------------------------------------------------------------------
 //
+// Returns the name of the object. If the name of the object is not the
+// class name it returns the object name and in []-brackets the class name.
+//
+const char *MParContainer::GetDescriptor() const
+{
+    //
+    // Because it returns a (const char*) we cannot return a casted
+    // local TString. The pointer would - immediatly after return -
+    // point to a random memory segment, because the TString has gone.
+    //
+    return fName==ClassName() ? ClassName() : Form("%s [%s]", fName.Data(), ClassName());
+}
+
+// --------------------------------------------------------------------------
+//
 //  Return a unique name for this container. It is created from
 //  the container name and the unique Id. (This is mostly used
Index: trunk/MagicSoft/Mars/mbase/MParContainer.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 2461)
+++ trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 2470)
@@ -74,5 +74,5 @@
     virtual void        FillBuffer(char *&buffer);
 
-    virtual const char   *GetDescriptor() const { return fName==ClassName() ? ClassName() : Form("%s [%s]", fName.Data(), ClassName()); }
+    virtual const char   *GetDescriptor() const;
     virtual const TString GetUniqueName() const;
     virtual const char   *GetName() const       { return fName.Data(); }
Index: trunk/MagicSoft/Mars/mbase/MTask.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 2461)
+++ trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 2470)
@@ -24,45 +24,53 @@
 
 /////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-//   MTask                                                                 //
-//                                                                         //
-//   Base class for all tasks which can perfomed in a tasklist             //
-//   For each event processed in the eventloop all the different           //
-//   tasks in the tasklist will be processed.                              //
-//                                                                         //
-//   So all tasks must inherit from this baseclass.                        //
-//                                                                         //
-//   The inheritance from MInputStreamID is used to indicate the           //
-//   type of event that this task is for. If it is "All" it is executed    //
-//   independantly of the actual ID of the task list.                      //
-//                                                                         //
-//   Inside this abstract class, there are three fundamental function:     //
-//                                                                         //
-//   - PreProcess():   executed before the eventloop starts. Here you      //
-//                     can initiate different things, open files, etc.     //
-//                     As an argument this function gets a pointer to the  //
-//                     parameter list. You can stop the execution by       //
-//                     returning kFALSE instead of kTRUE. If an error      //
-//                     occured and you return kFALSE make sure, that       //
-//                     any action is closed correctly and all newly        //
-//                     created object are deleted. The PostProcess in      //
-//                     such a case won't be executed by the Tasklist or    //
-//                     Eventloop.                                          //
-//                                                                         //
-//   - Process():      executed for each event in the eventloop. Do it     //
-//                     one task after the other (as they occur in the      //
-//                     tasklist). Only the tasks with a Stream ID          //
-//                     which matches the actual ID of the tasklist         //
-//                     are executed. A task can return kFALSE to           //
-//                     stop the execuition of the tasklist or              //
-//                     kCONTINUE to skip the pending tasks. If you want    //
-//                     to stop the eventloop and wants the eventloop to    //
-//                     return the status 'failed' return kERROR.           //
-//                                                                         //
-//   - PostProcess():  executed after the eventloop. Here you can close    //
-//                     output files, start display of the run parameter,   //
-//                     etc. PostProcess is only executed in case of        //
-//                     PreProcess was successfull (returned kTRUE)         //
-//                                                                         //
+//
+//   MTask
+//
+//   Base class for all tasks which can perfomed in a tasklist
+//   For each event processed in the eventloop all the different
+//   tasks in the tasklist will be processed.
+//
+//   So all tasks must inherit from this baseclass.
+//
+//   The inheritance from MInputStreamID is used to indicate the
+//   type of event that this task is for. If it is "All" it is executed
+//   independantly of the actual ID of the task list.
+//
+//   Inside this abstract class, there are three fundamental function:
+//
+//   - PreProcess():   executed before the eventloop starts. Here you
+//                     can initiate different things, open files, etc.
+//                     As an argument this function gets a pointer to the
+//                     parameter list. You can stop the execution by
+//                     returning kFALSE instead of kTRUE. If an error
+//                     occured and you return kFALSE make sure, that
+//                     any action is closed correctly and all newly
+//                     created object are deleted. The PostProcess in
+//                     such a case won't be executed by the Tasklist or
+//                     Eventloop.
+//
+//   - Process():      executed for each event in the eventloop. Do it
+//                     one task after the other (as they occur in the
+//                     tasklist). Only the tasks with a Stream ID
+//                     which matches the actual ID of the tasklist
+//                     are executed. A task can return kFALSE to
+//                     stop the execuition of the tasklist or
+//                     kCONTINUE to skip the pending tasks. If you want
+//                     to stop the eventloop and wants the eventloop to
+//                     return the status 'failed' return kERROR.
+//
+//   - PostProcess():  executed after the eventloop. Here you can close
+//                     output files, start display of the run parameter,
+//                     etc. PostProcess is only executed in case of
+//                     PreProcess was successfull (returned kTRUE)
+//
+//  Version 1:
+//  ----------
+//   - first version
+//
+//  Version 2:
+//  ----------
+//   - added fSerialNumber
+//
 /////////////////////////////////////////////////////////////////////////////
 #include "MTask.h"
@@ -286,4 +294,26 @@
 {
     return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Returns the name of the object. If the name of the object is not the
+// class name it returns the object name and in []-brackets the class name.
+// If a serial number is set (!=0) the serial number is added to the
+// name (eg. ;1)
+//
+const char *MTask::GetDescriptor() const
+{
+    //
+    // Because it returns a (const char*) we cannot return a casted
+    // local TString. The pointer would - immediatly after return -
+    // point to a random memory segment, because the TString has gone.
+    //
+    if (fName==ClassName())
+        return fSerialNumber==0 ? ClassName() : Form("%s;%d", ClassName(), fSerialNumber);
+
+    return fSerialNumber>0 ?
+        Form("%s;%d [%s]", fName.Data(), fSerialNumber, ClassName()) :
+        Form("%s [%s]", fName.Data(), ClassName());
 }
 
@@ -327,5 +357,7 @@
      fFilter->SavePrimitive(out);
      */
-     out << "   " << GetUniqueName() << ".SetFilter(&" << fFilter->GetUniqueName() <<");" << endl;
+    out << "   " << GetUniqueName() << ".SetFilter(&" << fFilter->GetUniqueName() <<");" << endl;
+    if (fSerialNumber>0)
+        out << "   " << GetUniqueName() << ".SetSerialNumber(" << fSerialNumber <<");" << endl;
 }
 
Index: trunk/MagicSoft/Mars/mbase/MTask.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.h	(revision 2461)
+++ trunk/MagicSoft/Mars/mbase/MTask.h	(revision 2470)
@@ -25,4 +25,5 @@
 
     MFilter *fFilter;       // Filter for conditional task execution
+    Byte_t   fSerialNumber; // Serial number having more than one detector of the same type
 
     Bool_t fIsPreprocessed; //! Indicates the success of the PreProcessing (set by MTaskList)
@@ -68,6 +69,14 @@
     const MFilter *GetFilter() const      { return fFilter; }
     MFilter *GetFilter()  { return fFilter; } // for MContinue only
+
     void SetDisplay(MStatusDisplay *d);
     virtual void PrintStatistics(const Int_t lvl=0, Bool_t title=kFALSE) const;
+
+    virtual void SetSerialNumber(Byte_t num) { fSerialNumber = num; }
+    Byte_t  GetSerialNumber() const { return fSerialNumber; }
+    TString AddSerialNumber(const char *str) const { TString s(str); if (fSerialNumber==0) return s; s += ";"; s += fSerialNumber; return s; }
+    TString AddSerialNumber(const TString &str) const { return AddSerialNumber((const char*)str); }
+
+    const char *GetDescriptor() const;
 
     UInt_t GetNumExecutions() const { return fNumExecutions; }
@@ -85,5 +94,5 @@
     void SavePrimitive(ofstream &out, Option_t *o="");
 
-    ClassDef(MTask, 1) //Abstract base class for a task
+    ClassDef(MTask, 2) //Abstract base class for a task
 };
 
Index: trunk/MagicSoft/Mars/mbase/MTaskList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 2461)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 2470)
@@ -145,8 +145,23 @@
 }
 
+// --------------------------------------------------------------------------
+//
+//  Set the display for the all tasks in the list and the tasklist itself.
+//
 void MTaskList::SetDisplay(MStatusDisplay *d)
 {
     fTasks->ForEach(MTask, SetDisplay)(d);
     MTask::SetDisplay(d);
+}
+
+// --------------------------------------------------------------------------
+//
+//  Set the serial number for the all tasks in the list and the tasklist
+//  itself.
+//
+void MTaskList::SetSerialNumber(Byte_t num)
+{
+    fTasks->ForEach(MTask, SetSerialNumber)(num);
+    MTask::SetSerialNumber(num);
 }
 
Index: trunk/MagicSoft/Mars/mbase/MTaskList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 2461)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 2470)
@@ -47,4 +47,6 @@
     Bool_t AddToList(MTask *task, const char *tType="All");
 
+    void SetSerialNumber(Byte_t num);
+
     Bool_t RemoveFromList(MTask *task);
 
