Index: trunk/MagicSoft/Mars/manalysis/MGeomApply.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MGeomApply.cc	(revision 7150)
+++ trunk/MagicSoft/Mars/manalysis/MGeomApply.cc	(revision 7188)
@@ -133,6 +133,24 @@
     {
         MCamEvent *cam = dynamic_cast<MCamEvent*>(o);
-        if (cam)
-            cam->Init(geom);
+        if (!cam)
+            continue;
+
+        // If the MGeomApply task has a serial number >0 (indicating most likely
+        // a specific telescope in a multi-telescope file), then apply the
+        // geometry only to objects with the same serial number. This is important
+        // for stereo setups in which the telescopes have cameras with different
+        // numbers of pixels. If the MGeomApply task has serial number 0 (default),
+        // it will apply the geometry to all found objects as it used to do.
+        const TString name(o->GetName());
+
+        // Extract serial number from name:
+        const Int_t serial = atoi(name.Data()+name.Last(';')+1);
+
+        // Compare with the serial number of this task:
+        if (serial>0 && serial!=GetSerialNumber())
+            continue;
+
+        // Initialize object according to camera geometry:
+        cam->Init(geom);
     }
 }
@@ -186,5 +204,5 @@
 
     // FIXME, workaround: this call to CalcPixRatio is here just to allow
-    // the use of some camera files from the 0.7 beta version in which the 
+    // the use of some MC camera files from the 0.7 beta version in which the 
     // array containing pixel ratios is not initialized.
     geom->CalcPixRatio();
Index: trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc	(revision 7150)
+++ trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc	(revision 7188)
@@ -95,5 +95,5 @@
 Bool_t MMcCalibrationUpdate::CheckRunType(MParList *pList) const
 {
-    const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
+    const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject(AddSerialNumber("MRawRunHeader"));
     if (!run)
     {
@@ -176,5 +176,10 @@
     }
 
-    MMcRunHeader* mcrunh = (MMcRunHeader*) pList->FindObject("MMcRunHeader");
+    MMcRunHeader* mcrunh = (MMcRunHeader*) pList->FindObject(AddSerialNumber("MMcRunHeader"));
+    if (!mcrunh)
+    {
+        *fLog << err << AddSerialNumber("MMcRunHeader") << " not found... aborting." << endl;
+        return kFALSE;
+    }
 
     //
@@ -247,7 +252,7 @@
     // perpendicular to the camera plane.
     //
-    // FIXME! We look for AddSerialNumber("MMcConfigRunHeader") but
-    // for the moment the stereo version of camera does not write one such
-    // header per telescope (it should!)
+    // As it happens with most containers, we look for AddSerialNumber("MMcConfigRunHeader")
+    // because in the stereo option the camera simulation writes one such header 
+    // per telescope.
     //
     MMcConfigRunHeader* mcconfig = (MMcConfigRunHeader*) pList->FindObject(AddSerialNumber("MMcConfigRunHeader"));
Index: trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc	(revision 7150)
+++ trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc	(revision 7188)
@@ -17,5 +17,4 @@
 !
 !   Author(s): Antonio Stamerra  1/2003 <mailto:antono.stamerra@pi.infn.it>
-!   Author(s): Marcos Lopez 1/2003 <mailto:marcos@gae.ucm.es>
 !
 !   Copyright: MAGIC Software Development, 2000-2003
@@ -71,5 +70,5 @@
 // run type
 //
-Bool_t MMcTriggerLvl2Calc::CheckRunType(MParList *pList) const
+Bool_t MMcTriggerLvl2Calc::IsMCRun(MParList *pList) const
 {
   const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
@@ -90,46 +89,7 @@
 Bool_t MMcTriggerLvl2Calc::ReInit(MParList *pList)
 {
-    //
-    // If it is no MC file skip this function...
-    //
-    if (!CheckRunType(pList))
-    {
-        *fLog << inf << "This is no MC file... skipping." << endl;
-        return kTRUE;
-    }
-        
-    //
-    // Check all necessary containers
-    //
-    fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
-     if (!fMcEvt)
-     {
-         *fLog << err << dbginf << "MMcEvt not found... exit." << endl;
-         return kFALSE;
-     }
-
-    fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig");
-    if (!fMcTrig)
-    {
-        *fLog << err << dbginf << "MMcTrig not found... exit." << endl;
-        return kFALSE;
-    }
-
-    fCam = (MGeomCam*)pList->FindObject("MGeomCam");
-    if (!fCam)
-    {
-        *fLog << dbginf << "MGeomCam not found (no geometry information available)... aborting." << endl;
-        return kFALSE;
-    }
-    // Check if fCam is a Magic geometry: only MGeomCamMagic geometry and 
-    // geometries with 577 pixels are now accepted by MMcTriggerLvl2
-    if (fCam->GetNumPixels()!= 577)
-      {
-        *fLog << dbginf << "MGeomCam has a wrong geometry; only MAGIC geometry (577 pixels) is accepted by now... aborting" <<endl;
-	return kFALSE;
-      }
-
     return kTRUE;
 }
+
 
 
@@ -168,6 +128,47 @@
       *fLog << "Compact pixel is set with at least "<<fMMcTriggerLvl2->GetCompactNN() << " NN" <<endl;
 
+    //------------------------------------------------------------
+    //
+    // If it is no MC file skip this function...
+    //
+    if (!IsMCRun(pList))
+    {
+        *fLog << inf << "Reading a data file...skipping the rest of PreProcess()" << endl;
+        return kTRUE;
+    }
+        
+    //
+    // Check all necessary containers in case of a MC run
+    //
+    fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
+     if (!fMcEvt)
+     {
+         *fLog << err << dbginf << "MMcEvt not found... exit." << endl;
+         return kFALSE;
+     }
+
+    fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig");
+    if (!fMcTrig)
+    {
+        *fLog << err << dbginf << "MMcTrig not found... exit." << endl;
+        return kFALSE;
+    }
+
+    fCam = (MGeomCam*)pList->FindObject("MGeomCam");
+    if (!fCam)
+    {
+        *fLog << err << "MGeomCam not found (no geometry information available)... aborting." << endl;
+        return kFALSE;
+    }
+    // Check if fCam is a Magic geometry: only MGeomCamMagic geometry and 
+    // geometries with 577 pixels are now accepted by MMcTriggerLvl2
+    if (fCam->GetNumPixels()!= 577)
+      {
+        *fLog << warn << "MGeomCam has a wrong geometry; only MAGIC geometry (577 pixels) is accepted by now... the Task is skipped." <<endl;
+	return kSKIP;
+      }
 
     return kTRUE;
+
 }
 
Index: trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.h	(revision 7150)
+++ trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.h	(revision 7188)
@@ -33,5 +33,5 @@
 
   Bool_t ReInit(MParList *pList);
-  Bool_t CheckRunType(MParList *pList) const;
+  Bool_t IsMCRun(MParList *pList) const;
 
  public:
