GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4FitDataRidge.cxx
Go to the documentation of this file.
1// $Id$
2//-----------------------------------------------------------------------
3// The GSI Online Offline Object Oriented (Go4) Project
4// Experiment Data Processing at EE department, GSI
5//-----------------------------------------------------------------------
6// Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7// Planckstr. 1, 64291 Darmstadt, Germany
8// Contact: http://go4.gsi.de
9//-----------------------------------------------------------------------
10// This software can be used under the license agreements as stated
11// in Go4License.txt file which is part of the distribution.
12//-----------------------------------------------------------------------
13
14#include "TGo4FitDataRidge.h"
15
16#include <iostream>
17
19
20TGo4FitDataRidge::TGo4FitDataRidge(const char *iName, TGo4FitData *Data, Int_t SelectedAxis)
21 : TGo4FitData(iName, "Histogram transform", dtGraph, kFALSE),
22 fxData("DataForRidge", "Data, used to represent bins for ridge", this, TGo4FitData::Class(), kTRUE, Data, kTRUE),
23 fiSelectedAxis(SelectedAxis)
24{
25 SetExcludeLessThen(-1e50);
26}
27
29
30std::unique_ptr<TGo4FitDataIter> TGo4FitDataRidge::MakeIter()
31{
32 return std::make_unique<TGo4FitDataRidgeIter>(this);
33}
34
35void TGo4FitDataRidge::FillSlotList(TSeqCollection *list)
36{
38 list->Add(&fxData);
39 if (GetData())
40 GetData()->FillSlotList(list);
41}
42
43void TGo4FitDataRidge::Print(Option_t *option) const
44{
45 TGo4FitData::Print(option);
46 if (GetData())
47 GetData()->Print(option);
48 std::cout << " selected axis for transform " << fiSelectedAxis << std::endl;
49}
50
51// *********************************************************************************
52
54
59
63
65{
66 iter.reset();
67
68 if (!fxData)
69 return kFALSE;
70
71 TGo4FitData *data = fxData->GetData();
72 if (!data)
73 return kFALSE;
74
76 std::cout << " Only histogramic data can be used for transform " << std::endl;
77 return kFALSE;
78 }
79
80 iter = data->MakeIter();
81 if (!iter || !iter->Reset(kTRUE))
82 return kFALSE;
83
84 fxOwnScales.Set(iter->ScalesSize() - 1);
85 fxOwnScales.Reset(0.);
86
87 return ReserveArrays(iter->IndexesSize(), iter->ScalesSize() - 1, kFALSE);
88}
89
91{
92 if (!iter || !fxData)
93 return kFALSE;
94
95 if (!GetDeviation()) {
96 if (iter->Value() > 0.)
97 fdStandardDeviation = 1. / iter->Value();
98 else
100 }
101 Int_t n1 = 0;
102 for (Int_t n = 0; n < iter->ScalesSize(); n++)
103 if (n == fxData->GetSelectedAxis())
104 fdValue = iter->Scales()[n];
105 else
106 fxOwnScales[n1++] = iter->Scales()[n];
107
108 return ProduceScales(iter->Indexes(), fxOwnScales.GetArray(), nullptr);
109}
110
112{
113 if (!iter)
114 return kFALSE;
115 Bool_t res = iter->Next(kTRUE);
116 while (res && (iter->Value() <= 0.))
117 res = iter->Next(kTRUE);
118 return res;
119}
Double_t fdStandardDeviation
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.
TGo4FitDataIter()
Default constructor.
Bool_t ReserveArrays(Int_t NumDimen, Int_t NumOwnAxis, Bool_t HasWidth)
Reserve buffers for indexes, scales and width values.
Bool_t ShiftToNextPoint() override
Move pointer to following data point.
TGo4FitDataRidge * fxData
Bool_t ReadCurrentPoint() override
Perform specific actions to read all values from data object.
std::unique_ptr< TGo4FitDataIter > iter
Bool_t StartReset() override
Reset pointer and other specific values to the beginning of data.
Special object to approximate ridges on multi-dimensional histograms.
TGo4FitData * GetData() const
Returns pointer on TGo4FitData object.
Int_t fiSelectedAxis
Number of selected as ridge axis.
std::unique_ptr< TGo4FitDataIter > MakeIter() override
Create TGo4FitDataRidgeIter iterator, associated with given data object.
virtual ~TGo4FitDataRidge()
Destroys TGo4FitDataRidge object.
TGo4FitSlot fxData
Slot for TGo4FitData object.
virtual void Print(Option_t *option="") const override
Print information to standard output.
void FillSlotList(TSeqCollection *list) override
Add pointer on slot, which should contain TGo4FitData object, to list of slots.
TGo4FitDataRidge()
Default constructor.
Basic abstract class for representing data, which should be fitted.
Definition TGo4FitData.h:39
void SetExcludeLessThen(Double_t limit=0.)
Sets limit to exclude bins, which not less then this limit.
Int_t GetDataType() const
Returns type of data source.
Definition TGo4FitData.h:64
void FillSlotList(TSeqCollection *list) override
Copy pointers on all slots of data object to list.
TGo4FitData()
Default constructor.
virtual std::unique_ptr< TGo4FitDataIter > MakeIter()
Creates iterator for data object.
void Print(Option_t *option="") const override
Display information about data object on standard output.