Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4Fitter Class Reference

Central class of Go4Fit package. More...

#include <TGo4Fitter.h>

Inheritance diagram for TGo4Fitter:

TGo4FitterAbstract TGo4FitParsList TGo4FitSlotList TGo4FitNamed List of all members.

Public Types

enum  {
  ff_least_squares = 0, ff_chi_square = 1, ff_chi_Pearson = 2, ff_chi_Neyman = 3,
  ff_chi_gamma = 4, ff_ML_Poisson = 5, ff_user = 6
}

Public Member Functions

 TGo4Fitter ()
 Default constructor.
 TGo4Fitter (const char *iName, const char *iTitle)
 Creates TGo4Fitter object and sets name and title.
 TGo4Fitter (const char *iName, Int_t iFitFunctionType, Bool_t IsAddStandardActions)
 Creates TGo4Fitter object and set type of fit function.
virtual ~TGo4Fitter ()
 Destructor.
void SetFitFunctionType (Int_t iFitFunctionType)
 Set fitted function type for minimization.
Int_t GetFitFunctionType ()
 Return type of fitted function.
void SetUserFitFunction (TUserFitFunction iFunc)
 Set user-defined fitted function.
void SetMemoryUsage (Int_t iMemoryUsage)
 Set value of memory usage.
Int_t GetMemoryUsage ()
 Retrurn value of memory usage parameter.
virtual void Clear (Option_t *option=0)
 Remove all data, all models and all actions.
Int_t GetNumData () const
 Return number of data objects in fitter.
TGo4FitDataGetData (Int_t n)
 Return data object with given index.
const char * GetDataName (Int_t n)
 Return name of data object with given index.
TGo4FitDataFindData (const char *DataName)
 Return data object with given name.
TGo4FitDataAddData (TGo4FitData *d)
 Add data object to fitter.
TGo4FitDataHistogramAddH1 (const char *DataName, TH1 *histo, Bool_t Owned=kFALSE, Double_t lrange=0., Double_t rrange=0.)
 Create TGo4FitDataHistogram object and adds its to fitter.
TGo4FitDataHistogramSetH1 (const char *DataName, TH1 *histo, Bool_t Owned=kFALSE)
 Set histogram to existing TGo4FitDataHistogram object.
TGo4FitDataGraphAddGraph (const char *DataName, TGraph *gr, Bool_t Owned=kFALSE, Double_t lrange=0., Double_t rrange=0.)
 Create TGo4FitDataGraph object and adds its to fitter.
TGo4FitDataGraphSetGraph (const char *DataName, TGraph *gr, Bool_t Owned=kFALSE)
 Set graph to existing TGo4FitDataGraph object.
TGo4FitDataRemoveData (const char *DataName, Bool_t IsDel=kFALSE)
 Remove data object from fitter.
void DeleteAllData ()
 Delete all data objects from fitter.
Int_t GetNumModel () const
 Return number of model component in fitter.
TGo4FitModelGetModel (Int_t n)
 Return model component with given index.
TGo4FitModelFindModel (const char *ModelName)
 Return model component with given name.
TGo4FitModelAddModel (TGo4FitModel *m)
 Add model component to fitter.
TGo4FitModelAddModel (const char *DataName, TGo4FitModel *m)
 Add model component to fitter and assign it to specified data object.
void AddPolynomX (const char *DataName, const char *NamePrefix, Int_t MaxOrder=1, Int_t GroupIndex=0, Double_t lrange=0., Double_t rrange=0.)
 Construct 1-dim polynom for specified data object for x scale.
void AddPolynomX (const char *DataName, const char *NamePrefix, TArrayD &Coef, Int_t GroupIndex=0)
 Construct 1-dim polynom with specified polynom coefficients NamePrefix sets prefix of model name for each polynom component.
void AddPolynoms (const char *DataName, const char *NamePrefix, Int_t MaxOrder=1, Int_t NumAxis=1, Int_t GroupIndex=0)
 Construct full polynom for specified data object.
TGo4FitModelGauss1AddGauss1 (const char *DataName, const char *ModelName, Double_t iPosition, Double_t iWidth, Double_t iAmpl=1., Int_t Axis=0)
 Add 1-dim gaussian model to fitter.
Int_t NumModelsAssosiatedTo (const char *DataName)
 Counts models assosiated with specific data.
TGo4FitModelCloneModel (const char *ModelName, const char *NewName=0)
 Clones specified model.
TGo4FitModelRemoveModel (const char *ModelName, Bool_t IsDel=kFALSE)
 Remove model component from fitter.
void DeleteModelsAssosiatedTo (const char *DataName)
 Remove models assosiated with specific data.
void DeleteAllModels ()
 Delete all model objects from fitter.
void AssignModelTo (const char *ModelName, const char *DataName, Double_t RatioValue=1., Bool_t FixRatio=kFALSE)
 Assign model to specified data object.
void ClearModelAssignmentTo (const char *ModelName, const char *DataName=0)
 Remove assignment to given data (if exists).
void ChangeDataNameInAssignments (const char *oldname, const char *newname)
 Change data name in model component assignments.
Int_t GetNumComp () const
 Return total number of TGo4FitComponent (data and model) objects in fitter.
TGo4FitComponentGetComp (Int_t n)
 Return TGo4FitComponent object with given index.
void EstimateAmplitudes (Int_t NumIters=1)
 Estimate amplitude of all model components.
void AddAmplEstimation (Int_t NumIters=1)
 Add amplitude estimation to actions list.
void AddStandardActions ()
 Add list of standard actions to fitter.
Double_t CalculateFitFunction (Double_t *pars=0, Int_t FitFunctionType=-1, const char *DataName=0)
 Calculate value of fit function for given set of parameters and specified type of fit function (it can not correspond to minimized fit function type).
Int_t CalculateNDF (const char *DataName=0)
 Calculates number of degree of freedom (NDF).
virtual void FillSlotList (TSeqCollection *list)
 Collect all TGo4FitSlot objects, situated in fitter, data and models to givven TObjArray.
virtual void Print (Option_t *option) const
 Print containment of fitter.
Bool_t CalculatesMomentums (const char *DataName, Bool_t UseRanges, Bool_t SubstractModels, Double_t &first, Double_t &second)
 Calculates first and second momentum for specified data Usage of ranges and substraction of model can be specified.
Double_t CalculatesIntegral (const char *DataName, const char *ModelName=0, Bool_t OnlyCounts=kFALSE)
 Calculates integral for data or model (if ModelName is specified) if OnlyCounts specified, only sum of values in bins position are calculated.
Double_t CalculatesModelIntegral (const char *ModelName, Bool_t OnlyCounts=kFALSE)
 Calculates integral of model (if ModelName is specified) if OnlyCounts specified, only sum of values in bins position are calculated.
TObject * CreateDrawObject (const char *ObjName, const char *DataName, Bool_t IsModel=kFALSE, const char *ModelName=0)
 Create object (TH1 or TGraph), which can be drawn.
virtual void Draw (Option_t *option)
 Draw fitter on current canvas.
void ProvideLastDrawObjects (TObjArray &lst)
 Copy pointer on drawn object after last command to specified TObjArray.
void PrintAmpls () const
 Print value of all amplitude parameters.
void PrintLines () const
 Print amplitude, position and width for each model components.
TString FindNextName (const char *Head, Int_t start, Bool_t isModel=kTRUE)

Protected Member Functions

Bool_t ModelBuffersAllocated (TGo4FitModel *model)
Bool_t DataBuffersAllocated (TGo4FitData *data)
Int_t GetDataBinsSize (TGo4FitData *data)
Double_t * GetDataBinsValues (TGo4FitData *data)
Double_t * GetDataBinsDevs (TGo4FitData *data)
Double_t * GetDataBinsResult (TGo4FitData *data)
Double_t * GetModelBinsValues (TGo4FitModel *model, const char *DataName)
void RebuildAll (Bool_t ForceBuild=kFALSE)
 Update all data objects and model components acording to current parameters values.
virtual void CollectAllPars ()
 Should collect parameters from all associated to fitter objects.
virtual Double_t DoCalculation ()
 Calculates value of fit function according current values of parameters.
virtual Int_t DoNDFCalculation ()
 Calculates number of dimensions of freedom; Should be implemented in inherited classes.
Double_t CalculateFCN (Int_t FitFunctionType, TGo4FitData *selectdata=0)
Double_t PointFitFunction (Int_t FitFunctionType, Double_t value, Double_t modelvalue, Double_t standdev)
virtual Bool_t InitFitterData ()
 Initialize fitter data.
virtual void FinalizeFitterData ()
 Finalize fitter data.

Protected Attributes

TObjArray fxDatas
 Container for data objects.
TObjArray fxModels
 Container for model components.
Int_t fiFitFunctionType
 Defines type of fitted function.
Int_t fiMemoryUsage
 Defines use of memory during actions executions.

Private Member Functions

void MoveDrawObjectsToROOT ()
void CheckSlotsBeforeDelete (TGo4FitComponent *comp)

Private Attributes

TUserFitFunction fxUserFitFunction
 Pointer on user fit function.
TObjArray * fxDrawObjs

Friends

class TGo4FitAmplEstimation

Detailed Description

Central class of Go4Fit package.

Definition at line 39 of file TGo4Fitter.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
ff_least_squares 
ff_chi_square 
ff_chi_Pearson 
ff_chi_Neyman 
ff_chi_gamma 
ff_ML_Poisson 
ff_user 

Definition at line 41 of file TGo4Fitter.h.


Constructor & Destructor Documentation

TGo4Fitter::TGo4Fitter  ) 
 

Default constructor.

Definition at line 43 of file TGo4Fitter.cxx.

TGo4Fitter::TGo4Fitter const char *  iName,
const char *  iTitle
 

Creates TGo4Fitter object and sets name and title.

Definition at line 47 of file TGo4Fitter.cxx.

References fxDatas, and fxModels.

TGo4Fitter::TGo4Fitter const char *  iName,
Int_t  iFitFunctionType,
Bool_t  IsAddStandardActions
 

Creates TGo4Fitter object and set type of fit function.

If AddStandardActions flag is set,

Definition at line 53 of file TGo4Fitter.cxx.

References AddStandardActions(), fxDatas, fxModels, and SetFitFunctionType().

TGo4Fitter::~TGo4Fitter  )  [virtual]
 

Destructor.

Delete TGo4Fitter object.

Definition at line 62 of file TGo4Fitter.cxx.

References TGo4FitSlotList::CheckDuplicatesOnSlot(), and MoveDrawObjectsToROOT().


Member Function Documentation

void TGo4Fitter::SetFitFunctionType Int_t  iFitFunctionType  )  [inline]
 

Set fitted function type for minimization.

Possible values are: TGo4Fitter:ff_least_squares = 0 sum of difference squares between model and data; TGo4Fitter:ff_chi_square = 1 standard chi-square sum TGo4Fitter:ff_chi_Pearson = 2 Pearson chi-square for Poisson statistic TGo4Fitter:ff_chi_Neyman = 3 modified Neyman chi-square for Poisson statistic TGo4Fitter:ff_chi_gamma = 4 modified chi-square for Poisson statistic TGo4Fitter:ff_ML_Poisson = 5 -2Ln from maximum likelihood function for Poisson statistic TGo4Fitter:ff_user = 6 user function User function type should not be specified directly, but using SetUserFitFunction() method. More informtation about fit function types can be found in Go4Fit tutorial.

Definition at line 82 of file TGo4Fitter.h.

References fiFitFunctionType.

Referenced by TGo4Fitter().

Int_t TGo4Fitter::GetFitFunctionType  )  [inline]
 

Return type of fitted function.

For possible values see SetFitFunctionType() method.

Definition at line 87 of file TGo4Fitter.h.

References fiFitFunctionType.

Referenced by CalculateFitFunction(), and TGo4FitAmplEstimation::CalculateWithBuffers().

void TGo4Fitter::SetUserFitFunction TUserFitFunction  iFunc  )  [inline]
 

Set user-defined fitted function.

Function should be global and has following signature: Double_t (*TUserFitFunction)(Int_t, Double_t*, Double_t*) First parameter - number of points, Second - array of data points, Third - array of model points. Function should return value, which will be MINIMIZED by fitter. If necessary maximization, fit function should return negative value.

Definition at line 99 of file TGo4Fitter.h.

References ff_user, fiFitFunctionType, and fxUserFitFunction.

void TGo4Fitter::SetMemoryUsage Int_t  iMemoryUsage  ) 
 

Set value of memory usage.

This parameter can be: 0 - no aditional memory will be allocated in buffers 1 - buffers will be allocated only for data objects 2 - buffers will be used for all data and models objects 3 - individual setup for data and model objects will be used for memory allocaions

Definition at line 67 of file TGo4Fitter.cxx.

References fiMemoryUsage.

Referenced by BuildFitter(), Example13(), and Example8().

Int_t TGo4Fitter::GetMemoryUsage  )  [inline]
 

Retrurn value of memory usage parameter.

See SetMemoryUsage for detailed description.

Definition at line 115 of file TGo4Fitter.h.

References fiMemoryUsage.

Referenced by CalculateFCN(), and InitFitterData().

void TGo4Fitter::Clear Option_t *  option = 0  )  [virtual]
 

Remove all data, all models and all actions.

Reimplemented from TGo4FitterAbstract.

Definition at line 91 of file TGo4Fitter.cxx.

References TGo4FitterAbstract::Clear(), DeleteAllData(), and DeleteAllModels().

Referenced by TGo4FitterEnvelope::Clear().

Int_t TGo4Fitter::GetNumData  )  const [inline]
 

Return number of data objects in fitter.

Definition at line 125 of file TGo4Fitter.h.

References fxDatas.

Referenced by AssignModelTo(), CalculateFCN(), CalculateNDF(), TGo4FitAmplEstimation::CalculateWithBuffers(), CollectAllPars(), Draw(), FinalizeFitterData(), GetComp(), GetNumComp(), InitFitterData(), and RebuildAll().

TGo4FitData * TGo4Fitter::GetData Int_t  n  ) 
 

Return data object with given index.

If index out of valid range, return 0.

Definition at line 97 of file TGo4Fitter.cxx.

References fxDatas.

Referenced by AssignModelTo(), CalculateFCN(), CalculateNDF(), TGo4FitAmplEstimation::CalculateWithBuffers(), CollectAllPars(), Draw(), FinalizeFitterData(), GetComp(), GetDataName(), InitFitterData(), and RebuildAll().

const char * TGo4Fitter::GetDataName Int_t  n  ) 
 

Return name of data object with given index.

If index not valid, return 0.

Definition at line 102 of file TGo4Fitter.cxx.

References GetData().

Referenced by TGo4FitAmplEstimation::CalculateWithBuffers(), and Draw().

TGo4FitData * TGo4Fitter::FindData const char *  DataName  ) 
 

Return data object with given name.

if no corresponding objects, return 0.

Definition at line 107 of file TGo4Fitter.cxx.

References fxDatas.

Referenced by CalculateFitFunction(), CalculateNDF(), CalculatesIntegral(), CalculatesMomentums(), TGo4FitAmplEstimation::CalculateWithBuffers(), CollectAllPars(), CreateDrawObject(), TGo4FitPeakFinder::DoAction(), Example6(), FindNextName(), and RemoveData().

TGo4FitData * TGo4Fitter::AddData TGo4FitData d  ) 
 

Add data object to fitter.

Data object owned by fitter and will be destroyed together with fitter.

Definition at line 112 of file TGo4Fitter.cxx.

References fxDatas, TGo4FitterAbstract::SetParsListChange(), and TGo4FitSlotList::SetUpdateSlotList().

Referenced by AddGraph(), AddH1(), BuildFitter(), Example13(), Example8(), and Example9().

TGo4FitDataHistogram * TGo4Fitter::AddH1 const char *  DataName,
TH1 *  histo,
Bool_t  Owned = kFALSE,
Double_t  lrange = 0.,
Double_t  rrange = 0.
 

Create TGo4FitDataHistogram object and adds its to fitter.

Definition at line 120 of file TGo4Fitter.cxx.

References AddData().

Referenced by Example1(), Example10(), Example11(), Example2(), Example3(), Example4(), Example5(), and TXXXCalibPar::TXXXCalibPar().

TGo4FitDataHistogram * TGo4Fitter::SetH1 const char *  DataName,
TH1 *  histo,
Bool_t  Owned = kFALSE
 

Set histogram to existing TGo4FitDataHistogram object.

Definition at line 127 of file TGo4Fitter.cxx.

TGo4FitDataGraph * TGo4Fitter::AddGraph const char *  DataName,
TGraph *  gr,
Bool_t  Owned = kFALSE,
Double_t  lrange = 0.,
Double_t  rrange = 0.
 

Create TGo4FitDataGraph object and adds its to fitter.

Definition at line 134 of file TGo4Fitter.cxx.

References AddData().

Referenced by Example12(), and TXXXCalibPar::TXXXCalibPar().

TGo4FitDataGraph * TGo4Fitter::SetGraph const char *  DataName,
TGraph *  gr,
Bool_t  Owned = kFALSE
 

Set graph to existing TGo4FitDataGraph object.

Definition at line 141 of file TGo4Fitter.cxx.

TGo4FitData * TGo4Fitter::RemoveData const char *  DataName,
Bool_t  IsDel = kFALSE
 

Remove data object from fitter.

If IsDel flag is set, object will be destroyed, otherwise (by default) function return pointer on this object.

Definition at line 163 of file TGo4Fitter.cxx.

References CheckSlotsBeforeDelete(), FindData(), fxDatas, TGo4FitterAbstract::SetParsListChange(), and TGo4FitSlotList::SetUpdateSlotList().

void TGo4Fitter::DeleteAllData  ) 
 

Delete all data objects from fitter.

Definition at line 175 of file TGo4Fitter.cxx.

References fxDatas, TGo4FitterAbstract::SetParsListChange(), and TGo4FitSlotList::SetUpdateSlotList().

Referenced by Clear().

Int_t TGo4Fitter::GetNumModel  )  const [inline]
 

Return number of model component in fitter.

Definition at line 180 of file TGo4Fitter.h.

References fxModels.

Referenced by CalculateFCN(), CalculateNDF(), CalculatesMomentums(), TGo4FitAmplEstimation::CalculateWithBuffers(), ChangeDataNameInAssignments(), CollectAllPars(), CreateDrawObject(), DeleteModelsAssosiatedTo(), Draw(), FinalizeFitterData(), GetNumComp(), InitFitterData(), NumModelsAssosiatedTo(), PrintLines(), and RebuildAll().

TGo4FitModel * TGo4Fitter::GetModel Int_t  n  ) 
 

Return model component with given index.

If index out of valid range, return 0.

Definition at line 183 of file TGo4Fitter.cxx.

References fxModels.

Referenced by CalculateFCN(), CalculateNDF(), CalculatesMomentums(), TGo4FitAmplEstimation::CalculateWithBuffers(), ChangeDataNameInAssignments(), CollectAllPars(), CreateDrawObject(), DeleteModelsAssosiatedTo(), Draw(), FinalizeFitterData(), GetComp(), InitFitterData(), NumModelsAssosiatedTo(), and RebuildAll().

TGo4FitModel * TGo4Fitter::FindModel const char *  ModelName  ) 
 

Return model component with given name.

If no such model name exists, return 0.

Definition at line 188 of file TGo4Fitter.cxx.

References fxModels.

Referenced by AddPolynoms(), AddPolynomX(), AssignModelTo(), CalculatesIntegral(), CalculatesModelIntegral(), ClearModelAssignmentTo(), CloneModel(), CreateDrawObject(), Draw(), FindNextName(), RemoveModel(), TXXXCalibPar::TXXXCalibPar(), and TXXXCalibPar::UpdateFrom().

TGo4FitModel * TGo4Fitter::AddModel TGo4FitModel m  ) 
 

Add model component to fitter.

Model already should be assigned to at least one data object.

Definition at line 193 of file TGo4Fitter.cxx.

References fxModels, TGo4FitterAbstract::SetParsListChange(), and TGo4FitSlotList::SetUpdateSlotList().

Referenced by AddGauss1(), AddPolynoms(), AddPolynomX(), BuildFitter(), CloneModel(), Example10(), Example13(), Example2(), Example3(), Example4(), Example8(), and Example9().

TGo4FitModel * TGo4Fitter::AddModel const char *  DataName,
TGo4FitModel m
 

Add model component to fitter and assign it to specified data object.

Definition at line 201 of file TGo4Fitter.cxx.

References TGo4FitModel::AssignToData(), fxModels, TGo4FitterAbstract::SetParsListChange(), and TGo4FitSlotList::SetUpdateSlotList().

void TGo4Fitter::AddPolynomX const char *  DataName,
const char *  NamePrefix,
Int_t  MaxOrder = 1,
Int_t  GroupIndex = 0,
Double_t  lrange = 0.,
Double_t  rrange = 0.
 

Construct 1-dim polynom for specified data object for x scale.

NamePrefix sets prefix of model name for each polynom component. MaxOrder sets maximum order of polynom (default =1 ) NumAxis sets number of axis, for which polynom will be sets GroupIndex sets index of models group for all polyn components (default = 0 - background group) lbound and rbound sets range, where polynom will be calculated

Definition at line 215 of file TGo4Fitter.cxx.

References AddModel(), FindModel(), and TGo4FitModel::SetGroupIndex().

Referenced by Example1(), Example10(), Example12(), Example2(), Example3(), Example4(), Example5(), TGo4FitPeakFinder::HansEsselPeakFinder(), TGo4FitPeakFinder::ROOTPeakFinder(), and TXXXCalibPar::TXXXCalibPar().

void TGo4Fitter::AddPolynomX const char *  DataName,
const char *  NamePrefix,
TArrayD &  Coef,
Int_t  GroupIndex = 0
 

Construct 1-dim polynom with specified polynom coefficients NamePrefix sets prefix of model name for each polynom component.

GroupIndex sets index of models group for all polyn components (default = 0 - background group)

Definition at line 252 of file TGo4Fitter.cxx.

References AddModel(), FindModel(), TGo4FitComponent::SetAmplValue(), and TGo4FitModel::SetGroupIndex().

void TGo4Fitter::AddPolynoms const char *  DataName,
const char *  NamePrefix,
Int_t  MaxOrder = 1,
Int_t  NumAxis = 1,
Int_t  GroupIndex = 0
 

Construct full polynom for specified data object.

NamePrefix sets prefix of model name for each polynom component. MaxOrder sets maximum order of polynom (default =1 ) NumAxis sets number of axis, for which polynom will be sets GroupIndex sets index of models group for all polyn components (default = 0 - background group)

Definition at line 286 of file TGo4Fitter.cxx.

References AddModel(), FindModel(), and TGo4FitModel::SetGroupIndex().

TGo4FitModelGauss1 * TGo4Fitter::AddGauss1 const char *  DataName,
const char *  ModelName,
Double_t  iPosition,
Double_t  iWidth,
Double_t  iAmpl = 1.,
Int_t  Axis = 0
 

Add 1-dim gaussian model to fitter.

Definition at line 335 of file TGo4Fitter.cxx.

References AddModel(), and TGo4FitComponent::SetAmplValue().

Referenced by Example1(), Example10(), Example5(), TGo4FitPeakFinder::HansEsselPeakFinder(), TXXXCalibPar::ReadDatabase(), and TGo4FitPeakFinder::ROOTPeakFinder().

Int_t TGo4Fitter::NumModelsAssosiatedTo const char *  DataName  ) 
 

Counts models assosiated with specific data.

Definition at line 378 of file TGo4Fitter.cxx.

References GetModel(), and GetNumModel().

TGo4FitModel * TGo4Fitter::CloneModel const char *  ModelName,
const char *  NewName = 0
 

Clones specified model.

Definition at line 343 of file TGo4Fitter.cxx.

References AddModel(), and FindModel().

TGo4FitModel * TGo4Fitter::RemoveModel const char *  ModelName,
Bool_t  IsDel = kFALSE
 

Remove model component from fitter.

If IsDel flag specified, component is delete, otherwise (by default) function return pointer on this model component.

Definition at line 365 of file TGo4Fitter.cxx.

References CheckSlotsBeforeDelete(), FindModel(), fxModels, TGo4FitterAbstract::SetParsListChange(), and TGo4FitSlotList::SetUpdateSlotList().

void TGo4Fitter::DeleteModelsAssosiatedTo const char *  DataName  ) 
 

Remove models assosiated with specific data.

Definition at line 385 of file TGo4Fitter.cxx.

References TGo4FitModel::ClearAssignmentTo(), fxModels, GetModel(), GetNumModel(), TGo4FitModel::IsAssignTo(), TGo4FitModel::NumAssigments(), TGo4FitterAbstract::SetParsListChange(), and TGo4FitSlotList::SetUpdateSlotList().

Referenced by TGo4FitPeakFinder::DoAction().

void TGo4Fitter::DeleteAllModels  ) 
 

Delete all model objects from fitter.

Definition at line 402 of file TGo4Fitter.cxx.

References fxModels, TGo4FitterAbstract::SetParsListChange(), and TGo4FitSlotList::SetUpdateSlotList().

Referenced by Clear().

void TGo4Fitter::AssignModelTo const char *  ModelName,
const char *  DataName,
Double_t  RatioValue = 1.,
Bool_t  FixRatio = kFALSE
 

Assign model to specified data object.

When model assigns to more then one data, additional "Ratio1", "Ratio2" and so on parameters will be created. They means ratio in amplitude of model component in this data to ampltute of this component in data, to wich model was assigned first. By default, this ratio is 1. and not fixed.

Definition at line 409 of file TGo4Fitter.cxx.

References TGo4FitModel::AssignToData(), TGo4FitModel::ClearAssignments(), FindModel(), GetData(), GetNumData(), and TGo4FitterAbstract::SetParsListChange().

void TGo4Fitter::ClearModelAssignmentTo const char *  ModelName,
const char *  DataName = 0
 

Remove assignment to given data (if exists).

If DataName==0, all assignments will be cleared.

Definition at line 424 of file TGo4Fitter.cxx.

References TGo4FitModel::ClearAssignments(), TGo4FitModel::ClearAssignmentTo(), FindModel(), and TGo4FitterAbstract::SetParsListChange().

void TGo4Fitter::ChangeDataNameInAssignments const char *  oldname,
const char *  newname
 

Change data name in model component assignments.

This function should be used, if data name is changing out of the fitter.

Definition at line 433 of file TGo4Fitter.cxx.

References GetModel(), and GetNumModel().

Int_t TGo4Fitter::GetNumComp  )  const [inline]
 

Return total number of TGo4FitComponent (data and model) objects in fitter.

This is just a sum GetNumData()+GetNumModel().

Definition at line 283 of file TGo4Fitter.h.

References GetNumData(), and GetNumModel().

Referenced by FillSlotList(), and PrintAmpls().

TGo4FitComponent * TGo4Fitter::GetComp Int_t  n  ) 
 

Return TGo4FitComponent object with given index.

If index < GetNumData() return data object, else return model component. If index not valid, return 0.

Definition at line 210 of file TGo4Fitter.cxx.

References GetData(), GetModel(), and GetNumData().

Referenced by FillSlotList().

void TGo4Fitter::EstimateAmplitudes Int_t  NumIters = 1  ) 
 

Estimate amplitude of all model components.

This routine typically should be executed before general minimization routine. To obtain good estimation of amplitudes, rest model parameters (like position and widths) should has good estimation, otherwise amplitude estimation routine gives unacceptable values.

Definition at line 626 of file TGo4Fitter.cxx.

References TGo4FitAmplEstimation::DoAction().

void TGo4Fitter::AddAmplEstimation Int_t  NumIters = 1  ) 
 

Add amplitude estimation to actions list.

Definition at line 631 of file TGo4Fitter.cxx.

References TGo4FitterAbstract::AddAction(), and TGo4FitAmplEstimation.

Referenced by AddStandardActions(), and BuildFitter().

void TGo4Fitter::AddStandardActions  ) 
 

Add list of standard actions to fitter.

Now : AmplEstimate action and Minuit minimizer with "MIGRAD 500 1" command.

Definition at line 635 of file TGo4Fitter.cxx.

References AddAmplEstimation(), and TGo4FitterAbstract::AddSimpleMinuit().

Referenced by BuildFitter(), and TGo4Fitter().

Double_t TGo4Fitter::CalculateFitFunction Double_t *  pars = 0,
Int_t  FitFunctionType = -1,
const char *  DataName = 0
 

Calculate value of fit function for given set of parameters and specified type of fit function (it can not correspond to minimized fit function type).

If DataName not specified (default), fitfunction calculates for all data objects.

Definition at line 565 of file TGo4Fitter.cxx.

References CalculateFCN(), TGo4FitterAbstract::ExecuteDependencies(), FindData(), GetFitFunctionType(), and TGo4FitParsList::SetParsValues().

Int_t TGo4Fitter::CalculateNDF const char *  DataName = 0  ) 
 

Calculates number of degree of freedom (NDF).

If DataName not specified (default), NDF calculates for all data objects. NDF defined as total number of bins in data object minus number of variable parameters.

Definition at line 577 of file TGo4Fitter.cxx.

References TGo4FitData::DefineBinsSize(), FindData(), GetData(), GetModel(), GetNumData(), GetNumModel(), TGo4FitModel::IsAssignTo(), and TGo4FitParsList::NumFreePars().

Referenced by DoNDFCalculation().

void TGo4Fitter::FillSlotList TSeqCollection *  list  )  [virtual]
 

Collect all TGo4FitSlot objects, situated in fitter, data and models to givven TObjArray.

Reimplemented from TGo4FitSlotList.

Definition at line 640 of file TGo4Fitter.cxx.

References TGo4FitSlotList::FillSlotList(), GetComp(), and GetNumComp().

void TGo4Fitter::Print Option_t *  option  )  const [virtual]
 

Print containment of fitter.

If option = "**", print also containment of all associated objects like histogram, calibrations and so on.

Reimplemented from TGo4FitterAbstract.

Definition at line 674 of file TGo4Fitter.cxx.

References ff_chi_gamma, ff_chi_Neyman, ff_chi_Pearson, ff_chi_square, ff_ML_Poisson, ff_user, fiFitFunctionType, fxDatas, fxModels, TGo4FitterAbstract::Print(), PrintAmpls(), PrintLines(), TGo4FitParsList::PrintPars(), and TGo4FitterAbstract::PrintResults().

Referenced by Example10(), Example11(), Example12(), Example13(), Example2(), Example4(), Example5(), and Example8().

Bool_t TGo4Fitter::CalculatesMomentums const char *  DataName,
Bool_t  UseRanges,
Bool_t  SubstractModels,
Double_t &  first,
Double_t &  second
 

Calculates first and second momentum for specified data Usage of ranges and substraction of model can be specified.

Definition at line 698 of file TGo4Fitter.cxx.

References TGo4FitModel::AfterEval(), TGo4FitModel::BeforeEval(), TGo4FitDataIter::CountPoints(), TGo4FitModel::EvaluateAtPoint(), FindData(), TGo4FitComponent::GetAmplValue(), GetModel(), GetNumModel(), TGo4FitModel::GetRatioValueFor(), TGo4FitData::MakeIter(), TGo4FitDataIter::Next(), TGo4FitDataIter::Reset(), TGo4FitDataIter::ScalesSize(), TGo4FitDataIter::Value(), and TGo4FitDataIter::x().

Double_t TGo4Fitter::CalculatesIntegral const char *  DataName,
const char *  ModelName = 0,
Bool_t  OnlyCounts = kFALSE
 

Calculates integral for data or model (if ModelName is specified) if OnlyCounts specified, only sum of values in bins position are calculated.

Definition at line 773 of file TGo4Fitter.cxx.

References TGo4FitModel::AfterEval(), TGo4FitModel::BeforeEval(), TGo4FitModel::EvaluateAtPoint(), FindData(), FindModel(), TGo4FitComponent::GetAmplValue(), TGo4FitModel::GetRatioValueFor(), TGo4FitData::MakeIter(), TGo4FitDataIter::Next(), TGo4FitDataIter::Reset(), TGo4FitDataIter::ScalesSize(), TGo4FitDataIter::Value(), and TGo4FitDataIter::xWidths().

Referenced by CalculatesModelIntegral().

Double_t TGo4Fitter::CalculatesModelIntegral const char *  ModelName,
Bool_t  OnlyCounts = kFALSE
 

Calculates integral of model (if ModelName is specified) if OnlyCounts specified, only sum of values in bins position are calculated.

Definition at line 810 of file TGo4Fitter.cxx.

References TGo4FitModel::AssignmentName(), CalculatesIntegral(), and FindModel().

TObject * TGo4Fitter::CreateDrawObject const char *  ObjName,
const char *  DataName,
Bool_t  IsModel = kFALSE,
const char *  ModelName = 0
 

Create object (TH1 or TGraph), which can be drawn.

Object can contain data bins (IsModel = kFALSE), full data model (IsModel = kTRUE, ModelName = 0) or specific model component (IsModel = kTRUE, ModelName specify component name)

Definition at line 816 of file TGo4Fitter.cxx.

References TGo4FitModel::AfterEval(), TGo4FitModel::BeforeEval(), TGo4FitDataIter::CreateGraph(), TGo4FitDataIter::CreateHistogram(), TGo4FitModel::EvaluateAtPoint(), FindData(), FindModel(), TGo4FitComponent::GetAmplValue(), GetModel(), GetNumModel(), TGo4FitModel::GetRatioValueFor(), TGo4FitDataIter::HasIndexes(), TGo4FitDataIter::HasWidths(), TGo4FitDataIter::Indexes(), TGo4FitDataIter::IndexesSize(), TGo4FitModel::IsAssignTo(), TGo4FitData::MakeIter(), TGo4FitDataIter::Next(), TGo4FitDataIter::Point(), TGo4FitDataIter::Reset(), TGo4FitDataIter::ScalesSize(), and TGo4FitDataIter::x().

Referenced by Draw(), Example8(), and Example9().

void TGo4Fitter::Draw Option_t *  option  )  [virtual]
 

Draw fitter on current canvas.

As options, data name(s) or component name(s) should be specified, separated by commas. For instance: Draw("data1") - draw data object with name "data1" and it's full model Draw("data1,Gauss1,Gauss2") - draw data object "data1", full model and model components with names "Gauss1" and "Gauss2" All objects is created via CreateDrawObject() method and stored in internal list. They will be moved to ROOT when fitter will be destroyed.

Definition at line 946 of file TGo4Fitter.cxx.

References CreateDrawObject(), FindModel(), fxDrawObjs, GetData(), GetDataName(), GetModel(), GetNumData(), GetNumModel(), TGo4FitModel::IsAssignTo(), and MoveDrawObjectsToROOT().

Referenced by Example1(), Example10(), Example11(), Example12(), Example13(), Example2(), Example4(), and Example5().

void TGo4Fitter::ProvideLastDrawObjects TObjArray &  lst  ) 
 

Copy pointer on drawn object after last command to specified TObjArray.

From this moment user should take care about proper destroyment of this objects.

Definition at line 1134 of file TGo4Fitter.cxx.

References fxDrawObjs.

void TGo4Fitter::PrintAmpls  )  const
 

Print value of all amplitude parameters.

Definition at line 1089 of file TGo4Fitter.cxx.

References TGo4FitComponent::GetAmplError(), TGo4FitComponent::GetAmplFullName(), TGo4FitComponent::GetAmplPar(), TGo4FitComponent::GetAmplValue(), and GetNumComp().

Referenced by Print().

void TGo4Fitter::PrintLines  )  const
 

Print amplitude, position and width for each model components.

Definition at line 1098 of file TGo4Fitter.cxx.

References TGo4FitComponent::GetAmplValue(), GetNumModel(), TGo4FitModel::GetPosition(), and TGo4FitModel::GetWidth().

Referenced by Print(), TYYYParameter::PrintParameter(), and TXXXCalibPar::UpdateFrom().

TString TGo4Fitter::FindNextName const char *  Head,
Int_t  start,
Bool_t  isModel = kTRUE
 

Definition at line 1151 of file TGo4Fitter.cxx.

References FindData(), and FindModel().

Referenced by TGo4FitPeakFinder::HansEsselPeakFinder(), and TGo4FitPeakFinder::ROOTPeakFinder().

Bool_t TGo4Fitter::ModelBuffersAllocated TGo4FitModel model  )  [protected]
 

Definition at line 646 of file TGo4Fitter.cxx.

Referenced by TGo4FitAmplEstimation::CalculateWithBuffers().

Bool_t TGo4Fitter::DataBuffersAllocated TGo4FitData data  )  [protected]
 

Definition at line 650 of file TGo4Fitter.cxx.

References TGo4FitData::BuffersAllocated().

Referenced by TGo4FitAmplEstimation::CalculateWithBuffers().

Int_t TGo4Fitter::GetDataBinsSize TGo4FitData data  )  [protected]
 

Definition at line 654 of file TGo4Fitter.cxx.

References TGo4FitData::GetBinsSize().

Referenced by TGo4FitAmplEstimation::CalculateWithBuffers().

Double_t * TGo4Fitter::GetDataBinsValues TGo4FitData data  )  [protected]
 

Definition at line 658 of file TGo4Fitter.cxx.

References TGo4FitData::GetBinsValues().

Referenced by TGo4FitAmplEstimation::CalculateWithBuffers().

Double_t * TGo4Fitter::GetDataBinsDevs TGo4FitData data  )  [protected]
 

Definition at line 662 of file TGo4Fitter.cxx.

References TGo4FitData::GetBinsDevs().

Referenced by TGo4FitAmplEstimation::CalculateWithBuffers().

Double_t * TGo4Fitter::GetDataBinsResult TGo4FitData data  )  [protected]
 

Definition at line 666 of file TGo4Fitter.cxx.

References TGo4FitData::GetBinsResult().

Referenced by TGo4FitAmplEstimation::CalculateWithBuffers().

Double_t * TGo4Fitter::GetModelBinsValues TGo4FitModel model,
const char *  DataName
[protected]
 

Definition at line 670 of file TGo4Fitter.cxx.

References TGo4FitModel::GetModelBins().

Referenced by TGo4FitAmplEstimation::CalculateWithBuffers().

void TGo4Fitter::RebuildAll Bool_t  ForceBuild = kFALSE  )  [protected]
 

Update all data objects and model components acording to current parameters values.

Only those objects will be recalculated, which parameters were changed after last recalculation. If ForceBuild flag is set (default = kFALSE), all objects will be recalculated anyway.

Definition at line 606 of file TGo4Fitter.cxx.

References TGo4FitModel::AddModelToDataResult(), TGo4FitData::BuffersAllocated(), TGo4FitData::GetBinsResult(), TGo4FitData::GetBinsSize(), GetData(), GetModel(), GetNumData(), GetNumModel(), and TGo4FitModel::IsAssignTo().

Referenced by CalculateFCN(), and TGo4FitAmplEstimation::CalculateWithBuffers().

void TGo4Fitter::CollectAllPars  )  [protected, virtual]
 

Should collect parameters from all associated to fitter objects.

This function should be extend in inherited classes.

Reimplemented from TGo4FitterAbstract.

Definition at line 74 of file TGo4Fitter.cxx.

References TGo4FitModel::AssignmentName(), TGo4FitterAbstract::CollectAllPars(), TGo4FitComponent::CollectParsTo(), FindData(), GetData(), GetModel(), GetNumData(), and GetNumModel().

Double_t TGo4Fitter::DoCalculation  )  [protected, virtual]
 

Calculates value of fit function according current values of parameters.

Should be implemented in inherited classes.

Reimplemented from TGo4FitterAbstract.

Definition at line 598 of file TGo4Fitter.cxx.

References CalculateFCN(), and fiFitFunctionType.

Int_t TGo4Fitter::DoNDFCalculation  )  [protected, virtual]
 

Calculates number of dimensions of freedom; Should be implemented in inherited classes.

Reimplemented from TGo4FitterAbstract.

Definition at line 602 of file TGo4Fitter.cxx.

References CalculateNDF().

Double_t TGo4Fitter::CalculateFCN Int_t  FitFunctionType,
TGo4FitData selectdata = 0
[protected]
 

Definition at line 506 of file TGo4Fitter.cxx.

References TGo4FitModel::BeforeEval(), TGo4FitData::BuffersAllocated(), TGo4FitModel::EvaluateAtPoint(), TGo4FitComponent::GetAmplValue(), TGo4FitData::GetBinsDevs(), TGo4FitData::GetBinsResult(), TGo4FitData::GetBinsSize(), TGo4FitData::GetBinsValues(), GetData(), GetMemoryUsage(), GetModel(), GetNumData(), GetNumModel(), TGo4FitModel::GetRatioValueFor(), TGo4FitData::MakeIter(), TGo4FitDataIter::Next(), PointFitFunction(), RebuildAll(), TGo4FitDataIter::Reset(), TGo4FitDataIter::ScalesSize(), TGo4FitDataIter::StandardDeviation(), and TGo4FitDataIter::Value().

Referenced by CalculateFitFunction(), and DoCalculation().

Double_t TGo4Fitter::PointFitFunction Int_t  FitFunctionType,
Double_t  value,
Double_t  modelvalue,
Double_t  standdev
[protected]
 

Definition at line 475 of file TGo4Fitter.cxx.

References ff_chi_gamma, ff_chi_Neyman, ff_chi_Pearson, ff_chi_square, ff_least_squares, ff_ML_Poisson, ff_user, and fxUserFitFunction.

Referenced by CalculateFCN().

Bool_t TGo4Fitter::InitFitterData  )  [protected, virtual]
 

Initialize fitter data.

Called during Initialize() method. Should be reimplemented in derived classes.

Reimplemented from TGo4FitterAbstract.

Definition at line 438 of file TGo4Fitter.cxx.

References ff_least_squares, ff_user, fiFitFunctionType, fxUserFitFunction, GetData(), GetMemoryUsage(), GetModel(), GetNumData(), GetNumModel(), TGo4FitModel::Initialize(), and TGo4FitData::Initialize().

void TGo4Fitter::FinalizeFitterData  )  [protected, virtual]
 

Finalize fitter data.

Called during Finalize() method. Should be reimplemented in derived classes.

Reimplemented from TGo4FitterAbstract.

Definition at line 469 of file TGo4Fitter.cxx.

References GetData(), GetModel(), GetNumData(), and GetNumModel().

void TGo4Fitter::MoveDrawObjectsToROOT  )  [private]
 

Definition at line 1142 of file TGo4Fitter.cxx.

Referenced by Draw(), and ~TGo4Fitter().

void TGo4Fitter::CheckSlotsBeforeDelete TGo4FitComponent comp  )  [private]
 

Definition at line 149 of file TGo4Fitter.cxx.

References TGo4FitSlot::ClearConnectionToSlot(), TGo4FitSlotList::ClearSlot(), TGo4FitSlot::GetConnectedSlot(), TGo4FitSlotList::GetSlot(), and TGo4FitSlotList::NumSlots().

Referenced by RemoveData(), and RemoveModel().


Friends And Related Function Documentation

friend class TGo4FitAmplEstimation [friend]
 

Definition at line 387 of file TGo4Fitter.h.

Referenced by AddAmplEstimation().


Member Data Documentation

TObjArray TGo4Fitter::fxDatas [protected]
 

Container for data objects.

Definition at line 421 of file TGo4Fitter.h.

Referenced by AddData(), DeleteAllData(), FindData(), GetData(), GetNumData(), Print(), RemoveData(), and TGo4Fitter().

TObjArray TGo4Fitter::fxModels [protected]
 

Container for model components.

Definition at line 426 of file TGo4Fitter.h.

Referenced by AddModel(), DeleteAllModels(), DeleteModelsAssosiatedTo(), FindModel(), GetModel(), GetNumModel(), Print(), RemoveModel(), and TGo4Fitter().

Int_t TGo4Fitter::fiFitFunctionType [protected]
 

Defines type of fitted function.

Definition at line 431 of file TGo4Fitter.h.

Referenced by DoCalculation(), GetFitFunctionType(), InitFitterData(), Print(), SetFitFunctionType(), and SetUserFitFunction().

Int_t TGo4Fitter::fiMemoryUsage [protected]
 

Defines use of memory during actions executions.

Definition at line 436 of file TGo4Fitter.h.

Referenced by GetMemoryUsage(), and SetMemoryUsage().

TUserFitFunction TGo4Fitter::fxUserFitFunction [private]
 

Pointer on user fit function.

Definition at line 446 of file TGo4Fitter.h.

Referenced by InitFitterData(), PointFitFunction(), and SetUserFitFunction().

TObjArray* TGo4Fitter::fxDrawObjs [private]
 

Definition at line 448 of file TGo4Fitter.h.

Referenced by Draw(), and ProvideLastDrawObjects().


The documentation for this class was generated from the following files:
Generated on Fri Nov 28 13:00:59 2008 for Go4-v3.04-1 by  doxygen 1.4.2