Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 2764)
+++ trunk/MagicSoft/Mars/Changelog	(revision 2765)
@@ -5,4 +5,8 @@
                                                  -*-*- END OF LINE -*-*-
  2004/01/09: Markus Gaug
+
+   * mcalib/MCalibrationCam.[h,cc]
+     - take out 1-dim histos because we can use 
+       the projections in MHCamera (s.b.)
 
    * mcalib/MHCalibrationBlindPixel.h
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc	(revision 2764)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc	(revision 2765)
@@ -239,6 +239,14 @@
     for (UInt_t i=0;i<cam->GetNumPixels();i++)
       {
+
         MCalibrationPix &pix = (*fCalibrations)[i];
         pix.DefinePixId(i);
+        MHCalibrationPixel *hist = pix.GetHist();
+
+        hist->SetTimeFitRangesHiGain(fSignals->GetFirstUsedSliceHiGain(),
+                                    fSignals->GetLastUsedSliceHiGain());
+        hist->SetTimeFitRangesLoGain(fSignals->GetFirstUsedSliceLoGain(),
+                                    fSignals->GetLastUsedSliceLoGain());
+        
       }
     
@@ -453,11 +461,29 @@
       MCalibrationPix &pix = (*fCalibrations)[pixid];
 
+      //
+      // get the pedestals
+      //
       const Float_t ped    = (*fPedestals)[pixid].GetPedestal() * fNumHiGainSamples;
-      const Float_t prms   = (*fPedestals)[pixid].GetPedestalRms() * TMath::Sqrt((float)fNumHiGainSamples);
-
+      const Float_t prms   = (*fPedestals)[pixid].GetPedestalRms() * fSqrtHiGainSamples;
+
+      //
+      // set them in the calibration camera
+      //
       pix.SetPedestal(ped,prms);
 
+      //
+      // perform the Gauss fits to the charges
+      //
       pix.FitCharge();
 
+      //
+      // Fill 1-dim histograms with the results
+      //
+      fCalibrations->Fill1DimCharges(pix.GetCharge(),pix.GetErrCharge(),
+                                     pix.GetSigmaCharge(),pix.GetChargeProb());
+
+      //
+      // Perform the Gauss fits to the arrival times
+      //
       if (TESTBIT(fFlags,kUseTimeFits))
         pix.FitTime();
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc	(revision 2764)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc	(revision 2765)
@@ -83,4 +83,5 @@
     fBlindPixel = new MCalibrationBlindPix();
     fPINDiode   = new MCalibrationPINDiode();
+
 }
 
@@ -337,5 +338,5 @@
       break;
     case 7:
-      val = (*this)[idx].GetTimeChiSquare();
+      val = (*this)[idx].GetTimeProb();
       break;
     case 8:
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationCam.h
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationCam.h	(revision 2764)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationCam.h	(revision 2765)
@@ -57,25 +57,8 @@
   Float_t fMeanPhotErrOutsidePlexiglass;      //  The uncertainty about the number of photons in an INNER PIXEL  
 
-  TH1F* fHChargeAllPixels;                     //! 
-  TH1F* fHChargeErrAllPixels;                  //! 
-  TH1F* fHChargeSigmaAllPixels;                //! 
-  TH1F* fHChargeProbAllPixels;                 //! 
-
-  TH1F* fHTimeAllPixels;                       //! 
-  TH1F* fHTimeSigmaAllPixels;                  //! 
-  TH1F* fHTimeProbAllPixels;                   //! 
-
-  TH1F* fHPedAllPixels;                        //! 
-  TH1F* fHPedRMSAllPixels;                     //! 
-  TH1F* fHSigmaPerChargeAllPixels;             //! 
-  TH1F* fHPhEAllPixels;                        //! 
-
-  TH1F* fHConvPhEperFADCAllPixels;             //! 
-  TH1F* fHConvPhperFADCAllPixels;              //! 
-
-  TH1D* fOffsets;                              //! 
-  TH1D* fSlopes;                               //! 
+  TH1D* fOffsets;                             //! 
+  TH1D* fSlopes;                              //! 
   
-  TH2D* fOffvsSlope;                           //! 
+  TH2D* fOffvsSlope;                          //! 
 
 public:
@@ -95,7 +78,7 @@
   
   void InitSize(const Int_t i);
-  Int_t GetSize() const;
+  Int_t GetSize()                    const;
 
-  UInt_t GetNumPixels() const { return fNumPixels; }
+  UInt_t GetNumPixels()              const { return fNumPixels; }
 
   Bool_t IsPixelUsed(Int_t idx)      const;
@@ -117,5 +100,5 @@
   MCalibrationPINDiode *GetPINDiode()                const { return fPINDiode;    }
 
-  void SetColor(CalibrationColor_t color)    { fColor = color; }
+  void SetColor(CalibrationColor_t color)                     { fColor = color; }
 
   Bool_t GetConversionFactorFFactor(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
Index: trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc
===================================================================
--- trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc	(revision 2764)
+++ trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc	(revision 2765)
@@ -389,17 +389,32 @@
 {
 
-  if (fTime < fHist->GetTimeLowerFitRange()+1.)
+  Float_t lowerrange;
+  Float_t upperrange;
+
+  if (fHiGainSaturation)
+    {
+      lowerrange = (Float_t)fHist->GetTimeLowerFitRangeLoGain()+1.;
+      upperrange = (Float_t)fHist->GetTimeUpperFitRangeLoGain()+1.;
+    }
+  else
+    {
+      lowerrange = (Float_t)fHist->GetTimeLowerFitRangeHiGain()+1.;
+      upperrange = (Float_t)fHist->GetTimeUpperFitRangeHiGain()+1.;
+    }
+
+
+  if (fTime < lowerrange)
     {
       *fLog << warn 
             << "WARNING: Mean Fitted Time inside or smaller than first used FADC slice in Pixel " 
-            << fPixId << endl;
-      return kFALSE;
-    }
-
-  if (fTime < fHist->GetTimeUpperFitRange()-1.)
+            << fPixId << " time: " << fTime << " Range: " << lowerrange << endl;
+      return kFALSE;
+    }
+
+  if (fTime > upperrange)
     {
       *fLog << warn 
             << "WARNING: Mean Fitted Time inside or greater than last used FADC slice in Pixel " 
-            << fPixId << endl;
+            << fPixId << " time: " << fTime << " Range: " << upperrange << endl;
       return kFALSE;
     }
@@ -484,4 +499,5 @@
   fSigmaTime     = fHist->GetTimeSigma();
   fTimeChiSquare = fHist->GetTimeChiSquare();
+  fTimeProb      = fHist->GetTimeProb();
 
   if (!CheckTimeFitValidity())
