GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4FitDataGraph.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 "TGo4FitDataGraph.h"
15
16#include <iostream>
17#include "TGraph.h"
18
21 fxGraph(this, TGraph::Class())
22{
23}
24
25TGo4FitDataGraph::TGo4FitDataGraph(const char *iName, TGraph *iGraph, Bool_t iGraphOwned, Bool_t AddAmpl) :
26 TGo4FitData(iName,"TGraph and derived classes", dtGraph, AddAmpl),
27 fxGraph("Graph","Data object of TGraph class", this, TGraph::Class(), kTRUE, iGraph, iGraphOwned)
28{
29 SetExcludeLessThen(-1e50);
30}
31
35
36std::unique_ptr<TGo4FitDataIter> TGo4FitDataGraph::MakeIter()
37{
38 return std::make_unique<TGo4FitDataGraphIter>(this);
39}
40
41void TGo4FitDataGraph::SetGraph(TGraph *iGraph, Bool_t iGraphOwned)
42{
43 fxGraph.ClearObject();
44 fxGraph.SetObject(iGraph,iGraphOwned);
45}
46
47void TGo4FitDataGraph::FillSlotList(TSeqCollection *list)
48{
50 list->Add(&fxGraph);
51}
52
53void TGo4FitDataGraph::Print(Option_t *option) const
54{
55 TGo4FitData::Print(option);
56 std::cout << " ";
57 fxGraph.Print(option);
58}
59
60// *********************************************************************************
61
68
75
79
81{
82 if (!fxData || !fxData->GetGraph()) return kFALSE;
83
84 fiNumPoints = fxData->GetGraph()->GetN();
85
86 return ReserveArrays(1, 1, kFALSE);
87}
88
90{
91 if (!fxData) return kFALSE;
92 TGraph *gr = fxData->GetGraph();
93 if (!gr) return kFALSE;
94
95 auto xx = gr->GetX();
96 auto yy = gr->GetY();
97 if (!xx || !yy) return kFALSE;
98
99 Double_t xvalue = xx[fxIndexes[0]];
100 fdValue = yy[fxIndexes[0]];
101
102 if (!GetDeviation()) {
103 Double_t zn = gr->GetErrorY(fxIndexes[0]);
104 if (zn > 0.) fdStandardDeviation = zn*zn;
105 else fdStandardDeviation = 1.;
106 }
107
108 return ProduceScales(fxIndexes.GetArray(), &xvalue, nullptr);
109}
110
112{
113 fxIndexes[0] += 1;
114 return fxIndexes[0] < fiNumPoints;
115}
Bool_t ReadCurrentPoint() override
Perform specific actions to read all values from data object.
Bool_t StartReset() override
Reset pointer and other specific values to the beginning of data.
Bool_t ShiftToNextPoint() override
Move pointer to following data point.
TGo4FitDataGraph * fxData
Data object, which provides access to TGraph and TGraphErrors ROOT objects.
TGo4FitSlot fxGraph
Slot to for TGraph object.
virtual ~TGo4FitDataGraph()
Destroys TGo4FitDataGraph object.
std::unique_ptr< TGo4FitDataIter > MakeIter() override
Create TGo4FitDataGraphIter iterator, associated with given data object.
void Print(Option_t *option="") const override
Print information on standard output.
void FillSlotList(TSeqCollection *list) override
Add pointer on slot, which should contain TGraph object, to slots list.
TGo4FitDataGraph()
Default constructor.
void SetGraph(TGraph *iGraph, Bool_t iGraphOwned=kFALSE)
Set TGraph object.
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.
void SetExcludeLessThen(Double_t limit=0.)
Sets limit to exclude bins, which not less then this limit.
void FillSlotList(TSeqCollection *list) override
Copy pointers on all slots of data object to list.
TGo4FitData()
Default constructor.
void Print(Option_t *option="") const override
Display information about data object on standard output.