Index: trunk/MagicSoft/Mars/manalysis/MCerPhotCalc2.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotCalc2.cc	(revision 1403)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotCalc2.cc	(revision 1404)
@@ -33,5 +33,5 @@
 //                                                                          //
 //  Input Containers:                                                       //
-//   MRawEvtData, MPedesdtalCam                                             //
+//   MRawEvtData, MPedestalCam                                             //
 //                                                                          //
 //  Output Containers:                                                      //
@@ -58,9 +58,4 @@
 ClassImp(MCerPhotCalc2);
 
-const Float_t fWeight[15] ={0, 0.0809835, 0.289593, 0.366926, 0.211665, 0.0508328, 0., 0., 0., 0., 0., 0., 0., 0., 0.};
-
-Float_t SumQuadWeights, SumWeights;
-
-
 // --------------------------------------------------------------------------
 //
@@ -77,11 +72,11 @@
     AddToBranchList("MRawEvtData.fLoGainFadcSamples");
 
-    SumQuadWeights = SumWeights = 0.;
+    fSumQuadWeights = fSumWeights = 0.;
     for (Int_t i = 0; i < 15; i++)
       {
-	SumQuadWeights += pow(fWeight[i],2.);
-	SumWeights += fWeight[i];
+	fSumQuadWeights += fWeight[i]*fWeight[i];
+	fSumWeights += fWeight[i];
       }
-    SumQuadWeights = sqrt(SumQuadWeights);
+    fSumQuadWeights = sqrt(fSumQuadWeights);
 
 }
@@ -204,7 +199,7 @@
         //
         if (nphot!=0)
-	  nphot -= mean*SumWeights;
-
-	Float_t nphoterr = ped.GetSigma()* SumQuadWeights;
+	  nphot -= mean*fSumWeights;
+
+	Float_t nphoterr = ped.GetSigma()* fSumQuadWeights;
 
         fCerPhotEvt->AddPixel(pixid, nphot, nphoterr);
@@ -217,2 +212,4 @@
     return kTRUE;
 }
+
+Float_t MCerPhotCalc2::fWeight[15] = {0, 0.0809835, 0.289593, 0.366926, 0.211665, 0.0508328, 0., 0., 0., 0., 0., 0., 0., 0., 0.};
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotCalc2.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotCalc2.h	(revision 1403)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotCalc2.h	(revision 1404)
@@ -22,11 +22,13 @@
 class MCerPhotCalc2 : public MTask
 {
-    MPedestalCam  *fPedestals;  // Pedestals of all pixels in the camera
-    MRawEvtData   *fRawEvt;     // raw event data (time slices)
-    MCerPhotEvt   *fCerPhotEvt; // Cerenkov Photon Event used for calculation
-    MRawRunHeader *fRunHeader;  //  RunHeader information
+    MPedestalCam   *fPedestals;  // Pedestals of all pixels in the camera
+    MRawEvtData    *fRawEvt;     // raw event data (time slices)
+    MCerPhotEvt    *fCerPhotEvt; // Cerenkov Photon Event used for calculation
+    MRawRunHeader  *fRunHeader;  //  RunHeader information
  
-    Bool_t         fEnableFix;  // fix for a bug in files from older camera versions (<=40)
+    Bool_t          fEnableFix;  // fix for a bug in files from older camera versions (<=40)
 
+    Float_t         fSumQuadWeights, fSumWeights;
+    static Float_t  fWeight[15];
 
 public:
@@ -41,3 +43,4 @@
 };
 
+
 #endif
