#include <TGo4FitData.h>
Public Member Functions | |
TGo4FitDataIter () | |
virtual | ~TGo4FitDataIter () |
virtual Bool_t | Reset (Bool_t UseRanges=kTRUE) |
virtual Bool_t | Next (Bool_t UseRanges=kTRUE) |
Bool_t | HasIndexes () const |
Int_t | IndexesSize () const |
const Int_t * | Indexes () const |
Bool_t | DefineIndexesLimits (TArrayI &Limits) |
Int_t | ScalesSize () const |
const Double_t * | Scales () const |
Double_t | x () const |
Double_t | y () const |
Double_t | z () const |
Bool_t | HasWidths () const |
const Double_t * | Widths () const |
Double_t | xWidths () const |
Double_t | Value () const |
Double_t | StandardDeviation () const |
Int_t | Point () const |
Bool_t | CheckPointForRange () |
Int_t | CountPoints (Bool_t UseRanges=kTRUE) |
Bool_t | ReachEnd () const |
TH1 * | CreateHistogram (const char *HistoName, Bool_t UseRanges=kFALSE, Bool_t SetBins=kFALSE) |
TGraph * | CreateGraph (const char *GraphName, Bool_t UseRanges=kFALSE, Bool_t SetBins=kFALSE) |
TObject * | CreateDrawObject (const char *ObjName) |
Protected Member Functions | |
virtual TGo4FitData * | GetData () const =0 |
virtual Bool_t | StartReset ()=0 |
virtual Bool_t | ReadCurrentPoint ()=0 |
virtual Bool_t | ShiftToNextPoint ()=0 |
Bool_t | ReserveArrays (Int_t NumDimen, Int_t NumOwnAxis, Bool_t HasWidth) |
void | TransformScales (Double_t *scales) |
Bool_t | ProduceScales (const Int_t *index, const Double_t *ownscales, const Double_t *ownwidths) |
Bool_t | NextIndex (TArrayI &Index, TArrayI &Limits) |
Bool_t | GetDeviation () |
Protected Attributes | |
TArrayI | fxIndexes |
TArrayD | fxScales |
TArrayD | fxWidths |
Double_t | fdValue |
Double_t | fdStandardDeviation |
Int_t | fiNumPoint |
Bool_t | fbReachEnd |
Iterator class for data object. The main aim of TGo4FitDataIter class is provide an sequential access to data, containing in appropriate data object. Each new class of data object should provide also it's own implementation for TGo4FitDataIrter class. To create iterator, MakeIter() method of data object should be used. Iterator has two main methods: Reset() and Next(). First method resets all internal buffers of iterator and positioning pointer on first data point. Next() method shifts to next data pointer. As argument of these methods usage of bins selection mechanism via range conditions or amplitude threshold can be specified. Typical usage of iterator:
TGo4FitDataIter* iter = data->MakeIter(); if (iter->Reset()) do { // do something with values in iterator } while (iter->Next());
Access to most iterator methods like Values(), IndexesSize() and so on can be done only after first call of Reset() method.
Definition at line 423 of file TGo4FitData.h.
TGo4FitDataIter::TGo4FitDataIter | ( | ) |
Default constructor.
Definition at line 354 of file TGo4FitData.cxx.
TGo4FitDataIter::~TGo4FitDataIter | ( | ) | [virtual] |
Destroys TGo4FitDataIter object.
Definition at line 358 of file TGo4FitData.cxx.
Bool_t TGo4FitDataIter::CheckPointForRange | ( | ) |
Check range conditions and amplitude threshold for current point.
Definition at line 446 of file TGo4FitData.cxx.
References TGo4FitComponent::CheckRangeConditions(), GetData(), TGo4FitData::GetExcludeLessThen(), Scales(), ScalesSize(), and Value().
Int_t TGo4FitDataIter::CountPoints | ( | Bool_t | UseRanges = kTRUE |
) |
Counts total number of points in data object. Uses Reset() and Next() methods, therefore change pointer to the data object
Definition at line 498 of file TGo4FitData.cxx.
References Next(), and Reset().
Referenced by TGo4Fitter::CalculatesMomentums(), CreateGraph(), TGo4FitData::DefineBinsSize(), TGo4FitPeakFinder::HansEsselPeakFinder(), TGo4FitData::Initialize(), TGo4FitPeakFinder::ROOTPeakFinder(), and TGo4FitPeakFinder::SergeyLinevPeakFinder().
TObject * TGo4FitDataIter::CreateDrawObject | ( | const char * | ObjName | ) |
Create either histogram or graph object.
Definition at line 582 of file TGo4FitData.cxx.
References CreateGraph(), CreateHistogram(), HasIndexes(), HasWidths(), IndexesSize(), Reset(), and ScalesSize().
Referenced by TGo4FitData::CreateDrawObject().
TGraph * TGo4FitDataIter::CreateGraph | ( | const char * | GraphName, | |
Bool_t | UseRanges = kFALSE , |
|||
Bool_t | SetBins = kFALSE | |||
) |
Create TGraph object with appropriate to data object size. If more than one scales values exists, only first will be used as X-coordinate of TGraph. Bin content (Value()) will be used as Y-coordinate in TGraph. If UseRanges specified, data point selection mechanism will be involved. If SetBins specified, bin content will be copied to histogram.
Definition at line 567 of file TGo4FitData.cxx.
References CountPoints(), TGo4FitComponent::GetAmplValue(), GetData(), Next(), Point(), Reset(), ScalesSize(), Value(), and x().
Referenced by TGo4Fitter::CreateDrawObject(), and CreateDrawObject().
TH1 * TGo4FitDataIter::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. If UseRanges specified, data point selection mechanism will be involved. If SetBins specified, bin content will be copied to histogram.
Definition at line 518 of file TGo4FitData.cxx.
References DefineIndexesLimits(), TGo4FitComponent::GetAmplValue(), GetData(), HasIndexes(), HasWidths(), Indexes(), IndexesSize(), Next(), Reset(), Scales(), ScalesSize(), Value(), and Widths().
Referenced by TGo4Fitter::CreateDrawObject(), and CreateDrawObject().
Bool_t TGo4FitDataIter::DefineIndexesLimits | ( | TArrayI & | Limits | ) |
Iterate over all data points and returns maximum value for indexes.
Definition at line 507 of file TGo4FitData.cxx.
References Indexes(), IndexesSize(), Next(), and Reset().
Referenced by CreateHistogram().
virtual TGo4FitData* TGo4FitDataIter::GetData | ( | ) | const [protected, pure virtual] |
Return pointer on correspondent TGo4FitData object, which create iterator. Should be implemented in derived classes.
Implemented in TGo4FitDataGraphIter, TGo4FitDataHistogramIter, TGo4FitDataProfileIter, and TGo4FitDataRidgeIter.
Referenced by CheckPointForRange(), CreateGraph(), CreateHistogram(), GetDeviation(), Next(), ProduceScales(), ReserveArrays(), and TransformScales().
Bool_t TGo4FitDataIter::GetDeviation | ( | ) | [protected] |
Calculates standard deviation from GetSigmaValue() of data object.
Definition at line 437 of file TGo4FitData.cxx.
References fdStandardDeviation, GetData(), TGo4FitData::GetSigmaSource(), and TGo4FitData::GetSigmaValue().
Referenced by TGo4FitDataRidgeIter::ReadCurrentPoint(), TGo4FitDataProfileIter::ReadCurrentPoint(), TGo4FitDataHistogramIter::ReadCurrentPoint(), and TGo4FitDataGraphIter::ReadCurrentPoint().
Bool_t TGo4FitDataIter::HasIndexes | ( | ) | const [inline] |
Return kTRUE, if data object has indexes.
Definition at line 454 of file TGo4FitData.h.
References IndexesSize().
Referenced by TGo4Fitter::CreateDrawObject(), CreateDrawObject(), CreateHistogram(), and TGo4FitData::Initialize().
Bool_t TGo4FitDataIter::HasWidths | ( | ) | const [inline] |
Return kTRUE, if scale widths values exists.
Definition at line 499 of file TGo4FitData.h.
References fxWidths.
Referenced by TGo4Fitter::CreateDrawObject(), CreateDrawObject(), CreateHistogram(), TGo4FitData::Initialize(), TGo4FitPeakFinder::ROOTPeakFinder(), and xWidths().
const Int_t* TGo4FitDataIter::Indexes | ( | ) | const [inline] |
Return indexes for current data point.
Definition at line 464 of file TGo4FitData.h.
References fxIndexes.
Referenced by TGo4Fitter::CreateDrawObject(), CreateHistogram(), DefineIndexesLimits(), TGo4FitModelFromData::EvaluateAtPoint(), TGo4FitModelFromData::FindDataPoint(), TGo4FitData::Initialize(), and TGo4FitDataRidgeIter::ReadCurrentPoint().
Int_t TGo4FitDataIter::IndexesSize | ( | ) | const [inline] |
Return size (number of dimensions) of data indexes.
Definition at line 459 of file TGo4FitData.h.
References fxIndexes.
Referenced by TGo4FitAmplEstimation::CalculateWithIterators(), TGo4Fitter::CreateDrawObject(), CreateDrawObject(), CreateHistogram(), TGo4FitData::DefineDimensions(), DefineIndexesLimits(), TGo4FitModelFromData::EvaluateAtPoint(), TGo4FitModelFromData::FindDataPoint(), HasIndexes(), TGo4FitData::Initialize(), TGo4FitData::IsCompatibleData(), and TGo4FitDataRidgeIter::StartReset().
Bool_t TGo4FitDataIter::Next | ( | Bool_t | UseRanges = kTRUE |
) | [virtual] |
Shift pointer to next data point. Return kTRUE, if next points exist. If UseRanges = kTRUE (default), selection mechanism of data points via range conditions or amplitude threshold will be involved. Most of iterator routines should be used only after Reset() command.
Definition at line 472 of file TGo4FitData.cxx.
References CheckPointForRange(), fbReachEnd, fiNumPoint, GetData(), ReadCurrentPoint(), and ShiftToNextPoint().
Referenced by TGo4FitData::ApplyRangesForModelMask(), TGo4Fitter::CalculateFCN(), TGo4Fitter::CalculatesIntegral(), TGo4Fitter::CalculatesMomentums(), TGo4FitAmplEstimation::CalculateWithIterators(), CountPoints(), TGo4Fitter::CreateDrawObject(), CreateGraph(), CreateHistogram(), DefineIndexesLimits(), TGo4FitData::DefineScaleMinMax(), TGo4FitModelFromData::FindDataPoint(), TGo4FitPeakFinder::HansEsselPeakFinder(), TGo4FitData::Initialize(), TGo4FitPeakFinder::ROOTPeakFinder(), TGo4FitPeakFinder::SergeyLinevPeakFinder(), and TGo4FitDataRidgeIter::ShiftToNextPoint().
Bool_t TGo4FitDataIter::NextIndex | ( | TArrayI & | Index, | |
TArrayI & | Limits | |||
) | [protected] |
Producing next indexes set according limits values.
Definition at line 427 of file TGo4FitData.cxx.
Referenced by TGo4FitDataHistogramIter::ShiftToNextPoint().
Int_t TGo4FitDataIter::Point | ( | ) | const [inline] |
Return number of current point, starting from 0.
Definition at line 524 of file TGo4FitData.h.
References fiNumPoint.
Referenced by TGo4Fitter::CreateDrawObject(), and CreateGraph().
Bool_t TGo4FitDataIter::ProduceScales | ( | const Int_t * | index, | |
const Double_t * | ownscales, | |||
const Double_t * | ownwidths | |||
) | [protected] |
Converts scale values. Involved when usage of binary number instead scales or axis calibration objects specified to data.
Definition at line 389 of file TGo4FitData.cxx.
References fxScales, fxWidths, GetData(), TGo4FitData::GetDataType(), TGo4FitData::GetNumberOfTransSlots(), TGo4FitData::GetUseBinScale(), ScalesSize(), and TransformScales().
Referenced by TGo4FitDataRidgeIter::ReadCurrentPoint(), TGo4FitDataProfileIter::ReadCurrentPoint(), TGo4FitDataHistogramIter::ReadCurrentPoint(), and TGo4FitDataGraphIter::ReadCurrentPoint().
Bool_t TGo4FitDataIter::ReachEnd | ( | ) | const [inline] |
Checks, if iterator already reach end of data object. This happens, when Next() method return kFALSE value.
Definition at line 541 of file TGo4FitData.h.
References fbReachEnd.
Referenced by TGo4FitModelFromData::FindDataPoint().
virtual Bool_t TGo4FitDataIter::ReadCurrentPoint | ( | ) | [protected, pure virtual] |
Perform specific actions to read all values from data object. Should be implemented in derived classes.
Implemented in TGo4FitDataGraphIter, TGo4FitDataHistogramIter, TGo4FitDataProfileIter, and TGo4FitDataRidgeIter.
Bool_t TGo4FitDataIter::ReserveArrays | ( | Int_t | NumDimen, | |
Int_t | NumOwnAxis, | |||
Bool_t | HasWidth | |||
) | [protected] |
Reserve buffers for indexes, scales and width values. In case of 3-D histogram they consume only 3 Int_t and 6 Double_t points.
Definition at line 361 of file TGo4FitData.cxx.
References fxIndexes, fxScales, fxWidths, GetData(), and TGo4FitData::GetUseBinScale().
Referenced by TGo4FitDataRidgeIter::StartReset(), TGo4FitDataProfileIter::StartReset(), TGo4FitDataHistogramIter::StartReset(), and TGo4FitDataGraphIter::StartReset().
Bool_t TGo4FitDataIter::Reset | ( | Bool_t | UseRanges = kTRUE |
) | [virtual] |
Initialize iterator and positioning pointer on first point. If UseRanges = kTRUE (default), selection mechanism of data points via range conditions or amplitude threshold will be involved. Most of iterator routines should be used only after Reset() command.
Definition at line 453 of file TGo4FitData.cxx.
References CheckPointForRange(), fbReachEnd, fiNumPoint, ReadCurrentPoint(), ShiftToNextPoint(), and StartReset().
Referenced by TGo4FitData::ApplyRangesForModelMask(), TGo4FitModelFromData::BeforeEval(), TGo4Fitter::CalculateFCN(), TGo4Fitter::CalculatesIntegral(), TGo4Fitter::CalculatesMomentums(), TGo4FitAmplEstimation::CalculateWithIterators(), CountPoints(), TGo4Fitter::CreateDrawObject(), CreateDrawObject(), CreateGraph(), CreateHistogram(), TGo4FitData::DefineDimensions(), DefineIndexesLimits(), TGo4FitData::DefineScaleMinMax(), TGo4FitPeakFinder::HansEsselPeakFinder(), TGo4FitData::Initialize(), TGo4FitData::IsCompatibleData(), TGo4FitPeakFinder::ROOTPeakFinder(), TGo4FitPeakFinder::SergeyLinevPeakFinder(), and TGo4FitDataRidgeIter::StartReset().
const Double_t* TGo4FitDataIter::Scales | ( | ) | const [inline] |
Return scale values for current data points.
Definition at line 479 of file TGo4FitData.h.
References fxScales.
Referenced by TGo4FitData::ApplyRangesForModelMask(), CheckPointForRange(), CreateHistogram(), TGo4FitData::DefineScaleMinMax(), TGo4FitModel::EvaluateAtPoint(), TGo4FitData::Initialize(), and TGo4FitDataRidgeIter::ReadCurrentPoint().
Int_t TGo4FitDataIter::ScalesSize | ( | ) | const [inline] |
Return size (number) of scale values for each data point.
Definition at line 474 of file TGo4FitData.h.
References fxScales.
Referenced by TGo4FitData::ApplyRangesForModelMask(), TGo4Fitter::CalculateFCN(), TGo4Fitter::CalculatesIntegral(), TGo4Fitter::CalculatesMomentums(), CheckPointForRange(), TGo4Fitter::CreateDrawObject(), CreateDrawObject(), CreateGraph(), CreateHistogram(), TGo4FitData::DefineScaleMinMax(), TGo4FitModel::EvaluateAtPoint(), TGo4FitPeakFinder::HansEsselPeakFinder(), TGo4FitData::Initialize(), ProduceScales(), TGo4FitDataRidgeIter::ReadCurrentPoint(), TGo4FitPeakFinder::ROOTPeakFinder(), TGo4FitPeakFinder::SergeyLinevPeakFinder(), TGo4FitDataRidgeIter::StartReset(), and TransformScales().
virtual Bool_t TGo4FitDataIter::ShiftToNextPoint | ( | ) | [protected, pure virtual] |
Move pointer to following data point. Should be implemented in derived classes.
Implemented in TGo4FitDataGraphIter, TGo4FitDataHistogramIter, TGo4FitDataProfileIter, and TGo4FitDataRidgeIter.
Double_t TGo4FitDataIter::StandardDeviation | ( | ) | const [inline] |
Return standard deviation of bin content (Value) for current point.
Definition at line 519 of file TGo4FitData.h.
References fdStandardDeviation.
Referenced by TGo4Fitter::CalculateFCN(), TGo4FitAmplEstimation::CalculateWithIterators(), TGo4FitData::Initialize(), and TGo4FitPeakFinder::SergeyLinevPeakFinder().
virtual Bool_t TGo4FitDataIter::StartReset | ( | ) | [protected, pure virtual] |
Reset pointer and other specific values to the beginning of data. Should be implemented in derived classes.
Implemented in TGo4FitDataGraphIter, TGo4FitDataHistogramIter, TGo4FitDataProfileIter, and TGo4FitDataRidgeIter.
Referenced by Reset().
void TGo4FitDataIter::TransformScales | ( | Double_t * | scales | ) | [protected] |
Transform scales values, using transformation objects in data.
Definition at line 380 of file TGo4FitData.cxx.
References TGo4FitData::GetAxisTrans(), GetData(), TGo4FitData::GetNumberOfTransSlots(), ScalesSize(), and TGo4FitAxisTrans::Transformation().
Referenced by ProduceScales().
Double_t TGo4FitDataIter::Value | ( | ) | const [inline] |
Return bin content (Value) for current point.
Definition at line 514 of file TGo4FitData.h.
References fdValue.
Referenced by TGo4Fitter::CalculateFCN(), TGo4Fitter::CalculatesIntegral(), TGo4Fitter::CalculatesMomentums(), TGo4FitAmplEstimation::CalculateWithIterators(), CheckPointForRange(), CreateGraph(), CreateHistogram(), TGo4FitModelFromData::FindDataPoint(), TGo4FitPeakFinder::HansEsselPeakFinder(), TGo4FitData::Initialize(), TGo4FitDataRidgeIter::ReadCurrentPoint(), TGo4FitPeakFinder::ROOTPeakFinder(), TGo4FitPeakFinder::SergeyLinevPeakFinder(), and TGo4FitDataRidgeIter::ShiftToNextPoint().
const Double_t* TGo4FitDataIter::Widths | ( | ) | const [inline] |
Return scales widths values.
Definition at line 504 of file TGo4FitData.h.
References fxWidths.
Referenced by CreateHistogram(), TGo4FitModel::EvaluateAtPoint(), TGo4FitData::Initialize(), and TGo4FitPeakFinder::ROOTPeakFinder().
Double_t TGo4FitDataIter::x | ( | ) | const [inline] |
Return current x coordinate if exists, otherwise 0
Definition at line 484 of file TGo4FitData.h.
References fxScales.
Referenced by TGo4Fitter::CalculatesMomentums(), TGo4Fitter::CreateDrawObject(), CreateGraph(), TGo4FitPeakFinder::HansEsselPeakFinder(), TGo4FitPeakFinder::ROOTPeakFinder(), and TGo4FitPeakFinder::SergeyLinevPeakFinder().
Double_t TGo4FitDataIter::xWidths | ( | ) | const |
Return production of all width parameters (1 if no widths)
Definition at line 489 of file TGo4FitData.cxx.
References fxWidths, and HasWidths().
Referenced by TGo4Fitter::CalculatesIntegral().
Double_t TGo4FitDataIter::y | ( | ) | const [inline] |
Return current y coordinate if exists, otherwise 0
Definition at line 489 of file TGo4FitData.h.
References fxScales.
Double_t TGo4FitDataIter::z | ( | ) | const [inline] |
Return current z coordinate if exists, otherwise 0
Definition at line 494 of file TGo4FitData.h.
References fxScales.
Bool_t TGo4FitDataIter::fbReachEnd [protected] |
Definition at line 626 of file TGo4FitData.h.
Referenced by Next(), ReachEnd(), and Reset().
Double_t TGo4FitDataIter::fdStandardDeviation [protected] |
Definition at line 622 of file TGo4FitData.h.
Referenced by GetDeviation(), TGo4FitDataRidgeIter::ReadCurrentPoint(), TGo4FitDataProfileIter::ReadCurrentPoint(), TGo4FitDataHistogramIter::ReadCurrentPoint(), TGo4FitDataGraphIter::ReadCurrentPoint(), and StandardDeviation().
Double_t TGo4FitDataIter::fdValue [protected] |
Definition at line 621 of file TGo4FitData.h.
Referenced by TGo4FitDataRidgeIter::ReadCurrentPoint(), TGo4FitDataProfileIter::ReadCurrentPoint(), TGo4FitDataHistogramIter::ReadCurrentPoint(), TGo4FitDataGraphIter::ReadCurrentPoint(), and Value().
Int_t TGo4FitDataIter::fiNumPoint [protected] |
Definition at line 624 of file TGo4FitData.h.
TArrayI TGo4FitDataIter::fxIndexes [protected] |
Definition at line 617 of file TGo4FitData.h.
Referenced by Indexes(), IndexesSize(), TGo4FitDataProfileIter::ReadCurrentPoint(), TGo4FitDataHistogramIter::ReadCurrentPoint(), TGo4FitDataGraphIter::ReadCurrentPoint(), ReserveArrays(), TGo4FitDataProfileIter::ShiftToNextPoint(), TGo4FitDataHistogramIter::ShiftToNextPoint(), and TGo4FitDataGraphIter::ShiftToNextPoint().
TArrayD TGo4FitDataIter::fxScales [protected] |
Definition at line 619 of file TGo4FitData.h.
Referenced by ProduceScales(), ReserveArrays(), Scales(), ScalesSize(), x(), y(), and z().
TArrayD TGo4FitDataIter::fxWidths [protected] |
Definition at line 620 of file TGo4FitData.h.
Referenced by HasWidths(), ProduceScales(), ReserveArrays(), Widths(), and xWidths().