GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
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
25TGo4FitDataProfile::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
35
36void TGo4FitDataProfile::SetProfile(TProfile *iProfile, Bool_t iProfileOwned)
37{
38 fxProfile.ClearObject();
39 fxProfile.SetObject(iProfile,iProfileOwned);
40}
41
42std::unique_ptr<TGo4FitDataIter> TGo4FitDataProfile::MakeIter()
43{
44 return std::make_unique<TGo4FitDataProfileIter>(this);
45}
46
47void TGo4FitDataProfile::FillSlotList(TSeqCollection *list)
48{
50 list->Add(&fxProfile);
51}
52
53void TGo4FitDataProfile::Print(Option_t *option) const
54{
55 TGo4FitData::Print(option);
56 std::cout << " ";
57 fxProfile.Print(option);
58}
59
60
61// ********************************************************************************************
62
63
67
72
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}
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.
TGo4FitDataProfile * fxData
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.
Data object, which provides access to TProfile ROOT class.
std::unique_ptr< TGo4FitDataIter > MakeIter() override
Create TGo4FitDataProfileIter iterator, associated with given data object.
void Print(Option_t *option="") const override
Print information on standard output.
TGo4FitDataProfile()
Default constructor.
void SetProfile(TProfile *iProfile, Bool_t iProfileOwned=kFALSE)
Set pointer on TProfile object.
virtual ~TGo4FitDataProfile()
Destroys TGo4FitDataProfile object.
TGo4FitSlot fxProfile
Slot for TProfile object.
void FillSlotList(TSeqCollection *list) override
Add pointer on slot, which should contain TProfile object, to list of slots.
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.