Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 3627)
+++ trunk/MagicSoft/Mars/Changelog	(revision 3628)
@@ -21,4 +21,7 @@
 
  2004/04/01: Markus Gaug
+
+   * msignal/MArrivalTimeCalc.[h,cc]
+     - set fSaturationLimit as a variable with default (instead of 0xff)
 
    * mcalib/MHCalibrationChargeCam.[h,cc]
Index: trunk/MagicSoft/Mars/msignal/MArrivalTimeCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MArrivalTimeCalc.cc	(revision 3627)
+++ trunk/MagicSoft/Mars/msignal/MArrivalTimeCalc.cc	(revision 3628)
@@ -15,5 +15,4 @@
 ! *
 !
-!
 !   Author(s): Sebastian Raducci 12/2003 <mailto:raducci@fisica.uniud.it>
 !
@@ -62,4 +61,5 @@
 using namespace std;
 
+const Byte_t MArrivalTimeCalc::fgSaturationLimit = 254;
 // --------------------------------------------------------------------------
 //
@@ -72,5 +72,6 @@
     fName  = name  ? name  : "MArrivalTimeCalc";
     fTitle = title ? title : "Calculate photons arrival time";
-
+    
+    SetSaturationLimit();
 }
 
@@ -149,5 +150,5 @@
       // If pixel is saturated we use LoGains
       //
-      if (pixel.GetMaxHiGainSample() == 0xff && pixel.HasLoGain())
+      if ((pixel.GetMaxHiGainSample() >= fSaturationLimit) && pixel.HasLoGain())
         {
           
@@ -191,18 +192,18 @@
   // Initialize the spline
   //
-    MCubicSpline *spline = new MCubicSpline(fadcSamples);  
+  MCubicSpline *spline = new MCubicSpline(fadcSamples);  
 
   //
   // Now find the maximum  
   //
-    Double_t abMaximum = spline->EvalAbMax();
-    Double_t maximum = spline->EvalMax();
-    const MPedestalPix &ped = (*fPedestals)[idx];
-    const Double_t pedestal = ped.GetPedestal();
-    const Double_t halfMax = (maximum + pedestal)/2.;
-    Float_t time = (halfMax > pedestal) ? (Float_t ) spline->FindVal(halfMax,abMaximum,'l'): 0.0;
-    delete spline;
-    return time;
-    
-}
-
+  Double_t abMaximum = spline->EvalAbMax();
+  Double_t maximum = spline->EvalMax();
+  const MPedestalPix &ped = (*fPedestals)[idx];
+  const Double_t pedestal = ped.GetPedestal();
+  const Double_t halfMax = (maximum + pedestal)/2.;
+  Float_t time = (halfMax > pedestal) ? (Float_t ) spline->FindVal(halfMax,abMaximum,'l'): 0.0;
+  delete spline;
+  return time;
+    
+}
+
Index: trunk/MagicSoft/Mars/msignal/MArrivalTimeCalc.h
===================================================================
--- trunk/MagicSoft/Mars/msignal/MArrivalTimeCalc.h	(revision 3627)
+++ trunk/MagicSoft/Mars/msignal/MArrivalTimeCalc.h	(revision 3628)
@@ -13,21 +13,26 @@
 {
 
-    MRawEvtData    *fRawEvt;     // raw event data (time slices)
-    MRawRunHeader  *fRunHeader;  // RunHeader information
-    MPedestalCam   *fPedestals;  // pedestal information
-
-    MArrivalTimeCam *fArrTime;   // Container with the photons arrival times
-
-    Int_t PreProcess(MParList *pList);
-    Bool_t ReInit(MParList *pList);
-    Int_t Process();
-    Int_t PostProcess() {return kTRUE;}
-
-    Float_t Calc(const Byte_t *fadcSamples, const Short_t nslices, const UInt_t idx);
- 
+  static const Byte_t fgSaturationLimit; // Default for fSaturationLimit
+  Byte_t              fSaturationLimit; // Maximum FADC counts before being considered as saturated
+  
+  MRawEvtData    *fRawEvt;     // raw event data (time slices)
+  MRawRunHeader  *fRunHeader;  // RunHeader information
+  MPedestalCam   *fPedestals;  // pedestal information
+  
+  MArrivalTimeCam *fArrTime;   // Container with the photons arrival times
+  
+  Int_t PreProcess(MParList *pList);
+  Bool_t ReInit(MParList *pList);
+  Int_t Process();
+  Int_t PostProcess() {return kTRUE;}
+  
+  Float_t Calc(const Byte_t *fadcSamples, const Short_t nslices, const UInt_t idx);
+  
 public:
     MArrivalTimeCalc(const char *name=NULL, const char *title=NULL);
     ~MArrivalTimeCalc(){}
  
+    void SetSaturationLimit(const Byte_t lim=fgSaturationLimit) { fSaturationLimit = lim; }
+    
     ClassDef(MArrivalTimeCalc, 0)   // Task to calculate Arrival Times from raw data
 };
