Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityChargeCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityChargeCam.cc	(revision 6411)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityChargeCam.cc	(revision 6412)
@@ -561,4 +561,5 @@
   
   TString option(varname);
+  option.ToLower();
 
   TArrayF nr(size);
@@ -588,60 +589,75 @@
         continue;
       //
-      if (option.Contains("RSigma"))
+      if (option.Contains("rsigma"))
         {
           var   [i] = pix.GetRSigma();
           varerr[i] = pix.GetRSigmaErr();
         }
-      if (option.Contains("AbsTime"))
+      if (option.Contains("abstime"))
         {
           var   [i] = pix.GetAbsTimeMean();
           varerr[i] = pix.GetAbsTimeRms();
         }
-      if (option.Contains("ConversionHiLo"))
+      if (option.Contains("blackout"))
+        {
+          var   [i] = pix.GetNumBlackout();
+          varerr[i] = 0.;
+        }
+      if (option.Contains("pickup"))
+        {
+          var   [i] = pix.GetNumPickup();
+          varerr[i] = 0.;
+        }
+      if (option.Contains("outlier"))
+        {
+          var   [i] = pix.GetNumPickup() + pix.GetNumBlackout();
+          varerr[i] = 0.;
+        }
+      if (option.Contains("conversionhilo"))
         {
           var   [i] = pix.GetConversionHiLo();
           varerr[i] = pix.GetConversionHiLoErr();
         }
-      if (option.Contains("ConvertedMean"))
+      if (option.Contains("convertedmean"))
         {
           var   [i] = pix.GetConvertedMean();
           varerr[i] = pix.GetConvertedMeanErr();
         }
-      if (option.Contains("ConvertedSigma"))
+      if (option.Contains("convertedsigma"))
         {
           var   [i] = pix.GetConvertedSigma();
           varerr[i] = pix.GetConvertedSigmaErr();
         }
-      if (option.Contains("ConvertedRSigma"))
+      if (option.Contains("convertedrsigma"))
         {
           var   [i] = pix.GetConvertedRSigma();
           varerr[i] = pix.GetConvertedRSigmaErr();
         }
-      if (option.Contains("MeanConvFADC2Phe"))
+      if (option.Contains("meanconvfadc2phe"))
         {
           var   [i] = pix.GetMeanConvFADC2Phe();
           varerr[i] = pix.GetMeanConvFADC2PheErr();
         }
-      if (option.Contains("MeanFFactorFADC2Phot"))
+      if (option.Contains("meanffactorfadc2phot"))
         {
           var   [i] = pix.GetMeanFFactorFADC2Phot();
           varerr[i] = pix.GetMeanFFactorFADC2PhotErr();
         }
-      if (option.Contains("Ped"))
+      if (option.Contains("ped"))
         {
           var   [i] = pix.GetPed();
           varerr[i] = pix.GetPedErr();
         }
-      if (option.Contains("PedRms"))
+      if (option.Contains("pedrms"))
         {
           var   [i] = pix.GetPedRms();
           varerr[i] = pix.GetPedRmsErr();
         }
-      if (option.Contains("PheFFactorMethod"))
+      if (option.Contains("pheffactormethod"))
         {
           var   [i] = pix.GetPheFFactorMethod();
           varerr[i] = pix.GetPheFFactorMethodErr();
         }
-      if (option.Contains("RSigmaPerCharge"))
+      if (option.Contains("rsigmapercharge"))
         {
           var   [i] = pix.GetRSigmaPerCharge();
@@ -674,4 +690,5 @@
 
   TString option(varname);
+  option.ToLower();
 
   TArrayF vararea(size);
@@ -717,4 +734,317 @@
           pvar = 0.;
           
+          if (option.Contains("rsigma"))
+            pvar = pix.GetRSigma();
+          if (option.Contains("abstime"))
+            pvar = pix.GetAbsTimeMean();
+          if (option.Contains("conversionhilo"))
+            pvar = pix.GetConversionHiLo();
+          if (option.Contains("convertedmean"))
+            pvar = pix.GetConvertedMean();
+          if (option.Contains("convertedsigma"))
+            pvar = pix.GetConvertedSigma();
+          if (option.Contains("convertedrsigma"))
+            pvar = pix.GetConvertedRSigma();
+          if (option.Contains("meanconvfadc2phe"))
+            pvar = pix.GetMeanConvFADC2Phe();
+          if (option.Contains("meanffactorfadc2phot"))
+            pvar = pix.GetMeanFFactorFADC2Phot();
+          if (option.Contains("ped"))
+            pvar = pix.GetPed();
+          if (option.Contains("pedrms"))
+            pvar = pix.GetPedRms();
+          if (option.Contains("pheffactormethod"))
+            pvar = pix.GetPheFFactorMethod();
+          if (option.Contains("rsigmapercharge"))
+            pvar = pix.GetRSigmaPerCharge();
+
+          variab  += pvar;
+          variab2 += pvar*pvar;
+          num++;
+          
+          camcharge.Fill(j,pvar);
+          camcharge.SetUsed(j);
+        }
+      
+      if (num > 1)
+        {
+          variab  /= num;
+          variance = (variab2 - variab*variab*num) / (num-1);
+
+          vararea[i] = variab;
+          if (variance > 0.)
+            varareaerr[i] = TMath::Sqrt(variance);
+          else
+            varareaerr[i] = 999999999.;
+
+          //
+          // Make also a Gauss-fit to the distributions. The RMS can be determined by 
+          // outlier, thus we look at the sigma and the RMS and take the smaller one, afterwards.
+          // 
+          h = camcharge.ProjectionS(TArrayI(),TArrayI(1,&aidx),"_py",750);
+          h->SetDirectory(NULL);
+          h->Fit("gaus","QL");
+          TF1 *fit = h->GetFunction("gaus");
+
+          Float_t ci2   = fit->GetChisquare();
+          Float_t sigma = fit->GetParameter(2);
+
+          if (ci2 > 500. || sigma > varareaerr[i])
+            {
+              h->Fit("gaus","QLM");
+              fit = h->GetFunction("gaus");
+
+              ci2   = fit->GetChisquare();
+              sigma = fit->GetParameter(2);
+            }
+          
+          const Float_t mean  = fit->GetParameter(1);
+          const Float_t ndf   = fit->GetNDF();
+          
+          *fLog << inf << "Camera Nr: " << i << endl;
+          *fLog << inf << option.Data() << " area idx: " << aidx << " Results: " << endl;
+          *fLog << inf << "Mean: " << Form("%4.3f",mean) 
+                << "+-" << Form("%4.3f",fit->GetParError(1))
+                << "  Sigma: " << Form("%4.3f",sigma) << "+-" << Form("%4.3f",fit->GetParError(2)) 
+                << "  Chisquare: " << Form("%4.3f",fit->GetChisquare()) << "  NDF  : " << ndf << endl;          
+          delete h;
+          gROOT->GetListOfFunctions()->Remove(fit);
+
+          if (sigma < varareaerr[i] && ndf > 2)
+            {
+              vararea   [i] = mean;
+              varareaerr[i] = sigma;
+            }
+        }
+      else
+        {
+          vararea[i]    = -1.;
+          varareaerr[i] = 0.;
+        }
+
+      nr[i] = i;
+      nrerr[i] = 0.;
+    }
+  
+  TGraphErrors *gr = new TGraphErrors(size,
+                                     nr.GetArray(),vararea.GetArray(),
+                                     nrerr.GetArray(),varareaerr.GetArray());
+  gr->SetTitle(Form("%s Area %3i Average",option.Data(),aidx));
+  gr->GetXaxis()->SetTitle("Camera Nr.");
+  //  gr->GetYaxis()->SetTitle("<Q> [1]");      
+  return gr;
+}
+
+
+// -------------------------------------------------------------------
+//
+// Returns a TGraphErrors with the mean effective number of photon
+// vs. the calibration camera number. With the string 'method', different
+// calibration methods can be called.
+//
+TGraphErrors *MCalibrationIntensityChargeCam::GetPhotVsTime( const Option_t *method )
+{
+  
+  const Int_t size = GetSize();
+  
+  if (size == 0)
+    return NULL;
+
+  TString option(method);
+
+  TArrayF photarr(size);
+  TArrayF photarrerr(size);
+  TArrayF nr(size);
+  TArrayF nrerr(size);
+  
+  for (Int_t i=0;i<GetSize();i++)
+    {
+      //
+      // Get the calibration cam from the intensity cam
+      //
+      MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(i);
+
+      //
+      // Get the calibration pix from the calibration cam
+      //
+      Float_t phot    = 0.;
+      Float_t photerr = 0.;
+
+      if (option.Contains("BlindPixel"))
+        {
+          phot    = cam->GetNumPhotonsBlindPixelMethod();
+          photerr = cam->GetNumPhotonsBlindPixelMethodErr();
+        }
+      if (option.Contains("FFactor"))
+        {
+          phot    = cam->GetNumPhotonsFFactorMethod();
+          photerr = cam->GetNumPhotonsFFactorMethodErr();
+        }
+      if (option.Contains("PINDiode"))
+        {
+          phot    = cam->GetNumPhotonsPINDiodeMethod();
+          photerr = cam->GetNumPhotonsPINDiodeMethodErr();
+        }
+
+      photarr[i]       = phot;
+      photarrerr[i]    = photerr;
+
+      nr[i] = i;
+      nrerr[i] = 0.;
+    }
+  
+  TGraphErrors *gr = new TGraphErrors(size,
+                                     nr.GetArray(),photarr.GetArray(),
+                                     nrerr.GetArray(),photarrerr.GetArray());
+  gr->SetTitle("Photons Average");
+  gr->GetXaxis()->SetTitle("Camera Nr.");
+  gr->GetYaxis()->SetTitle("<N_phot> [1]");      
+  return gr;
+}
+
+// -------------------------------------------------------------------
+//
+// Returns a TGraphErrors with the mean effective number of photo-electrons per 
+// area index 'aidx' vs. the calibration camera number 
+//
+TGraphErrors *MCalibrationIntensityChargeCam::GetPhePerAreaVsTime( const Int_t aidx, const MGeomCam &geom)
+{
+  
+  const Int_t size = GetSize();
+  
+  if (size == 0)
+    return NULL;
+  
+  TArrayF phearea(size);
+  TArrayF pheareaerr(size);
+  TArrayF time(size);
+  TArrayF timeerr(size);
+  
+  for (Int_t i=0;i<GetSize();i++)
+    {
+      //
+      // Get the calibration cam from the intensity cam
+      //
+      MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(i);
+
+      //
+      // Get the calibration pix from the calibration cam
+      //
+      const MCalibrationChargePix &apix = (MCalibrationChargePix&)cam->GetAverageArea(aidx);
+      const Float_t phe          = apix.GetPheFFactorMethod();
+      const Float_t pheerr       = apix.GetPheFFactorMethodErr();
+
+      phearea[i]       = phe;
+      pheareaerr[i]    = pheerr;
+
+      time[i] = i;
+      timeerr[i] = 0.;
+    }
+  
+  TGraphErrors *gr = new TGraphErrors(size,
+                                     time.GetArray(),phearea.GetArray(),
+                                     timeerr.GetArray(),pheareaerr.GetArray());
+  gr->SetTitle(Form("Phes Area %d Average",aidx));
+  gr->GetXaxis()->SetTitle("Camera Nr.");
+  gr->GetYaxis()->SetTitle("<N_phes> [1]");      
+  return gr;
+}
+
+// -------------------------------------------------------------------
+//
+// Returns a TGraphErrors with the event-by-event averaged charge per 
+// area index 'aidx' vs. the calibration camera number 
+//
+TGraphErrors *MCalibrationIntensityChargeCam::GetChargePerAreaVsTime( const Int_t aidx, const MGeomCam &geom)
+{
+  
+  const Int_t size = GetSize();
+  
+  if (size == 0)
+    return NULL;
+  
+  TArrayF chargearea(size);
+  TArrayF chargeareaerr(size);
+  TArrayF nr(size);
+  TArrayF nrerr(size);
+  
+  for (Int_t i=0;i<GetSize();i++)
+    {
+      //
+      // Get the calibration cam from the intensity cam
+      //
+      MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(i);
+
+      //
+      // Get the calibration pix from the calibration cam
+      //
+      const MCalibrationChargePix &apix = (MCalibrationChargePix&)cam->GetAverageArea(aidx);
+      const Float_t charge          = apix.GetConvertedMean();
+      const Float_t chargeerr       = apix.GetConvertedSigma();
+
+      chargearea[i]       = charge;
+      chargeareaerr[i]    = chargeerr;
+
+      nr[i]    = i;
+      nrerr[i] = 0.;
+    }
+  
+  TGraphErrors *gr = new TGraphErrors(size,
+                                     nr.GetArray(),chargearea.GetArray(),
+                                     nrerr.GetArray(),chargeareaerr.GetArray());
+  gr->SetTitle(Form("Averaged Charges Area Idx %d",aidx));
+  gr->GetXaxis()->SetTitle("Camera Nr.");
+  gr->GetYaxis()->SetTitle("<Q> [FADC cnts]");      
+  return gr;
+}
+
+TH1F *MCalibrationIntensityChargeCam::GetVarFluctuations( const Int_t aidx, const MGeomCam &geom, const Option_t *varname )
+{
+  
+  const Int_t size = GetSize();
+  
+  if (size == 0)
+    return NULL;
+  
+  TString option(varname);
+  
+  TH1F *hist = new TH1F("hist",Form("%s - Rel. Fluctuations %s Pixel",option.Data(),aidx ? "Outer" : "Inner"),
+                        200,0.,100.);
+  hist->SetXTitle("Relative Fluctuation [%]");
+  hist->SetYTitle("Nr. channels [1]");  
+  hist->SetFillColor(kRed+aidx);
+
+  MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam();
+
+  //
+  // Loop over pixels
+  //
+  for (Int_t npix=0;npix<cam->GetSize();npix++)
+    {
+      if (geom[npix].GetAidx() != aidx)
+        continue;
+
+      Double_t variab   = 0.;
+      Double_t variab2  = 0.;
+      Double_t variance = 0.;
+      Int_t    num      = 0;
+      Float_t  pvar     = 0.;
+      Float_t  relrms   = 99.9;
+      //
+      // Loop over the Cams for each pixel
+      //
+      for (Int_t i=0; i<GetSize(); i++)
+        {
+          MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(i);
+          //
+          // Get the calibration pix from the calibration cam
+          //
+          MCalibrationChargePix &pix = (MCalibrationChargePix&)(*cam)[npix];
+          //
+          // Don't use bad pixels
+          //
+          if (!pix.IsFFactorMethodValid())
+            continue;
+
           if (option.Contains("RSigma"))
             pvar = pix.GetRSigma();
@@ -745,317 +1075,4 @@
           variab2 += pvar*pvar;
           num++;
-          
-          camcharge.Fill(j,pvar);
-          camcharge.SetUsed(j);
-        }
-      
-      if (num > 1)
-        {
-          variab  /= num;
-          variance = (variab2 - variab*variab*num) / (num-1);
-
-          vararea[i] = variab;
-          if (variance > 0.)
-            varareaerr[i] = TMath::Sqrt(variance);
-          else
-            varareaerr[i] = 999999999.;
-
-          //
-          // Make also a Gauss-fit to the distributions. The RMS can be determined by 
-          // outlier, thus we look at the sigma and the RMS and take the smaller one, afterwards.
-          // 
-          h = camcharge.ProjectionS(TArrayI(),TArrayI(1,&aidx),"_py",750);
-          h->SetDirectory(NULL);
-          h->Fit("gaus","QL");
-          TF1 *fit = h->GetFunction("gaus");
-
-          Float_t ci2   = fit->GetChisquare();
-          Float_t sigma = fit->GetParameter(2);
-
-          if (ci2 > 500. || sigma > varareaerr[i])
-            {
-              h->Fit("gaus","QLM");
-              fit = h->GetFunction("gaus");
-
-              ci2   = fit->GetChisquare();
-              sigma = fit->GetParameter(2);
-            }
-          
-          const Float_t mean  = fit->GetParameter(1);
-          const Float_t ndf   = fit->GetNDF();
-          
-          *fLog << inf << "Camera Nr: " << i << endl;
-          *fLog << inf << option.Data() << " area idx: " << aidx << " Results: " << endl;
-          *fLog << inf << "Mean: " << Form("%4.3f",mean) 
-                << "+-" << Form("%4.3f",fit->GetParError(1))
-                << "  Sigma: " << Form("%4.3f",sigma) << "+-" << Form("%4.3f",fit->GetParError(2)) 
-                << "  Chisquare: " << Form("%4.3f",fit->GetChisquare()) << "  NDF  : " << ndf << endl;          
-          delete h;
-          gROOT->GetListOfFunctions()->Remove(fit);
-
-          if (sigma < varareaerr[i] && ndf > 2)
-            {
-              vararea   [i] = mean;
-              varareaerr[i] = sigma;
-            }
-        }
-      else
-        {
-          vararea[i]    = -1.;
-          varareaerr[i] = 0.;
-        }
-
-      nr[i] = i;
-      nrerr[i] = 0.;
-    }
-  
-  TGraphErrors *gr = new TGraphErrors(size,
-                                     nr.GetArray(),vararea.GetArray(),
-                                     nrerr.GetArray(),varareaerr.GetArray());
-  gr->SetTitle(Form("%s Area %3i Average",option.Data(),aidx));
-  gr->GetXaxis()->SetTitle("Camera Nr.");
-  //  gr->GetYaxis()->SetTitle("<Q> [1]");      
-  return gr;
-}
-
-
-// -------------------------------------------------------------------
-//
-// Returns a TGraphErrors with the mean effective number of photon
-// vs. the calibration camera number. With the string 'method', different
-// calibration methods can be called.
-//
-TGraphErrors *MCalibrationIntensityChargeCam::GetPhotVsTime( const Option_t *method )
-{
-  
-  const Int_t size = GetSize();
-  
-  if (size == 0)
-    return NULL;
-
-  TString option(method);
-
-  TArrayF photarr(size);
-  TArrayF photarrerr(size);
-  TArrayF nr(size);
-  TArrayF nrerr(size);
-  
-  for (Int_t i=0;i<GetSize();i++)
-    {
-      //
-      // Get the calibration cam from the intensity cam
-      //
-      MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(i);
-
-      //
-      // Get the calibration pix from the calibration cam
-      //
-      Float_t phot    = 0.;
-      Float_t photerr = 0.;
-
-      if (option.Contains("BlindPixel"))
-        {
-          phot    = cam->GetNumPhotonsBlindPixelMethod();
-          photerr = cam->GetNumPhotonsBlindPixelMethodErr();
-        }
-      if (option.Contains("FFactor"))
-        {
-          phot    = cam->GetNumPhotonsFFactorMethod();
-          photerr = cam->GetNumPhotonsFFactorMethodErr();
-        }
-      if (option.Contains("PINDiode"))
-        {
-          phot    = cam->GetNumPhotonsPINDiodeMethod();
-          photerr = cam->GetNumPhotonsPINDiodeMethodErr();
-        }
-
-      photarr[i]       = phot;
-      photarrerr[i]    = photerr;
-
-      nr[i] = i;
-      nrerr[i] = 0.;
-    }
-  
-  TGraphErrors *gr = new TGraphErrors(size,
-                                     nr.GetArray(),photarr.GetArray(),
-                                     nrerr.GetArray(),photarrerr.GetArray());
-  gr->SetTitle("Photons Average");
-  gr->GetXaxis()->SetTitle("Camera Nr.");
-  gr->GetYaxis()->SetTitle("<N_phot> [1]");      
-  return gr;
-}
-
-// -------------------------------------------------------------------
-//
-// Returns a TGraphErrors with the mean effective number of photo-electrons per 
-// area index 'aidx' vs. the calibration camera number 
-//
-TGraphErrors *MCalibrationIntensityChargeCam::GetPhePerAreaVsTime( const Int_t aidx, const MGeomCam &geom)
-{
-  
-  const Int_t size = GetSize();
-  
-  if (size == 0)
-    return NULL;
-  
-  TArrayF phearea(size);
-  TArrayF pheareaerr(size);
-  TArrayF time(size);
-  TArrayF timeerr(size);
-  
-  for (Int_t i=0;i<GetSize();i++)
-    {
-      //
-      // Get the calibration cam from the intensity cam
-      //
-      MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(i);
-
-      //
-      // Get the calibration pix from the calibration cam
-      //
-      const MCalibrationChargePix &apix = (MCalibrationChargePix&)cam->GetAverageArea(aidx);
-      const Float_t phe          = apix.GetPheFFactorMethod();
-      const Float_t pheerr       = apix.GetPheFFactorMethodErr();
-
-      phearea[i]       = phe;
-      pheareaerr[i]    = pheerr;
-
-      time[i] = i;
-      timeerr[i] = 0.;
-    }
-  
-  TGraphErrors *gr = new TGraphErrors(size,
-                                     time.GetArray(),phearea.GetArray(),
-                                     timeerr.GetArray(),pheareaerr.GetArray());
-  gr->SetTitle(Form("Phes Area %d Average",aidx));
-  gr->GetXaxis()->SetTitle("Camera Nr.");
-  gr->GetYaxis()->SetTitle("<N_phes> [1]");      
-  return gr;
-}
-
-// -------------------------------------------------------------------
-//
-// Returns a TGraphErrors with the event-by-event averaged charge per 
-// area index 'aidx' vs. the calibration camera number 
-//
-TGraphErrors *MCalibrationIntensityChargeCam::GetChargePerAreaVsTime( const Int_t aidx, const MGeomCam &geom)
-{
-  
-  const Int_t size = GetSize();
-  
-  if (size == 0)
-    return NULL;
-  
-  TArrayF chargearea(size);
-  TArrayF chargeareaerr(size);
-  TArrayF nr(size);
-  TArrayF nrerr(size);
-  
-  for (Int_t i=0;i<GetSize();i++)
-    {
-      //
-      // Get the calibration cam from the intensity cam
-      //
-      MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(i);
-
-      //
-      // Get the calibration pix from the calibration cam
-      //
-      const MCalibrationChargePix &apix = (MCalibrationChargePix&)cam->GetAverageArea(aidx);
-      const Float_t charge          = apix.GetConvertedMean();
-      const Float_t chargeerr       = apix.GetConvertedSigma();
-
-      chargearea[i]       = charge;
-      chargeareaerr[i]    = chargeerr;
-
-      nr[i]    = i;
-      nrerr[i] = 0.;
-    }
-  
-  TGraphErrors *gr = new TGraphErrors(size,
-                                     nr.GetArray(),chargearea.GetArray(),
-                                     nrerr.GetArray(),chargeareaerr.GetArray());
-  gr->SetTitle(Form("Averaged Charges Area Idx %d",aidx));
-  gr->GetXaxis()->SetTitle("Camera Nr.");
-  gr->GetYaxis()->SetTitle("<Q> [FADC cnts]");      
-  return gr;
-}
-
-TH1F *MCalibrationIntensityChargeCam::GetVarFluctuations( const Int_t aidx, const MGeomCam &geom, const Option_t *varname )
-{
-  
-  const Int_t size = GetSize();
-  
-  if (size == 0)
-    return NULL;
-  
-  TString option(varname);
-  
-  TH1F *hist = new TH1F("hist",Form("%s - Rel. Fluctuations %s Pixel",option.Data(),aidx ? "Outer" : "Inner"),
-                        200,0.,100.);
-  hist->SetXTitle("Relative Fluctuation [%]");
-  hist->SetYTitle("Nr. channels [1]");  
-  hist->SetFillColor(kRed+aidx);
-
-  MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam();
-
-  //
-  // Loop over pixels
-  //
-  for (Int_t npix=0;npix<cam->GetSize();npix++)
-    {
-      if (geom[npix].GetAidx() != aidx)
-        continue;
-
-      Double_t variab   = 0.;
-      Double_t variab2  = 0.;
-      Double_t variance = 0.;
-      Int_t    num      = 0;
-      Float_t  pvar     = 0.;
-      Float_t  relrms   = 99.9;
-      //
-      // Loop over the Cams for each pixel
-      //
-      for (Int_t i=0; i<GetSize(); i++)
-        {
-          MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(i);
-          //
-          // Get the calibration pix from the calibration cam
-          //
-          MCalibrationChargePix &pix = (MCalibrationChargePix&)(*cam)[npix];
-          //
-          // Don't use bad pixels
-          //
-          if (!pix.IsFFactorMethodValid())
-            continue;
-
-          if (option.Contains("RSigma"))
-            pvar = pix.GetRSigma();
-          if (option.Contains("AbsTime"))
-            pvar = pix.GetAbsTimeMean();
-          if (option.Contains("ConversionHiLo"))
-            pvar = pix.GetConversionHiLo();
-          if (option.Contains("ConvertedMean"))
-            pvar = pix.GetConvertedMean();
-          if (option.Contains("ConvertedSigma"))
-            pvar = pix.GetConvertedSigma();
-          if (option.Contains("ConvertedRSigma"))
-            pvar = pix.GetConvertedRSigma();
-          if (option.Contains("MeanConvFADC2Phe"))
-            pvar = pix.GetMeanConvFADC2Phe();
-          if (option.Contains("MeanFFactorFADC2Phot"))
-            pvar = pix.GetMeanFFactorFADC2Phot();
-          if (option.Contains("Ped"))
-            pvar = pix.GetPed();
-          if (option.Contains("PedRms"))
-            pvar = pix.GetPedRms();
-          if (option.Contains("PheFFactorMethod"))
-            pvar = pix.GetPheFFactorMethod();
-          if (option.Contains("RSigmaPerCharge"))
-            pvar = pix.GetRSigmaPerCharge();
-
-          variab  += pvar;
-          variab2 += pvar*pvar;
-          num++;
         }
 
