GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4FitDataProfile.cxx
Go to the documentation of this file.
1 // $Id: TGo4FitDataProfile.cxx 3490 2022-01-21 14:19:46Z linev $
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 TGo4FitDataProfile::TGo4FitDataProfile(const char* iName, TProfile *iProfile, Bool_t iProfileOwned, Bool_t AddAmpl) :
25  TGo4FitData(iName,"TProfile classes", dtGraph, AddAmpl),
26  fxProfile("Profile","Data object of TProfile class", this, TProfile::Class(), kTRUE, iProfile, iProfileOwned)
27 {
28  SetExcludeLessThen(-1e50);
29 }
30 
32 {
33 }
34 
35 void TGo4FitDataProfile::SetProfile(TProfile *iProfile, Bool_t iProfileOwned)
36 {
38  fxProfile.SetObject(iProfile,iProfileOwned);
39 }
40 
42 {
43  return new TGo4FitDataProfileIter(this);
44 }
45 
46 void TGo4FitDataProfile::FillSlotList(TSeqCollection* list)
47 {
49  list->Add(&fxProfile);
50 }
51 
52 void TGo4FitDataProfile::Print(Option_t* option) const
53 {
54  TGo4FitData::Print(option);
55  std::cout << " ";
56  fxProfile.Print(option);
57 }
58 
59 
60 // ********************************************************************************************
61 
62 
64 {
65 }
66 
68  TGo4FitDataIter(), fxData(Data), fiNumPoints(0)
69 {
70 }
71 
73 {
74 }
75 
77 {
78  if ((fxData==0) || (fxData->GetProfile()==0)) return kFALSE;
79 
80  fiNumPoints = fxData->GetProfile()->GetNbinsX();
81 
82  return ReserveArrays(1, 1, kFALSE);
83 }
84 
86 {
87  if (fxData==0) return kFALSE;
88  TProfile* pr = fxData->GetProfile();
89  if (pr==0) return kFALSE;
90 
91  Double_t xvalue = pr->GetXaxis()->GetBinCenter(fxIndexes[0]+1);
92  fdValue = pr->GetBinContent(fxIndexes[0]+1);
93 
94  if (!GetDeviation()) {
95  Double_t zn = pr->GetBinError(fxIndexes[0]+1);
96  if (zn>0) fdStandardDeviation = zn*zn;
97  else fdStandardDeviation = 1.;
98  }
99 
100  return ProduceScales(fxIndexes.GetArray(), &xvalue, 0);
101 }
102 
103 
105 {
106  fxIndexes[0]+=1;
107  return (fxIndexes[0]<fiNumPoints);
108 }
Bool_t ProduceScales(const Int_t *index, const Double_t *ownscales, const Double_t *ownwidths)
TArrayI fxIndexes
Definition: TGo4FitData.h:617
Double_t fdStandardDeviation
Definition: TGo4FitData.h:622
virtual void Print(Option_t *option) const
void SetProfile(TProfile *iProfile, Bool_t iProfileOwned=kFALSE)
Double_t fdValue
Definition: TGo4FitData.h:621
void SetExcludeLessThen(Double_t limit=0.)
Definition: TGo4FitData.h:107
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)
virtual Bool_t ShiftToNextPoint()
virtual void FillSlotList(TSeqCollection *list)
virtual Bool_t ReadCurrentPoint()
Bool_t GetDeviation()
virtual void Print(Option_t *option) const
virtual void FillSlotList(TSeqCollection *list)
void ClearObject()
TGo4FitDataProfile * fxData
TGo4FitDataIter * MakeIter()
virtual void Print(Option_t *option) const