Index: trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 4596)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 4599)
@@ -38,5 +38,5 @@
 //   SetPedestalType(). Default is 'kRun', i.e. calibration of pedestals from a 
 //   dedicated pedestal run.
-//   In case, the chosen pedestal type is kRun or kEvt, in ReInit() the MPedPhotCam 
+//   In case, the chosen pedestal type is kRun or kEvent, in ReInit() the MPedPhotCam 
 //   container is filled using the information from MPedestalCam, MExtractedSignalCam, 
 //   MCalibrationChargeCam and MCalibrationQECam
@@ -74,4 +74,6 @@
 #include "MCalibrateData.h"
 
+#include <fstream>
+
 #include "MLog.h"
 #include "MLogManip.h"
@@ -105,14 +107,40 @@
 
 using namespace std;
+
+const TString MCalibrateData::fgNamePedADCRunContainer     = "MPedestalCam"        ;   
+const TString MCalibrateData::fgNamePedADCEventContainer   = "MPedestalCamFromData"; 
+const TString MCalibrateData::fgNamePedPhotRunContainer    = "MPedPhotCam"         ;  
+const TString MCalibrateData::fgNamePedPhotEventContainer  = "MPedPhotCamFromData" ;
 // --------------------------------------------------------------------------
 //
 // Default constructor. 
 //
+// Sets all pointers to NULL
+// 
+// Initializes:
+// - fCalibrationMode to kDefault
+// - fPedestalFlag to kRun
+// - fNamePedADCRunContainer    to "MPedestalCam"  
+// - fNamePedADCEventContainer  to "MPedestalCamFromData" 
+// - fNamePedPhotRunContainer   to "MPedPhotCam"    
+// - fNamePedPhotEventContainer to "MPedPhotCamFromData"
+//
 MCalibrateData::MCalibrateData(CalibrationMode_t calmode,const char *name, const char *title) 
-    : fGeomCam(NULL), fPedestal(NULL), fBadPixels(NULL), fCalibrations(NULL), fSignals(NULL), 
-      fPedPhot(NULL), fCerPhotEvt(NULL), fCalibrationMode(calmode), fFlags(kRun), fNamePedADCRunContainer("MPedestalCam"), fNamePedADCEventContainer("MPedestalCamFromData"), fNamePedPhotRunContainer("MPedPhotCam"), fNamePedPhotEventContainer("MPedPhotCamFromData")
+    : fGeomCam(NULL), fPedestal(NULL), fPedestalFromData(NULL), 
+      fBadPixels(NULL), fCalibrations(NULL), fQEs(NULL), fSignals(NULL), 
+      fPedPhot(NULL), fPedPhotFromData(NULL), fCerPhotEvt(NULL)
 {
-    fName  = name  ? name  : "MCalibrateData";
-    fTitle = title ? title : "Task to calculate the number of photons in one event";
+
+  fName  = name  ? name  : "MCalibrateData";
+  fTitle = title ? title : "Task to calculate the number of photons in one event";
+  
+  SetCalibrationMode();
+  SetPedestalType();
+
+  SetNamePedADCRunContainer   ();
+  SetNamePedADCEventContainer ();
+  SetNamePedPhotRunContainer  ();
+  SetNamePedPhotEventContainer();
+
 }
 
@@ -120,4 +148,5 @@
 //
 // The PreProcess searches for the following input containers:
+//
 //  - MGeomCam
 //  - MPedestalCam
@@ -125,4 +154,5 @@
 //  - MCalibrationQECam
 //  - MExtractedSignalCam
+//  - MBadPixelsCam
 //
 // The following output containers are also searched and created if
@@ -136,5 +166,4 @@
 
   // input containers
-
 
   if (TestFlag(kRun))
@@ -162,27 +191,27 @@
 
 
-    fSignals = (MExtractedSignalCam*)pList->FindObject(AddSerialNumber("MExtractedSignalCam"));
-    if (!fSignals)
+  fSignals = (MExtractedSignalCam*)pList->FindObject(AddSerialNumber("MExtractedSignalCam"));
+  if (!fSignals)
     {
       *fLog << err << AddSerialNumber("MExtractedSignalCam") << " not found ... aborting" << endl;
-        return kFALSE;
-    }
-
-    fBadPixels = (MBadPixelsCam*)pList->FindObject(AddSerialNumber("MBadPixelsCam"));
-
-    if (!fBadPixels)
+      return kFALSE;
+    }
+
+  fBadPixels = (MBadPixelsCam*)pList->FindObject(AddSerialNumber("MBadPixelsCam"));
+  if (!fBadPixels)
     {
       *fLog << err << AddSerialNumber("MBadPixelsCam") << " not found ... aborting" << endl;
-        return kFALSE;
-    }
-
-    if (fCalibrationMode>kNone)
+      return kFALSE;
+    }
+  
+  if (fCalibrationMode>kNone)
     {
         fCalibrations = (MCalibrationChargeCam*)pList->FindObject(AddSerialNumber("MCalibrationChargeCam"));
         if (!fCalibrations)
-        {
+          {
             *fLog << err << AddSerialNumber("MCalibrationChargeCam") << " not found ... aborting." << endl;
             return kFALSE;
-        }
+          }
+
         fQEs = (MCalibrationQECam*)pList->FindObject(AddSerialNumber("MCalibrationQECam"));
         if (!fQEs)
@@ -192,52 +221,64 @@
         }
     }
-
-    // output containers
-
-    if (TestFlag(kRun))
+  
+  // output containers
+
+  if (TestFlag(kRun))
     {
       fPedPhot = (MPedPhotCam*)pList->FindCreateObj(AddSerialNumber("MPedPhotCam"), fNamePedPhotRunContainer);
       if (!fPedPhot)
-      {
+        {
 	*fLog << err << "container 'MPedPhotCam'" 
 	      << " not found ... aborting" << endl;
         return kFALSE;
+        }
+    }
+
+
+  if (TestFlag(kEvent))
+    {  
+      fPedPhotFromData = (MPedPhotCam*)pList->FindCreateObj(AddSerialNumber("MPedPhotCam"), 
+                                                            fNamePedPhotEventContainer);
+      if (!fPedPhotFromData)
+        {
+          *fLog << err << "container 'MPedPhotCamFromData'" 
+                << " not found ... aborting" << endl;
+          return kFALSE;
       }
     }
-
-
-    if (TestFlag(kEvent))
-    {  
-      fPedPhotFromData = (MPedPhotCam*)pList->FindCreateObj(AddSerialNumber("MPedPhotCam"), fNamePedPhotEventContainer);
-      if (!fPedPhotFromData)
-      {
-	*fLog << err << "container 'MPedPhotCamFromData'" 
-	      << " not found ... aborting" << endl;
-        return kFALSE;
-      }
-    }
-
-    fCerPhotEvt = (MCerPhotEvt*)pList->FindCreateObj(AddSerialNumber("MCerPhotEvt"));
-    if (!fCerPhotEvt)
-        return kFALSE;
-    
-    return kTRUE;
+  
+  fCerPhotEvt = (MCerPhotEvt*)pList->FindCreateObj(AddSerialNumber("MCerPhotEvt"));
+  if (!fCerPhotEvt)
+    return kFALSE;
+  
+  return kTRUE;
 }
 
 // --------------------------------------------------------------------------
+//
+// The ReInit searches for the following input containers:
+//
+//  - MGeomCam
 //
 // Check for validity of the selected calibration method, switch to a 
 // different one in case of need
 //
-// fill the MPedPhotCam container using the information from MPedestalCam,
+// Fill the MPedPhotCam container using the information from MPedestalCam,
 // MExtractedSignalCam and MCalibrationCam
-//
 //
 Bool_t MCalibrateData::ReInit(MParList *pList)
 {
 
+  fGeomCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
+  if (!fGeomCam)
+    {
+      *fLog << err << "No MGeomCam found... aborting." << endl;
+      return kFALSE;
+    }
+
   if(fCalibrationMode == kBlindPixel && !fQEs->IsBlindPixelMethodValid())
     {
-      *fLog << warn << GetDescriptor() << "Warning: Blind pixel calibration method not valid, switching to F-factor method" << endl;
+      *fLog << warn << GetDescriptor() 
+            << ": Blind pixel calibration method not valid, switching to default F-factor method" << endl;
       fCalibrationMode = kFfactor;
     }
@@ -245,13 +286,58 @@
   if(fCalibrationMode == kPinDiode && !fQEs->IsPINDiodeMethodValid())
     { 
-      *fLog << warn << GetDescriptor() << "Warning: PIN diode calibration method not valid, switching to F-factor method" << endl;
+      *fLog << warn << GetDescriptor()
+            << ": PIN diode calibration method not valid, switching to default F-factor method" << endl;
       fCalibrationMode = kFfactor;
     }
 
+  if(fCalibrationMode == kCombined && !fQEs->IsCombinedMethodValid())
+    { 
+      *fLog << warn << GetDescriptor() 
+            << ": Combined calibration method not valid, switching to default F-factor method" << endl;
+      fCalibrationMode = kFfactor;
+    }
+
+  //
+  // output information or warnings:
+  //
+  switch(fCalibrationMode)
+    {
+    case kBlindPixel:
+      break;
+    case kFfactor:
+      break;
+    case kPinDiode:
+      *fLog << err << GetDescriptor() 
+                    << ": PIN Diode Calibration mode not yet available " << endl;
+      return kFALSE;
+      break;
+    case kCombined:
+      *fLog << err << GetDescriptor() 
+                    << ": Combined Calibration mode not yet available " << endl;
+      return kFALSE;
+      break;
+    case kFlatCharge:
+      *fLog << warn << GetDescriptor() 
+            << ": WARNING: Flat-fielding charges - only for muon calibration! " << endl;
+      break;
+    case kDummy:
+      *fLog << warn << GetDescriptor() 
+            << ": WARNING: Dummy calibration, no calibration applied!!" << endl;
+      break;
+    case kNone:
+      *fLog << warn << GetDescriptor() 
+            << ": WARNING: No calibration applied!!" << endl;
+      break;
+    default:
+      *fLog << warn << GetDescriptor() 
+            << ": WARNING: Calibration mode value ("
+            << fCalibrationMode << ") not known" << endl;
+      return kFALSE;
+    }
 
   if (TestFlag(kRun))
-  {
-    if (!CalibratePedestal(fPedestal,fPedPhot)) return kFALSE;
-  }
+    if (!CalibratePedestal(fPedestal,fPedPhot)) 
+      return kFALSE;
+
 
   return kTRUE;
@@ -264,12 +350,12 @@
 // Calibrate the Pedestal values
 // 
-//
 Bool_t MCalibrateData::CalibratePedestal(MPedestalCam *pedADCCam, MPedPhotCam *pedPhotCam)
 {
-  //---------------------------------------------
-  // fill MPedPhot container using the informations from
+
+  //
+  // Fill MPedPhot container using the informations from
   // MPedestalCam, MExtractedSignalCam and MCalibrationCam
-
-  fNumUsedHiGainFADCSlices = fSignals->GetNumUsedHiGainFADCSlices();
+  //
+  const Float_t slices = fSignals->GetNumUsedHiGainFADCSlices();
 
   // is pixid equal to pixidx ?
@@ -280,17 +366,17 @@
   } 
 
- 
 
   for (Int_t pixid=0; pixid<pedADCCam->GetSize(); pixid++)
   {
+
     const MPedestalPix    &ped = (*pedADCCam)[pixid];
 
     // pedestals/(used FADC slices)   in [ADC] counts
-    Float_t pedes  = ped.GetPedestal()    * fNumUsedHiGainFADCSlices;
-    Float_t pedrms = ped.GetPedestalRms() * sqrt(fNumUsedHiGainFADCSlices);
-
-    //----------------------------------
+    Float_t pedes  = ped.GetPedestal()    * slices;
+    Float_t pedrms = ped.GetPedestalRms() * TMath::Sqrt(slices);
+
+    //
     // get phe/ADC conversion factor
-
+    //
     Float_t hiloconv;
     Float_t hiloconverr;
@@ -303,7 +389,7 @@
       continue;
 
-    //---------------------------------- 
-
+    //
     // pedestals/(used FADC slices)   in [number of photons] 
+    //
     Float_t pedphot    = pedes  * calibConv;
     Float_t pedphotrms = pedrms * calibConv;
@@ -313,6 +399,4 @@
   }
 
-  //---------------------------------------------
-
   pedPhotCam->SetReadyToSave();
 
@@ -320,14 +404,7 @@
 }
 
-
-
-
-
-
-
 // --------------------------------------------------------------------------
 //
 // Get conversion factor and its error from MCalibrationCam
-// 
 //
 Bool_t MCalibrateData::GetConversionFactor(UInt_t pixidx,
@@ -344,13 +421,10 @@
   hiloconverr  = 0.;
   calibConv    = 1.;
-  calibConvVar  = 0.;
+  calibConvVar = 0.;
   calibFFactor = 0.;
   Float_t calibQE       = 1.;
   Float_t calibQEVar    = 0.;
-
   Float_t avMean        = 1.;
   Float_t avMeanRelVar  = 0.;
-
-
 
   if (fCalibrationMode == kFlatCharge)
@@ -363,98 +437,94 @@
 
   if(fCalibrationMode!=kNone)
-  {
-	  
-    MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCalibrations)[pixidx];
-
-    hiloconv   = pix.GetConversionHiLo   ();
-    hiloconverr= pix.GetConversionHiLoErr();
-	  
-    if (fBadPixels)
-    {
-      MBadPixelsPix         &bad = (*fBadPixels)[pixidx];
-      if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun))
-	return kFALSE;
-    }
-            
-    calibConv      = pix.GetMeanConvFADC2Phe();
-    calibConvVar   = pix.GetMeanConvFADC2PheVar();
-    calibFFactor   = pix.GetMeanFFactorFADC2Phot();
-
-    MCalibrationQEPix &qe  = (MCalibrationQEPix&) (*fQEs)[pixidx];
+    {
+      
+      MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCalibrations)[pixidx];
+      
+      hiloconv   = pix.GetConversionHiLo   ();
+      hiloconverr= pix.GetConversionHiLoErr();
+      
+      if (fBadPixels)
+        {
+          MBadPixelsPix &bad = (*fBadPixels)[pixidx];
+          if (bad.IsUnsuitable())
+            return kFALSE;
+        }
+      
+      calibConv      = pix.GetMeanConvFADC2Phe();
+      calibConvVar   = pix.GetMeanConvFADC2PheVar();
+      calibFFactor   = pix.GetMeanFFactorFADC2Phot();
+      
+      MCalibrationQEPix &qe  = (MCalibrationQEPix&) (*fQEs)[pixidx];
+      
+      switch(fCalibrationMode)
+        {
+        case kFlatCharge:
+          calibConv        = avMean / pix.GetMean() / fGeomCam->GetPixRatio(pixidx) ;
+          calibConvVar     = (avMeanRelVar + pix.GetMeanRelVar()) * calibConv * calibConv;
+          if (pix.IsFFactorMethodValid())
+            {
+              const Float_t convmin1 = qe.GetQECascadesFFactor(zenith)/pix.GetMeanConvFADC2Phe();
+              if (convmin1 > 0)
+                calibFFactor *= TMath::Sqrt(convmin1);
+              else
+                calibFFactor = -1.;
+            }
+          break;
+        case kBlindPixel:
+          if (qe.IsBlindPixelMethodValid())
+            {
+              calibQE      = qe.GetQECascadesBlindPixel   ( zenith );
+              calibQEVar   = qe.GetQECascadesBlindPixelVar( zenith );
+            }
+          else
+            return kFALSE;
+          break;
+        case kPinDiode:
+          if (qe.IsPINDiodeMethodValid())
+            {
+              calibQE      = qe.GetQECascadesPINDiode   ( zenith );
+              calibQEVar   = qe.GetQECascadesPINDiodeVar( zenith );
+            }
+          else
+            return kFALSE;
+          break;
+        case kFfactor:
+          if (pix.IsFFactorMethodValid())
+            {
+              calibQE      = qe.GetQECascadesFFactor   ( zenith );
+              calibQEVar   = qe.GetQECascadesFFactorVar( zenith );
+            }
+          else
+            return kFALSE;
+          break;
+        case kCombined:
+          if (qe.IsCombinedMethodValid())
+            {
+              calibQE      = qe.GetQECascadesCombined   ( zenith );
+              calibQEVar   = qe.GetQECascadesCombinedVar( zenith );
+            }
+          else
+            return kFALSE;
+          break;
+        case kDummy:
+          hiloconv     = 1.;
+          hiloconverr  = 0.;
+          break;
           
-    switch(fCalibrationMode)
-    {
-    case kFlatCharge:
-      calibConv        = avMean / pix.GetMean() / fGeomCam->GetPixRatio(pixidx) ;
-      calibConvVar     = (avMeanRelVar + pix.GetMeanRelVar()) * calibConv * calibConv;
-      if (pix.IsFFactorMethodValid())
-      {
-	const Float_t convmin1 = qe.GetQECascadesFFactor(zenith)/pix.GetMeanConvFADC2Phe();
-	if (convmin1 > 0)
-	  calibFFactor *= TMath::Sqrt(convmin1);
-	else
-	  calibFFactor = -1.;
-      }
-      break;
-    case kBlindPixel:
-      if (qe.IsBlindPixelMethodValid())
-      {
-	calibQE      = qe.GetQECascadesBlindPixel   ( zenith );
-	calibQEVar   = qe.GetQECascadesBlindPixelVar( zenith );
-      }
-      else
-	return kFALSE;
-      break;
-    case kPinDiode:
-      if (qe.IsPINDiodeMethodValid())
-      {
-	calibQE      = qe.GetQECascadesPINDiode   ( zenith );
-	calibQEVar   = qe.GetQECascadesPINDiodeVar( zenith );
-      }
-      else
-	return kFALSE;
-      break;
-    case kFfactor:
-      if (pix.IsFFactorMethodValid())
-      {
-	calibQE      = qe.GetQECascadesFFactor   ( zenith );
-	calibQEVar   = qe.GetQECascadesFFactorVar( zenith );
-      }
-      else
-	return kFALSE;
-      break;
-    case kCombined:
-      if (qe.IsCombinedMethodValid())
-      {
-	calibQE      = qe.GetQECascadesCombined   ( zenith );
-	calibQEVar   = qe.GetQECascadesCombinedVar( zenith );
-      }
-      else
-	return kFALSE;
-      break;
-    case kDummy:
-      hiloconv     = 1.;
-      hiloconverr  = 0.;
-      calibQE      = 1.;
-      calibQEVar   = 0.;
-      break;
-              
-    } /* switch calibration mode */
-  } /* if(fCalibrationMode!=kNone) */
+        } /* switch calibration mode */
+    } /* if(fCalibrationMode!=kNone) */
   else
-  {
-    hiloconv       = 1.;
-    hiloconverr    = 0.;
-    calibConv      = 1./fGeomCam->GetPixRatio(pixidx);
-    calibConvVar   = 0.;
-    calibFFactor   = 0.;
-    calibQE        = 1.;
-    calibQEVar     = 0.;
-  }     
+    {
+      calibConv  = 1./fGeomCam->GetPixRatio(pixidx);
+    }     
   
   calibConv    /= calibQE;
-  calibConvVar /= calibQE;
-
-
+
+  if (calibConv != 0. && calibQE != 0.)
+    {
+      calibConvVar  = calibConvVar/calibConv/calibConv + calibQEVar/calibQE/calibQE;
+      calibConvVar *= calibConv*calibConv;
+    }
+  
   return kTRUE;
 }
@@ -468,4 +538,10 @@
 Int_t MCalibrateData::Process()
 {
+
+  //
+  // For the moment, we use only a dummy zenith for the calibration:
+  //
+  const Float_t zenith = 0;
+
   /*
     if (fCalibrations->GetNumPixels() != (UInt_t)fSignals->GetSize())
@@ -518,10 +594,14 @@
       nphot    = signal*calibrationConversionFactor;
       nphotErr = calibFFactor*TMath::Sqrt(TMath::Abs(nphot));
-      //   nphotErr = signal*calibrationConversionFactorErr
-      //	*signal*calibrationConversionFactorErr
-      //	+signalErr*calibrationConversionFactor
-      //	*signalErr*calibrationConversionFactor;
-      //     nphotErr  = TMath::Sqrt(nphotErr);
-      
+      //
+      // The following part is the commented first version of the error calculation
+      // Contact Markus Gaug for questions (or wait for the next documentation update...)
+      //
+      /*
+        nphotErr = signal    > 0 ? signalErr*signalErr / (signal * signal)  : 0.
+                 + calibConv > 0 ? calibConvVar  / (calibConv * calibConv ) : 0.;
+        nphotErr  = TMath::Sqrt(nphotErr) * nphot;
+      */
+
       MCerPhotPix *cpix = fCerPhotEvt->AddPixel(pixidx, nphot, nphotErr);
 
@@ -536,24 +616,22 @@
   fCerPhotEvt->SetReadyToSave();
   
-
-
   if(TestFlag(kEvent)) 
-  {
-    if (!CalibratePedestal(fPedestalFromData,fPedPhotFromData)) return kFALSE;
-  }
+    if (!CalibratePedestal(fPedestalFromData,fPedPhotFromData)) 
+      return kFALSE;
 
   /*
-  //---------------------------------------------
+  //
   // fill MPedPhot(FromData) container using the informations from
   // MPedestalCam, MExtractedSignalCam and MCalibrationCam
-
+  //
   fNumUsedHiGainFADCSlices = fSignals->GetNumUsedHiGainFADCSlices();
 
   // is pixid equal to pixidx ?
   if (    (Int_t)(fPedestal->GetSize()) != fSignals->GetSize())
-  {
-    *fLog << err << "MCalibrateData::ReInit(); sizes of MPedestalCam and MCalibrationCam are different" 
-          << endl;
-	  } */
+    {
+      *fLog << err << "MCalibrateData::ReInit(); sizes of MPedestalCam and MCalibrationCam are different" 
+                   << endl;
+     } 
+  */
 
   /*
@@ -607,2 +685,52 @@
   return kTRUE;
 }
+
+// --------------------------------------------------------------------------
+//
+// Implementation of SavePrimitive. Used to write the call to a constructor
+// to a macro. In the original root implementation it is used to write
+// gui elements to a macro-file.
+//
+void MCalibrateData::StreamPrimitive(ofstream &out) const
+{
+
+  out << "   " << ClassName() << " " << GetUniqueName() << "(\"";
+  out << "\"" << fName << "\", \"" << fTitle << "\");" << endl;
+
+  if (TestFlag(kEvent))
+    out << "   " << GetUniqueName() << ".EnablePedestalType(kEvent)" << endl;
+  if (TestFlag(kRun))
+    out << "   " << GetUniqueName() << ".EnablePedestalType(kRun)" << endl;
+
+  if (fCalibrationMode != kDefault)
+    out << "   " << GetUniqueName() << ".SetCalibrationMode(fCalibrationMode)" << endl;
+
+  if (fNamePedADCRunContainer != fgNamePedADCRunContainer)
+    {
+      out << "   " << GetUniqueName() << ".SetNamePedADCRunContainer(";
+      out << fNamePedADCRunContainer.Data() << ");" << endl;
+    }
+  
+  if (fNamePedADCEventContainer != fgNamePedADCEventContainer)
+    {
+      out << "   " << GetUniqueName() << ".SetNamePedADCEventContainer(";
+      out << fNamePedADCEventContainer.Data() << ");" << endl;
+    }
+
+  
+  if (fNamePedPhotRunContainer  != fgNamePedPhotRunContainer)
+    {
+      out << "   " << GetUniqueName() << ".SetNamePedPhotRunContainer(";
+      out << fNamePedPhotRunContainer.Data() << ");" << endl;
+    }
+
+
+  if (fNamePedPhotEventContainer != fNamePedPhotEventContainer)
+    {
+      out << "   " << GetUniqueName() << ".SetNamePedPhotEventContainer(";
+      out <<  fNamePedPhotEventContainer.Data() << ");" << endl;
+    }
+
+}
+
+  
Index: trunk/MagicSoft/Mars/mcalib/MCalibrateData.h
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrateData.h	(revision 4596)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrateData.h	(revision 4599)
@@ -35,4 +35,9 @@
 private:
 
+  static const TString fgNamePedADCRunContainer;    //! "MPedestalCam"
+  static const TString fgNamePedADCEventContainer;  //! "MPedestalCamFromData" 
+  static const TString fgNamePedPhotRunContainer;   //! "MPedPhotCam" 
+  static const TString fgNamePedPhotEventContainer; //! "MPedPhotCamFromData"  
+  
   MGeomCam              *fGeomCam;          //! Camera geometry container
   MPedestalCam          *fPedestal;         //! Pedestals/slice [ADC counts]
@@ -48,5 +53,4 @@
   
   UShort_t fCalibrationMode;
-  Float_t  fConversionHiLo;
   Byte_t   fPedestalFlag;                   // Flags defining to calibrate the pedestal each event or each run
   
@@ -56,6 +60,4 @@
   TString  fNamePedPhotEventContainer;      // name of fPedPhotFromData
 
-  Float_t  fNumUsedHiGainFADCSlices;
-  
   Bool_t   CalibratePedestal ( MPedestalCam *, MPedPhotCam * );
   
@@ -67,9 +69,11 @@
   Bool_t   ReInit    ( MParList *pList );
   Int_t    Process   ( );
+
+  void      StreamPrimitive( ofstream &out ) const;
   
 public:
 
   enum CalibrationMode_t { kNone=0,kFlatCharge=1,
-                           kBlindPixel,kFfactor,kPinDiode,kCombined, kDummy };
+                           kBlindPixel=2,kFfactor=3,kPinDiode=4,kCombined=5, kDummy=6 };
 
   static const CalibrationMode_t kDefault = kFfactor;
@@ -84,5 +88,4 @@
                   const char *name=NULL, const char *title=NULL);
   
-  void   DisablePedestalType( PedestalType_t i      )              { fPedestalFlag &= ~i;      } 
   void   EnablePedestalType ( PedestalType_t i      )              { fPedestalFlag |=  i;      } 
   void   SetPedestalType    ( PedestalType_t i=kRun )              { fPedestalFlag  =  i;      } 
@@ -90,13 +93,12 @@
   
   void   SetCalibrationMode ( CalibrationMode_t calmode=kDefault ) { fCalibrationMode=calmode; }
-  void   SetConversionHiLo  ( Float_t conv                       ) { fConversionHiLo = conv;   }
   
-  void   SetNamePedADCRunContainer   ( const char *name="MPedestalCam" )         {
+  void   SetNamePedADCRunContainer   ( const char *name=fgNamePedADCRunContainer )         {
     fNamePedADCRunContainer    = name; }
-  void   SetNamePedADCEventContainer ( const char *name="MPedestalCamFromData" ) {
+  void   SetNamePedADCEventContainer ( const char *name=fgNamePedADCEventContainer ) {
     fNamePedADCEventContainer  = name; }
-  void   SetNamePedPhotRunContainer  ( const char *name="MPedPhotCam" )          {
+  void   SetNamePedPhotRunContainer  ( const char *name=fgNamePedPhotRunContainer )          {
     fNamePedPhotRunContainer   = name; }
-  void   SetNamePedPhotEventContainer( const char *name="MPedPhotCamFromData")   {
+  void   SetNamePedPhotEventContainer( const char *name=fgNamePedPhotEventContainer)   {
     fNamePedPhotEventContainer = name; }
   
