Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 3231)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 3232)
@@ -45,4 +45,7 @@
    * mraw/MRawFileRead.cc:
      - don't print warning in case of none executions
+
+   * manalysis/MArrivalTimeCalc2.cc:
+     - added some const-qualifiers
 
 
Index: /trunk/MagicSoft/Mars/manalysis/MArrivalTimeCalc2.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MArrivalTimeCalc2.cc	(revision 3231)
+++ /trunk/MagicSoft/Mars/manalysis/MArrivalTimeCalc2.cc	(revision 3232)
@@ -77,5 +77,4 @@
 void MArrivalTimeCalc2::SetRange(Byte_t hifirst, Byte_t hilast, Byte_t lofirst, Byte_t lolast, Byte_t windowsize)
 {
-
     fNumHiGainSamples = hilast-hifirst+1;
     fNumLoGainSamples = lolast-lofirst+1;
@@ -84,10 +83,9 @@
     fLoGainFirst = lofirst;
 
-   
     fWindowSize = windowsize & ~1;
 
     if (fWindowSize != windowsize)
       *fLog << warn << "MArrivalTimeCalc2::SetRange - window size has to be even, set to: " << int(fWindowSize) << " samples " << endl;
-    
+
     if (fWindowSize<2) 
     {
@@ -95,5 +93,5 @@
       *fLog << warn << "MArrivalTimeCalc2::SetRange - window size set to two samples" << endl;
     }
-    
+
     if (fWindowSize > fNumHiGainSamples)
     {
@@ -101,5 +99,5 @@
       *fLog << warn << "MArrivalTimeCalc2::SetRange - window size set to " << int(fWindowSize) << " samples " << endl;
     }
-    
+
     if (fWindowSize > fNumLoGainSamples)
     {
@@ -109,8 +107,5 @@
 
     fWindowSizeSqrt = TMath::Sqrt((Float_t)fWindowSize);
-
-}
-
-
+}
 
 // --------------------------------------------------------------------------
@@ -134,7 +129,4 @@
     }
 
-
-   
-
     fPedestals = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam"));
     if (!fPedestals)
@@ -147,5 +139,5 @@
     if (!fArrivalTime)
         return kFALSE;
- 
+
     return kTRUE;
 }
@@ -157,5 +149,5 @@
     Int_t sum=0;    // integral content of the actual window
     Int_t max = 0;  // highest integral content of all windows
-      
+
     //
     // Calculate the sum of the first fWindowSize slices
@@ -163,5 +155,4 @@
     sat = 0;
     Byte_t *p = ptr;
-  
 
     while (p<ptr+fWindowSize)
@@ -198,27 +189,20 @@
     }
 
-
     // now calculate the time for the maximum window
-
-
-    Int_t timesignalsum = 0;  
+    Int_t timesignalsum = 0;
     Int_t timesquaredsum =0;
-    Int_t timesum =0;    
-   
-   
+    Int_t timesum =0;
+
     for (p=ptrmax; p < ptrmax + fWindowSize; p++)
     {
-      timesignalsum += *p*(p-ptr);
-      timesum += p-ptr;
-      timesquaredsum  += (p-ptr)*(p-ptr);
-    }
-    
-
-    float pedsubsum = max - fWindowSize*pedes;
-
-    float pedsubtimesignalsum = timesignalsum - timesum*pedes;
-
-    time = pedsubsum != 0 ? pedsubtimesignalsum / pedsubsum : 1;
-
+        timesignalsum += *p*(p-ptr);
+        timesum += p-ptr;
+        timesquaredsum  += (p-ptr)*(p-ptr);
+    }
+
+    const Float_t pedsubsum = max - fWindowSize*pedes;
+    const Float_t pedsubtimesignalsum = timesignalsum - timesum*pedes;
+
+    time      = pedsubsum != 0 ? pedsubtimesignalsum / pedsubsum : 1;
     deltatime = pedsubsum != 0 ? pedrms / pedsubsum * sqrt(timesquaredsum - fWindowSize*time) : 1;
 }
@@ -232,5 +216,4 @@
 {
     MRawEvtPixelIter pixel(fRawEvt);
-   
 
     Int_t sat=0;
@@ -251,22 +234,17 @@
 
 	MArrivalTimePix &pix = (*fArrivalTime)[pixid];
-     
+
 	const Float_t pedes  = ped.GetPedestal();
 	const Float_t pedrms = ped.GetPedestalRms();
 
-
 	FindSignalTime(pixel.GetHiGainSamples()+fHiGainFirst, fNumHiGainSamples, timehi, deltatimehi, sathi, pedes, pedrms);
         FindSignalTime(pixel.GetLoGainSamples()+fLoGainFirst, fNumLoGainSamples, timelo, deltatimelo, satlo, pedes, pedrms);
-	
-	if (satlo)
+
+        if (satlo)
             sat++;
-     
-	pix.SetArrivalTime(timehi, deltatimehi,
-                           timelo, deltatimelo);	
-	
+
+        pix.SetArrivalTime(timehi, deltatimehi, timelo, deltatimelo);
 	pix.SetGainSaturation(sathi, sathi, satlo);
-
-
-    } /* while (pixel.Next()) */
+    }
 
     fArrivalTime->SetReadyToSave();
@@ -278,5 +256,4 @@
         *fLog << warn << "WARNING - Lo Gain saturated in " << sat << " pixels." << endl;
 
- 
     return kTRUE;
 }
