DstarDmFitter


class description - source file - inheritance tree

class DstarDmFitter : public TObject


    public:
DstarDmFitter(TH1* histo = 0, TH1* hWc = 0) DstarDmFitter(const DstarDmFitter& source) virtual ~DstarDmFitter() virtual void AddFitOption(const char* option) virtual void AddFitOption(char option) static TClass* Class() virtual Bool_t Fit(Int_t mode) virtual Bool_t Fit(Int_t mode, TH1* hist, TH1* hWc = 0) virtual Bool_t FitAll() virtual Bool_t FitAll(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixAll() virtual Bool_t FitFixAll(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixExp() virtual Bool_t FitFixExp(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixExpSqr() virtual Bool_t FitFixExpSqr(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixMean() virtual Bool_t FitFixMean(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixMeanExp() virtual Bool_t FitFixMeanExp(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixMeanExpSqr() virtual Bool_t FitFixMeanExpSqr(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixMeanSigma() virtual Bool_t FitFixMeanSigma(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixMeanSigmaExp() virtual Bool_t FitFixMeanSigmaExp(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixMeanSigmaExpSqr() virtual Bool_t FitFixMeanSigmaExpSqr(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixMeanSigmaSqr() virtual Bool_t FitFixMeanSigmaSqr(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixMeanSqr() virtual Bool_t FitFixMeanSqr(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixSigma() virtual Bool_t FitFixSigma(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixSigmaExp() virtual Bool_t FitFixSigmaExp(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixSigmaExpSqr() virtual Bool_t FitFixSigmaExpSqr(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixSigmaSqr() virtual Bool_t FitFixSigmaSqr(TH1* hist, TH1* hWc = 0) virtual Bool_t FitFixSqr() virtual Bool_t FitFixSqr(TH1* hist, TH1* hWc = 0) virtual Double_t GetBackgrExp() const virtual Double_t GetBackgrNorm() const virtual Double_t GetBackgrNormErr() const virtual Double_t GetBackgrSqr() const virtual const char* GetFitOption() const virtual TF1* GetFittedBackgrFunc() const virtual TF1* GetFittedFunc() const virtual Double_t GetHistBinSize() const virtual const char* GetHistName() const virtual Bool_t GetLimitBackgrExp() const virtual Bool_t GetLimitBackgrSqr() const virtual Double_t GetLowerBackgrExp() const virtual Double_t GetLowerBackgrSqr() const virtual Double_t GetMean() const virtual Double_t GetNDstar() const virtual Double_t GetNDstarErr() const virtual Double_t GetSigma() const virtual Double_t GetSignalBack() const virtual Double_t GetUpFitLimit() const virtual Double_t GetUpperBackgrExp() const virtual Double_t GetUpperBackgrSqr() const virtual Double_t GetWcScale() const virtual TClass* IsA() const virtual Bool_t IsSmartMode() const DstarDmFitter& operator=(const DstarDmFitter& rhs) virtual void ResetFitParameters() virtual void SetBackgrExp() virtual void SetBackgrExp(Double_t e) virtual void SetBackgrSqr() virtual void SetBackgrSqr(Double_t s) virtual void SetDetectIsMC(Bool_t set = kTRUE) virtual void SetFitOption(const char* option) virtual void SetHist(TH1* hist) virtual void SetHist(TH1* hist, TH1* hWc) virtual void SetHist(TH1* hist, Bool_t defaultSigmaMeanBgrExpSqr) virtual void SetHist(TH1* hist, TH1* hWc, Bool_t defaultSigMeanBgrExpSqr) virtual void SetLimitBackgrExp(Bool_t l) virtual void SetLimitBackground(Bool_t l) virtual void SetLimitBackgrSqrt(Bool_t l) virtual void SetLowerBackgrExp(Double_t e) virtual void SetLowerBackgrExp() virtual void SetLowerBackgrSqrt(Double_t s) virtual void SetLowerBackgrSqrt() virtual void SetMean() virtual void SetMean(Double_t m) virtual void SetSigma() virtual void SetSigma(Double_t s) virtual Bool_t SetSmartMode(Bool_t mode = kTRUE) virtual void SetUpFitLimit() virtual void SetUpFitLimit(Double_t u) virtual void SetUpperBackgrExp(Double_t e) virtual void SetUpperBackgrExp() virtual void SetUpperBackgrSqrt(Double_t s) virtual void SetUpperBackgrSqrt() virtual void SetWcScale(Double_t s) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members

    private:
DstarDmFitterUnsmart* fFitter ! stores fitvalues and fits in unsmart mode Bool_t fSmart smart mode on/off

Class Description

   last update: $Date: 2006/01/11 13:05:17 $
   by:          $Author: flucke $

 fitting class for D*-Analysis:
                  fits delta-mass-plots (m_{Kpipis} - m_{Kpi})

 This class is part of the DstarDmFitter package available in H1 CVS repository,
   https://www-h1.desy.de/icgi-cas/cvsweb/DstarDmFitter.

 The class DstarDmFitter is designed to fit
 the peak and background in 1-D histograms
 of the well known Delta-m-plots for D*.

  The fitting function is:

  nDstar*gaus(mean, sigma)
                  + U_n*N*((x-massPi)**U_exp)*(1-U_sqr*x**2)
  i.e.:
  (     signal
                  +      background        )

  nDstar:                number of D* in the peak
  mean:                  mean  of gaus peak
  sigma:                 sigma ------"-----
  U_n:                   number of D* candidates in background
  U_exp:                 exponent                ------"------
  U_sqr:                 square corr.            ------"------

 (N:                     normalisation factor of background )

  Besides nDstar and U_n you can choose to fix some of them.
  (If a WC-background-only histogram is given in addition to the
   right charge histogram, it is simultaneously fitted with one
    additional parameter, the ratio of U_n and U_n of the WC background only.)

  The range of the fit is restricted from mass(Pi) to 0.1675 GeV (fUpFitLimit),
  but the latter can be set manually.
  (take care: L4-finder cuts on 0.170 for photoproduction, 0.180 for DIS)

  If the flag SetDetectIsMC is called before a fit, DstarDmFitter should be able to
  distinguish between data and backgroundless MC.
  In the latter case it fits only the peak
  and sets the normalisation of the background to 0.
  (This may not be accurate, as also MC has some combinatorical background!)
  It is also possible to fit a (WC) background only, cf. DstarDmFitter::Fit(Int_t mode)

  The default fitting option foresees a likelihood fit, but this is ignored
  if the histogram contains weighted entries (==> ch^2 fit).
  To enforce likelihood method in this case, add the option 'LL'.

  fitting functions:
  ---------------------------
  FitAll():
    All 6 parameters are fitted.

  FitFixMeanSigmaExpSqr():
    Mean and sigma of signal
    and exponent and square of background are fixed,
    only nDstar and U_n are fixed.

  FitFixXXXYYYZZZ():
    all other combinations of fixed parameters are foreseen,
    all beginning with FitFix and ending with an indication
    which parameters are fixed.

  Two fitting modes are foreseen:
  A smart mode and an unsmart mode.
  In the first case only those fitting parameters,
  that are not fixed, appear in the histogram's
  statistic box, if you draw the histogram afterwards.
  In the latter case all parameters are shown,
  the fixed ones with an error of +-0.
  (For recent ROOT versions >= 4.04.02 [?] smart modes are not needed anymore since
   ROOT itself skips fixed parameters.)
  Use SetSmartMode(kTRUE/kFALSE) to specify the mode.
  The default has recently changed to unsmart since it is obsolete for recent
  ROOT versions and not all features are supported for smart mode.
  (up to now for several modes or, if a WC-histogram is given in
   addition, smartness has no effect and the smart
   modes can't deal with WC-background-only histograms!)


  For all fitting functions also a 'shortcut' is foreseen to
  get rid of one line, for example:

  FitAll(hist); // or FitAll(hist, histWc); for setting a WC-hist, too
     is possible instead of
  SetHist(hist);
  FitAll();

  When fitting in unsmart mode, one can endorce a parameter range for the
  background parameters U_sqr and U_sqr:

  SetLimitBackground(); // using default limits

  Getters and Setters:
  --------------------
  You can get:                         by:
  - S/U of the last fit                 GetSignalBack()
  - actual value of sigma               GetSigma()
  -              of mean                GetMean()
  -              of nDstar              GetNDstar()
  -              of U_exp               GetBackgrExp()
  -              of U_sqr               GetBackgrSqr()
  -              of U_n                 GetBackgrNorm()
  -              of U_n/U_n,wc          GetWcScale() // if WC hist given!
  -              of nDstar's error      GetNDstarErr()
  -              of U_n's error         GetBackgrNormErr()
  -              of the upper fit limit GetUpFitLimit()
  - the name     of the set histogram   GetHistName()
  - the binsize  ---------"----------   GetHistBinSize()
  - the fitted TF1 assoc. to the hist   GetFittedFunc()
  - the background part of the prior    GetFittedBackgrFunc()

  You can set                         by:
  - sigma                            SetSigma(Double_t s)
  - mean                             SetMean(Double_t m)
  - exponent of background           SetBackgrExp(Double_t e)
  - sqr-factor of background         SetBackgrSqr(Double_t s)
  - a new histogram 'TH1* hist'      SetHist(hist)   *)
  - the upper fit limit              SetUpFitLimit(double u)
  - the mode to unsmart              SetSmartMode(kFALSE)
  - root's fit option                SetFitOption(const char* option)

   *) Here by default mean, sigma, U_exp and U_sqr
      stay at the values of the last fit.
      If you want to reset the initial values use:
      SetHist(TH1* hist, kTRUE).

  Thanks to Roger Wolf there is now also the possibility to set ranges for
  the background parameters (I did not test it yet):
     SetUpperBackgrSqrt(Double_t s);
     SetLowerBackgrSqrt(Double_t s);
     SetUpperBackgrExp (Double_t e);
     SetLowerBackgrExp (Double_t e);


  known limitations:
  ------------------
  The histogram has to have constant bin size!
  (This will be checked:
   If the deviation is bigger than 0.01%, an ERROR message
   is printed and the fitting results will be senseless.)

  If you fit a second histogram with another bin size than the
  previous fit and draw the first histogram, the drawn fit function
  is scaled by the ratio of the old and new bin size. But the fit
  values shown in the statistic box are still correct.

  Smart modes ignore (!) a given WC-histogram (but put a warning).
  They also ignore limits for the background parameters (without warning).

  If someone else deletes the histogram,
  there will be a crash...

  TH1S and TH1C histograms are not yet tested.

  You have to link ROOT's libEG.so. So in interactive ROOT do
  gSystem.Load("libEG.so"); (Not needed for ROOT >= 4.00.08 or so.)

  For use in ROOT 3.01_06 or higher only!

    example of usage:
    -----------------
    TH1F* hist1 = new TH1F("dmHist1","#Delta m",
                            33, 0.137, 0.17);
    TH1F* hist2 = new TH1F("dmHist2","#Delta m with cuts",
                            33, 0.137, 0.17);
    TH1F* hist3 = new TH1F("dmHist3","#Delta m with other cuts",
                            33, 0.137, 0.17);
    TH1F* hist3Wc = new TH1F("dmHist3Wc","#Delta m for WC with other cuts",
                              33, 0.137, 0.17);
    //       filling of hists not shown...
    DstarDmFitter fitter(hist1);
    fitter.FitAll();
    Double_t nDstar = fitter.GetNDstar();
    Double_t sigma = fitter.GetSigma();
    Double_t sigBack = fitter.GetSignalBack();
    fitter.SetHist(hist2); // sigma etc. are not reset!
    // fit the subsample with the same sigma, mean, ...
    fitter.FitFixAll();
    double nDstarCuts = fitter.GetNDstar();
    fitter.SetSigma(1.1*sigma);
    fitter.FitFixSigma(hist3, hist3Wc);

DstarDmFitter(TH1* hist, TH1* hWc)
 constructor with hist(s) (does not work for TH2!)

DstarDmFitter(const DstarDmFitter& source)

~DstarDmFitter()

void SetHist(TH1* hist, TH1* hWc, Bool_t defSigmaMeanExpSqr)
 sets the histogram 'hist' (and wrong charge hist 'hWc')for a new fit
 if(defSigmaMeanExpSqr==kTRUE):
   sigma, mean, backgrExp and backgrSqr
   are reset to the defaults,
 else (=default!) they stay as they are.

void SetSigma(Double_t sigma)
 sets sigma for next fit
 if no argument given: set default

void SetMean(Double_t mean)
 sets mean for next fit
 if no argument given: set default

void SetBackgrExp(Double_t exp)
 sets exponent of background for next fit
 if no argument given: set default

void SetBackgrSqr(Double_t sqr)
 sets square factor of background for next fit
 if no argument given: set default

void SetUpperBackgrExp(Double_t exp)
 sets limit for exponent of background for
 next fit if no argument given: set default

void SetLowerBackgrExp(Double_t exp)
 sets limit for exponent of background for
 next fit if no argument given: set default

void SetUpperBackgrSqrt(Double_t sqr)
 sets limit for square factor of background for
 next fit if no argument given: set default

void SetLowerBackgrSqrt(Double_t sqr)
 sets limit for square factor of background for
 next fit if no argument given: set default

void SetUpFitLimit(Double_t upLimit)
 sets the upper fit limit
 if no argument given: set default

void SetFitOption(const char* option)
 sets root's fitoption (c.f. DstarDmFitterSpecial_I::DstarDmFitterSpecial_I)

void AddFitOption(const char* option)
 adds 'option' to root's fitoption (c.f. DstarDmFitterSpecial_I::DstarDmFitterSpecial_I)

void AddFitOption(char option)
 adds 'option' to root's fitoption (c.f. DstarDmFitterSpecial_I::DstarDmFitterSpecial_I)

void ResetFitParameters()
 resets the fitting parameters sigma, mean, backgrExp and backgrSqr
 to their default values

TF1* GetFittedBackgrFunc() const
 pointer to the background part of the fitted function associated with the histogram

Bool_t Fit(Int_t mode)
 fits current hist(s) according to mode
 (c.f. DstarDmFitterUnsmart::Fit(Int_t mode))
 smart mode implemented only for 1111 and 1011

Bool_t Fit(Int_t mode, TH1* hist, TH1* hWc)
 fits hist according to mode (c.f. DstarDmFitterUnsmart::Fit(Int_t mode))

Bool_t FitAll()
 fits current hist(s) without fixing any parameter

Bool_t FitAll(TH1* hist, TH1* hWc)
 fits hist(s) without fixing any parameter

Bool_t FitFixMean()
 fits current hist(s) with mean value of signal fixed
 smart mode not yet implemented!

Bool_t FitFixMean(TH1* hist, TH1* hWc)
 fits hist(s) with mean value of signal fixed

Bool_t FitFixMeanSigma()
 fits current hist(s) with mean value and sigma of signal fixed
 smart mode not yet implemented!

Bool_t FitFixMeanSigma(TH1* hist, TH1* hWc)
 fits hist(s) with mean value and sigma of signal fixed

Bool_t FitFixMeanSigmaExp()
 fits current hist(s) with mean value and sigma of signal and
 U_exp of background fixed
 smart mode not yet implemented!

Bool_t FitFixMeanSigmaExp(TH1* hist, TH1* hWc)
 fits hist(s) with mean value and sigma of signal and
 U_exp of background fixed

Bool_t FitFixMeanSigmaExpSqr()
 fits current hist(s) with the following parameters fixed:
 mean and sigma of signal,
 exponent and square factor of background

Bool_t FitFixMeanSigmaExpSqr(TH1* hist, TH1* hWc)
 fits hist(s) with the following parameters fixed:
 mean and sigma of signal,
 exponent and square factor of background

Bool_t FitFixMeanSigmaSqr()
 fits current hist(s) with mean value and sigma of signal and
 U_sqr of background fixed

Bool_t FitFixMeanSigmaSqr(TH1* hist, TH1* hWc)
 fits hist(s) with mean value and sigma of signal and
 U_sqr of background fixed

Bool_t FitFixMeanExp()
 fits current hist(s) with mean value of signal and
 U_exp of background fixed
 smart mode not yet implemented!

Bool_t FitFixMeanExp(TH1* hist, TH1* hWc)
 fits hist(s) with mean value of signal and
 U_exp of background fixed

Bool_t FitFixMeanExpSqr()
 fits current hist(s) with mean value of signal and
 U_sqr, U_exp of background fixed
 smart mode not yet implemented!

Bool_t FitFixMeanExpSqr(TH1* hist, TH1* hWc)
 fits hist(s) with mean value of signal and
 U_sqr, U_exp of background fixed

Bool_t FitFixMeanSqr()
 fits current hist(s) with mean value of signal and U_sqr of background fixed
 smart mode not yet implemented!

Bool_t FitFixMeanSqr(TH1* hist, TH1* hWc)
 fits hist(s) with mean value of signal and U_sqr of background fixed

Bool_t FitFixSigma()
 fits current hist(s) with sigma of signal fixed
 smart mode not yet implemented!

Bool_t FitFixSigma(TH1* hist, TH1* hWc)
 fits hist(s) with sigma of signal fixed

Bool_t FitFixSigmaExp()
 fits current hist(s) with sigma of signal and
 U_exp of background fixed
 smart mode not yet implemented!

Bool_t FitFixSigmaExp(TH1* hist, TH1* hWc)
 fits hist(s) with sigma of signal and
 U_exp of background fixed

Bool_t FitFixSigmaExpSqr()
 fits current hist(s) with sigma of signal and
 U_sqr, U_exp of background fixed
 smart mode not yet implemented!

Bool_t FitFixSigmaExpSqr(TH1* hist, TH1* hWc)
 fits hist(s) with sigma of mean value of signal and
 U_sqr, U_exp of background fixed

Bool_t FitFixSigmaSqr()
 fits current hist(s) with sigma of signal and U_sqr of background fixed
 smart mode not yet implemented!

Bool_t FitFixSigmaSqr(TH1* hist, TH1* hWc)
 fits hist(s) with sigma of signal and U_sqr of background fixed

Bool_t FitFixExp()
 fits current hist(s) with U_Exp of background fixed
 smart mode not yet implemented!

Bool_t FitFixExp(TH1* hist, TH1* hWc)
 fits hist(s) with U_Exp of background fixed

Bool_t FitFixExpSqr()
 fits current hist(s) with U_sqr and U_Exp of background fixed
 smart mode not yet implemented!

Bool_t FitFixExpSqr(TH1* hist, TH1* hWc)
 fits hist(s) with U_sqr and U_Exp of background fixed

Bool_t FitFixSqr()
 fits current hist(s) with U_sqr of background fixed
 smart mode not yet implemented!

Bool_t FitFixSqr(TH1* hist, TH1* hWc)
 fits hist(s) with U_sqr of background fixed



Inline Functions


        DstarDmFitter& operator=(const DstarDmFitter& rhs)
                  void SetHist(TH1* hist, TH1* hWc)
                  void SetHist(TH1* hist, Bool_t defaultSigmaMeanBgrExpSqr)
                  void SetHist(TH1* hist, TH1* hWc, Bool_t defaultSigMeanBgrExpSqr)
                  void SetSigma(Double_t s)
                  void SetMean(Double_t m)
                  void SetBackgrExp(Double_t e)
                  void SetBackgrSqr(Double_t s)
                  void SetWcScale(Double_t s)
                  void SetLimitBackground(Bool_t l)
                  void SetLimitBackgrSqrt(Bool_t l)
                  void SetLimitBackgrExp(Bool_t l)
                  void SetUpperBackgrSqrt()
                  void SetLowerBackgrSqrt()
                  void SetUpperBackgrExp()
                  void SetLowerBackgrExp()
                  void SetUpFitLimit(Double_t u)
                Bool_t SetSmartMode(Bool_t mode = kTRUE)
              Double_t GetNDstar() const
              Double_t GetNDstarErr() const
              Double_t GetSigma() const
              Double_t GetMean() const
              Double_t GetBackgrNorm() const
              Double_t GetBackgrNormErr() const
              Double_t GetBackgrExp() const
              Double_t GetBackgrSqr() const
                Bool_t GetLimitBackgrExp() const
              Double_t GetUpperBackgrExp() const
              Double_t GetLowerBackgrExp() const
                Bool_t GetLimitBackgrSqr() const
              Double_t GetUpperBackgrSqr() const
              Double_t GetLowerBackgrSqr() const
              Double_t GetWcScale() const
              Double_t GetSignalBack() const
              Double_t GetHistBinSize() const
           const char* GetHistName() const
              Double_t GetUpFitLimit() const
           const char* GetFitOption() const
                  TF1* GetFittedFunc() const
                Bool_t IsSmartMode() const
                  void SetDetectIsMC(Bool_t set = kTRUE)
                Bool_t FitFixAll()
                Bool_t FitFixAll(TH1* hist, TH1* hWc = 0)
               TClass* Class()
               TClass* IsA() const
                  void ShowMembers(TMemberInspector& insp, char* parent)
                  void Streamer(TBuffer& b)
                  void StreamerNVirtual(TBuffer& b)


Author: Gero Flucke
Last update: Wed Jan 11 14:05:41 2006


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.