Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4Fit/TGo4FitDataGraph.cxx

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "TGo4FitDataGraph.h"
00017 
00018 #include <iostream.h>
00019 #include "TGraphErrors.h"
00020 #include "TGraphAsymmErrors.h"
00021 #include "TArrayD.h"
00022 
00023 TGo4FitDataGraph::TGo4FitDataGraph() :
00024   TGo4FitData(), fxGraph(this, TGraph::Class()) {
00025 }
00026 
00027 TGo4FitDataGraph::TGo4FitDataGraph(const char* iName, TGraph *iGraph, Bool_t iGraphOwned, Bool_t AddAmpl) :
00028   TGo4FitData(iName,"TGraph and derived classes", dtGraph, AddAmpl),
00029   fxGraph("Graph","Data object of TGraph class",this, TGraph::Class(), kTRUE, iGraph, iGraphOwned) {
00030     SetExcludeLessThen(-1e50);
00031 }
00032 
00033 TGo4FitDataGraph::~TGo4FitDataGraph() {
00034 }
00035 
00036 TGo4FitDataIter* TGo4FitDataGraph::MakeIter() {
00037    return new TGo4FitDataGraphIter(this);
00038 }
00039 
00040 void TGo4FitDataGraph::FillSlotList(TSeqCollection* list) {
00041    TGo4FitData::FillSlotList(list);
00042    list->Add(&fxGraph);
00043 }
00044 
00045 void TGo4FitDataGraph::Print(Option_t* option) const {
00046    TGo4FitData::Print(option);
00047    cout << "   ";
00048    fxGraph.Print(option);
00049 }
00050 
00051 ClassImp(TGo4FitDataGraph)
00052 
00053 
00054 // *********************************************************************************
00055 
00056 
00057 TGo4FitDataGraphIter::TGo4FitDataGraphIter() : TGo4FitDataIter(), fxData(0), fiNumPoints(0) {
00058 
00059 }
00060 
00061 TGo4FitDataGraphIter::TGo4FitDataGraphIter(TGo4FitDataGraph* Data) :
00062   TGo4FitDataIter(), fxData(Data), fiNumPoints(0) {
00063 }
00064 
00065 TGo4FitDataGraphIter::~TGo4FitDataGraphIter() {
00066 
00067 }
00068 
00069 Bool_t TGo4FitDataGraphIter::StartReset() {
00070   if ((fxData==0) || (fxData->GetGraph()==0)) return kFALSE;
00071 
00072   fiNumPoints = fxData->GetGraph()->GetN();
00073 
00074   return ReserveArrays(1, 1, kFALSE);
00075 }
00076 
00077 Bool_t TGo4FitDataGraphIter::ReadCurrentPoint() {
00078    if (fxData==0) return kFALSE;
00079    TGraph* gr = fxData->GetGraph();
00080    if (gr==0) return kFALSE;
00081 
00082    Double_t xvalue = (gr->GetX())[fxIndexes[0]];
00083    fdValue = (gr->GetY())[fxIndexes[0]];
00084 
00085    if (!GetDeviation()) {
00086       Double_t zn = gr->GetErrorY(fxIndexes[0]);
00087       if (zn>0) fdStandardDeviation = zn*zn;
00088            else fdStandardDeviation = 1.;
00089    }
00090 
00091    return ProduceScales(fxIndexes.GetArray(), &xvalue, 0);
00092 }
00093 
00094 Bool_t TGo4FitDataGraphIter::ShiftToNextPoint() {
00095    fxIndexes[0]+=1;
00096    return (fxIndexes[0]<fiNumPoints);
00097 }
00098 
00099 ClassImp(TGo4FitDataGraphIter)
00100 
00101 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:55:56 2005 for Go4-v2.10-5 by doxygen1.2.15