Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 3654)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 3655)
@@ -18,4 +18,15 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2004/04/05: Markus Gaug
+
+   * msignal/MExtractedSignalPINDiode.h
+     - new function GetLastUsedSlice()
+
+   * mcalib/MCalibrationChargeCalc.[h,cc]
+     - holds also pointers to MExtractedSignalPINDiode and 
+       MExtractedSignalBlindPixel and does the checks inside the task 
+       (instead of inside the containers)
+
 
  2004/04/05: Nadia Tonello
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 3654)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 3655)
@@ -199,4 +199,6 @@
 #include "MExtractedSignalCam.h"
 #include "MExtractedSignalPix.h"
+#include "MExtractedSignalBlindPixel.h"
+#include "MExtractedSignalPINDiode.h"
 
 #include "MBadPixelsCam.h"
@@ -224,5 +226,6 @@
       fRawEvt(NULL), fRunHeader(NULL), fGeom(NULL), 
       fBadPixels(NULL), fEvtTime(NULL),
-      fSignals(NULL), fPINDiode(NULL), fBlindPixel(NULL)
+      fSignals(NULL), fSigBlind(NULL), fSigPIN(NULL),
+      fPINDiode(NULL), fBlindPixel(NULL)
 {
 
@@ -267,4 +270,7 @@
 //  - MRawEvtData
 //  - MPedestalCam
+//  - MExtractedSignalCam
+//  - MExtractedSignalBlindPixel
+//  - MExtractedSignalPINDiode
 //
 // The following output containers are also searched and created if
@@ -288,35 +294,59 @@
     }
   
+  fPedestals = (MPedestalCam*)pList->FindObject("MPedestalCam");
+  if (!fPedestals)
+    {
+      *fLog << err << "MPedestalCam not found... aborting" << endl;
+      return kFALSE;
+    }
+  
+  fSignals = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam");
+  if (!fSignals)
+    {
+      *fLog << err << "MExtractedSignalCam not found... aborting" << endl;
+      return kFALSE;
+    }
+  
+  fSigBlind = (MExtractedSignalBlindPixel*)pList->FindObject("MExtractedSignalBlindPixel");
+  if (!fSigBlind)
+    *fLog << warn << "MExtractedSignalBlindPixel not found... no blind pixel method! " << endl;
+  else
+    {
+      fBlindPixel = (MCalibrationChargeBlindPix*)pList->FindCreateObj("MCalibrationChargeBlindPix");
+      if (!fBlindPixel)
+        {
+          *fLog << err << "Cannot find nor create MCalibrationChargeBlindPix... aborting" << endl;
+          return kFALSE;
+        }
+    }
+  
+  fSigPIN  = (MExtractedSignalPINDiode*)pList->FindObject("MExtractedSignalPINDiode");
+  if (!fSigPIN)
+    *fLog << warn << "MExtractedSignalPINDiode not found... no PIN Diode method! " << endl;
+  else
+    {
+      fPINDiode = (MCalibrationChargePINDiode*)pList->FindCreateObj("MCalibrationChargePINDiode");
+      if (!fPINDiode)
+        {
+          *fLog << err << "Cannot find nor create MCalibrationChargePINDiode... aborting" << endl;
+          return kFALSE;
+        }
+    }
+  
   fCam = (MCalibrationChargeCam*)pList->FindCreateObj("MCalibrationChargeCam");
   if (!fCam)
-    return kFALSE;
+    {
+      *fLog << err << "Cannot find nor create MCalibrationChargeCam... aborting" << endl;
+      return kFALSE;
+    }
   
   fQECam = (MCalibrationQECam*)pList->FindCreateObj("MCalibrationQECam");
   if (!fQECam)
-    return kFALSE;
-  
-  fPINDiode = (MCalibrationChargePINDiode*)pList->FindCreateObj("MCalibrationChargePINDiode");
-  if (!fPINDiode)
-    return kFALSE;
-  
-  fBlindPixel = (MCalibrationChargeBlindPix*)pList->FindCreateObj("MCalibrationChargeBlindPix");
-  if (!fBlindPixel)
-    return kFALSE;
+    {
+      *fLog << err << "Cannot find nor create MCalibrationQECam... aborting" << endl;
+      return kFALSE;
+    }
   
   fEvtTime = (MTime*)pList->FindObject("MTime");
-  
-  fPedestals = (MPedestalCam*)pList->FindObject("MPedestalCam");
-  if (!fPedestals)
-    {
-      *fLog << err << "MPedestalCam not found... aborting" << endl;
-      return kFALSE;
-    }
-  
-  fSignals = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam");
-  if (!fSignals)
-    {
-      *fLog << err << "MExtractedSignalCam not found... aborting" << endl;
-      return kFALSE;
-    }
   
   return kTRUE;
@@ -407,9 +437,9 @@
 // Finalize pedestals: 
 // 
-// * Retrieve pedestal and pedestal RMS from MPedestalPix
-// * Retrieve total entries from MPedestalCam
-// * sum up pedestal and pedestalRMS for the average pixel
-// * set pedestal*number of used samples in MCalibrationChargePix
-// * set pedestal RMS * sqrt of number of used samples in MCalibrationChargePix
+// - Retrieve pedestal and pedestal RMS from MPedestalPix
+// - Retrieve total entries from MPedestalCam
+// - Sum up pedestal and pedestalRMS for the average pixel
+// - Set pedestal*number of used samples in MCalibrationChargePix
+// - Set pedestal RMS * sqrt of number of used samples in MCalibrationChargePix
 // 
 //
@@ -472,11 +502,11 @@
 }
 
+// ---------------------------------------------------------------------
 //
 // Finalize charges per pixel: 
-// * Check chage validity
-// * check absolute time validity
-// * calculate the reduced sigma
-// * caluclate the number of photo-electrons
-//
+// - Check chage validity
+// - Check absolute time validity
+// - Calculate the reduced sigma
+// - Calculate the number of photo-electrons
 //
 Bool_t MCalibrationChargeCalc::FinalizeCharges(MCalibrationChargePix &cal, MBadPixelsPix &bad)
@@ -526,5 +556,6 @@
   // The check returns kTRUE if:
   //
-  // The mean arrival time is at least 1.0 slices from the lower edge slices and 2 slices from the upper edge
+  // The mean arrival time is at least fTimeLowerLimit slices from the lower edge 
+  // and fUpperLimit slices from the upper edge
   //
   const Byte_t loweredge  = cal.IsHiGainSaturation() ? fSignals->GetFirstUsedSliceLoGain() 
@@ -575,9 +606,92 @@
 }
 
-//
-// * Finalize the pedestals
-// * Do the quality checks 
-// * Calculate the reduced sigma 
-// * Calculate the F-Factor Method
+// ------------------------------------------------------------------------
+//
+// Returns kFALSE if pointer to MExtractedSignalPINDiode is NULL
+// Returns kFALSE if pointer to MCalibrationChargePINDiode is NULL
+//
+// The check return kTRUE if:
+//
+// 1) PINDiode has a fitted charge greater than fChargeLimit*PedRMS
+// 2) PINDiode has a fit error greater than fChargeErrLimit
+// 3) PINDiode has a fitted charge greater its fChargeRelErrLimit times its charge error
+// 4) PINDiode has a charge sigma bigger than its Pedestal RMS
+// 5) The mean arrival time is at least fTimeLowerLimit slices from the lower edge 
+//    and fUpperLimit slices from the upper edge
+// 
+Bool_t MCalibrationChargeCalc::FinalizePINDiode()
+{
+
+  if (!fSigPIN)
+    return kFALSE;
+  
+  if (!fPINDiode)
+    return kFALSE;  
+
+  if (fPINDiode->GetMean() < fChargeLimit*fPINDiode->GetPedRms())
+    {
+      *fLog << warn << "WARNING: Fitted Charge is smaller than "
+            << fChargeLimit << " Pedestal RMS in PINDiode " << endl;
+      return kFALSE;
+    }
+  
+  if (fPINDiode->GetMeanErr() < fChargeErrLimit) 
+    {
+      *fLog << warn << "WARNING: Error of Fitted Charge is smaller than "
+            << fChargeErrLimit << " in PINDiode " << endl;
+      return kFALSE;
+    }
+      
+  if (fPINDiode->GetMean() < fChargeRelErrLimit*fPINDiode->GetMeanErr()) 
+    {
+      *fLog << warn << "WARNING: Fitted Charge is smaller than "
+            << fChargeRelErrLimit << "* its error in PINDiode " << endl;
+      return kFALSE;
+    }
+      
+  if (fPINDiode->GetSigma() < fPINDiode->GetPedRms())
+    {
+      *fLog << warn << "WARNING: Sigma of Fitted Charge smaller than Pedestal RMS in PINDiode " << endl;
+      return kFALSE;
+    }
+
+  const Byte_t  loweredge  = fSigPIN->GetFirstUsedSlice();
+  const Byte_t  upperedge  = fSigPIN->GetLastUsedSlice();
+  const Float_t lowerlimit = (Float_t)loweredge + fTimeLowerLimit;
+  const Float_t upperlimit = (Float_t)upperedge + fTimeUpperLimit;  
+
+  if (fPINDiode->GetAbsTimeMean() < lowerlimit)
+    {
+      *fLog << warn << "WARNING: Mean ArrivalTime in first " << fTimeLowerLimit 
+            << " extraction bin in PIN Diode " << endl;
+      *fLog << fPINDiode->GetAbsTimeMean() << "   " << lowerlimit << endl;
+      return kFALSE;
+    }
+  
+  if ( fPINDiode->GetAbsTimeMean() > upperlimit )
+    {
+      *fLog << warn << "WARNING: Mean ArrivalTime in last " << fTimeUpperLimit 
+            << " two extraction bins in PIN Diode " << endl;
+      *fLog << fPINDiode->GetAbsTimeMean() << "   " << upperlimit << endl;
+      return kFALSE;
+    }
+
+  if (!fPINDiode->CalcFluxOutsidePlexiglass())
+    {
+      *fLog << warn << "Could not calculate the flux of photons from the PIN Diode, "
+            << "will skip PIN Diode Calibration " << endl;
+      return kFALSE;
+    }
+  
+  return kTRUE;
+}
+
+
+// -----------------------------------------------------------------------
+//
+// - Finalize the pedestals
+// - Do the quality checks 
+// - Calculate the reduced sigma 
+// - Calculate the F-Factor Method
 //
 Int_t MCalibrationChargeCalc::PostProcess()
@@ -698,24 +812,11 @@
   // PIN Diode calibration
   //
-  if (!fPINDiode->CheckChargeFitValidity() || !fPINDiode->CheckTimeFitValidity())
-  {
-      *fLog << warn << "Could not calculate the flux of photons from the PIN Diode, "
-            << "charge fit not valid " << endl;
-      fCam->SetPINDiodeMethodValid(kFALSE);
-  }
+  if (!FinalizePINDiode())
+    fCam->SetPINDiodeMethodValid(kFALSE); 
   else
-  { 
-      if (!fPINDiode->CalcFluxOutsidePlexiglass())
-      {
-	  *fLog << warn << "Could not calculate the flux of photons from the PIN Diode, "
-                << "will skip PIN Diode Calibration " << endl;
-	  fCam->SetPINDiodeMethodValid(kFALSE);
-      }
-      else
-      {
-	  fCam->SetPINDiodeMethodValid(kTRUE);
-	  fCam->ApplyPINDiodeCalibration(*fGeom,*fBadPixels, *fPINDiode);
-      }
-  }
+    {
+      fCam->SetPINDiodeMethodValid(kTRUE);
+      fCam->ApplyPINDiodeCalibration(*fGeom,*fBadPixels, *fPINDiode);
+    }
 
   fCam->SetReadyToSave();
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h	(revision 3654)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h	(revision 3655)
@@ -30,4 +30,6 @@
 class MGeomCam;
 class MExtractedSignalCam;
+class MExtractedSignalBlindPixel;
+class MExtractedSignalPINDiode;
 class MBadPixelsCam;
 class MBadPixelsPix;
@@ -37,15 +39,15 @@
 private:
 
-  static const Float_t fgChargeLimit;       // The default for fChargeLimit
-  static const Float_t fgChargeErrLimit;    // The default for fChargeErrLimit
-  static const Float_t fgChargeRelErrLimit; // The default for fChargeRelErrLimit
-  static const Float_t fgTimeLowerLimit;    // The default for fTimeLowerLimit
-  static const Float_t fgTimeUpperLimit;    // The default for fTimeUpperLimit
+  static const Float_t fgChargeLimit;       // Default for fChargeLimit        (now set to: 3.)
+  static const Float_t fgChargeErrLimit;    // Default for fChargeErrLimit     (now set to: 0.)
+  static const Float_t fgChargeRelErrLimit; // Default for fChargeRelErrLimit  (now set to: 1.)
+  static const Float_t fgTimeLowerLimit;    // Default for fTimeLowerLimit     (now set to: 1.) 
+  static const Float_t fgTimeUpperLimit;    // Default for fTimeUpperLimit     (now set to: 2.)
   
-  Float_t fChargeLimit;          // The limit (in units of PedRMS) for acceptance of the fitted mean charge
-  Float_t fChargeErrLimit;       // The limit (in units of PedRMS) for acceptance of the fitted charge sigma square
-  Float_t fChargeRelErrLimit;    // The limit (in units of Sigma of fitted charge) for acceptance of the fitted mean  
-  Float_t fTimeLowerLimit;       // The limit (in units of FADC slices) for distance to first signal extraction slice
-  Float_t fTimeUpperLimit;       // The limit (in units of FADC slices) for distance to last signal extraction slice
+  Float_t fChargeLimit;          // Limit (in units of PedRMS) for acceptance of mean charge
+  Float_t fChargeErrLimit;       // Limit (in units of PedRMS) for acceptance of charge sigma square
+  Float_t fChargeRelErrLimit;    // Limit (in units of Sigma of fitted charge) for acceptance of mean  
+  Float_t fTimeLowerLimit;       // Limit (in units of FADC slices) for dist. to first signal slice
+  Float_t fTimeUpperLimit;       // Limit (in units of FADC slices) for dist. to last signal slice
 
   MPedestalCam               *fPedestals;     //! Pedestals of all pixels in the camera
@@ -59,5 +61,8 @@
   MTime                      *fEvtTime;       //! Time of the event
 
-  MExtractedSignalCam        *fSignals;       // Extracted signal of all pixels in the camera
+  MExtractedSignalCam        *fSignals;       //! Extracted signal of pixels in the camera
+  MExtractedSignalBlindPixel *fSigBlind;      //! Extracted signal of Blind Pixel
+  MExtractedSignalPINDiode   *fSigPIN;        //! Extracted signal of PIN Diode 
+
   MCalibrationChargePINDiode *fPINDiode;      // Calibration results of the PIN Diode
   MCalibrationChargeBlindPix *fBlindPixel;    // Calibration results of the Blind Pixel 
@@ -83,5 +88,6 @@
   void FinalizeAvPedestals(MCalibrationChargePix &cal, Float_t avped, Float_t avrms, Int_t avnum);
   Bool_t FinalizeCharges(MCalibrationChargePix &cal, MBadPixelsPix &bad);
-
+  Bool_t FinalizePINDiode();
+  
   void PrintUnsuitable(MBadPixelsPix::UnsuitableType_t typ, const char *text) const;   
   void PrintUncalibrated(MBadPixelsPix::UncalibratedType_t typ, const char *text) const;
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.cc	(revision 3654)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.cc	(revision 3655)
@@ -102,5 +102,4 @@
   SetOscillating          ( kFALSE );
   SetExcluded             ( kFALSE );
-  SetExcludeQualityCheck  ( kFALSE );
 }
 
@@ -114,6 +113,4 @@
   SetChargeFitValid     ( kFALSE );
   SetTimeFitValid       ( kFALSE );
-  SetMeanTimeInFirstBin ( kFALSE );
-  SetMeanTimeInLastBin  ( kFALSE );
     
   fPed                              =  -1.;
@@ -128,7 +125,4 @@
   fAbsTimeRms                       =  -1.;
 
-  fTimeLowerEdge                    =  -1.;
-  fTimeUpperEdge                    =  -1.;
-
   fConvertedPhotons                 =  -1.;
   fConvertedPhotonsErr              =  -1.;
@@ -166,13 +160,4 @@
 // Set the Excluded Bit from outside 
 //
-void MCalibrationChargePINDiode::SetExcludeQualityCheck(Bool_t b )
-{ 
-  b ?  SETBIT(fCalibFlags, kExcludeQualityCheck) : CLRBIT(fCalibFlags, kExcludeQualityCheck); 
-}
-
-// --------------------------------------------------------------------------
-//
-// Set the Excluded Bit from outside 
-//
 void MCalibrationChargePINDiode::SetChargeFitValid(Bool_t b )    
 { 
@@ -194,24 +179,4 @@
 }
 
-void MCalibrationChargePINDiode::SetMeanTimeInFirstBin(const Bool_t b)
-{
-  b ? SETBIT(fCalibFlags,kMeanTimeInFirstBin) : CLRBIT(fCalibFlags,kMeanTimeInFirstBin);
-}
-
-void MCalibrationChargePINDiode::SetMeanTimeInLastBin(const Bool_t b)
-{
-  b ? SETBIT(fCalibFlags,kMeanTimeInLastBin) : CLRBIT(fCalibFlags,kMeanTimeInLastBin);
-}
-
-Bool_t MCalibrationChargePINDiode::IsMeanTimeInFirstBin() const
-{
-  return TESTBIT(fCalibFlags,kMeanTimeInFirstBin);
-}
-
-Bool_t MCalibrationChargePINDiode::IsMeanTimeInLastBin() const
-{
-  return TESTBIT(fCalibFlags,kMeanTimeInLastBin);
-}
-
 Bool_t MCalibrationChargePINDiode::IsChargeFitValid() const 
 {
@@ -222,70 +187,4 @@
 {
   return TESTBIT(fCalibFlags, kTimeFitValid);  
-}
-
-//
-// The check return kTRUE if:
-//
-// 1) PINDiode has a fitted charge greater than fChargeLimit*PedRMS
-// 2) PINDiode has a fit error greater than fChargeErrLimit
-// 3) PINDiode has a fitted charge greater its fChargeRelErrLimit times its charge error
-// 4) PINDiode has a charge sigma bigger than its Pedestal RMS
-// 
-Bool_t MCalibrationChargePINDiode::CheckChargeFitValidity()
-{
-
-
-  if (GetMean() < fChargeLimit*GetPedRms())
-    {
-      *fLog << warn << "WARNING: Fitted Charge is smaller than "
-            << fChargeLimit << " Pedestal RMS in PINDiode " << endl;
-      return kFALSE;
-    }
-  
-  if (GetMeanErr() < fChargeErrLimit) 
-    {
-      *fLog << warn << "WARNING: Error of Fitted Charge is smaller than "
-            << fChargeErrLimit << " in PINDiode " << endl;
-      return kFALSE;
-    }
-      
-  if (GetMean() < fChargeRelErrLimit*GetMeanErr()) 
-    {
-      *fLog << warn << "WARNING: Fitted Charge is smaller than "
-            << fChargeRelErrLimit << "* its error in PINDiode " << endl;
-      return kFALSE;
-    }
-      
-  if (GetSigma() < GetPedRms())
-    {
-      *fLog << warn << "WARNING: Sigma of Fitted Charge smaller than Pedestal RMS in PINDiode " << endl;
-      return kFALSE;
-    }
-  return kTRUE;
-}
-
-//
-// The check returns kTRUE if:
-//
-// The mean arrival time is at least 1.0 slices from the used edge slices 
-//
-Bool_t MCalibrationChargePINDiode::CheckTimeFitValidity()
-{
-
-  if ( fAbsTimeMean < fTimeLowerEdge+1.)
-    {
-      *fLog << warn << "WARNING: Mean ArrivalTime in first extraction bin of the PINDiode " << endl;
-      SetMeanTimeInFirstBin();
-      return kFALSE;
-    }
-
-  if ( fAbsTimeMean > fTimeUpperEdge-1.)
-    {
-      *fLog << warn << "WARNING: Mean ArrivalTime in last extraction bin of the PINDiode " << endl;
-      SetMeanTimeInLastBin();
-      return kFALSE;
-    }
-
-  return kTRUE;
 }
 
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.h
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.h	(revision 3654)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.h	(revision 3655)
@@ -10,60 +10,45 @@
 private:
 
-  static const Float_t fgChargeLimit;       // The default limit (in units of PedRMS) for acceptance of the fitted mean charge
-  static const Float_t fgChargeErrLimit;    // The default limit (in units of PedRMS) for acceptance of the fitted charge sigma
-  static const Float_t fgChargeRelErrLimit; // The default limit (in units of Error of fitted charge) for acceptance of the fitted mean  
+  static const Float_t fgChargeLimit;                //! Default for fChargeLimit
+  static const Float_t fgChargeErrLimit;             //! Default for fChargeErrLimit
+  static const Float_t fgChargeRelErrLimit;          //! Default for fChargeRelErrLimit
+  static const Float_t fgConversionChargePhotons;    //! Default for fConversionChargePhotons
+  static const Float_t fgConversionChargePhotonsErr; //! Default for fConversionChargePhotonsErr
+  static const Float_t gkPINDiodeArea;               //! PIN Diode Effective Area in mm^2  
+  static const Float_t gkFluxCameravsPINDiode;       //! Flux Conversion PIN Diode - inner pixel
+  static const Float_t gkFluxCameravsPINDiodeErr;    //! Error of flux conv. PIN Diode - inner pixel
+  static const Float_t gkPINDiodeQEGreen;            //! Quantum Efficiency at 520 nm
+  static const Float_t gkPINDiodeQEBlue;             //! Quantum Efficiency at 460 nm
+  static const Float_t gkPINDiodeQEUV;               //! Quantum Efficiency at 370 nm
+  static const Float_t gkPINDiodeQECT1;              //! Quantum Efficiency at 370 nm
+  static const Float_t gkPINDiodeQEGreenErr;         //! Uncertainty QE at 520 nm
+  static const Float_t gkPINDiodeQEBlueErr ;         //! Uncertainty QE at 460 nm
+  static const Float_t gkPINDiodeQEUVErr   ;         //! Uncertainty QE at 370 nm
+  static const Float_t gkPINDiodeQECT1Err  ;         //! Uncertainty QE at 370 nmu
+ 
 
-  static const Float_t fgConversionChargePhotons;    // The default mean conversion from PIN Diode charge to the number of incident photons
-  static const Float_t fgConversionChargePhotonsErr; // The default error of the mean conversion from PIN Diode charge to the number of incident photons
-
-  static const Float_t gkPINDiodeArea;         // The Blind Pixel area in mm^2  
-
-  static const Float_t gkFluxCameravsPINDiode     ;
-  static const Float_t gkFluxCameravsPINDiodeErr  ;
-  
-  static const Float_t gkPINDiodeQEGreen;
-  static const Float_t gkPINDiodeQEBlue ;
-  static const Float_t gkPINDiodeQEUV   ;
-  static const Float_t gkPINDiodeQECT1  ;
-  
-  static const Float_t gkPINDiodeQEGreenErr;
-  static const Float_t gkPINDiodeQEBlueErr ;
-  static const Float_t gkPINDiodeQEUVErr   ;
-  static const Float_t gkPINDiodeQECT1Err  ;
- 
-  Float_t fChargeLimit;                     // The limit (in units of PedRMS) for acceptance of the fitted mean charge
-  Float_t fChargeErrLimit;                  // The limit (in units of PedRMS) for acceptance of the fitted charge sigma
-  Float_t fChargeRelErrLimit;               // The limit (in units of Error of fitted charge) for acceptance of the fitted mean  
-  
-  Float_t fConversionChargePhotons;         // The mean conversion from PIN Diode charge to the number of incident photons
-  Float_t fConversionChargePhotonsErr;      // The error of the mean conversion from PIN Diode charge to the number of incident photons
-
-  Float_t fPed;                   // The mean pedestal (from MPedestalPix)
-  Float_t fPedRms;                // The pedestal  RMS (from MPedestalPix)
-
-  Float_t fRmsChargeMean;
-  Float_t fRmsChargeMeanErr;
-  Float_t fRmsChargeSigma;  
-  Float_t fRmsChargeSigmaErr;
-
-  Byte_t  fCalibFlags;                            // Flag for the set Bits
-
-  Float_t fAbsTimeMean;
-  Float_t fAbsTimeRms;
-
-  Float_t fTimeLowerEdge;
-  Float_t fTimeUpperEdge;
-
-  Float_t fConvertedPhotons;
-  Float_t fConvertedPhotonsErr;
-
-  Float_t fMeanFluxOutsidePlexiglass;         //  The mean number of photons in an INNER PIXEL outside the plexiglass
-  Float_t fMeanFluxErrOutsidePlexiglass;      //  The uncertainty about the number of photons in an INNER PIXEL  
+  Float_t fAbsTimeMean;                     // Mean Absolute Arrival Time
+  Float_t fAbsTimeRms;                      // RMS Mean Absolute Arrival Time
+  Byte_t  fCalibFlags;                      // Bit-field for the class-own bits
+  Float_t fChargeLimit;                     // Limit (in units of PedRMS) for acceptance fitted mean charge
+  Float_t fChargeErrLimit;                  // Limit (in units of PedRMS) for acceptance fitted charge sigma
+  Float_t fChargeRelErrLimit;               // Limit (in units of Error of fitted charge) for acceptance fitted mean  
+  Float_t fConversionChargePhotons;         // Mean conv. PIN Diode charge to number of incident photons
+  Float_t fConversionChargePhotonsErr;      // Error mean conv. PIN Diode charge to nr. incident photons
+  Float_t fConvertedPhotons;                // Number photons incidident on PIN Diode
+  Float_t fConvertedPhotonsErr;             // Error on nr. photons incid. on PIN Diode
+  Float_t fMeanFluxOutsidePlexiglass;       // Mean number photons in INNER PIXEL outside plexiglass
+  Float_t fMeanFluxErrOutsidePlexiglass;    // Error on nr. photons in INNER PIXEL outside plexiglass
+  Float_t fPed;                             // Mean pedestal (from MPedestalPix)
+  Float_t fPedRms;                          // Pedestal  RMS (from MPedestalPix)
+  Float_t fRmsChargeMean;                   // Mean of RMS of summed FADC slices distribution 
+  Float_t fRmsChargeMeanErr;                // Error on Mean RMS summed FADC slices distribution 
+  Float_t fRmsChargeSigma;                  // Sigma of RMS of summed FADC slices distribution    
+  Float_t fRmsChargeSigmaErr;               // Error on Sigma RMS summed FADC slices distribution 
 
   PulserColor_t fColor;  
 
-  enum  { kExcludeQualityCheck, kOscillating,
+  enum  { kOscillating,
           kChargeFitValid, kTimeFitValid, 
-	  kMeanTimeInFirstBin, kMeanTimeInLastBin, 
 	  kFluxOutsidePlexiglassAvailable  };    
 
@@ -96,12 +81,7 @@
 
   void SetOscillating     ( const Bool_t b=kTRUE);
-  void SetExcludeQualityCheck( const Bool_t b = kTRUE );
   void SetChargeFitValid     ( const Bool_t b = kTRUE );
   void SetTimeFitValid       ( const Bool_t b = kTRUE );
   void SetFluxOutsidePlexiglassAvailable ( const Bool_t b = kTRUE );
-
-  // Setters ONLY for MC:
-  void  SetMeanTimeInFirstBin( const Bool_t b = kTRUE );
-  void  SetMeanTimeInLastBin ( const Bool_t b = kTRUE );
 
   // Getters
@@ -110,19 +90,15 @@
 
   // Pedestals
-  Float_t GetPed()             const { return fPed;    }
-  Float_t GetPedRms()          const { return fPedRms; }
-
+  Float_t GetAbsTimeMean()     const { return fAbsTimeMean; }
+  Float_t GetAbsTimeRms ()     const { return fAbsTimeRms;  }
+  Float_t GetPed()             const { return fPed;         }
+  Float_t GetPedRms()          const { return fPedRms;      }
 
   Bool_t  IsChargeFitValid()    const;
   Bool_t  IsTimeFitValid()      const;
 
-  Bool_t  IsMeanTimeInFirstBin() const;
-  Bool_t  IsMeanTimeInLastBin()  const;
-
-  Bool_t  CheckChargeFitValidity();
-  Bool_t  CheckTimeFitValidity();
   Bool_t  CalcFluxOutsidePlexiglass();
 
-  ClassDef(MCalibrationChargePINDiode, 1)	// Container for Calibration PIN Diode
+  ClassDef(MCalibrationChargePINDiode, 1)	// Container Charge Calibration Results PIN Diode
 };
 
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.h
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.h	(revision 3654)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.h	(revision 3655)
@@ -10,13 +10,12 @@
 private:
 
-  Float_t fQEGreen;          // The calibrated quantum efficiency at 520 nm
-  Float_t fQEBlue;           // The calibrated quantum efficiency at 460 nm
-  Float_t fQEUV;             // The calibrated quantum efficiency at 370 nm
-  Float_t fQECT1;            // The calibrated quantum efficiency at 370 nm
-  
-  Float_t fQEGreenErr;       // The uncertainty about the calibrated QE at 520 nm
-  Float_t fQEBlueErr;        // The uncertainty about the calibrated QE at 460 nm
-  Float_t fQEUVErr;          // The uncertainty about the calibrated QE at 370 nm
-  Float_t fQECT1Err;         // The uncertainty about the calibrated QE at 370 nm
+  Float_t fQEGreen;          // Calibrated quantum efficiency at 520 nm
+  Float_t fQEBlue;           // Calibrated quantum efficiency at 460 nm
+  Float_t fQEUV;             // Calibrated quantum efficiency at 370 nm
+  Float_t fQECT1;            // Calibrated quantum efficiency at 370 nm
+  Float_t fQEGreenErr;       // Uncertainty calibrated QE at 520 nm
+  Float_t fQEBlueErr;        // Uncertainty calibrated QE at 460 nm
+  Float_t fQEUVErr;          // Uncertainty calibrated QE at 370 nm
+  Float_t fQECT1Err;         // Uncertainty calibrated QE at 370 nm
   
 public:
Index: /trunk/MagicSoft/Mars/msignal/MExtractedSignalPINDiode.h
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MExtractedSignalPINDiode.h	(revision 3654)
+++ /trunk/MagicSoft/Mars/msignal/MExtractedSignalPINDiode.h	(revision 3655)
@@ -35,14 +35,13 @@
     
     // Getter
-    Float_t GetExtractedSignal()    const { return fExtractedSignal; }
-    Float_t GetExtractedSignalErr() const { return fExtractedSignalErr; }
-    Float_t GetExtractedTime()      const { return fExtractedTime; }
-    Float_t GetExtractedTimeErr()   const { return fExtractedTimeErr; }
-    Float_t GetExtractedRms()       const { return fExtractedRms; }
-    Float_t GetExtractedRmsErr()    const { return fExtractedRmsErr; }
-
-    Byte_t  GetNumFADCSamples()     const { return fNumFADCSamples;  }
-    
-
+    Float_t GetExtractedSignal()    const { return fExtractedSignal;       }
+    Float_t GetExtractedSignalErr() const { return fExtractedSignalErr;    }
+    Float_t GetExtractedTime()      const { return fExtractedTime;         }
+    Float_t GetExtractedTimeErr()   const { return fExtractedTimeErr;      }
+    Float_t GetExtractedRms()       const { return fExtractedRms;          }
+    Float_t GetExtractedRmsErr()    const { return fExtractedRmsErr;       }
+    Byte_t  GetNumFADCSamples()     const { return fNumFADCSamples;        }
+    Byte_t  GetFirstUsedSlice()     const { return fFirst;                 }
+    Byte_t  GetLastUsedSlice()      const { return fFirst+fNumFADCSamples; }    
     
     Bool_t IsValid() const;   
