GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4FitDataProfile.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 "TGo4FitDataProfile.h"
15 
16 #include <iostream>
17 
18 #include "TProfile.h"
19 
21  TGo4FitData(), fxProfile(this, TProfile::Class())
22 {
23 }
24 
25 TGo4FitDataProfile::TGo4FitDataProfile(const char *iName, TProfile *iProfile, Bool_t iProfileOwned, Bool_t AddAmpl) :
26  TGo4FitData(iName,"TProfile classes", dtGraph, AddAmpl),
27  fxProfile("Profile","Data object of TProfile class", this, TProfile::Class(), kTRUE, iProfile, iProfileOwned)
28 {
29  SetExcludeLessThen(-1e50);
30 }
31 
33 {
34 }
35 
36 void TGo4FitDataProfile::SetProfile(TProfile *iProfile, Bool_t iProfileOwned)
37 {
39  fxProfile.SetObject(iProfile,iProfileOwned);
40 }
41 
42 std::unique_ptr<TGo4FitDataIter> TGo4FitDataProfile::MakeIter()
43 {
44  return std::make_unique<TGo4FitDataProfileIter>(this);
45 }
46 
47 void TGo4FitDataProfile::FillSlotList(TSeqCollection *list)
48 {
50  list->Add(&fxProfile);
51 }
52 
53 void TGo4FitDataProfile::Print(Option_t *option) const
54 {
55  TGo4FitData::Print(option);
56  std::cout << " ";
57  fxProfile.Print(option);
58 }
59 
60 
61 // ********************************************************************************************
62 
63 
65 {
66 }
67 
70 {
71 }
72 
74 {
75 }
76 
78 {
79  if (!fxData || !fxData->GetProfile()) return kFALSE;
80 
81  fiNumPoints = fxData->GetProfile()->GetNbinsX();
82 
83  return ReserveArrays(1, 1, kFALSE);
84 }
85 
87 {
88  if (!fxData) return kFALSE;
89  TProfile *pr = fxData->GetProfile();
90  if (!pr) return kFALSE;
91 
92  Double_t xvalue = pr->GetXaxis()->GetBinCenter(fxIndexes[0]+1);
93  fdValue = pr->GetBinContent(fxIndexes[0]+1);
94 
95  if (!GetDeviation()) {
96  Double_t zn = pr->GetBinError(fxIndexes[0]+1);
97  if (zn > 0.) fdStandardDeviation = zn*zn;
98  else fdStandardDeviation = 1.;
99  }
100 
101  return ProduceScales(fxIndexes.GetArray(), &xvalue, nullptr);
102 }
103 
104 
106 {
107  fxIndexes[0] += 1;
108  return fxIndexes[0] < fiNumPoints;
109 }
Bool_t StartReset() override
Bool_t ProduceScales(const Int_t *index, const Double_t *ownscales, const Double_t *ownwidths)
TArrayI fxIndexes
Definition: TGo4FitData.h:612
Double_t fdStandardDeviation
Definition: TGo4FitData.h:617
void Print(Option_t *option="") const override
void Print(Option_t *option="") const override
TProfile * GetProfile() const
void SetProfile(TProfile *iProfile, Bool_t iProfileOwned=kFALSE)
std::unique_ptr< TGo4FitDataIter > MakeIter() override
Double_t fdValue
Definition: TGo4FitData.h:616
void SetExcludeLessThen(Double_t limit=0.)
Definition: TGo4FitData.h:117
void FillSlotList(TSeqCollection *list) override
void Print(Option_t *option="") const override
Bool_t SetObject(TObject *iObject, Bool_t iOwned=kFALSE, Bool_t CheckClass=kTRUE)
Bool_t ReserveArrays(Int_t NumDimen, Int_t NumOwnAxis, Bool_t HasWidth)
void FillSlotList(TSeqCollection *list) override
Bool_t GetDeviation()
Bool_t ShiftToNextPoint() override
Bool_t ReadCurrentPoint() override
void ClearObject()
TGo4FitDataProfile * fxData