56 if ((nslots < 0) || (nslots == oldnum))
60 for (Int_t n = oldnum; n < nslots; n++) {
61 TString name(
"Trans");
63 fxAxisTrans.Add(
new TGo4FitSlot(name.Data(),
"Axis transformation",
this, TGo4FitAxisTrans::Class(), kFALSE));
66 for (Int_t n = oldnum; n > nslots; n--) {
126 TObject *obj = iter->CreateDrawObject(ObjName);
141 Bool_t use = ((UseBuffers < 0) &&
GetUseBuffers()) || (UseBuffers > 0);
158 if (iter->HasIndexes())
161 if (iter->HasWidths())
184 }
while (iter->Next());
240 if (iter->Reset(kFALSE) && (iter->ScalesSize() <= naxis)) {
241 min = iter->Scales()[naxis];
244 Double_t value = iter->Scales()[naxis];
247 else if (value > max)
249 }
while (iter->Next(kFALSE));
262 if (iter->Reset(kFALSE))
263 res = iter->IndexesSize();
271 return iter ? iter->CountPoints(kTRUE) : 0;
305 if (iter->Reset(kFALSE))
317 for (Int_t nbin = 0; nbin <
GetBinsSize(); nbin++) {
322 ModelMask[nbin] = res ? 1 : 0;
330 ModelMask[nbin] = res ? 1 : 0;
332 }
while (iter->Next());
346 std::cout <<
" Data type: ";
348 case 1: std::cout <<
"histogram" << std::endl;
break;
349 case 2: std::cout <<
"graph" << std::endl;
break;
350 default: std::cout <<
fiDataType << std::endl;
352 std::cout <<
" Use bin scale: " <<
fbUseBinScale << std::endl;
353 std::cout <<
" Take sigmas from: ";
355 case 0: std::cout <<
"none" << std::endl;
break;
356 case 1: std::cout <<
"data" << std::endl;
break;
357 case 2: std::cout <<
"const value " <<
GetSigmaValue() << std::endl;
break;
360 std::cout <<
" Axis transformation data: " << std::endl;
364void TGo4FitData::Streamer(TBuffer &b)
368 TGo4FitData::Class()->ReadBuffer(b,
this);
370 for (Int_t n = 0; n <=
fxAxisTrans.GetLast(); n++) {
376 TGo4FitData::Class()->WriteBuffer(b,
this);
439 for (Int_t n = 0; n <
fxScales.GetSize(); n++)
443 for (Int_t n = 0; n <
fxScales.GetSize(); n++)
446 for (Int_t n = 0; n <
fxWidths.GetSize(); n++)
460 fxWidths[n] = TMath::Abs(arr2[n] - arr1[n]);
472 while (n < Index.GetSize()) {
474 if (Index[n] < Limits[n])
563 for (
int n = 0; n <
fxWidths.GetSize(); n++)
570 if (!
Reset(UseRanges))
575 }
while (
Next(UseRanges));
591 }
while (
Next(kFALSE));
607 Double_t *dummy =
nullptr;
608 TH1 *histo =
nullptr;
610 case 1: histo =
new TH1D(HistoName,
"result", Limits[0] + 1, dummy);
break;
611 case 2: histo =
new TH2D(HistoName,
"result", Limits[0] + 1, dummy, Limits[1] + 1, dummy);
break;
613 histo =
new TH3D(HistoName,
"result", Limits[0] + 1, dummy, Limits[1] + 1, dummy, Limits[2] + 1, dummy);
615 default:
return nullptr;
618 histo->SetDirectory(
nullptr);
621 for (Int_t n = 0; n < NumDim; n++)
622 Axises[n] =
new Double_t[Limits[n] + 2];
626 if (
Reset(UseRanges))
630 case 1: histo->SetBinContent(
Indexes()[0] + 1, ampl *
Value());
break;
634 for (Int_t n = 0; n < NumDim; n++) {
639 }
while (
Next(UseRanges));
641 histo->GetXaxis()->Set(Limits[0] + 1, Axises[0]);
643 histo->GetYaxis()->Set(Limits[1] + 1, Axises[1]);
645 histo->GetZaxis()->Set(Limits[2] + 1, Axises[2]);
647 for (Int_t n = 0; n < NumDim; n++)
659 TGraph *gr =
new TGraph(NumPoints);
660 gr->SetName(GraphName);
661 if (
Reset(UseRanges))
663 (gr->GetX())[
Point()] =
x();
666 }
while (
Next(UseRanges));
Base class for axis transformation objects.
virtual void Transformation(Double_t *scales, Int_t naxis)=0
Bool_t CheckRangeConditions(const Double_t *values, Int_t numaxis)
Check all range conditions for specified point.
Bool_t GetUseBuffers() const
Returns flag of usage of additional buffers.
TGo4FitParameter * NewAmplitude(const char *Name=nullptr, Double_t iValue=0., Bool_t IsFixed=kFALSE, Int_t AtIndx=0)
Create amplitude parameter with specified properties.
TGo4FitComponent()
Default constructor.
Double_t GetAmplValue()
Return value of amplitude parameter.
void Print(Option_t *option="") const override
Print info about object on standard output.
TGraph * CreateGraph(const char *GraphName, Bool_t UseRanges=kFALSE, Bool_t SetBins=kFALSE)
Create TGraph object with appropriate to data object size.
Double_t xWidths() const
Return production of all width parameters (1 if no widths)
const Double_t * Widths() const
Return scales widths values.
Double_t fdStandardDeviation
virtual ~TGo4FitDataIter()
Destroys TGo4FitDataIter object.
virtual Bool_t Next(Bool_t UseRanges=kTRUE)
Shift pointer to next data point.
virtual Bool_t StartReset()=0
Reset pointer and other specific values to the beginning of data.
Bool_t ProduceScales(const Int_t *index, const Double_t *ownscales, const Double_t *ownwidths)
Converts scale values.
Bool_t GetDeviation()
Calculates standard deviation from GetSigmaValue() of data object.
Bool_t DefineIndexesLimits(TArrayI &Limits)
Iterate over all data points and returns maximum value for indexes.
Bool_t NextIndex(TArrayI &Index, TArrayI &Limits)
Producing next indexes set according limits values.
virtual Bool_t Reset(Bool_t UseRanges=kTRUE)
Initialize iterator and positioning pointer on first point.
Bool_t HasWidths() const
Return kTRUE, if scale widths values exists.
Bool_t HasIndexes() const
Return kTRUE, if data object has indexes.
const Int_t * Indexes() const
Return indexes for current data point.
Int_t CountPoints(Bool_t UseRanges=kTRUE)
Counts total number of points in data object.
Double_t Value() const
Return bin content (Value) for current point.
virtual Bool_t ReadCurrentPoint()=0
Perform specific actions to read all values from data object.
Bool_t CheckPointForRange()
Check range conditions and amplitude threshold for current point.
void TransformScales(Double_t *scales)
Transform scales values, using transformation objects in data.
Double_t x() const
Return current x coordinate if exists, otherwise 0.
TGo4FitDataIter()
Default constructor.
const Double_t * Scales() const
Return scale values for current data points.
TH1 * CreateHistogram(const char *HistoName, Bool_t UseRanges=kFALSE, Bool_t SetBins=kFALSE)
Create histogram (if possible) with appropriate to data object dimensions number and size.
Bool_t ReserveArrays(Int_t NumDimen, Int_t NumOwnAxis, Bool_t HasWidth)
Reserve buffers for indexes, scales and width values.
virtual Bool_t ShiftToNextPoint()=0
Move pointer to following data point.
virtual TGo4FitData * GetData() const =0
Return pointer on correspondent TGo4FitData object, which create iterator.
Int_t ScalesSize() const
Return size (number) of scale values for each data point.
Int_t Point() const
Return number of current point, starting from 0.
Int_t IndexesSize() const
Return size (number of dimensions) of data indexes.
TObject * CreateDrawObject(const char *ObjName)
Create either histogram or graph object.
Basic abstract class for representing data, which should be fitted.
Double_t * fxStandDev
Buffer for standard deviations of bins values.
const Double_t * GetWidthValues(Int_t nbin) const
Return scales width values for specified index from buffer.
const Double_t * GetScaleValues(Int_t nbin) const
Return scale values for specified index from buffer.
Bool_t fbUseBinScale
Use binary numbers as scale values.
Int_t GetNumberOfTransSlots() const
Return number of slots for scale transformation objects.
TGo4FitAxisTrans * GetAxisTrans(Int_t nslot) const
Return transformation object for given slot.
Int_t DefineDimensions()
Define dimension number of data Create iterator and checks number of dimension.
Double_t * fxBinsResult
Buffer for complete model of bins values.
TObject * CreateDrawObject(const char *ObjName)
Creates object, which can be drawn on canvas by ROOT.
Int_t * fxFullIndex
Store combination of indexes for each data bins.
Double_t fdSigmaValue
Value of sigma when fiTakeSigmasFrom = 2.
Bool_t BuffersAllocated() const
Checks, if buffers allocated for data.
Int_t GetBinsSize() const
Return number of data bins in buffers.
Int_t fiDataType
Specified type of data: 0 - Histogram, 1 - graphics, 2 and so on - user defined.
void SetAxisTrans(Int_t nslot, TGo4FitAxisTrans *Trans, Bool_t TransOwned=kFALSE)
Sets transformation object for given slot.
void SetAxisTransNeeded(Int_t nslot, Bool_t iNeeded=kFALSE)
Specified, when iNeeded = kTRUE, that transformation object should always be provided to data.
Int_t fiTakeSigmasFrom
Specify sigma source.
Double_t * fxFullScale
Array of axis values for each bins.
void ResetAllPoinetrs()
Clears (sets to 0) all pointers, used for buffer allocations.
Int_t GetSigmaSource() const
Return source of sigma values.
Int_t GetIndexesSize() const
Returns dimension of indexes arrays.
Double_t * fxValues
Buffer for bins values.
const Int_t * GetFullIndex(Int_t nbin) const
Return indexes values for specified data bin from buffer.
virtual ~TGo4FitData()
Destroys TGo4FitData object.
Int_t fiScalesSize
Number of scales values for each point.
Int_t GetDataType() const
Returns type of data source.
Int_t fiIndexesSize
Number of indexes for each point.
Bool_t SetNumberOfTransSlots(Int_t nslots)
Sets number of slots for scale transformation objects.
Bool_t DefineScaleMinMax(Int_t naxis, Double_t &min, Double_t &max)
Return scales minimum and maximum for specified axis.
Int_t fiBinsSize
Number of entries in buffers.
void FillSlotList(TSeqCollection *list) override
Copy pointers on all slots of data object to list.
TGo4FitData()
Default constructor.
virtual void Finalize()
Removes all buffers, created in initialize() routine.
virtual Bool_t Initialize(Int_t UseBuffers=-1)
Initialize data object.
Bool_t GetUseBinScale() const
Returns kTRUE, if binary numbers used as scale values.
void AddAxisTrans(TGo4FitAxisTrans *Trans, Bool_t TransOwned=kFALSE)
Add transformation object to data.
Double_t GetSigmaValue() const
Return constant sigma value.
Double_t GetExcludeLessThen() const
Returns limit, which uses to exclude bins, less then this limit.
virtual Bool_t IsAnyDataTransform() const
Return kTRUE, if either initial data axis or data bins are transformed by TGo4FitData object.
Double_t fdExcludeLessThen
Sets limit for exclude bins, which less then this limit.
void ReleaseAllPointers()
Release all memory, allocated for buffers.
virtual std::unique_ptr< TGo4FitDataIter > MakeIter()
Creates iterator for data object.
Double_t * fxFullWidth
Array of width values for each bin.
void Print(Option_t *option="") const override
Display information about data object on standard output.
Int_t DefineBinsSize()
Defines number of selected bins in data Creates iterator and sequentially checks all points.
TGo4FitSlot * GetAxisTransSlot(Int_t nslot) const
Return slot for transformation object.
TObjArray fxAxisTrans
Array of slots for scale transformation objects.
Int_t GetScalesSize() const
Returns number of axis values for each point.
void ApplyRangesForModelMask(TGo4FitComponent *model, Char_t *ModelMask)
Exclude points from model according model range conditions.
Bool_t IsCompatibleData(TGo4FitData *data)
Checks, if data has same dimensions number and size of each dimensions.
Bool_t IsAllParsFixed()
Returns true, if all parameters in list fixed;.
virtual void FillSlotList(TSeqCollection *lst)
Fill list of TGo4FitSlot objects to provided collection.
void SetUpdateSlotList()
Update internal list of slots (if exists).
Managing pointers on specific objects.
void SetDefaults(TNamed *iOwner, TClass *iClass)
Set basic fields of slot.
TObject * GetObject() const
Return pointer on assigned object.