Ignore:
Timestamp:
03/08/05 15:14:57 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhcalib/MHPedestalCam.cc

    r6393 r6792  
    119119using namespace std;
    120120
    121 const Int_t   MHPedestalCam::fgNbins      = 200;
    122 const Axis_t  MHPedestalCam::fgFirst      = -49.5;
    123 const Axis_t  MHPedestalCam::fgLast       = 150.5;
     121const Int_t   MHPedestalCam::fgNbins      =  50;
     122const Axis_t  MHPedestalCam::fgFirst      = -57.5;
     123const Axis_t  MHPedestalCam::fgLast       = 192.5;
    124124const TString MHPedestalCam::gsHistName   = "Pedestal";
    125125const TString MHPedestalCam::gsHistTitle  = "Pedestal";
     
    166166  SetHistYTitle(gsHistYTitle.Data());
    167167
     168  SetFitStart();
    168169}
    169170
     
    280281 
    281282
    282   fPedestalsOut = (MPedestalCam*)pList->FindObject(AddSerialNumber(fNamePedestalCamOut),"MPedestalCam");
     283  if (!fPedestalsOut)
     284    fPedestalsOut = (MPedestalCam*)pList->FindObject(AddSerialNumber(fNamePedestalCamOut),"MPedestalCam");
    283285
    284286  if (!fPedestalsOut)
     
    558560      //      else
    559561      TH1F *gaush = hist.GetHGausHist();
    560       hist.FitGaus("RQ0",-0.5,gaush->GetBinCenter(gaush->GetXaxis()->GetLast()));
    561       //
    562       // 3) Take histogram means and RMS
    563       //
    564       hist.BypassFit();
     562      hist.FitGaus("RQ0",fFitStart,gaush->GetBinCenter(gaush->GetXaxis()->GetLast()));
    565563      //
    566564      // 4) Check for oscillations
     
    596594      // 2) Fit the Hi Gain histograms with a Gaussian
    597595      //
    598       hist.FitGaus();
    599       //
    600       // 3) Take histogram means and RMS
    601       //
    602       hist.BypassFit();
     596      TH1F *gaush = hist.GetHGausHist();
     597      hist.FitGaus("RQ0",fFitStart,gaush->GetBinCenter(gaush->GetXaxis()->GetLast()));
    603598      //
    604599      // 4) Check for oscillations
     
    640635      // 2) Fit the Hi Gain histograms with a Gaussian
    641636      //
    642       hist.FitGaus();
    643       //
    644       // 3) Take histogram means and RMS
    645       //
    646       hist.BypassFit();
     637      TH1F *gaush = hist.GetHGausHist();
     638      hist.FitGaus("RQ0",fFitStart,gaush->GetBinCenter(gaush->GetXaxis()->GetLast()));
    647639      //
    648640      // 4) Check for oscillations
     
    698690     
    699691      MCalibrationPix &pix = (*fCam)[i];
     692      MPedestalPix    &ped = (*fPedestalsOut)[i];
    700693      pix.SetHiGainMean     ( pix.GetHiGainMean()     / fExtractHiGainSlices  );
    701694      pix.SetLoGainMean     ( pix.GetLoGainMean()     / fExtractHiGainSlices  );
     695
     696      ped.SetPedestal(pix.GetHiGainMean());
    702697      //
    703698      // Mean error goes with PedestalRMS/Sqrt(entries) -> scale with sqrt(slices)
     
    705700      pix.SetHiGainMeanVar  ( pix.GetHiGainMeanVar()  / fExtractHiGainSlices );
    706701      pix.SetLoGainMeanVar  ( pix.GetHiGainMeanVar()  / fExtractHiGainSlices );
     702
    707703      //
    708704      // Sigma goes like PedestalRMS -> scale with sqrt(slices)   
     
    710706      pix.SetHiGainSigma    ( pix.GetHiGainSigma()    / sqslices  );
    711707      pix.SetLoGainSigma    ( pix.GetLoGainSigma()    / sqslices  );
     708
     709      ped.SetPedestalRms(pix.GetHiGainSigma());
    712710      //
    713711      // Sigma error goes like PedestalRMS/2.(entries) -> scale with sqrt(slices)
Note: See TracChangeset for help on using the changeset viewer.