Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 3241)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 3242)
@@ -4,4 +4,14 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2004/01/19: Markus Gaug
+   * mcalib/MCalibrationPix.[h,cc]
+   * mcalib/MCalibrationCam.cc
+   * mcalib/MCalibrate.cc
+   * mcalib/MCalibrateDate.cc
+   * manalysis/MMcCalibrationUpdate.cc
+     - standardized naming of variables containing "Error", this also affected 
+       the calling functions MCalibrate, MMcCalibrationUpdate and MCalibrateData
+
+
  2004/01/19: Abelardo Moralejo
 
Index: /trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc	(revision 3241)
+++ /trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc	(revision 3242)
@@ -225,5 +225,5 @@
 
 	calpix.SetConversionHiLo(fConversionHiLo);
-	calpix.SetConversionHiLoError(0.);         // FIXME ?
+	calpix.SetConversionHiLoErr(0.);         // FIXME ?
 
 	//
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrate.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrate.cc	(revision 3241)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrate.cc	(revision 3242)
@@ -185,8 +185,8 @@
   UInt_t npix = fSignals->GetSize();
 
-  Float_t hiloconv   = 1.;
-  Float_t hiloconverr= 0.;
-  Float_t calibrationConversionFactor = 1.;
-  Float_t calibrationConversionFactorError = 0.;
+  Float_t hiloconv      = 1.;
+  Float_t hiloconverr   = 0.;
+  Float_t calibrationConversionFactor    = 1.;
+  Float_t calibrationConversionFactorErr = 0.;
   
   for (UInt_t pixidx=0; pixidx<npix; pixidx++)
@@ -200,5 +200,5 @@
 	  
 	  hiloconv   = pix.GetConversionHiLo();
-	  hiloconverr= pix.GetConversionHiLoError();
+	  hiloconverr= pix.GetConversionHiLoErr();
 	  
 	  switch(fCalibrationMode)
@@ -206,21 +206,21 @@
 	    case kBlindPixel:
 	      calibrationConversionFactor      = pix.GetMeanConversionBlindPixelMethod();
-	      calibrationConversionFactorError = pix.GetErrorConversionBlindPixelMethod();
+	      calibrationConversionFactorErr   = pix.GetConversionBlindPixelMethodErr();
 	      break;
 	    case kPinDiode:
 	      calibrationConversionFactor      = pix.GetMeanConversionPINDiodeMethod();
-	      calibrationConversionFactorError = pix.GetErrorConversionPINDiodeMethod();
+	      calibrationConversionFactorErr   = pix.GetConversionPINDiodeMethodErr();
 	      break;
 	    case kFfactor:
 	      calibrationConversionFactor      = pix.GetMeanConversionFFactorMethod();
-	      calibrationConversionFactorError = pix.GetErrorConversionFFactorMethod();
+	      calibrationConversionFactorErr   = pix.GetConversionFFactorMethodErr();
 	      break;
 	    case kCombined:
 	      calibrationConversionFactor      = pix.GetMeanConversionCombinedMethod();
-	      calibrationConversionFactorError = pix.GetErrorConversionCombinedMethod();
+	      calibrationConversionFactorErr   = pix.GetConversionCombinedMethodErr();
 	      break;
             case kDummy:
 	      calibrationConversionFactor      = 1.;
-	      calibrationConversionFactorError = 0.;
+	      calibrationConversionFactorErr   = 0.;
               break;
 	    }
@@ -250,8 +250,8 @@
       
       nphot    = signal*calibrationConversionFactor;
-      nphotErr = signal*calibrationConversionFactorError
-	*signal*calibrationConversionFactorError
-	+signalErr*calibrationConversionFactor
-	*signalErr*calibrationConversionFactor;
+      nphotErr = signal*calibrationConversionFactorErr
+        	*signal*calibrationConversionFactorErr
+	       + signalErr*calibrationConversionFactor
+        	*signalErr*calibrationConversionFactor;
       
       nphotErr  = TMath::Sqrt(nphotErr);
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 3241)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc	(revision 3242)
@@ -193,8 +193,8 @@
     Float_t hiloconverr;
     Float_t calibrationConversionFactor;
-    Float_t calibrationConversionFactorError;
+    Float_t calibrationConversionFactorErr;
 
     if ( !GetConversionFactor(pixid, hiloconv, hiloconverr,
-	  calibrationConversionFactor, calibrationConversionFactorError) )
+			      calibrationConversionFactor, calibrationConversionFactorErr ))
       continue;
 
@@ -226,10 +226,10 @@
 Bool_t MCalibrateData::GetConversionFactor(UInt_t pixidx,
  Float_t &hiloconv, Float_t &hiloconverr,
- Float_t &calibrationConversionFactor, Float_t &calibrationConversionFactorError)
+ Float_t &calibrationConversionFactor, Float_t &calibrationConversionFactorErr)
 {
   hiloconv    = 1.;
   hiloconverr = 0.;
   calibrationConversionFactor      = 1.;
-  calibrationConversionFactorError = 0.;
+  calibrationConversionFactorErr   = 0.;
 
   if(fCalibrationMode!=kNone)
@@ -241,5 +241,5 @@
 	  
     hiloconv   = pix.GetConversionHiLo();
-    hiloconverr= pix.GetConversionHiLoError();
+    hiloconverr= pix.GetConversionHiLoErr();
 	  
     switch(fCalibrationMode)
@@ -247,9 +247,9 @@
       case kBlindPixel:
       calibrationConversionFactor      = pix.GetMeanConversionBlindPixelMethod();
-      calibrationConversionFactorError = pix.GetErrorConversionBlindPixelMethod();
+      calibrationConversionFactorErr   = pix.GetConversionBlindPixelMethodErr();
       break;
       case kFfactor:
       calibrationConversionFactor      = pix.GetMeanConversionFFactorMethod();
-      calibrationConversionFactorError = pix.GetErrorConversionFFactorMethod();
+      calibrationConversionFactorErr   = pix.GetConversionFFactorMethodErr();
       break;
       default:
@@ -286,10 +286,10 @@
   Float_t hiloconverr;
   Float_t calibrationConversionFactor;
-  Float_t calibrationConversionFactorError;
+  Float_t calibrationConversionFactorErr;
   
   for (UInt_t pixidx=0; pixidx<npix; pixidx++)
     {
       if ( !GetConversionFactor(pixidx, hiloconv, hiloconverr,
-	    calibrationConversionFactor, calibrationConversionFactorError) )
+	    calibrationConversionFactor, calibrationConversionFactorErr) )
         continue;
       
@@ -317,6 +317,6 @@
       
       nphot    = signal*calibrationConversionFactor;
-      nphotErr = signal*calibrationConversionFactorError
-	*signal*calibrationConversionFactorError
+      nphotErr = signal*calibrationConversionFactorErr
+	*signal*calibrationConversionFactorErr
 	+signalErr*calibrationConversionFactor
 	*signalErr*calibrationConversionFactor;
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc	(revision 3241)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc	(revision 3242)
@@ -556,5 +556,5 @@
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetErrCharge();
+      val = (*this)[idx].GetChargeErr();
       break;
     case 2:
@@ -566,5 +566,5 @@
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetErrSigmaCharge();
+      val = (*this)[idx].GetSigmaChargeErr();
       break;
     case 4:
@@ -581,5 +581,5 @@
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetErrRSigmaCharge();
+      val = (*this)[idx].GetRSigmaChargeErr();
       break;
     case 7:
@@ -592,8 +592,8 @@
         return kFALSE;
       // relative error RsigmaCharge square
-      val =    (*this)[idx].GetErrRSigmaCharge()* (*this)[idx].GetErrRSigmaCharge() 
+      val =    (*this)[idx].GetRSigmaChargeErr()* (*this)[idx].GetRSigmaChargeErr() 
             / ((*this)[idx].GetRSigmaCharge()   * (*this)[idx].GetRSigmaCharge()   );
       // relative error Charge square
-      val +=   (*this)[idx].GetErrCharge() * (*this)[idx].GetErrCharge()
+      val +=   (*this)[idx].GetChargeErr() * (*this)[idx].GetChargeErr()
             / ((*this)[idx].GetCharge()    * (*this)[idx].GetCharge()   );
       // calculate relative error out of squares
@@ -610,5 +610,5 @@
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetPheFFactorMethodError();
+      val = (*this)[idx].GetPheFFactorMethodErr();
       break;
     case 11:
@@ -620,5 +620,5 @@
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetErrorConversionFFactorMethod();
+      val = (*this)[idx].GetConversionFFactorMethodErr();
       break;
     case 13:
@@ -630,5 +630,5 @@
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetTotalFFactorErrorFFactorMethod();
+      val = (*this)[idx].GetTotalFFactorErrFFactorMethod();
       break;
     case 15:
@@ -650,5 +650,5 @@
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetErrorConversionBlindPixelMethod();
+      val = (*this)[idx].GetConversionBlindPixelMethodErr();
       break;
     case 19:
@@ -660,5 +660,5 @@
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetTotalFFactorErrorBlindPixelMethod();
+      val = (*this)[idx].GetTotalFFactorErrBlindPixelMethod();
       break;
     case 21:
@@ -680,5 +680,5 @@
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetErrorConversionPINDiodeMethod();
+      val = (*this)[idx].GetConversionPINDiodeMethodErr();
       break;
     case 25:
@@ -690,5 +690,5 @@
       if ((*this)[idx].IsExcluded())
         return kFALSE;
-      val = (*this)[idx].GetTotalFFactorErrorBlindPixelMethod();
+      val = (*this)[idx].GetTotalFFactorErrBlindPixelMethod();
       break;
     case 27:
@@ -914,5 +914,5 @@
           const Float_t charge    = pix->GetCharge();
           const Float_t area      = (*fGeomCam)[idx].GetA();
-          const Float_t chargeerr = pix->GetErrCharge();          
+          const Float_t chargeerr = pix->GetChargeErr();          
 
           const Float_t nphot      = fMeanFluxInsidePlexiglass*area;
@@ -1025,5 +1025,5 @@
           const Float_t charge    = pix->GetCharge();
           const Float_t area      = (*fGeomCam)[idx].GetA();
-          const Float_t chargeerr = pix->GetErrCharge();          
+          const Float_t chargeerr = pix->GetChargeErr();          
 
           const Float_t nphot      = fMeanFluxOutsidePlexiglass*area;
@@ -1066,5 +1066,5 @@
 
   mean  = (*this)[ipx].GetMeanConversionBlindPixelMethod();
-  err   = (*this)[ipx].GetErrorConversionBlindPixelMethod();
+  err   = (*this)[ipx].GetConversionBlindPixelMethodErr();
   sigma = (*this)[ipx].GetSigmaConversionBlindPixelMethod();
 
@@ -1085,5 +1085,5 @@
 
   mean  = conv;
-  err   = (*this)[ipx].GetErrorConversionFFactorMethod();
+  err   = (*this)[ipx].GetConversionFFactorMethodErr();
   sigma = (*this)[ipx].GetSigmaConversionFFactorMethod();
 
@@ -1111,5 +1111,5 @@
 
   mean  = (*this)[ipx].GetMeanConversionPINDiodeMethod();
-  err   = (*this)[ipx].GetErrorConversionPINDiodeMethod();
+  err   = (*this)[ipx].GetConversionPINDiodeMethodErr();
   sigma = (*this)[ipx].GetSigmaConversionPINDiodeMethod();
 
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc	(revision 3241)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc	(revision 3242)
@@ -96,7 +96,7 @@
 
 const Float_t MCalibrationPix::gkElectronicPedRms         = 1.5;
-const Float_t MCalibrationPix::gkErrElectronicPedRms      = 0.3;
+const Float_t MCalibrationPix::gkElectronicPedRmsErr      = 0.3;
 const Float_t MCalibrationPix::gkFFactor                  = 1.15;
-const Float_t MCalibrationPix::gkFFactorError             = 0.02;
+const Float_t MCalibrationPix::gkFFactorErr               = 0.02;
 const Float_t MCalibrationPix::gkChargeLimit              = 3.;
 const Float_t MCalibrationPix::gkChargeErrLimit           = 0.;
@@ -104,10 +104,10 @@
 const Float_t MCalibrationPix::gkTimeLimit                = 1.5;
 const Float_t MCalibrationPix::gkTimeErrLimit             = 3.;
-const Float_t MCalibrationPix::gkConvFFactorRelErrorLimit = 0.1;
+const Float_t MCalibrationPix::gkConvFFactorRelErrLimit   = 0.1;
 
 const Float_t MCalibrationPix::gkAverageQE                = 0.18;     
 const Float_t MCalibrationPix::gkAverageQEErr             = 0.02;  
 const Float_t MCalibrationPix::gkConversionHiLo           = 10.;
-const Float_t MCalibrationPix::gkConversionHiLoError      = 2.5;
+const Float_t MCalibrationPix::gkConversionHiLoErr        = 2.5;
 // --------------------------------------------------------------------------
 //
@@ -122,20 +122,19 @@
   fTitle = title ? title : "Container of the MHCalibrationPixels and the fit results";
 
+  fHist = new MHCalibrationPixel("MHCalibrationPixel","Calibration Histograms Pixel ");
+
+  if (!fHist)
+    *fLog << warn << dbginf << " Could not create MHCalibrationPixel " << endl;
+
+  Clear();
+
   //
   // At the moment, we don't have a database, yet, 
   // so we get it from the configuration file
   //
-  fConversionHiLo      = gkConversionHiLo;
-  fConversionHiLoError = gkConversionHiLoError;  
-
-  fHist = new MHCalibrationPixel("MHCalibrationPixel","Calibration Histograms Pixel ");
-
-  if (!fHist)
-    *fLog << warn << dbginf << " Could not create MHCalibrationPixel " << endl;
-
-  Clear();
+  SetConversionHiLo();
+  SetConversionHiLoErr();
 
   SetAverageQE();
-
 }
 
@@ -167,14 +166,14 @@
 
   fCharge                           =  -1.;
-  fErrCharge                        =  -1.;
+  fChargeErr                        =  -1.;
   fSigmaCharge                      =  -1.;
-  fErrSigmaCharge                   =  -1.;
+  fSigmaChargeErr                   =  -1.;
   fRSigmaCharge                     =  -1.;
-  fErrRSigmaCharge                  =  -1.;
+  fRSigmaChargeErr                  =  -1.;
 
   fChargeProb                       =  -1.;
   fPed                              =  -1.;
   fPedRms                           =  -1.;
-  fErrPedRms                        =   0.;
+  fPedRmsErr                        =  -1.;
 
   fNumHiGainSamples                 =  -1.;
@@ -190,5 +189,5 @@
 
   fPheFFactorMethod                 =  -1.;
-  fPheFFactorMethodError            =  -1.;
+  fPheFFactorMethodErr              =  -1.;
 
   fMeanConversionFFactorMethod      =  -1.;
@@ -197,8 +196,8 @@
   fMeanConversionCombinedMethod     =  -1.;
 
-  fErrorConversionFFactorMethod     =  -1.;
-  fErrorConversionBlindPixelMethod  =  -1.;
-  fErrorConversionPINDiodeMethod    =  -1.;
-  fErrorConversionCombinedMethod    =  -1.;
+  fConversionFFactorMethodErr       =  -1.;
+  fConversionBlindPixelMethodErr    =  -1.;
+  fConversionPINDiodeMethodErr      =  -1.;
+  fConversionCombinedMethodErr      =  -1.;
 
   fSigmaConversionFFactorMethod     =  -1.;
@@ -207,5 +206,8 @@
   fSigmaConversionCombinedMethod    =  -1.;
 
-  fFactorCalculated = kFALSE;
+  fTotalFFactorFFactorMethod        =  -1.;
+  fTotalFFactorBlindPixelMethod     =  -1.;
+  fTotalFFactorPINDiodeMethod       =  -1.;
+  fTotalFFactorCombinedMethod       =  -1.;
 
 }
@@ -226,5 +228,5 @@
 //
 void MCalibrationPix::SetPedestal(const Float_t ped, const Float_t pedrms, 
-                                  const Float_t higainsamp, const Float_t logainsamp )
+                                  const Float_t higainsamp, const Float_t logainsamp ) 
 {
 
@@ -243,6 +245,6 @@
 void MCalibrationPix::SetConversionFFactorMethod(Float_t c, Float_t err, Float_t sig)
 {
-  fMeanConversionFFactorMethod = c;
-  fErrorConversionFFactorMethod = err;
+  fMeanConversionFFactorMethod  = c;
+  fConversionFFactorMethodErr   = err;
   fSigmaConversionFFactorMethod = sig;
 }
@@ -254,6 +256,6 @@
 void MCalibrationPix::SetConversionCombinedMethod(Float_t c, Float_t err, Float_t sig)
 {
-  fMeanConversionCombinedMethod = c;
-  fErrorConversionCombinedMethod = err;
+  fMeanConversionCombinedMethod  = c;
+  fConversionCombinedMethodErr   = err;
   fSigmaConversionCombinedMethod = sig;
 }
@@ -267,5 +269,5 @@
 {
   fMeanConversionBlindPixelMethod  = c;
-  fErrorConversionBlindPixelMethod = err;
+  fConversionBlindPixelMethodErr   = err;
   fSigmaConversionBlindPixelMethod = sig;
 }
@@ -277,6 +279,6 @@
 void MCalibrationPix::SetConversionPINDiodeMethod(Float_t c, Float_t err, Float_t sig)
 {
-  fMeanConversionPINDiodeMethod = c ;
-  fErrorConversionPINDiodeMethod = err;
+  fMeanConversionPINDiodeMethod  = c ;
+  fConversionPINDiodeMethodErr   = err;
   fSigmaConversionPINDiodeMethod = sig;
 }
@@ -390,170 +392,32 @@
 }
 
-Float_t MCalibrationPix::GetPheFFactorMethod() 
-{
-  
-  if (!fFactorCalculated)
-    CalcFFactorMethod();
-  
-  return fPheFFactorMethod;
-  
-}
-
-Float_t MCalibrationPix::GetPheFFactorMethodError() 
-{
-  
-  if (!fFactorCalculated)
-    CalcFFactorMethod();
-  
-  return fPheFFactorMethodError;
-  
-}
-
-
-Float_t MCalibrationPix::GetTotalFFactorFFactorMethod() 
-{
-  if (!fFactorCalculated)
-    CalcFFactorMethod();
-  
-  if (fPheFFactorMethod > 0)
-    return (fRSigmaCharge/fCharge)*TMath::Sqrt(fPheFFactorMethod);
-  else
-    return -1.;
-}
-
-Float_t MCalibrationPix::GetTotalFFactorErrorFFactorMethod() 
-{
-
-  if (!fFactorCalculated)
-   CalcFFactorMethod();
-
-  const Float_t rsigmaChargeRelErrSquare = fErrRSigmaCharge * fErrRSigmaCharge 
-                                           / (fRSigmaCharge * fRSigmaCharge) ;
-  const Float_t rChargeRelErrSquare      = fErrCharge * fErrCharge 
-                                           / (fCharge * fCharge) ;
-  const Float_t rPheRelErrSquare         = fPheFFactorMethodError * fPheFFactorMethodError 
-                                           / (fPheFFactorMethod * fPheFFactorMethod) ;
-
-  return TMath::Sqrt(rsigmaChargeRelErrSquare+rChargeRelErrSquare+rPheRelErrSquare);
-}
-
-
-Float_t MCalibrationPix::GetTotalFFactorBlindPixelMethod() 
-{
-  return 1.;
-}
-
-Float_t MCalibrationPix::GetTotalFFactorErrorBlindPixelMethod() 
-{
-
-  return 1.;
-}
-
-Float_t MCalibrationPix::GetTotalFFactorPINDiodeMethod() 
-{
-  return 1.;
-}
-
-Float_t MCalibrationPix::GetTotalFFactorErrorPINDiodeMethod() 
-{
-
-  return 1.;
-}
-
-Float_t MCalibrationPix::GetTotalFFactorCombinedMethod() 
-{
-  return 1.;
-}
-
-Float_t MCalibrationPix::GetTotalFFactorErrorCombinedMethod() 
-{
-
-  return 1.;
-}
-
-//
-// FIXME: This is a preliminary solution, the qe shall be 
-// calibrated itself!
-//
-Float_t MCalibrationPix::GetMeanConversionFFactorMethod()
-{
-
-  if (!fFactorCalculated)
-    CalcFFactorMethod();
-
-  return fMeanConversionFFactorMethod/fAverageQE;
-  
-}
-
-Float_t MCalibrationPix::GetErrorConversionFFactorMethod()
-{
-
-  if (!fFactorCalculated)
-    CalcFFactorMethod();
-  
-  Float_t var = fErrorConversionFFactorMethod*fErrorConversionFFactorMethod
-             / (fMeanConversionFFactorMethod * fMeanConversionFFactorMethod);
-
-  var += fAverageQEErr * fAverageQEErr 
-       / (fAverageQE * fAverageQE);
-
-  if (var > 0)
-    return -1.;
-
-  var = TMath::Sqrt(var);
-
-  return var*GetMeanConversionFFactorMethod();
-  
-}
-
-Float_t MCalibrationPix::GetSigmaConversionFFactorMethod()
-{
-
-  if (!fFactorCalculated)
-    CalcFFactorMethod();
-  
-  return fSigmaConversionFFactorMethod;
-  
-}
-
-
-Bool_t MCalibrationPix::IsExcluded() const
- { 
+Bool_t MCalibrationPix::IsExcluded()            const
+{ 
    return TESTBIT(fFlags,kExcluded);  
- }
+}
 
 Bool_t MCalibrationPix::IsExcludeQualityCheck() const
- { 
-   return TESTBIT(fFlags,kExcludeQualityCheck);  
- }
-
-Bool_t MCalibrationPix::IsHiGainSaturation() const
- { 
+{ 
+    return TESTBIT(fFlags,kExcludeQualityCheck);  
+}
+
+Bool_t MCalibrationPix::IsHiGainSaturation()    const
+{ 
    return TESTBIT(fFlags,kHiGainSaturation);  
- }
-
-Bool_t MCalibrationPix::IsChargeValid() const 
+}
+
+Bool_t MCalibrationPix::IsChargeValid()         const 
 {
   return TESTBIT(fFlags, kChargeValid);  
 }
 
-Bool_t MCalibrationPix::IsFitted() const 
+Bool_t MCalibrationPix::IsFitted()              const 
 { 
   return TESTBIT(fFlags, kFitted);    
 }
 
-Bool_t MCalibrationPix::IsOscillating()
-{ 
-
-  if (TESTBIT(fFlags, kOscillating))
-    return kTRUE;
-
-  if (fHist->CheckOscillations())
-    {
-      SETBIT(fFlags,kOscillating);
-      return kTRUE;
-    }
-  
-  return kFALSE;
+Bool_t MCalibrationPix::IsOscillating()         const
+{ 
+  return TESTBIT(fFlags, kOscillating);
 }
 
@@ -563,19 +427,15 @@
 }
 
-Bool_t MCalibrationPix::IsFFactorMethodValid() 
-{ 
-
-  if (!fFactorCalculated)
-    CalcFFactorMethod();
-
+Bool_t MCalibrationPix::IsFFactorMethodValid()   const
+{ 
   return TESTBIT(fFlags, kFFactorMethodValid);     
 }
 
-Bool_t MCalibrationPix::IsPINDiodeMethodValid() const 
+Bool_t MCalibrationPix::IsPINDiodeMethodValid()  const 
 { 
   return TESTBIT(fFlags, kPINDiodeMethodValid);    
 }
 
-Bool_t MCalibrationPix::IsCombinedMethodValid() 
+Bool_t MCalibrationPix::IsCombinedMethodValid()  const
 { 
   return TESTBIT(fFlags, kCombinedMethodValid);    
@@ -655,10 +515,10 @@
   //
   // 6) Retrieve the results and store them in this class
-  //    If fFitted is false, we get the means and RMS of the histogram!!
+  //    If fFitted is false, we get the eans and RMS of the histogram!!
   //
   fCharge         = fHist->GetChargeMean();
-  fErrCharge      = fHist->GetChargeMeanErr(); 
+  fChargeErr      = fHist->GetChargeMeanErr(); 
   fSigmaCharge    = fHist->GetChargeSigma();
-  fErrSigmaCharge = fHist->GetChargeSigmaErr();
+  fSigmaChargeErr = fHist->GetChargeSigmaErr();
   fChargeProb     = fHist->GetChargeProb();
 
@@ -674,5 +534,5 @@
 
   //
-  // Calculate the conversion factors 
+  //Calculate the conversion factors 
   //
   if (IsHiGainSaturation())
@@ -699,5 +559,5 @@
 
   if ( (fCharge    == -1.)
-   || (fErrCharge   < 0.)
+   || (fChargeErr   < 0.)
    || (fSigmaCharge < 0.)
    || (fPedRms      < 0.) )
@@ -714,17 +574,28 @@
   // First the relative error squares
   //
-  const Float_t chargeSquare              =       fCharge*   fCharge;
-  const Float_t chargeSquareRelErrSquare  = 4.*fErrCharge*fErrCharge / chargeSquare;
-  
-  const Float_t ffactorsquare             =    gkFFactor      * gkFFactor;
-  const Float_t ffactorsquareRelErrSquare = 4.*gkFFactorError * gkFFactorError / ffactorsquare;
+  const Float_t chargeSquare              =     fCharge    * fCharge;
+  const Float_t chargeSquareRelErrSquare  = 4.* fChargeErr * fChargeErr / chargeSquare;
+
+  const Float_t chargeRelErrSquare        =     fChargeErr * fChargeErr 
+                                             / (fCharge    * fCharge);
+  
+  const Float_t ffactorsquare             =    gkFFactor    * gkFFactor;
+  const Float_t ffactorsquareRelErrSquare = 4.*gkFFactorErr * gkFFactorErr / ffactorsquare;
+
+  const Float_t avQERelErrSquare          =    fAverageQEErr * fAverageQEErr / fAverageQE / fAverageQE; 
+
+  const Float_t avQEFFactor               = TMath::Sqrt( ( 1. - fAverageQE ) / fAverageQE  );
+  const Float_t avQEFFactorErr            = 1./ ( 2. * avQEFFactor ) * fAverageQEErr 
+                                            / ( fAverageQE * fAverageQE );
+  const Float_t avQEFFactorRelErrSquare  = avQEFFactorErr  * avQEFFactorErr 
+                                           / ( avQEFFactor * avQEFFactor) ;
   //
   // Now the absolute error squares
   //
-  const Float_t sigmaSquare               =       fSigmaCharge*fSigmaCharge;
-  const Float_t sigmaSquareErrSquare      = 4.*fErrSigmaCharge*fErrSigmaCharge * sigmaSquare;
-  
-  Float_t pedRmsSquare                    =       fPedRms*   fPedRms;
-  Float_t pedRmsSquareErrSquare           = 4.*fErrPedRms*fErrPedRms * pedRmsSquare;
+  const Float_t sigmaSquare               =    fSigmaCharge   * fSigmaCharge;
+  const Float_t sigmaSquareErrSquare      = 4.*fSigmaChargeErr* fSigmaChargeErr * sigmaSquare;
+  
+  Float_t pedRmsSquare                    =       fPedRms * fPedRms;
+  Float_t pedRmsSquareErrSquare           = 4.*fPedRmsErr * fPedRmsErr * pedRmsSquare;
   
   if (!IsHiGainSaturation())
@@ -743,6 +614,6 @@
       // We extract the pure NSB contribution:
       //
-      const Float_t elecRmsSquare          =    gkElectronicPedRms   *gkElectronicPedRms;
-      const Float_t elecRmsSquareErrSquare = 4.*gkErrElectronicPedRms*gkErrElectronicPedRms * elecRmsSquare;
+      const Float_t elecRmsSquare          =    gkElectronicPedRms    * gkElectronicPedRms;
+      const Float_t elecRmsSquareErrSquare = 4.*gkElectronicPedRmsErr * gkElectronicPedRmsErr * elecRmsSquare;
   
       Float_t nsbSquare             =  pedRmsSquare          - elecRmsSquare;
@@ -757,6 +628,6 @@
       // add it quadratically to the electronic noise
       //
-      const Float_t conversionSquare             =    fConversionHiLo     *fConversionHiLo;
-      const Float_t conversionSquareRelErrSquare = 4.*fConversionHiLoError*fConversionHiLoError/conversionSquare;
+      const Float_t conversionSquare             =    fConversionHiLo    * fConversionHiLo;
+      const Float_t conversionSquareRelErrSquare = 4.*fConversionHiLoErr * fConversionHiLoErr / conversionSquare;
       
       const Float_t convertedNsbSquare          =  nsbSquare             / conversionSquare;
@@ -790,5 +661,4 @@
             << fPixId << endl;
       CLRBIT(fFlags,kFFactorMethodValid);
-      fFactorCalculated = kTRUE;
       return kFALSE;
     }
@@ -798,5 +668,5 @@
   
   fRSigmaCharge    = TMath::Sqrt(rsigmachargesquare);
-  fErrRSigmaCharge = TMath::Sqrt(sigmaSquareErrSquare + pedRmsSquareErrSquare);
+  fRSigmaChargeErr = TMath::Sqrt(sigmaSquareErrSquare + pedRmsSquareErrSquare);
 
 
@@ -806,25 +676,51 @@
   //
   fPheFFactorMethod = ffactorsquare * chargeSquare / rsigmachargesquare;
+  //
+  // Calculate the number of photons from the F-Factor method
+  // FIXME: This is a preliminary solution, the qe shall be 
+  // calibrated itself!
+  //
+  fPheFFactorMethod /= fAverageQE;
 
   const Float_t pheFFactorRelErrSquare =  ffactorsquareRelErrSquare
-                                       + chargeSquareRelErrSquare
-                                       + rSigmaSquareRelErrSquare ;
-  
-  fPheFFactorMethodError        =  TMath::Sqrt(pheFFactorRelErrSquare) * fPheFFactorMethod;
-  
-  const Float_t chargeRelErrSquare = fErrCharge*fErrCharge / (fCharge * fCharge);
-  
-  fMeanConversionFFactorMethod     =  fPheFFactorMethod / fCharge ;
-  fErrorConversionFFactorMethod    =  ( pheFFactorRelErrSquare + chargeRelErrSquare )
-                                   * fMeanConversionFFactorMethod * fMeanConversionFFactorMethod;
-
-  const Float_t convrelerror = fErrorConversionFFactorMethod/fMeanConversionFFactorMethod;
-  
-  if ( (fMeanConversionFFactorMethod > 0.) && (convrelerror < gkConvFFactorRelErrorLimit))
+                                        + chargeSquareRelErrSquare
+                                        + rSigmaSquareRelErrSquare
+                                        + avQERelErrSquare;
+  
+  fPheFFactorMethodErr                 =  TMath::Sqrt(pheFFactorRelErrSquare) * fPheFFactorMethod;
+  
+  fMeanConversionFFactorMethod         =  fPheFFactorMethod / fCharge ;
+  fConversionFFactorMethodErr          =  ( pheFFactorRelErrSquare + chargeRelErrSquare )
+                                        * fMeanConversionFFactorMethod * fMeanConversionFFactorMethod;
+
+  const Float_t convrelerror           =   fConversionFFactorMethodErr
+                                         / fMeanConversionFFactorMethod;
+  
+  if ( (fMeanConversionFFactorMethod > 0.) && (convrelerror < gkConvFFactorRelErrLimit))
     SETBIT(fFlags,kFFactorMethodValid);
 
-  fFactorCalculated = kTRUE;
-
   fSigmaConversionFFactorMethod = GetTotalFFactorFFactorMethod()*TMath::Sqrt(fMeanConversionFFactorMethod);
+  
+  //
+  // Calculate the Total F-Factor of the camera ( in photons )
+  //
+  if (fPheFFactorMethod > 0)
+  {      
+      fTotalFFactorFFactorMethod =  (fRSigmaCharge/fCharge)*TMath::Sqrt(fPheFFactorMethod);
+      fTotalFFactorFFactorMethod *=  avQEFFactor;
+  }
+
+  //
+  // Calculate the error of the Total F-Factor of the camera ( in photons )
+  //
+  const Float_t rSigmaChargeRelErrSquare =    fRSigmaChargeErr * fRSigmaChargeErr 
+                                           / (fRSigmaCharge    * fRSigmaCharge) ;
+
+  fTotalFFactorErrFFactorMethod = TMath::Sqrt(  rSigmaChargeRelErrSquare
+						+ chargeRelErrSquare
+						+ pheFFactorRelErrSquare
+						+ avQEFFactorRelErrSquare  );
+
+  fTotalFFactorErrFFactorMethod *= fTotalFFactorFFactorMethod;
 
   return kTRUE;
@@ -870,12 +766,12 @@
     }
   
-  if (fErrCharge < gkChargeErrLimit) 
-    {
-      *fLog << warn << "WARNING: Error of Fitted Charge is smaller than "
+  if (fChargeErr < gkChargeErrLimit) 
+    {
+      *fLog << warn << "WARNING: Err of Fitted Charge is smaller than "
             << gkChargeErrLimit << " in Pixel " << fPixId << endl;
       return kFALSE;
     }
       
-  if (fCharge < gkChargeRelErrLimit*fErrCharge) 
+  if (fCharge < gkChargeRelErrLimit*fChargeErr) 
     {
       *fLog << warn << "WARNING: Fitted Charge is smaller than "
@@ -975,16 +871,16 @@
 {
   
-  const Float_t chargeRelErrSquare     =   fErrCharge*fErrCharge
-                                         /(   fCharge *  fCharge);
-  const Float_t sigmaRelErrSquare      =   fErrSigmaCharge*fErrSigmaCharge
-                                         /(   fSigmaCharge *  fSigmaCharge);
-  const Float_t conversionRelErrSquare =   fConversionHiLoError*fConversionHiLoError 
-                                         /(fConversionHiLo    * fConversionHiLo);
+  const Float_t chargeRelErrSquare     =    fChargeErr * fChargeErr
+                                         /( fCharge    * fCharge  );
+  const Float_t sigmaRelErrSquare      =    fSigmaChargeErr * fSigmaChargeErr
+                                         /( fSigmaCharge    * fSigmaCharge );
+  const Float_t conversionRelErrSquare =    fConversionHiLoErr * fConversionHiLoErr 
+                                         /( fConversionHiLo    * fConversionHiLo  );
   
   fCharge         *= fConversionHiLo;
-  fErrCharge       = TMath::Sqrt(chargeRelErrSquare + conversionRelErrSquare) * fCharge;
+  fChargeErr       = TMath::Sqrt(chargeRelErrSquare + conversionRelErrSquare) * fCharge;
   
   fSigmaCharge    *= fConversionHiLo;
-  fErrSigmaCharge =  TMath::Sqrt(sigmaRelErrSquare + conversionRelErrSquare) * fSigmaCharge;
-  
-}
+  fSigmaChargeErr =  TMath::Sqrt(sigmaRelErrSquare + conversionRelErrSquare) * fSigmaCharge;
+  
+}
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationPix.h
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationPix.h	(revision 3241)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationPix.h	(revision 3242)
@@ -12,78 +12,86 @@
 private:
 
-  static const Float_t gkAverageQE;           // The average quantum efficieny agreed on for the first analysis
-  static const Float_t gkAverageQEErr;        // The error of average quantum efficieny 
-  
-  static const Float_t gkConversionHiLo;      // The default conversion factor HI gain - Lo Gain
-  static const Float_t gkConversionHiLoError; // The error of the default conversion factor
-  
-  static const Float_t gkElectronicPedRms;    // The pure electronic component of the RMS
-  static const Float_t gkErrElectronicPedRms; // The error of the pure electronic component of the RMS
-  static const Float_t gkFFactor;             // The laboratory F-factor of the PMTs
-  static const Float_t gkFFactorError;        // The laboratory F-factor Error of the PMTs
-  static const Float_t gkChargeLimit;         // The limit (in units of PedRMS) for acceptance of the fitted mean charge
-  static const Float_t gkChargeErrLimit;      // The limit (in units of PedRMS) for acceptance of the fitted charge sigma
-  static const Float_t gkChargeRelErrLimit;   // The limit (in units of Error of fitted charge) for acceptance of the fitted mean  
-  static const Float_t gkTimeLimit;           // The limit (in units of FADC slices) for acceptance of the fitted time
-  static const Float_t gkTimeErrLimit;        // The limit (in units of FADC slices) for acceptance of the fitted time sigma
-  static const Float_t gkConvFFactorRelErrorLimit; // The limit (in units of [1]) for acceptance of the rel. error of the conversion factor with the FFactor method
-
-  Int_t   fPixId;               // the pixel Id
-
-  UInt_t  fFlags;               // Flag for the set Bits
- 
-  Float_t fAverageQE;
-  Float_t fAverageQEErr;  
-  
-  Float_t fCharge;              // The mean reduced charge after the fit
-  Float_t fErrCharge;           // The error of reduced mean charge after the fit
-  Float_t fSigmaCharge;         // The sigma of the mean charge after the fit
-  Float_t fErrSigmaCharge;      // The error of the sigma of the mean charge after the fit
-  Float_t fRSigmaCharge;        // The reduced squares of sigmas after the fit
-  Float_t fErrRSigmaCharge;     // The reduced squares of sigmas after the fit  
-  Float_t fChargeProb;          // The probability of the fit function 
-
-  Float_t fPed;                 // The mean pedestal (from MPedestalPix)
-  Float_t fPedRms;              // The pedestal  RMS (from MPedestalPix)
-  Float_t fErrPedRms;           // The error of the pedestal  RMS (from MPedestalPix)  
-
-  Float_t fAbsTimeMean;
-  Float_t fAbsTimeMeanErr;  
-  Float_t fAbsTimeRms;
-  
-  Byte_t  fTimeFirstHiGain;           // The first used FADC slice
-  Byte_t  fTimeLastHiGain;            // The last used FADC slice
-  
-  Byte_t  fTimeFirstLoGain;           // The first used FADC slice
-  Byte_t  fTimeLastLoGain;            // The last used FADC slice
-  
-  Float_t fPheFFactorMethod;                // The number of Phe's calculated (F-factor method)
-  Float_t fPheFFactorMethodError;           // The error on the number of Phe's calculated (F-factor method)
-
-  Float_t fMeanConversionFFactorMethod;     // The conversion factor to Phe's (F-factor method)
-  Float_t fMeanConversionBlindPixelMethod;  // The conversion factor to Ph's (Blind Pixel method)
-  Float_t fMeanConversionPINDiodeMethod;    // The conversion factor to Ph's (PIN Diode method)
-  Float_t fMeanConversionCombinedMethod;    // The conversion factor to Ph's (all methods combined)
-
-  Float_t fErrorConversionFFactorMethod;    // The error of the conversion factor to Phe's (F-factor method)
-  Float_t fErrorConversionBlindPixelMethod; // The error of the conversion factor to Ph's (Blind Pixel method)
-  Float_t fErrorConversionPINDiodeMethod;   // The error of the conversion factor to Ph's (PIN Diode method)
-  Float_t fErrorConversionCombinedMethod;   // The error of the conversion factor to Ph's (all methods combined)
-
-  Float_t fSigmaConversionFFactorMethod;    // The sigma of conversion factor to Phe's (F-factor method)
-  Float_t fSigmaConversionBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method)
-  Float_t fSigmaConversionPINDiodeMethod;   // The conversion factor to Ph's (PIN Diode method)
-  Float_t fSigmaConversionCombinedMethod;   // The conversion factor to Ph's (all methods combined)
-
-  Float_t fTotalFFactor;                    // The F-Factor of the total readout system (Sigma(out)/mean(out)*Mean(in)/sigma(in)
-  Float_t fTotalFFactorError;               // The error on the F-Factor of the total readout system
-  
-  Float_t fConversionHiLo;                  // The conversion factor between Hi Gain and Lo Gain  
-  Float_t fConversionHiLoError;             // The error of the conversion factor between Hi Gain and Lo Gain  
-
-  Float_t fNumHiGainSamples;
-  Float_t fNumLoGainSamples;
-  
-  Bool_t fFactorCalculated;
+  static const Float_t gkAverageQE;              // The average quantum efficieny agreed on for the first analysis
+  static const Float_t gkAverageQEErr;           // The error of average quantum efficieny 
+  
+  static const Float_t gkConversionHiLo;         // The default conversion factor HI gain - Lo Gain
+  static const Float_t gkConversionHiLoErr;      // The error of the default conversion factor
+  
+  static const Float_t gkElectronicPedRms;       // The pure electronic component of the RMS
+  static const Float_t gkElectronicPedRmsErr;    // The error of the pure electronic component of the RMS
+  static const Float_t gkFFactor;                // The laboratory F-factor of the PMTs
+  static const Float_t gkFFactorErr;             // The laboratory F-factor Error of the PMTs
+  static const Float_t gkChargeLimit;            // The limit (in units of PedRMS) for acceptance of the fitted mean charge
+  static const Float_t gkChargeErrLimit;         // The limit (in units of PedRMS) for acceptance of the fitted charge sigma
+  static const Float_t gkChargeRelErrLimit;      // The limit (in units of Error of fitted charge) for acceptance of the fitted mean  
+  static const Float_t gkTimeLimit;              // The limit (in units of FADC slices) for acceptance of the fitted time
+  static const Float_t gkTimeErrLimit;           // The limit (in units of FADC slices) for acceptance of the fitted time sigma
+  static const Float_t gkConvFFactorRelErrLimit; // The limit for acceptance of the rel. error of the conversion factor with the FFactor method
+
+  Int_t   fPixId;                                // the pixel Id
+
+  UInt_t  fFlags;                                // Flag for the set bits
+ 
+  Float_t fAverageQE;                            // The average quantum efficieny (see Class description)
+  Float_t fAverageQEErr;                         // The error of the average quantum efficieny (see Class description)
+  
+  Float_t fCharge;                               // The mean reduced charge after the fit
+  Float_t fChargeErr;                            // The error of reduced mean charge after the fit
+  Float_t fSigmaCharge;                          // The sigma of the mean charge after the fit
+  Float_t fSigmaChargeErr;                       // The error of the sigma of the mean charge after the fit
+  Float_t fRSigmaCharge;                         // The reduced squares of sigmas after the fit
+  Float_t fRSigmaChargeErr;                      // The reduced squares of sigmas after the fit  
+  Float_t fChargeProb;                           // The probability of the fit function 
+
+  Float_t fPed;                                  // The mean pedestal (from MPedestalPix)
+  Float_t fPedRms;                               // The pedestal  RMS (from MPedestalPix)
+  Float_t fPedRmsErr;                            // The error of the pedestal  RMS (from MPedestalPix)  
+
+  Float_t fAbsTimeMean;                          // The mean absolute arrival time
+  Float_t fAbsTimeMeanErr;                       // The error of the absolute mean arrival time
+  Float_t fAbsTimeRms;                           // The rms of the mean absolute arrival time
+  
+  Byte_t  fTimeFirstHiGain;                      // The first used FADC slice
+  Byte_t  fTimeLastHiGain;                       // The last used FADC slice
+  
+  Byte_t  fTimeFirstLoGain;                      // The first used FADC slice
+  Byte_t  fTimeLastLoGain;                       // The last used FADC slice
+  
+  Float_t fPheFFactorMethod;                     // The number of Phe's calculated (F-factor method)
+  Float_t fPheFFactorMethodErr;                  // The error on the number of Phe's calculated (F-factor method)
+
+  Float_t fMeanConversionFFactorMethod;          // The conversion factor to Phe's (F-factor method)
+  Float_t fMeanConversionBlindPixelMethod;       // The conversion factor to Ph's (Blind Pixel method)
+  Float_t fMeanConversionPINDiodeMethod;         // The conversion factor to Ph's (PIN Diode method)
+  Float_t fMeanConversionCombinedMethod;         // The conversion factor to Ph's (all methods combined)
+
+  Float_t fConversionFFactorMethodErr;           // The error of the conversion factor to Phe's (F-factor method)
+  Float_t fConversionBlindPixelMethodErr;        // The error of the conversion factor to Ph's (Blind Pixel method)
+  Float_t fConversionPINDiodeMethodErr;          // The error of the conversion factor to Ph's (PIN Diode method)
+  Float_t fConversionCombinedMethodErr;          // The error of the conversion factor to Ph's (all methods combined)
+
+  Float_t fSigmaConversionFFactorMethod;         // The sigma of conversion factor to Phe's (F-factor method)
+  Float_t fSigmaConversionBlindPixelMethod;      // The conversion factor to Ph's (Blind Pixel method)
+  Float_t fSigmaConversionPINDiodeMethod;        // The conversion factor to Ph's (PIN Diode method)
+  Float_t fSigmaConversionCombinedMethod;        // The conversion factor to Ph's (all methods combined)
+ 
+  Float_t fTotalFFactorFFactorMethod;            // The total F-Factor to Ph's (F-factor method)
+  Float_t fTotalFFactorBlindPixelMethod;         // The total F-Factor to Ph's (Blind Pixel method)
+  Float_t fTotalFFactorPINDiodeMethod;           // The total F-Factor to Ph's (PIN Diode method)
+  Float_t fTotalFFactorCombinedMethod;           // The total F-Factor to Ph's (all methods combined)
+ 
+  Float_t fTotalFFactorErrFFactorMethod;         // The error of the total F-Factor to Ph's (F-factor method)
+  Float_t fTotalFFactorErrBlindPixelMethod;      // The error of the total F-Factor to Ph's (Blind Pixel method)
+  Float_t fTotalFFactorErrPINDiodeMethod;        // The error of the total F-Factor to Ph's (PIN Diode method)
+  Float_t fTotalFFactorErrCombinedMethod;        // The error of the total F-Factor to Ph's (all methods combined)
+ 
+  Float_t fTotalFFactor;                         // The F-Factor of the total readout system (Sigma(out)/mean(out)*Mean(in)/sigma(in)
+  Float_t fTotalFFactorErr;                      // The error on the F-Factor of the total readout system
+  
+  Float_t fConversionHiLo;                       // The conversion factor between Hi Gain and Lo Gain  
+  Float_t fConversionHiLoErr;                    // The error of the conversion factor between Hi Gain and Lo Gain  
+
+  Float_t fNumHiGainSamples;                     // The number of hi-gain samples used for the signal extraction
+  Float_t fNumLoGainSamples;                     // The number of hi-gain samples used for the signal extraction
   
   enum  { kHiGainSaturation,
@@ -91,7 +99,8 @@
           kChargeValid, kTimeFitValid,
           kFitted, kOscillating, 
-          kBlindPixelMethodValid, kFFactorMethodValid, kPINDiodeMethodValid, kCombinedMethodValid };
-  
-  MHCalibrationPixel *fHist;                // Pointer to the histograms performing the fits, etc.  
+          kBlindPixelMethodValid, kFFactorMethodValid, 
+	  kPINDiodeMethodValid, kCombinedMethodValid };
+  
+  MHCalibrationPixel *fHist;                     // Pointer to the histograms performing the fits, etc.  
 
   Bool_t CheckChargeValidity();
@@ -111,92 +120,94 @@
   void SetPedestal(const Float_t ped, const Float_t pedrms,
                    const Float_t higainsamp, const Float_t logainsamp);
-  void SetConversionHiLo(     const Float_t c=gkConversionHiLo)       { fConversionHiLo      = c;    }
-  void SetConversionHiLoError(const Float_t e=gkConversionHiLoError)  { fConversionHiLoError = e;    }
-  void SetAverageQE(const Float_t qe=gkAverageQE, const Float_t err=gkAverageQEErr)
-                                    { fAverageQE = qe;               fAverageQEErr = err;  }
-  
+  void SetConversionHiLo(     const Float_t c = gkConversionHiLo)       { fConversionHiLo      = c;    }
+  void SetConversionHiLoErr(  const Float_t e = gkConversionHiLoErr)    { fConversionHiLoErr   = e;    }
+  void SetAverageQE(          const Float_t qe= gkAverageQE, 
+			      const Float_t err=gkAverageQEErr)         { fAverageQE    = qe;           
+			                                                  fAverageQEErr = err;         }
+
   // Setters for MC
-  void SetConversionFFactorMethod(Float_t c, Float_t err, Float_t sig);
-  void SetConversionBlindPixelMethod(Float_t c, Float_t err, Float_t sig);
-  void SetConversionPINDiodeMethod(Float_t c, Float_t err, Float_t sig);
-  void SetConversionCombinedMethod(Float_t c, Float_t err, Float_t sig);
+  void SetConversionFFactorMethod(    Float_t c, Float_t err, Float_t sig );
+  void SetConversionBlindPixelMethod( Float_t c, Float_t err, Float_t sig );
+  void SetConversionPINDiodeMethod(   Float_t c, Float_t err, Float_t sig );
+  void SetConversionCombinedMethod(   Float_t c, Float_t err, Float_t sig );
 
   // Bit Setters
-  void SetHiGainSaturation(Bool_t b = kTRUE);
-  void SetExcluded(Bool_t b = kTRUE);
-  void SetExcludeQualityCheck(Bool_t b = kTRUE);
-  void SetChargeValid(Bool_t b = kTRUE);
-  void SetFitted(Bool_t b = kTRUE);
-  void SetOscillating(Bool_t b = kTRUE);
-  void SetBlindPixelMethodValid(Bool_t b = kTRUE);
-  void SetFFactorMethodValid(Bool_t b = kTRUE);
-  void SetPINDiodeMethodValid(Bool_t b = kTRUE);
-  void SetAbsTimeBordersHiGain(Byte_t f, Byte_t l);
-  void SetAbsTimeBordersLoGain(Byte_t f, Byte_t l);
+  void SetHiGainSaturation(      Bool_t b = kTRUE );
+  void SetExcluded(              Bool_t b = kTRUE );
+  void SetExcludeQualityCheck(   Bool_t b = kTRUE );
+  void SetChargeValid(           Bool_t b = kTRUE );
+  void SetFitted(                Bool_t b = kTRUE );
+  void SetOscillating(           Bool_t b = kTRUE );
+  void SetBlindPixelMethodValid( Bool_t b = kTRUE );
+  void SetFFactorMethodValid(    Bool_t b = kTRUE );
+  void SetPINDiodeMethodValid(   Bool_t b = kTRUE );
+
+  void SetAbsTimeBordersHiGain( Byte_t f, Byte_t l );
+  void SetAbsTimeBordersLoGain( Byte_t f, Byte_t l );
   
   // Charges
   Float_t GetCharge()              const { return fCharge;          }
-  Float_t GetErrCharge()           const { return fErrCharge;       }
+  Float_t GetChargeErr()           const { return fChargeErr;       }
   Float_t GetChargeProb()          const { return fChargeProb;      }    
   Float_t GetSigmaCharge()         const { return fSigmaCharge;     }
-  Float_t GetErrSigmaCharge()      const { return fErrSigmaCharge;  }
+  Float_t GetSigmaChargeErr()      const { return fSigmaChargeErr;  }
   Float_t GetRSigmaCharge()        const { return fRSigmaCharge;    }
-  Float_t GetErrRSigmaCharge()     const { return fErrRSigmaCharge; }  
-
-
-  Float_t GetAbsTimeMean()         const { return fAbsTimeMean;    }
-  Float_t GetAbsTimeMeanErr()      const { return fAbsTimeMeanErr; }
-  Float_t GetAbsTimeRms()          const { return fAbsTimeRms;     }
+  Float_t GetRSigmaChargeErr()     const { return fRSigmaChargeErr; }  
+
+
+  Float_t GetAbsTimeMean()         const { return fAbsTimeMean;     }
+  Float_t GetAbsTimeMeanErr()      const { return fAbsTimeMeanErr;  }
+  Float_t GetAbsTimeRms()          const { return fAbsTimeRms;      }
   
   // Conversion Factors
-  Float_t GetConversionHiLo()                 const  { return fConversionHiLo;        }
-  Float_t GetConversionHiLoError()            const  { return fConversionHiLoError;   }
+  Float_t GetConversionHiLo()      const  { return fConversionHiLo;    }
+  Float_t GetConversionHiLoErr()   const  { return fConversionHiLoErr; }
 
   Float_t GetMeanConversionBlindPixelMethod()  const { return fMeanConversionBlindPixelMethod  ; }
-  Float_t GetErrorConversionBlindPixelMethod() const { return fErrorConversionBlindPixelMethod ; }
+  Float_t GetConversionBlindPixelMethodErr()   const { return fConversionBlindPixelMethodErr ;   }
   Float_t GetSigmaConversionBlindPixelMethod() const { return fSigmaConversionBlindPixelMethod ; }
 
-  Float_t GetMeanConversionFFactorMethod();
-  Float_t GetErrorConversionFFactorMethod();
-  Float_t GetSigmaConversionFFactorMethod();
-
-  Float_t GetMeanConversionPINDiodeMethod()    const { return fMeanConversionPINDiodeMethod ;  }
-  Float_t GetErrorConversionPINDiodeMethod()   const { return fErrorConversionPINDiodeMethod ; }
-  Float_t GetSigmaConversionPINDiodeMethod()   const { return fSigmaConversionPINDiodeMethod ; }
-
-  Float_t GetMeanConversionCombinedMethod()    const { return fMeanConversionCombinedMethod ;  }
-  Float_t GetErrorConversionCombinedMethod()   const { return fErrorConversionCombinedMethod ; }
-  Float_t GetSigmaConversionCombinedMethod()   const { return fSigmaConversionCombinedMethod ; }
-
-  Float_t GetPheFFactorMethod();    
-  Float_t GetPheFFactorMethodError();
-
-  Int_t   GetPixId()                           const  { return fPixId;   }
-
-  Float_t GetPed()                             const { return fPed;    }
-  Float_t GetPedRms()                          const { return fPedRms; }
-
-  Float_t GetTotalFFactorFFactorMethod();
-  Float_t GetTotalFFactorErrorFFactorMethod();
-  
-  Float_t GetTotalFFactorBlindPixelMethod();
-  Float_t GetTotalFFactorErrorBlindPixelMethod();
-  
-  Float_t GetTotalFFactorPINDiodeMethod();
-  Float_t GetTotalFFactorErrorPINDiodeMethod();
-
-  Float_t GetTotalFFactorCombinedMethod();
-  Float_t GetTotalFFactorErrorCombinedMethod();
-  
-  Bool_t IsExcluded()              const;
-  Bool_t IsExcludeQualityCheck()   const;
-  Bool_t IsHiGainSaturation()      const;
-  Bool_t IsChargeValid()        const;
-  Bool_t IsFitted()                const;
-  Bool_t IsOscillating();
-  Bool_t IsBlindPixelMethodValid() const;
-  Bool_t IsPINDiodeMethodValid()   const;
-  Bool_t IsFFactorMethodValid();
-  Bool_t IsCombinedMethodValid();
+  Float_t GetMeanConversionFFactorMethod()     const { return fMeanConversionFFactorMethod;      }
+  Float_t GetConversionFFactorMethodErr()      const { return fConversionFFactorMethodErr;       } 
+  Float_t GetSigmaConversionFFactorMethod()    const { return fSigmaConversionFFactorMethod;     }
+
+  Float_t GetMeanConversionPINDiodeMethod()    const { return fMeanConversionPINDiodeMethod ;    }
+  Float_t GetConversionPINDiodeMethodErr()     const { return fConversionPINDiodeMethodErr ;     }
+  Float_t GetSigmaConversionPINDiodeMethod()   const { return fSigmaConversionPINDiodeMethod ;   }
+
+  Float_t GetMeanConversionCombinedMethod()    const { return fMeanConversionCombinedMethod ;    }
+  Float_t GetConversionCombinedMethodErr()     const { return fConversionCombinedMethodErr ;     }
+  Float_t GetSigmaConversionCombinedMethod()   const { return fSigmaConversionCombinedMethod ;   }
+
+  Float_t GetPheFFactorMethod()                const { return fPheFFactorMethod;                 }    
+  Float_t GetPheFFactorMethodErr()             const { return fPheFFactorMethodErr;              }
+
+  Int_t   GetPixId()                           const { return fPixId;                            }
+
+  Float_t GetPed()                             const { return fPed;                              }
+  Float_t GetPedRms()                          const { return fPedRms;                           }
+
+  Float_t GetTotalFFactorFFactorMethod()       const { return fTotalFFactorFFactorMethod;        }
+  Float_t GetTotalFFactorErrFFactorMethod()    const { return fTotalFFactorErrFFactorMethod;     }
+  
+  Float_t GetTotalFFactorBlindPixelMethod()    const { return fTotalFFactorBlindPixelMethod;     }
+  Float_t GetTotalFFactorErrBlindPixelMethod() const { return fTotalFFactorErrBlindPixelMethod;  }
+  
+  Float_t GetTotalFFactorPINDiodeMethod()      const { return fTotalFFactorPINDiodeMethod;       }
+  Float_t GetTotalFFactorErrPINDiodeMethod()   const { return fTotalFFactorErrPINDiodeMethod;    } 
+
+  Float_t GetTotalFFactorCombinedMethod()      const { return fTotalFFactorCombinedMethod;       }
+  Float_t GetTotalFFactorErrCombinedMethod()   const { return fTotalFFactorErrCombinedMethod;    }
+  
+  Bool_t IsExcluded()                          const;
+  Bool_t IsExcludeQualityCheck()               const;
+  Bool_t IsHiGainSaturation()                  const;
+  Bool_t IsChargeValid()                       const;
+  Bool_t IsFitted()                            const;
+  Bool_t IsOscillating()                       const;
+  Bool_t IsBlindPixelMethodValid()             const;
+  Bool_t IsPINDiodeMethodValid()               const;
+  Bool_t IsFFactorMethodValid()                const;
+  Bool_t IsCombinedMethodValid()               const;
 
   // Fill histos
