49 std::cout <<
" " << GetName();
55 :
TGo4FitComponent(), fiMinIntegrDepth(0), fiMaxIntegrDepth(0), fdIntegrEps(0.), fbAbsoluteEps(kFALSE),
56 fbIntegrScaling(kFALSE), fxAssigments(), fiGroupIndex(-1), fxCurrentPars(), fxCurrentParsArray(nullptr),
57 fbNeedToRebuild(kFALSE), fxAllPars(nullptr), fxAllParsValues(nullptr)
112 ass->SetName(newname);
155 return ass ? ass->
fxData :
nullptr;
195 Bool_t iAbsoluteEps, Bool_t iIntegrScaling)
220 Bool_t use = ((UseBuffers < 0) && GetUseBuffers()) || (UseBuffers > 0);
224 std::cout <<
"Data " << ass->GetName() <<
" not assigned to model " << GetName() << std::endl;
286 if ((NumScales < 1) || !Scales)
290 TArrayI IntegrIndexes(NumScales);
291 TArrayD ScaleValues(NumScales, Scales);
292 TArrayD WidthValues(NumScales, Widths);
293 TArrayD dScaleValues(NumScales);
295 Int_t *dindx = IntegrIndexes.GetArray();
296 Double_t *vector = ScaleValues.GetArray();
297 Double_t *width = WidthValues.GetArray();
298 Double_t *dvector = dScaleValues.GetArray();
303 for (n = 0; n < NumScales; n++)
304 vector[n] -= 0.5 * width[n];
307 Double_t TotalSum =
EvalN(vector);
308 Int_t TotalNumPnt = 1;
310 Int_t IntegrDepth = 0;
313 Bool_t stopcondition = kFALSE;
318 IntegrIndexes.Reset(0);
324 for (n = 0; n < NumScales; n++)
325 dvector[n] = vector[n] + Step * width[n] * (dindx[n] + 0.5);
327 Sum +=
EvalN(dvector);
333 if (dindx[n] < NumStep)
337 }
while (n < NumScales);
338 }
while (n < NumScales);
341 stopcondition = kFALSE;
344 stopcondition = kTRUE;
346 Double_t v1 = TotalSum / TotalNumPnt;
347 Double_t v2 = Sum / NumPnt;
348 Double_t v = TMath::Abs(v1 - v2);
350 if ((v1 != 0.) || (v2 != 0.))
351 v = v / (TMath::Abs(v1) + TMath::Abs(v2));
356 stopcondition = kTRUE;
360 TotalNumPnt += NumPnt;
364 }
while (!stopcondition);
368 value = TotalSum / TotalNumPnt;
370 for (n = 0; n < NumScales; n++)
374 return EvalN(Scales);
392 const Double_t *scales = iter->
Scales();
432 for (Int_t nbin = 0; nbin < size; nbin++) {
433 if (mask && (mask[nbin] == 0))
460 for (Int_t nbin = 0; nbin < size; nbin++)
461 result[nbin] += ampl * modelbins[nbin];
470 for (Int_t nbin = 0; nbin < size; nbin++)
484 fxCurrentParsArray++;
507 Double_t vector[2] = {x, y};
518 Double_t vector[3] = {x, y, z};
561 res.Form(
"Ratio%d", n);
574 std::cout <<
" Assigned to: ";
576 std::cout << std::endl;
580 std::cout <<
" absolute";
582 std::cout <<
" relative";
583 std::cout <<
" error " <<
fdIntegrEps << std::endl;
587 void TGo4FitModel::Streamer(TBuffer &b)
590 TGo4FitModel::Class()->ReadBuffer(b,
this);
595 TGo4FitModel::Class()->WriteBuffer(b,
this);
TString GetRatioName(Int_t n)
Double_t GetValue() const
void Print(Option_t *option="") const override
void CollectParsTo(TGo4FitParsList &list) override
Int_t GetDataIndexesSize(TGo4FitData *data)
virtual Double_t Evaluate(Double_t x)
Double_t * fxCurrentParsArray
Bool_t CheckRangeConditions(const Double_t *values, Int_t numaxis)
virtual ~TGo4FitAssignment()
const Double_t * Scales() const
TGo4FitParameter * GetPar(Int_t n)
const Double_t * GetScaleValues(Int_t nbin) const
virtual TGo4FitParameter * GetWidthPar(Int_t naxis=0)
void AssignToData(const char *DataName, Double_t RatioValue=1., Bool_t FixRatio=kFALSE)
Int_t GetAmplIndex() const
virtual Bool_t SetPosition(Int_t naxis, Double_t pos)
TGo4FitParameter * NewAmplitude(const char *Name=nullptr, Double_t iValue=0., Bool_t IsFixed=kFALSE, Int_t AtIndx=0)
Double_t * GetBinsResult() const
TGo4FitAssignment * FindAssigment(const char *DataName) const
const Double_t * Widths() const
virtual Double_t Integral()
void ClearAssignmentTo(const char *DataName)
void SetOwner(TNamed *iOwner)
void Print(Option_t *option="") const override
virtual Double_t EvaluateAtPoint(TGo4FitData *data, Int_t nbin, Bool_t UseRanges=kTRUE)
virtual Bool_t GetPosition(Int_t naxis, Double_t &pos)
const Int_t * GetFullIndex(Int_t nbin) const
void ChangeDataNameInAssignments(const char *oldname, const char *newname)
TGo4FitParameter * Get(Int_t n) override
TGo4FitData * GetAssignedConnection(Int_t n)
virtual Double_t UserFunction(Double_t *, Double_t *)
Bool_t IsAnyRangeLimits() const
virtual Bool_t Initialize(Int_t UseBuffers=-1)
TGo4FitAssignment * GetAssigment(Int_t n)
virtual Bool_t BeforeEval(Int_t ndim)
TGo4FitParameter * fxRatio
void ConnectToDataIfAssigned(TGo4FitData *data)
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)
virtual Bool_t GetWidth(Int_t naxis, Double_t &width)
Int_t NumAssigments() const
TGo4FitParsList * fxAllPars
Double_t EvaluateAndIntegrate(Int_t NumScales, const Double_t *Scales, const Double_t *Widths)
const Double_t * GetWidthValues(Int_t nbin) const
void SetValue(Double_t iValue)
virtual TGo4FitParameter * GetPosPar(Int_t naxis=0)
Int_t GetIndexesSize() const
Bool_t BuffersAllocated() const
Bool_t BuffersAllocated() const
void RebuildShape(Bool_t ForceBuild=kFALSE)
virtual TGo4FitParameter * Get(Int_t n)
Double_t * GetModelBins(const char *DataName) const
void SetFixed(Bool_t iFixed)
Bool_t AddModelToDataResult(TGo4FitData *data)
void GetParsValues(Double_t *pars)
TArrayD * fxAllParsValues
Double_t GetRatioValueFor(const char *DataName)
void ApplyRangesForModelMask(TGo4FitComponent *model, Char_t *ModelMask)
const Int_t * GetDataFullIndex(TGo4FitData *data, Int_t nbin)
virtual Double_t EvalN(const Double_t *v)
void Print(Option_t *option="") const override
Int_t GetBinsSize() const
TGo4FitParameter * GetAmplPar()
Int_t GetScalesSize() const