Changeset 6792 for trunk/MagicSoft


Ignore:
Timestamp:
03/08/05 15:14:57 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6776 r6792  
    2121
    2222                                                 -*-*- END OF LINE -*-*-
     23 2005/03/08 Markus Gaug
     24
     25   * mhcalib/MHPedestalCam.[h,cc]
     26     - introduce new parameter "fFitStart" to decide from outside where
     27       to start fitting the pedestals.
     28
     29
    2330 2005/03/07 Markus Gaug
    2431
  • 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)
  • trunk/MagicSoft/Mars/mhcalib/MHPedestalCam.h

    r6777 r6792  
    3939  Bool_t  fRenorm;                        // Flag if the results will be re-normalized
    4040
     41  Axis_t  fFitStart;                      // Charge value to start the fitting procedure
     42 
    4143  MArrayD fSum;                           //! sum of values 
    4244  MArrayD fSumSquare;                     //! sum of squared values
     
    6971  void ResetHists();
    7072
    71   void SetNamePedestalCamOut(const char *name) { fNamePedestalCamOut = name; }
    72   void SetPedestalsOut ( MPedestalCam *cam) { fPedestalsOut = cam; }
    73   void SetRenorm         (const Bool_t b=kTRUE )  {  fRenorm = b; }
     73  void SetFitStart          ( const Axis_t a=-0.5  ) { fFitStart = a;  }
     74  void SetNamePedestalCamOut( const char *name     ) { fNamePedestalCamOut = name; }
     75  void SetPedestalsOut      ( MPedestalCam *cam    ) { fPedestalsOut = cam; }
     76  void SetRenorm            ( const Bool_t b=kTRUE ) { fRenorm = b; }
    7477 
    7578  ClassDef(MHPedestalCam, 1)    // Histogram class for Charge Camera Pedestals
Note: See TracChangeset for help on using the changeset viewer.