GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
TGo4FitModelFromData Class Reference

#include <TGo4FitModelFromData.h>

+ Inheritance diagram for TGo4FitModelFromData:

Public Member Functions

 TGo4FitModelFromData ()
 
 TGo4FitModelFromData (const char *iName, TGo4FitData *iDataAsModel=nullptr, Bool_t Amplitude=kTRUE)
 
 TGo4FitModelFromData (const char *iName, TH1 *, Bool_t iOwned=kFALSE, Bool_t Amplitude=kTRUE)
 
 ~TGo4FitModelFromData ()
 
TGo4FitDataGetDataAsModel () const
 
void SetDataAsModel (TGo4FitData *iData, Bool_t iOwned)
 
void FillSlotList (TSeqCollection *list) override
 
void Print (Option_t *option="") const override
 
Bool_t BeforeEval (Int_t) override
 
Double_t EvalN (const Double_t *) override
 
void AfterEval () override
 
Double_t EvaluateAtPoint (TGo4FitData *data, Int_t nbin, Bool_t UseRanges=kTRUE) override
 
Double_t EvaluateAtPoint (std::unique_ptr< TGo4FitDataIter > &iter, Bool_t UseRanges=kTRUE) override
 
- Public Member Functions inherited from TGo4FitModel
 TGo4FitModel ()
 
 TGo4FitModel (const char *iName, const char *iTitle, Bool_t MakeAmplitude=kFALSE)
 
virtual ~TGo4FitModel ()
 
void SetGroupIndex (Int_t index=-1)
 
void SetBackgroundGroupIndex ()
 
Int_t GetGroupIndex () const
 
Int_t NumAssigments () const
 
const char * AssignmentName (Int_t n)
 
void AssignToData (const char *DataName, Double_t RatioValue=1., Bool_t FixRatio=kFALSE)
 
Bool_t IsAssignTo (const char *DataName) const
 
void ChangeDataNameInAssignments (const char *oldname, const char *newname)
 
void ClearAssignmentTo (const char *DataName)
 
void ClearAssigmentTo (const char *DataName)
 
void ClearAssignments ()
 
void ConnectToDataIfAssigned (TGo4FitData *data)
 
Double_t GetRatioValueFor (const char *DataName)
 
void Print (Option_t *option="") const override
 
virtual Double_t Evaluate (Double_t x)
 
virtual Double_t Evaluate (Double_t x, Double_t y)
 
virtual Double_t Evaluate (Double_t x, Double_t y, Double_t z)
 
virtual Double_t Evaluate (Double_t *v, Int_t ndim)
 
virtual Double_t Integral ()
 
virtual Bool_t GetPosition (Int_t naxis, Double_t &pos)
 
virtual Bool_t SetPosition (Int_t naxis, Double_t pos)
 
virtual Bool_t GetWidth (Int_t naxis, Double_t &width)
 
virtual Bool_t SetWidth (Int_t naxis, Double_t width)
 
void SetIntegrationsProperty (Int_t iMinIntegrDepth, Int_t iMaxIntegrDepth=0, Double_t iIntegrEps=0., Bool_t iAbsoluteEps=kFALSE, Bool_t iIntegrScaling=kFALSE)
 
Bool_t NeedIntegration () const
 
Bool_t AddModelToDataResult (TGo4FitData *data)
 
Int_t NumPars () override
 
- Public Member Functions inherited from TGo4FitComponent
 TGo4FitComponent ()
 
 TGo4FitComponent (const char *iName, const char *iTitle)
 
virtual ~TGo4FitComponent ()
 
TGo4FitParameterGetAmplPar ()
 
const char * GetAmplName ()
 
const char * GetAmplFullName ()
 
Double_t GetAmplValue ()
 
void SetAmplValue (Double_t iAmpl)
 
Double_t GetAmplError ()
 
void SetAmplError (Double_t iError)
 
Bool_t MakeAmpl (Bool_t isFixed=kFALSE)
 
Bool_t RemoveAmpl ()
 
virtual Bool_t CanAmplTouch ()
 
void SetRange (Int_t naxis, Double_t min, Double_t max)
 
void ExcludeRange (Int_t naxis, Double_t min, Double_t max)
 
void SetRangeMin (Int_t naxis, Double_t value)
 
void SetRangeMax (Int_t naxis, Double_t value)
 
void AddRangeCut (TCutG *cut, Bool_t exclude=kFALSE)
 
void ClearRanges (Int_t naxis=-1)
 
Bool_t IsAnyRangeLimits () const
 
Bool_t GetRangeMin (Int_t naxis, Double_t &value) const
 
Bool_t GetRangeMax (Int_t naxis, Double_t &value) const
 
Int_t GetNumRangeCondition () const
 
void GetRangeCondition (Int_t n, Int_t &typ, Int_t &naxis, Double_t &left, Double_t &right) const
 
void SetRangeCondition (Int_t n, Int_t typ, Int_t naxis, Double_t left, Double_t right)
 
void AddRangeCondition (Int_t typ, Int_t naxis, Double_t left, Double_t right)
 
void RemoveRangeCondition (Int_t n)
 
Int_t GetNumRangeCut () const
 
TCutG * GetRangeCut (Int_t n) const
 
Bool_t IsRangeCutExcluding (Int_t n) const
 
void SetRangeCutExcluding (Int_t n, Bool_t exclude=kTRUE)
 
void RemoveRangeCut (Int_t n)
 
Bool_t CheckRangeConditions (const Double_t *values, Int_t numaxis)
 
void CollectParsTo (TGo4FitParsList &list) override
 
void SetUseBuffers (Bool_t iUse)
 
Bool_t GetUseBuffers () const
 
void Print (Option_t *option="") const override
 
- Public Member Functions inherited from TGo4FitParsList
 TGo4FitParsList ()
 
 TGo4FitParsList (Bool_t IsParsOwned)
 
 TGo4FitParsList (const char *Name, const char *Title, Bool_t IsParsOwned)
 
virtual ~TGo4FitParsList ()
 
TGo4FitParameterGetPar (Int_t n)
 
Int_t GetParIndex (const TGo4FitParameter *par)
 
TGo4FitParameterFindPar (const char *ParName)
 
TGo4FitParameterFindPar (const char *OwnerFullName, const char *ParName)
 
TGo4FitParameterFindPar (TGo4FitParameter *par)
 
Double_t GetParValue (const char *ParName)
 
Bool_t SetParValue (const char *ParName, Double_t iValue)
 
void GetParsValues (Double_t *pars)
 
void SetParsValues (Double_t *pars)
 
Double_t GetParError (const char *ParName)
 
Bool_t SetParError (const char *ParName, Double_t iError)
 
virtual Bool_t SetParFixed (const char *ParName, Bool_t iFixed=kTRUE)
 
virtual Bool_t GetParFixed (const char *ParName)
 
Int_t NumFixedPars ()
 
Int_t NumFreePars ()
 
virtual Bool_t SetParRange (const char *ParName, Double_t RangeMin, Double_t RangeMax)
 
virtual Bool_t GetParRange (const char *ParName, Double_t &RangeMin, Double_t &RangeMax)
 
virtual Bool_t SetParEpsilon (const char *ParName, Double_t Epsilon)
 
virtual Bool_t GetParEpsilon (const char *ParName, Double_t &Epsilon)
 
void SetParName (Int_t n, const char *name)
 
const char * GetParName (Int_t n)
 
const char * GetParFullName (Int_t n)
 
void SetParsNames (const char *name0="Par0", const char *name1="Par1", const char *name2="Par2", const char *name3="Par3", const char *name4="Par4", const char *name5="Par5", const char *name6="Par6", const char *name7="Par7", const char *name8="Par8", const char *name9="Par9")
 
void SetParsValues (Double_t par0=0., Double_t par1=0., Double_t par2=0., Double_t par3=0., Double_t par4=0., Double_t par5=0., Double_t par6=0., Double_t par7=0., Double_t par8=0., Double_t par9=0.)
 
virtual void MemorizePars ()
 
virtual bool CanRollbackPars ()
 
virtual void RememberPars ()
 
Bool_t IsAllParsFixed ()
 
TGo4FitParameterCreatePar (const char *ParName, const char *Title, Double_t iValue=0)
 
Bool_t RemovePar (const char *name)
 
Bool_t RemovePar (TGo4FitParameter *par)
 
void Print (Option_t *option="") const override
 
void PrintPars () const
 
void ClearPars ()
 
- Public Member Functions inherited from TGo4FitNamed
 TGo4FitNamed ()
 
 TGo4FitNamed (const char *Name, const char *Title, TNamed *Owner=nullptr)
 
virtual ~TGo4FitNamed ()
 
const char * GetFullName ()
 
const char * GetOwnerFullName ()
 
void SetOwner (TNamed *iOwner)
 
TNamed * GetOwner ()
 
void Print (Option_t *option="") const override
 
- Public Member Functions inherited from TGo4FitSlotList
 TGo4FitSlotList ()
 
virtual ~TGo4FitSlotList ()
 
void SetUpdateSlotList ()
 
const TObjArray * GetSlotList (Bool_t ForceUpdate=kFALSE)
 
Int_t NumSlots ()
 
TGo4FitSlotGetSlot (Int_t nslot)
 
TGo4FitSlotFindSlot (const char *FullSlotName)
 
Bool_t ConnectSlots (TGo4FitSlot *slot1, TGo4FitSlot *slot2)
 
Bool_t ConnectSlots (const char *Slot1FullName, const char *Slot2FullName)
 
TGo4FitSlotSetObject (TObject *obj, Bool_t iOwned=kFALSE)
 
TGo4FitSlotSetObject (const char *PlaceName, TObject *obj, Bool_t iOwned=kFALSE)
 
TGo4FitSlotIsObjectInSlots (TObject *obj)
 
Bool_t CheckObjects (Bool_t MakeOut=kTRUE)
 
Bool_t IsEmptySlots ()
 
void ClearObjects (const char *PlaceName=nullptr, Bool_t NonOwned=kTRUE)
 
void ClearSlot (TGo4FitSlot *slot, Bool_t NonOwned)
 
void SetSaveFlagForObjects (Int_t iSaveFlag, const char *PlaceName=nullptr)
 

Protected Member Functions

Bool_t Initialize (Int_t UseBuffers=-1) override
 
Double_t FindDataPoint (Int_t NumIndexes, const Int_t *Indexes)
 
- Protected Member Functions inherited from TGo4FitModel
TGo4FitParameterGet (Int_t n) override
 
Double_t EvaluateAndIntegrate (Int_t NumScales, const Double_t *Scales, const Double_t *Widths)
 
virtual void Finalize ()
 
TGo4FitDataGetAssignedConnection (Int_t n)
 
Bool_t BuffersAllocated () const
 
void RebuildShape (Bool_t ForceBuild=kFALSE)
 
Double_t * GetModelBins (const char *DataName) const
 
void SetNeedToRebuild ()
 
virtual Double_t UserFunction (Double_t *, Double_t *)
 
virtual Int_t GetPosParIndex (Int_t)
 
virtual Int_t GetWidthParIndex (Int_t)
 
virtual TGo4FitParameterGetPosPar (Int_t naxis=0)
 
virtual TGo4FitParameterGetWidthPar (Int_t naxis=0)
 
const Int_t * GetDataFullIndex (TGo4FitData *data, Int_t nbin)
 
Int_t GetDataIndexesSize (TGo4FitData *data)
 
- Protected Member Functions inherited from TGo4FitComponent
TGo4FitParameterNewParameter (const char *Name, const char *Title, Double_t iValue=0., Bool_t Fixed=kFALSE, Int_t AtIndx=-1)
 
TGo4FitParameterNewAmplitude (const char *Name=nullptr, Double_t iValue=0., Bool_t IsFixed=kFALSE, Int_t AtIndx=0)
 
Int_t GetAmplIndex () const
 
void SetAmplIndex (Int_t iAmplIndex=-1)
 
- Protected Member Functions inherited from TGo4FitParsList
TGo4FitParameterAddPar (TGo4FitParameter *par)
 
TGo4FitParameterInsertPar (TGo4FitParameter *par, Int_t indx)
 
void SetParsOwner (TGo4FitNamed *iOwner)
 
void ClearParsBlocking ()
 
TGo4FitParameterFind (const char *ParName)
 
TGo4FitParameterFind (const char *OwnerFullName, const char *ParName)
 
TGo4FitParameterFind (TGo4FitParameter *par)
 
Bool_t RemoveParByIndex (Int_t indx)
 
- Protected Member Functions inherited from TGo4FitSlotList
void CheckDuplicatesOnSlot ()
 
void PrepareSlotsForWriting ()
 
 ClassDef (TGo4FitSlotList, 1)
 

Protected Attributes

TGo4FitSlot fxData
 
- Protected Attributes inherited from TGo4FitModel
Int_t fiMinIntegrDepth {0}
 
Int_t fiMaxIntegrDepth {0}
 
Double_t fdIntegrEps {0}
 
Bool_t fbAbsoluteEps {kFALSE}
 
Bool_t fbIntegrScaling {kFALSE}
 
- Protected Attributes inherited from TGo4FitSlotList
TObjArray * fxSlotList {nullptr}
 
Bool_t fbUpdateSlotList {kFALSE}
 

Private Attributes

std::unique_ptr< TGo4FitDataIterfxIter
 

Detailed Description

Model object, which is uses TGo4FitData object to produce model bins.

In constructor one should just specify data object (it may be TGo4FitDataHistogram or other), which will be used as model. Optionally, amplitude parameter can be created. For instance:

TH1 *histo = GetHistogramSomewhere(); TGo4FitDataHistogram *h = new TGo4FitDataHistogram("hdata", histo, kFALSE); TGo4FitModelFromData *m = new TGo4FitModelFromData("hmodel", h, kFALSE);

The dimensions and bins number on each axis of data object, used in model, should be absolutely the same, as in data object, which should be fitted. Assigned data object will be owned by TGo4FitModelFromData object. But data source object (histogram "histo" in example) may not be owned by object and may be provided later by SetObject() method of fitter.

TGo4Fitter *fitter = GetFitterSomewhere(); TH1 *histo = GetHistogramSomewhere(); fitter->SetObject(histo, "hdata");

The name of data object "hdata" instead of model object "hmodel" should be used, when assigning data to TGo4FitModelFromData object via SetObject() method of fitter.

Definition at line 41 of file TGo4FitModelFromData.h.

Constructor & Destructor Documentation

◆ TGo4FitModelFromData() [1/3]

TGo4FitModelFromData::TGo4FitModelFromData ( )

Default constructor.

Definition at line 20 of file TGo4FitModelFromData.cxx.

◆ TGo4FitModelFromData() [2/3]

TGo4FitModelFromData::TGo4FitModelFromData ( const char *  iName,
TGo4FitData iDataAsModel = nullptr,
Bool_t  Amplitude = kTRUE 
)

Creates TGo4FitModelFromData object with given name. Pointer on TGo4FitData object and usage of amplitude can be specified.

Definition at line 22 of file TGo4FitModelFromData.cxx.

◆ TGo4FitModelFromData() [3/3]

TGo4FitModelFromData::TGo4FitModelFromData ( const char *  iName,
TH1 *  histo,
Bool_t  iOwned = kFALSE,
Bool_t  Amplitude = kTRUE 
)

Creates TGo4FitModelFromData object with given name, which uses external histogram as model component. In constructor TGo4FitDataHistogram object will be created, to which histogram will be assigned. Additionally ownership flag for histogram and usage of amplitude can be specified.

Definition at line 29 of file TGo4FitModelFromData.cxx.

References SetDataAsModel().

◆ ~TGo4FitModelFromData()

TGo4FitModelFromData::~TGo4FitModelFromData ( )

Destroy TGo4FitModelFromData object

Definition at line 36 of file TGo4FitModelFromData.cxx.

Member Function Documentation

◆ AfterEval()

void TGo4FitModelFromData::AfterEval ( )
overridevirtual

Clear buffers, which were created by BeforeEval() method.

Reimplemented from TGo4FitModel.

Definition at line 88 of file TGo4FitModelFromData.cxx.

References fxIter.

Referenced by EvalN().

◆ BeforeEval()

Bool_t TGo4FitModelFromData::BeforeEval ( Int_t  ndim)
overridevirtual

Prepares (if necessary) some intermediate variables to be able calculate values of model via EvalN() function. Number of axis, which will be used in evaluations, should be specified.

Reimplemented from TGo4FitModel.

Definition at line 66 of file TGo4FitModelFromData.cxx.

References fxIter, GetDataAsModel(), and TGo4FitData::MakeIter().

◆ EvalN()

Double_t TGo4FitModelFromData::EvalN ( const Double_t *  v)
inlineoverridevirtual

Calculates value of model according current parameters values and provided axes values. BeforeEval(), EvalN() & AfterEval() virtual methods provides general interface, where user-specific code should be situated.

Reimplemented from TGo4FitModel.

Definition at line 88 of file TGo4FitModelFromData.h.

References AfterEval(), EvaluateAtPoint(), FindDataPoint(), and Initialize().

◆ EvaluateAtPoint() [1/2]

Double_t TGo4FitModelFromData::EvaluateAtPoint ( TGo4FitData data,
Int_t  nbin,
Bool_t  UseRanges = kTRUE 
)
overridevirtual

Evaluate model value for specified data point. All scales values will be take from data buffers, therefore data should be initialized.

Reimplemented from TGo4FitModel.

Definition at line 78 of file TGo4FitModelFromData.cxx.

References FindDataPoint(), TGo4FitModel::GetDataFullIndex(), and TGo4FitModel::GetDataIndexesSize().

Referenced by EvalN().

◆ EvaluateAtPoint() [2/2]

Double_t TGo4FitModelFromData::EvaluateAtPoint ( std::unique_ptr< TGo4FitDataIter > &  iter,
Bool_t  UseRanges = kTRUE 
)
overridevirtual

Evaluate model value for point, specified by current values of iterator.

Reimplemented from TGo4FitModel.

Definition at line 83 of file TGo4FitModelFromData.cxx.

References FindDataPoint(), TGo4FitDataIter::Indexes(), and TGo4FitDataIter::IndexesSize().

◆ FillSlotList()

void TGo4FitModelFromData::FillSlotList ( TSeqCollection *  list)
overridevirtual

Add pointer on slot, which should contain TGo4FitData object, to a slots list.

Reimplemented from TGo4FitSlotList.

Definition at line 93 of file TGo4FitModelFromData.cxx.

References TGo4FitData::FillSlotList(), TGo4FitSlotList::FillSlotList(), fxData, and GetDataAsModel().

◆ FindDataPoint()

Double_t TGo4FitModelFromData::FindDataPoint ( Int_t  NumIndexes,
const Int_t *  Indexes 
)
protected

Definition at line 109 of file TGo4FitModelFromData.cxx.

References fxIter.

Referenced by EvalN(), and EvaluateAtPoint().

◆ GetDataAsModel()

TGo4FitData * TGo4FitModelFromData::GetDataAsModel ( ) const

Return pointer on TGo4FitData object, which is used as model component.

Definition at line 40 of file TGo4FitModelFromData.cxx.

References fxData, and TGo4FitSlot::GetObject().

Referenced by BeforeEval(), FillSlotList(), Initialize(), and Print().

◆ Initialize()

Bool_t TGo4FitModelFromData::Initialize ( Int_t  UseBuffers = -1)
overrideprotectedvirtual

◆ Print()

void TGo4FitModelFromData::Print ( Option_t *  option = "") const
override

Print information on standard output.

Definition at line 101 of file TGo4FitModelFromData.cxx.

References GetDataAsModel(), TGo4FitModel::Print(), and TGo4FitData::Print().

◆ SetDataAsModel()

void TGo4FitModelFromData::SetDataAsModel ( TGo4FitData iData,
Bool_t  iOwned 
)

Sets pointer on TGo4FitData object with ownership flag.

Definition at line 45 of file TGo4FitModelFromData.cxx.

References fxData, TGo4FitSlot::SetObject(), and TGo4FitSlotList::SetUpdateSlotList().

Referenced by TGo4FitModelFromData().

Member Data Documentation

◆ fxData

TGo4FitSlot TGo4FitModelFromData::fxData
protected

Slot for TGo4FitData object, which is used as model component. slot for TGo4FitData

Definition at line 107 of file TGo4FitModelFromData.h.

Referenced by FillSlotList(), GetDataAsModel(), and SetDataAsModel().

◆ fxIter

std::unique_ptr<TGo4FitDataIter> TGo4FitModelFromData::fxIter
private

Definition at line 110 of file TGo4FitModelFromData.h.

Referenced by AfterEval(), BeforeEval(), and FindDataPoint().


The documentation for this class was generated from the following files: