GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4FitDataProfile.cxx
Go to the documentation of this file.
1 // $Id: TGo4FitDataProfile.cxx 2749 2020-04-16 10:05:15Z 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  SetExcludeLessThen(-1e50);
28 }
29 
31 }
32 
33 void TGo4FitDataProfile::SetProfile(TProfile *iProfile, Bool_t iProfileOwned)
34 {
36  fxProfile.SetObject(iProfile,iProfileOwned);
37 }
38 
40  return new TGo4FitDataProfileIter(this);
41 }
42 
43 void TGo4FitDataProfile::FillSlotList(TSeqCollection* list) {
45  list->Add(&fxProfile);
46 }
47 
48 void TGo4FitDataProfile::Print(Option_t* option) const {
49  TGo4FitData::Print(option);
50  std::cout << " ";
51  fxProfile.Print(option);
52 }
53 
54 
55 // ********************************************************************************************
56 
57 
59 }
60 
62  TGo4FitDataIter(), fxData(Data), fiNumPoints(0) {
63 }
64 
66 }
67 
69  if ((fxData==0) || (fxData->GetProfile()==0)) return kFALSE;
70 
71  fiNumPoints = fxData->GetProfile()->GetNbinsX();
72 
73  return ReserveArrays(1, 1, kFALSE);
74 }
75 
77  if (fxData==0) return kFALSE;
78  TProfile* pr = fxData->GetProfile();
79  if (pr==0) return kFALSE;
80 
81  Double_t xvalue = pr->GetXaxis()->GetBinCenter(fxIndexes[0]+1);
82  fdValue = pr->GetBinContent(fxIndexes[0]+1);
83 
84  if (!GetDeviation()) {
85  Double_t zn = pr->GetBinError(fxIndexes[0]+1);
86  if (zn>0) fdStandardDeviation = zn*zn;
87  else fdStandardDeviation = 1.;
88  }
89 
90  return ProduceScales(fxIndexes.GetArray(), &xvalue, 0);
91 }
92 
93 
95  fxIndexes[0]+=1;
96  return (fxIndexes[0]<fiNumPoints);
97 }
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