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

/Go4Fit/TGo4FitDataProfile.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 "TGo4FitDataProfile.h"
00017 
00018 #include <iostream.h>
00019 
00020 #include "TArrayD.h"
00021 
00022 TGo4FitDataProfile::TGo4FitDataProfile() :
00023   TGo4FitData(), fxProfile(this, TProfile::Class()) {
00024 }
00025 
00026 TGo4FitDataProfile::TGo4FitDataProfile(const char* iName, TProfile *iProfile, Bool_t iProfileOwned, Bool_t AddAmpl) :
00027   TGo4FitData(iName,"TProfile classes", dtGraph, AddAmpl),
00028   fxProfile("Profile","Data object of TProfile class",this, TProfile::Class(), kTRUE, iProfile, iProfileOwned) {
00029     SetExcludeLessThen(-1e50);
00030 }
00031 
00032 TGo4FitDataProfile::~TGo4FitDataProfile() {
00033 }
00034 
00035 TGo4FitDataIter* TGo4FitDataProfile::MakeIter() {
00036   return new TGo4FitDataProfileIter(this);
00037 }
00038 
00039 void TGo4FitDataProfile::FillSlotList(TSeqCollection* list) {
00040    TGo4FitData::FillSlotList(list);
00041    list->Add(&fxProfile);
00042 }
00043 
00044 void TGo4FitDataProfile::Print(Option_t* option) const {
00045    TGo4FitData::Print(option);
00046    cout << "   ";
00047    fxProfile.Print(option);
00048 }
00049 
00050 ClassImp(TGo4FitDataProfile)
00051 
00052 
00053 // ********************************************************************************************
00054 
00055 
00056 TGo4FitDataProfileIter::TGo4FitDataProfileIter() : TGo4FitDataIter(), fxData(0), fiNumPoints(0) {
00057 }
00058 
00059 TGo4FitDataProfileIter::TGo4FitDataProfileIter(TGo4FitDataProfile* Data) :
00060   TGo4FitDataIter(), fxData(Data), fiNumPoints(0) {
00061 }
00062 
00063 TGo4FitDataProfileIter::~TGo4FitDataProfileIter() {
00064 }
00065 
00066 Bool_t TGo4FitDataProfileIter::StartReset() {
00067   if ((fxData==0) || (fxData->GetProfile()==0)) return kFALSE;
00068 
00069   fiNumPoints = fxData->GetProfile()->GetNbinsX();
00070 
00071   return ReserveArrays(1, 1, kFALSE);
00072 }
00073 
00074 Bool_t TGo4FitDataProfileIter::ReadCurrentPoint() {
00075    if (fxData==0) return kFALSE;
00076    TProfile* pr = fxData->GetProfile();
00077    if (pr==0) return kFALSE;
00078 
00079    Double_t xvalue = pr->GetXaxis()->GetBinCenter(fxIndexes[0]+1);
00080    fdValue = pr->GetBinContent(fxIndexes[0]+1);
00081 
00082    if (!GetDeviation()) {
00083       Double_t zn = pr->GetBinError(fxIndexes[0]+1);
00084       if (zn>0) fdStandardDeviation = zn*zn;
00085            else fdStandardDeviation = 1.;
00086    }
00087 
00088    return ProduceScales(fxIndexes.GetArray(), &xvalue, 0);
00089 }
00090 
00091 
00092 Bool_t TGo4FitDataProfileIter::ShiftToNextPoint() {
00093    fxIndexes[0]+=1;
00094    return (fxIndexes[0]<fiNumPoints);
00095 }
00096 
00097 ClassImp(TGo4FitDataProfileIter)
00098 
00099 //----------------------------END OF GO4 SOURCE FILE ---------------------

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