GSI Object Oriented Online Offline (Go4) GO4-6.4.0
|
Iterator class for data object. More...
#include <TGo4FitData.h>
Public Member Functions | |
TGo4FitDataIter () | |
Default constructor. | |
virtual | ~TGo4FitDataIter () |
Destroys TGo4FitDataIter object. | |
Bool_t | CheckPointForRange () |
Check range conditions and amplitude threshold for current point. | |
Int_t | CountPoints (Bool_t UseRanges=kTRUE) |
Counts total number of points in data object. | |
TObject * | CreateDrawObject (const char *ObjName) |
Create either histogram or graph object. | |
TGraph * | CreateGraph (const char *GraphName, Bool_t UseRanges=kFALSE, Bool_t SetBins=kFALSE) |
Create TGraph object with appropriate to data object size. | |
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 | DefineIndexesLimits (TArrayI &Limits) |
Iterate over all data points and returns maximum value for indexes. | |
Bool_t | HasIndexes () const |
Return kTRUE, if data object has indexes. | |
Bool_t | HasWidths () const |
Return kTRUE, if scale widths values exists. | |
const Int_t * | Indexes () const |
Return indexes for current data point. | |
Int_t | IndexesSize () const |
Return size (number of dimensions) of data indexes. | |
virtual Bool_t | Next (Bool_t UseRanges=kTRUE) |
Shift pointer to next data point. | |
Int_t | Point () const |
Return number of current point, starting from 0. | |
Bool_t | ReachEnd () const |
Checks, if iterator already reach end of data object. | |
virtual Bool_t | Reset (Bool_t UseRanges=kTRUE) |
Initialize iterator and positioning pointer on first point. | |
const Double_t * | Scales () const |
Return scale values for current data points. | |
Int_t | ScalesSize () const |
Return size (number) of scale values for each data point. | |
Double_t | StandardDeviation () const |
Return standard deviation of bin content (Value) for current point. | |
Double_t | Value () const |
Return bin content (Value) for current point. | |
const Double_t * | Widths () const |
Return scales widths values. | |
Double_t | x () const |
Return current x coordinate if exists, otherwise 0. | |
Double_t | xWidths () const |
Return production of all width parameters (1 if no widths) | |
Double_t | y () const |
Return current y coordinate if exists, otherwise 0. | |
Double_t | z () const |
Return current z coordinate if exists, otherwise 0. | |
Protected Member Functions | |
virtual TGo4FitData * | GetData () const =0 |
Return pointer on correspondent TGo4FitData object, which create iterator. | |
Bool_t | GetDeviation () |
Calculates standard deviation from GetSigmaValue() of data object. | |
Bool_t | NextIndex (TArrayI &Index, TArrayI &Limits) |
Producing next indexes set according limits values. | |
Bool_t | ProduceScales (const Int_t *index, const Double_t *ownscales, const Double_t *ownwidths) |
Converts scale values. | |
virtual Bool_t | ReadCurrentPoint ()=0 |
Perform specific actions to read all values from data object. | |
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 Bool_t | StartReset ()=0 |
Reset pointer and other specific values to the beginning of data. | |
void | TransformScales (Double_t *scales) |
Transform scales values, using transformation objects in data. | |
Protected Attributes | |
Bool_t | fbReachEnd {kFALSE} |
Double_t | fdStandardDeviation {0.} |
Double_t | fdValue {0.} |
Int_t | fiNumPoint {0} |
TArrayI | fxIndexes |
TArrayD | fxScales |
TArrayD | fxWidths |
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:
auto 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 419 of file TGo4FitData.h.
TGo4FitDataIter::TGo4FitDataIter | ( | ) |
Default constructor.
Definition at line 382 of file TGo4FitData.cxx.
References fbReachEnd, fdStandardDeviation, fdValue, fiNumPoint, fxIndexes, fxScales, and fxWidths.
Referenced by TGo4FitDataGraphIter::TGo4FitDataGraphIter(), TGo4FitDataGraphIter::TGo4FitDataGraphIter(), TGo4FitDataHistogramIter::TGo4FitDataHistogramIter(), TGo4FitDataHistogramIter::TGo4FitDataHistogramIter(), TGo4FitDataProfileIter::TGo4FitDataProfileIter(), TGo4FitDataProfileIter::TGo4FitDataProfileIter(), TGo4FitDataRidgeIter::TGo4FitDataRidgeIter(), and TGo4FitDataRidgeIter::TGo4FitDataRidgeIter().
|
virtual |
Destroys TGo4FitDataIter object.
Definition at line 388 of file TGo4FitData.cxx.
Bool_t TGo4FitDataIter::CheckPointForRange | ( | ) |
Check range conditions and amplitude threshold for current point.
Definition at line 494 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 568 of file TGo4FitData.cxx.
References Next(), and Reset().
Referenced by TGo4Fitter::CalculatesMomentums(), CreateGraph(), TGo4FitPeakFinder::HansEsselPeakFinder(), TGo4FitPeakFinder::ROOTPeakFinder(), and TGo4FitPeakFinder::SergeyLinevPeakFinder().
TObject * TGo4FitDataIter::CreateDrawObject | ( | const char * | ObjName | ) |
Create either histogram or graph object.
Definition at line 671 of file TGo4FitData.cxx.
References CreateGraph(), CreateHistogram(), HasIndexes(), HasWidths(), IndexesSize(), Reset(), and ScalesSize().
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 653 of file TGo4FitData.cxx.
References CountPoints(), TGo4FitComponent::GetAmplValue(), GetData(), Next(), Point(), Reset(), ScalesSize(), Value(), and x().
Referenced by 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 595 of file TGo4FitData.cxx.
References DefineIndexesLimits(), TGo4FitComponent::GetAmplValue(), GetData(), HasIndexes(), HasWidths(), Indexes(), IndexesSize(), Next(), Reset(), Scales(), ScalesSize(), Value(), and Widths().
Referenced by CreateDrawObject().
Bool_t TGo4FitDataIter::DefineIndexesLimits | ( | TArrayI & | Limits | ) |
Iterate over all data points and returns maximum value for indexes.
Definition at line 579 of file TGo4FitData.cxx.
References Indexes(), IndexesSize(), Next(), and Reset().
Referenced by CreateHistogram().
|
protectedpure 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().
|
protected |
Calculates standard deviation from GetSigmaValue() of data object.
Definition at line 482 of file TGo4FitData.cxx.
References fdStandardDeviation, GetData(), TGo4FitData::GetSigmaSource(), and TGo4FitData::GetSigmaValue().
Referenced by TGo4FitDataGraphIter::ReadCurrentPoint(), TGo4FitDataHistogramIter::ReadCurrentPoint(), TGo4FitDataProfileIter::ReadCurrentPoint(), and TGo4FitDataRidgeIter::ReadCurrentPoint().
|
inline |
Return kTRUE, if data object has indexes.
Definition at line 450 of file TGo4FitData.h.
References IndexesSize().
Referenced by CreateDrawObject(), and CreateHistogram().
|
inline |
Return kTRUE, if scale widths values exists.
Definition at line 495 of file TGo4FitData.h.
References fxWidths.
Referenced by CreateDrawObject(), CreateHistogram(), and xWidths().
|
inline |
Return indexes for current data point.
Definition at line 460 of file TGo4FitData.h.
References fxIndexes.
Referenced by CreateHistogram(), and DefineIndexesLimits().
|
inline |
Return size (number of dimensions) of data indexes.
Definition at line 455 of file TGo4FitData.h.
References fxIndexes.
Referenced by CreateDrawObject(), CreateHistogram(), DefineIndexesLimits(), and HasIndexes().
|
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 531 of file TGo4FitData.cxx.
References CheckPointForRange(), fbReachEnd, fiNumPoint, GetData(), ReadCurrentPoint(), and ShiftToNextPoint().
Referenced by CountPoints(), CreateGraph(), CreateHistogram(), and DefineIndexesLimits().
|
protected |
Producing next indexes set according limits values.
Definition at line 469 of file TGo4FitData.cxx.
Referenced by TGo4FitDataHistogramIter::ShiftToNextPoint().
|
inline |
Return number of current point, starting from 0.
Definition at line 520 of file TGo4FitData.h.
References fiNumPoint.
Referenced by CreateGraph().
|
protected |
Converts scale values.
Involved when usage of binary number instead scales or axis calibration objects specified to data.
Definition at line 429 of file TGo4FitData.cxx.
References TGo4FitData::dtHistogram, fxScales, fxWidths, GetData(), TGo4FitData::GetDataType(), TGo4FitData::GetNumberOfTransSlots(), TGo4FitData::GetUseBinScale(), ScalesSize(), and TransformScales().
Referenced by TGo4FitDataGraphIter::ReadCurrentPoint(), TGo4FitDataHistogramIter::ReadCurrentPoint(), TGo4FitDataProfileIter::ReadCurrentPoint(), and TGo4FitDataRidgeIter::ReadCurrentPoint().
|
inline |
Checks, if iterator already reach end of data object.
This happens, when Next() method return kFALSE value.
Definition at line 537 of file TGo4FitData.h.
References fbReachEnd.
|
protectedpure virtual |
Perform specific actions to read all values from data object.
Should be implemented in derived classes.
Implemented in TGo4FitDataGraphIter, TGo4FitDataHistogramIter, TGo4FitDataProfileIter, and TGo4FitDataRidgeIter.
|
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 390 of file TGo4FitData.cxx.
References fxIndexes, fxScales, fxWidths, GetData(), and TGo4FitData::GetUseBinScale().
Referenced by TGo4FitDataGraphIter::StartReset(), TGo4FitDataHistogramIter::StartReset(), TGo4FitDataProfileIter::StartReset(), and TGo4FitDataRidgeIter::StartReset().
|
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 504 of file TGo4FitData.cxx.
References CheckPointForRange(), fbReachEnd, fiNumPoint, ReadCurrentPoint(), ShiftToNextPoint(), and StartReset().
Referenced by CountPoints(), CreateDrawObject(), CreateGraph(), CreateHistogram(), and DefineIndexesLimits().
|
inline |
Return scale values for current data points.
Definition at line 475 of file TGo4FitData.h.
References fxScales.
Referenced by CheckPointForRange(), and CreateHistogram().
|
inline |
Return size (number) of scale values for each data point.
Definition at line 470 of file TGo4FitData.h.
References fxScales.
Referenced by CheckPointForRange(), CreateDrawObject(), CreateGraph(), CreateHistogram(), ProduceScales(), and TransformScales().
|
protectedpure virtual |
Move pointer to following data point.
Should be implemented in derived classes.
Implemented in TGo4FitDataGraphIter, TGo4FitDataHistogramIter, TGo4FitDataProfileIter, and TGo4FitDataRidgeIter.
|
inline |
Return standard deviation of bin content (Value) for current point.
Definition at line 515 of file TGo4FitData.h.
References fdStandardDeviation.
|
protectedpure 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().
|
protected |
Transform scales values, using transformation objects in data.
Definition at line 419 of file TGo4FitData.cxx.
References TGo4FitData::GetAxisTrans(), GetData(), TGo4FitData::GetNumberOfTransSlots(), ScalesSize(), and TGo4FitAxisTrans::Transformation().
Referenced by ProduceScales().
|
inline |
Return bin content (Value) for current point.
Definition at line 510 of file TGo4FitData.h.
References fdValue.
Referenced by CheckPointForRange(), CreateGraph(), and CreateHistogram().
|
inline |
Return scales widths values.
Definition at line 500 of file TGo4FitData.h.
References fxWidths.
Referenced by CreateHistogram().
|
inline |
Return current x coordinate if exists, otherwise 0.
Definition at line 480 of file TGo4FitData.h.
References fxScales.
Referenced by CreateGraph().
Double_t TGo4FitDataIter::xWidths | ( | ) | const |
Return production of all width parameters (1 if no widths)
Definition at line 559 of file TGo4FitData.cxx.
References fxWidths, and HasWidths().
|
inline |
Return current y coordinate if exists, otherwise 0.
Definition at line 485 of file TGo4FitData.h.
References fxScales.
|
inline |
Return current z coordinate if exists, otherwise 0.
Definition at line 490 of file TGo4FitData.h.
References fxScales.
|
protected |
Definition at line 622 of file TGo4FitData.h.
Referenced by TGo4FitDataIter(), Next(), ReachEnd(), and Reset().
|
protected |
Definition at line 618 of file TGo4FitData.h.
Referenced by TGo4FitDataIter(), GetDeviation(), TGo4FitDataGraphIter::ReadCurrentPoint(), TGo4FitDataHistogramIter::ReadCurrentPoint(), TGo4FitDataProfileIter::ReadCurrentPoint(), TGo4FitDataRidgeIter::ReadCurrentPoint(), and StandardDeviation().
|
protected |
Definition at line 617 of file TGo4FitData.h.
Referenced by TGo4FitDataIter(), TGo4FitDataGraphIter::ReadCurrentPoint(), TGo4FitDataHistogramIter::ReadCurrentPoint(), TGo4FitDataProfileIter::ReadCurrentPoint(), TGo4FitDataRidgeIter::ReadCurrentPoint(), and Value().
|
protected |
Definition at line 620 of file TGo4FitData.h.
Referenced by TGo4FitDataIter(), Next(), Point(), and Reset().
|
protected |
Definition at line 613 of file TGo4FitData.h.
Referenced by TGo4FitDataIter(), Indexes(), IndexesSize(), TGo4FitDataGraphIter::ReadCurrentPoint(), TGo4FitDataHistogramIter::ReadCurrentPoint(), TGo4FitDataProfileIter::ReadCurrentPoint(), ReserveArrays(), TGo4FitDataGraphIter::ShiftToNextPoint(), TGo4FitDataHistogramIter::ShiftToNextPoint(), and TGo4FitDataProfileIter::ShiftToNextPoint().
|
protected |
Definition at line 615 of file TGo4FitData.h.
Referenced by TGo4FitDataIter(), ProduceScales(), ReserveArrays(), Scales(), ScalesSize(), x(), y(), and z().
|
protected |
Definition at line 616 of file TGo4FitData.h.
Referenced by TGo4FitDataIter(), HasWidths(), ProduceScales(), ReserveArrays(), Widths(), and xWidths().