Index: trunk/MagicSoft/Mars/manalysis/MGeomApply.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MGeomApply.cc	(revision 5832)
+++ trunk/MagicSoft/Mars/manalysis/MGeomApply.cc	(revision 5844)
@@ -47,18 +47,18 @@
 //  specified in the constructor. The default geometry is
 //  MGeomCamMagic.
+//
+// In a standard setup all containers in the parameter list which derive
+// from MCamEvent are processed automatically in ReInit. To allow having
+// two parallel geometries in the parameter list or for MCamEvent in the
+// parameter list you can switch off the automatic procedure by adding
+// the containers to be processed using AddCamEvent().
+//
 // 
 //  Input Containers:
 //   [MGeomCam]
+//   [all MCamEvent]
 //
 //  Output Containers:
-//   [MPedestalCam]
-//   [MCalibrationChargeCam]
-//   [MCalibrationRelTimeCam]
-//   [MCalibrationQECam]
-//   [MCalibrationPedCam]
-//   [MPedPhotCam]
-//   [MExtractedSignalCam]
-//   [MArrivalTime]
-//   [MArrivalTimeCam]
+//   [all MCamEvent]
 //
 //////////////////////////////////////////////////////////////////////////////
@@ -67,4 +67,6 @@
 #include <fstream>
 
+#include <TObjString.h>
+
 #include "MLog.h"
 #include "MLogManip.h"
@@ -73,11 +75,5 @@
 
 #include "MGeomCam.h"
-#include "MPedestalCam.h"
-#include "MCalibrationCam.h"
-#include "MPedPhotCam.h"
-#include "MExtractedSignalCam.h"
-#include "MArrivalTimeCam.h"
-#include "MArrivalTime.h"
-#include "MBadPixelsCam.h"
+#include "MCamEvent.h"
 
 ClassImp(MGeomApply);
@@ -89,8 +85,21 @@
 //  Default constructor. MGeomCamMagic is the default geometry.
 //
-MGeomApply::MGeomApply(const char *name, const char *title) : fGeomName("MGeomCamMagic")
+MGeomApply::MGeomApply(const char *name, const char *title)
+    : fGeomName("MGeomCamMagic"), fNamesList(0), fList(0)
 {
     fName  = name  ? name  : "MGeomApply";
     fTitle = title ? title : "Task to apply geometry settings";
+}
+
+// --------------------------------------------------------------------------
+//
+//  Delete fList if available.
+//
+MGeomApply::~MGeomApply()
+{
+    if (fList)
+        delete fList;
+    if (fNamesList)
+        delete fNamesList;
 }
 
@@ -109,4 +118,55 @@
 
     return cam ? kTRUE : kFALSE;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Check the whole parameter list for MCamEvent. For all MCamEvent
+//  MCamEvent::Init(MGeomCam&) is called.
+//
+void MGeomApply::ProcessAutomatic(MParList &list, const MGeomCam &geom) const
+{
+    TIter Next(list);
+    TObject *o = 0;
+
+    while ((o=Next()))
+    {
+        MCamEvent *cam = dynamic_cast<MCamEvent*>(o);
+        if (cam)
+            cam->Init(geom);
+    }
+}
+
+// --------------------------------------------------------------------------
+//
+//  Check all containers in fNamesList and fList. For all MCamEvent
+//  MCamEvent::Init(MGeomCam&) is called.
+//
+Bool_t MGeomApply::ProcessManual(MParList &list, const MGeomCam &geom) const
+{
+    TIter NextN(fNamesList);
+    TObject *o = 0;
+
+    while ((o=NextN()))
+    {
+        TObject *cont = list.FindObject(o->GetName(), "MCamEvent");
+        if (!cont)
+        {
+            *fLog << err << o->GetName() << " [MCamEvent] not found... abort." << endl;
+            return kFALSE;
+        }
+
+        MCamEvent *cam = dynamic_cast<MCamEvent*>(o);
+        cam->Init(geom);
+    }
+
+    TIter NextL(fList);
+    while ((o=NextL()))
+    {
+        MCamEvent *cam = dynamic_cast<MCamEvent*>(o);
+        cam->Init(geom);
+    }
+
+    return kTRUE;
 }
 
@@ -130,13 +190,8 @@
     geom->CalcPixRatio();
 
-    TIter Next(*pList);
-    TObject *o = 0;
-
-    while ((o=Next()))
-    {
-        MCamEvent *cam = dynamic_cast<MCamEvent*>(o);
-        if (cam)
-            cam->Init(*geom);
-    }
+    if (fList)
+        return ProcessManual(*pList, *geom);
+
+    ProcessAutomatic(*pList, *geom);
 
     return kTRUE;
@@ -160,2 +215,44 @@
     out << fGeomName << "\");" << endl;
 }
+
+// --------------------------------------------------------------------------
+//
+// Add a MCamEvent to be processed. This switches off the automatic
+// processing of all MCamEvent in the parameter list completely!
+//
+void MGeomApply::AddCamEvent(TObject *obj)
+{
+    if (!obj->InheritsFrom(MCamEvent::Class()))
+    {
+        *fLog << warn << "MGeomApply::AddCamEvent - WARNING: Object doesn't inherit from MCamEvent... ignored." << endl;
+        return;
+    }
+
+    if (!fList)
+    {
+        fList = new TList;
+        fNamesList = new TList;
+
+        fNamesList->SetOwner();
+    }
+
+    fList->Add(obj);
+}
+
+// --------------------------------------------------------------------------
+//
+// Add a MCamEvent to be processed. This switches off the automatic
+// processing of all MCamEvent in the parameter list completely!
+//
+void MGeomApply::AddCamEvent(const char *name)
+{
+    if (!fList)
+    {
+        fList = new TList;
+        fNamesList = new TList;
+
+        fNamesList->SetOwner();
+    }
+
+    fNamesList->Add(new TObjString(name));
+}
Index: trunk/MagicSoft/Mars/manalysis/MGeomApply.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MGeomApply.h	(revision 5832)
+++ trunk/MagicSoft/Mars/manalysis/MGeomApply.h	(revision 5844)
@@ -7,4 +7,5 @@
 
 class MParList;
+class MGeomCam;
 
 class MGeomApply : public MTask
@@ -12,4 +13,10 @@
 private:
     TString fGeomName; // Name of geometry class
+
+    TList *fNamesList;
+    TList *fList;
+
+    void ProcessAutomatic(MParList &plist, const MGeomCam &geom) const;
+    Bool_t ProcessManual(MParList &plist, const MGeomCam &geom) const;
 
     Int_t  PreProcess(MParList *plist);
@@ -19,6 +26,10 @@
 public:
     MGeomApply(const char *name=NULL, const char *title=NULL);
+    ~MGeomApply();
 
     void SetGeometry(TString geom) { fGeomName = geom; }
+
+    void AddCamEvent(TObject *obj);
+    void AddCamEvent(const char *name);
 
     ClassDef(MGeomApply, 0) // Task to apply geometry settings
