Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 3003)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 3004)
@@ -4,4 +4,15 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2004/02/02: Abelardo Moralejo
+
+   * manalysis/MMcCalibrationUpdate.cc, MMcPedestalCopy.cc
+     - removed file type check (MC or data) from PreProcess since now
+       run headers are not yet known at that point.
+
+   * mcalib/MMcCalibrationCalc.cc
+     - same as above.
+
+
  2004/02/02: Thomas Bretz
 
Index: /trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc	(revision 3003)
+++ /trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc	(revision 3004)
@@ -108,11 +108,4 @@
 Int_t MMcCalibrationUpdate::PreProcess(MParList *pList)
 {
-  //
-  // If it is no MC file skip this function...
-  //
-  if (!CheckRunType(pList))
-    return kTRUE;
-
-
   fCalCam = (MCalibrationCam*) pList->FindObject(AddSerialNumber("MCalibrationCam"));
   if ( !fCalCam )
@@ -163,6 +156,9 @@
     //
     if (!CheckRunType(pList))
+      {
+	*fLog << inf << "This is no MC file... skipping." << endl;
         return kTRUE;
-
+      }
+	
     //
     // Now check the existence of all necessary containers.
Index: /trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc	(revision 3003)
+++ /trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc	(revision 3004)
@@ -89,17 +89,16 @@
 }
 
+
+
 // --------------------------------------------------------------------------
 //
-// Make sure, that there is an MPedestalCam Object in the Parameter List.
+// Make sure that there is a MPedestalCam object in the parameter list.
 //
-Int_t MMcPedestalCopy::PreProcess(MParList *pList)
+Int_t  MMcPedestalCopy::PreProcess(MParList *pList)
 {
-  //
-  // If it is no MC file skip this function...
-  //
-  if (! CheckRunType(pList))
-    return kTRUE;
+  if ( ! pList->FindObject(AddSerialNumber("MPedestalCam")) )
+    pList->FindCreateObj(AddSerialNumber("MPedestalCam"));
 
-  return pList->FindCreateObj(AddSerialNumber("MPedestalCam")) ? kTRUE : kFALSE;
+  return kTRUE;
 }
 
@@ -115,5 +114,8 @@
     //
     if (!CheckRunType(pList))
+      {
+	*fLog << inf << "This is no MC file... skipping." << endl;
         return kTRUE;
+      }
 
     //
@@ -128,7 +130,11 @@
     }
 
-    MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj(AddSerialNumber("MPedestalCam"));
+    MPedestalCam *pedcam = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam"));
     if (!pedcam)
+      {
+        *fLog << err << dbginf << "Cannot create " << AddSerialNumber("MPedestalCam") <<"... Exiting." << endl;
+
         return kFALSE;
+      }
 
     MMcRunHeader *mcrun = (MMcRunHeader*)pList->FindObject("MMcRunHeader");
Index: /trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc	(revision 3003)
+++ /trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc	(revision 3004)
@@ -99,12 +99,4 @@
 Int_t MMcCalibrationCalc::PreProcess(MParList *pList)
 {
-  //
-  // If it is no MC file display error and exit
-  //
-  if (!CheckRunType(pList))
-    {
-      *fLog << err << dbginf << "This is no MC file... aborting." << endl;
-      return kFALSE;
-    }
 
   fCalCam = (MCalibrationCam*) pList->FindObject(AddSerialNumber("MCalibrationCam"));
@@ -148,4 +140,13 @@
 Bool_t MMcCalibrationCalc::ReInit(MParList *pList)
 {
+  //
+  // If it is no MC file display error and exit
+  //
+  if (!CheckRunType(pList))
+    {
+      *fLog << err << dbginf << "This is no MC file... aborting." << endl;
+      return kFALSE;
+    }
+
   //
   // Now check the existence of all necessary containers.
