Index: trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 3362)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 3374)
@@ -164,5 +164,5 @@
     if (!fRawEvt)
     {
-      *fLog << err << dbginf << "MRawEvtData not found... aborting." << endl;
+      *fLog << err << "MRawEvtData not found... aborting." << endl;
       return kFALSE;
     }
@@ -170,24 +170,16 @@
     const MRawRunHeader *runheader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     if (!runheader)
-      *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl;
+      *fLog << warn << "Warning - cannot check file type, MRawRunHeader not found." << endl;
     else
-      if (runheader->GetRunType() == kRTMonteCarlo)
-        {
+      if (runheader->IsMonteCarloRun())
           return kTRUE;
-        }
     
     fCam = (MCalibrationChargeCam*)pList->FindCreateObj("MCalibrationChargeCam");
     if (!fCam)
-      {
-        *fLog << err << dbginf << "MCalibrationChargeCam could not be created ... aborting." << endl;        
-        return kFALSE;
-      }
+        return kFALSE;
 
     fPINDiode = (MCalibrationChargePINDiode*)pList->FindCreateObj("MCalibrationChargePINDiode");
     if (!fPINDiode)
-      {
-        *fLog << err << dbginf << "MCalibrationChargePINDiode could not be created ... aborting." << endl;        
-        return kFALSE;
-      }
+        return kFALSE;
 
     fCam->SetPINDiode(fPINDiode);
@@ -195,27 +187,23 @@
     fBlindPixel = (MCalibrationChargeBlindPix*)pList->FindCreateObj("MCalibrationChargeBlindPix");
     if (!fBlindPixel)
-      {
-        *fLog << err << dbginf << "MCalibrationChargeBlindPix could not be created ... aborting." << endl;        
-        return kFALSE;
-      }
+        return kFALSE;
 
     fCam->SetBlindPixel(fBlindPixel);
 
-    fEvtTime      = (MTime*)pList->FindObject("MTime");
+    fEvtTime = (MTime*)pList->FindObject("MTime");
 
     fPedestals = (MPedestalCam*)pList->FindObject("MPedestalCam");
     if (!fPedestals)
-      {
-        *fLog << err << dbginf << "Cannot find MPedestalCam ... aborting" << endl;
-        return kFALSE;
-      }
-
+    {
+        *fLog << err << "MPedestalCam not found... aborting" << endl;
+        return kFALSE;
+    }
 
     fSignals = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam");
     if (!fSignals)
-      {
-        *fLog << err << dbginf << "Cannot find MExtractedSignalCam ... aborting" << endl;
-        return kFALSE;
-      }
+    {
+        *fLog << err << "MExtractedSignalCam not found... aborting" << endl;
+        return kFALSE;
+    }
 
     return kTRUE;
@@ -230,18 +218,16 @@
 Bool_t MCalibrationChargeCalc::ReInit(MParList *pList )
 {
- 
     fRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     if (!fRunHeader)
     {
-      *fLog << err << dbginf << ": MRawRunHeader not found... aborting." << endl;
+      *fLog << err << "MRawRunHeader not found... aborting." << endl;
       return kFALSE;
     }
-
 
     fGeom = (MGeomCam*)pList->FindObject("MGeomCam");
     if (!fGeom)
     {
-      *fLog << err << GetDescriptor() << ": No MGeomCam found... aborting." << endl;
-      return kFALSE;
+        *fLog << err << "No MGeomCam found... aborting." << endl;
+        return kFALSE;
     }
 
@@ -255,6 +241,5 @@
 
     for (UInt_t i=0; i<npixels; i++)
-      {
-        
+    {
         MCalibrationChargePix &pix = (*fCam)[i];
         pix.DefinePixId(i);
@@ -264,65 +249,60 @@
         pix.SetAbsTimeBordersLoGain(fSignals->GetFirstUsedSliceLoGain(),
                                     fSignals->GetLastUsedSliceLoGain());
-        
-     }
+    }
     
+    if (fExcludedPixelsFile.IsNull())
+        return kTRUE;
+
     //
     // Look for file to exclude pixels from analysis
     //
-    if (!fExcludedPixelsFile.IsNull())
-      {
-        
-        fExcludedPixelsFile = gSystem->ExpandPathName(fExcludedPixelsFile.Data());
-        
+    gSystem->ExpandPathName(fExcludedPixelsFile);
+
+    //
+    // Initialize reading the file
+    //
+    ifstream in(fExcludedPixelsFile);
+    if (!in)
+    {
+        *fLog << warn << "Cannot open file '" << fExcludedPixelsFile << "'" << endl;
+        return kTRUE;
+    }
+
+    *fLog << inf << "Use excluded pixels from file: '" << fExcludedPixelsFile << "'" << endl;
+
+    //
+    // Read the file and count the number of entries
+    //
+    UInt_t pixel = 0;
+
+    while (++fNumExcludedPixels)
+    {
+        in >> pixel;
+        if (!in)
+            break;
+
         //
-        // Initialize reading the file
+        // Check for out of range
         //
-        ifstream in(fExcludedPixelsFile.Data(),ios::in);
-
-        if (in)
-          {
-            *fLog << inf << "Use excluded pixels from file: '" << fExcludedPixelsFile.Data() << "'" << endl;
-            //
-            // Read the file and count the number of entries
-            //
-            UInt_t pixel = 0;
-            
-            while (++fNumExcludedPixels)
-              {
-                
-                in >> pixel;
-
-                if (!in.good())
-                  break;
-                //
-                // Check for out of range
-                //
-                if (pixel > npixels)
-                  {
-                    *fLog << warn << "WARNING: To be excluded pixel: " << pixel 
-                          << " is out of range " << endl;
-                    continue;
-                  }
-                //
-                // Exclude pixel
-                //
-                MCalibrationChargePix &pix = (*fCam)[pixel];
-                pix.SetExcluded();
-                
-                *fLog << GetDescriptor() << inf << ": Exclude Pixel: " << pixel << endl;
-                
-              }
-            
-            if (--fNumExcludedPixels == 0)
-              *fLog << warn << "WARNING: File '" << fExcludedPixelsFile.Data() 
-                    << "'" << " is empty " << endl;
-            else
-              fCam->SetNumPixelsExcluded(fNumExcludedPixels);
-            
-          }
-        else
-          *fLog << warn << dbginf << "Cannot open file '" << fExcludedPixelsFile.Data() << "'" << endl;
-      }
-    
+        if (pixel > npixels)
+        {
+            *fLog << warn << "WARNING: To be excluded pixel: " << pixel << " is out of range " << endl;
+            continue;
+        }
+        //
+        // Exclude pixel
+        //
+        MCalibrationChargePix &pix = (*fCam)[pixel];
+        pix.SetExcluded();
+
+        *fLog << GetDescriptor() << inf << ": Exclude Pixel: " << pixel << endl;
+
+    }
+
+    if (--fNumExcludedPixels == 0)
+        *fLog << warn << "WARNING: File '" << fExcludedPixelsFile << "'" << " is empty " << endl;
+    else
+        fCam->SetNumPixelsExcluded(fNumExcludedPixels);
+
     return kTRUE;
 }
@@ -513,9 +493,2 @@
   return kTRUE;
 }
-
-
-
-
-
-
-
Index: trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc	(revision 3362)
+++ trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc	(revision 3374)
@@ -87,5 +87,5 @@
     }
 
-    return  run->GetRunType() == kRTMonteCarlo;
+    return  run->IsMonteCarloRun();
 }
 
