TGo4FitDataProfile.cxx

Go to the documentation of this file.
00001 // $Id: TGo4FitDataProfile.cxx 478 2009-10-29 12:26:09Z linev $
00002 //-----------------------------------------------------------------------
00003 //       The GSI Online Offline Object Oriented (Go4) Project
00004 //         Experiment Data Processing at EE department, GSI
00005 //-----------------------------------------------------------------------
00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
00007 //                     Planckstr. 1, 64291 Darmstadt, Germany
00008 // Contact:            http://go4.gsi.de
00009 //-----------------------------------------------------------------------
00010 // This software can be used under the license agreements as stated
00011 // in Go4License.txt file which is part of the distribution.
00012 //-----------------------------------------------------------------------
00013 
00014 #include "TGo4FitDataProfile.h"
00015 
00016 #include "Riostream.h"
00017 
00018 #include "TProfile.h"
00019 #include "TArrayD.h"
00020 
00021 TGo4FitDataProfile::TGo4FitDataProfile() :
00022   TGo4FitData(), fxProfile(this, TProfile::Class()) {
00023 }
00024 
00025 TGo4FitDataProfile::TGo4FitDataProfile(const char* iName, TProfile *iProfile, Bool_t iProfileOwned, Bool_t AddAmpl) :
00026   TGo4FitData(iName,"TProfile classes", dtGraph, AddAmpl),
00027   fxProfile("Profile","Data object of TProfile class",this, TProfile::Class(), kTRUE, iProfile, iProfileOwned) {
00028     SetExcludeLessThen(-1e50);
00029 }
00030 
00031 TGo4FitDataProfile::~TGo4FitDataProfile() {
00032 }
00033 
00034 void TGo4FitDataProfile::SetProfile(TProfile *iProfile, Bool_t iProfileOwned)
00035 {
00036   fxProfile.SetObject(iProfile,iProfileOwned);
00037 }
00038 
00039 TGo4FitDataIter* TGo4FitDataProfile::MakeIter() {
00040   return new TGo4FitDataProfileIter(this);
00041 }
00042 
00043 void TGo4FitDataProfile::FillSlotList(TSeqCollection* list) {
00044    TGo4FitData::FillSlotList(list);
00045    list->Add(&fxProfile);
00046 }
00047 
00048 void TGo4FitDataProfile::Print(Option_t* option) const {
00049    TGo4FitData::Print(option);
00050    cout << "   ";
00051    fxProfile.Print(option);
00052 }
00053 
00054 
00055 // ********************************************************************************************
00056 
00057 
00058 TGo4FitDataProfileIter::TGo4FitDataProfileIter() : TGo4FitDataIter(), fxData(0), fiNumPoints(0) {
00059 }
00060 
00061 TGo4FitDataProfileIter::TGo4FitDataProfileIter(TGo4FitDataProfile* Data) :
00062   TGo4FitDataIter(), fxData(Data), fiNumPoints(0) {
00063 }
00064 
00065 TGo4FitDataProfileIter::~TGo4FitDataProfileIter() {
00066 }
00067 
00068 Bool_t TGo4FitDataProfileIter::StartReset() {
00069   if ((fxData==0) || (fxData->GetProfile()==0)) return kFALSE;
00070 
00071   fiNumPoints = fxData->GetProfile()->GetNbinsX();
00072 
00073   return ReserveArrays(1, 1, kFALSE);
00074 }
00075 
00076 Bool_t TGo4FitDataProfileIter::ReadCurrentPoint() {
00077    if (fxData==0) return kFALSE;
00078    TProfile* pr = fxData->GetProfile();
00079    if (pr==0) return kFALSE;
00080 
00081    Double_t xvalue = pr->GetXaxis()->GetBinCenter(fxIndexes[0]+1);
00082    fdValue = pr->GetBinContent(fxIndexes[0]+1);
00083 
00084    if (!GetDeviation()) {
00085       Double_t zn = pr->GetBinError(fxIndexes[0]+1);
00086       if (zn>0) fdStandardDeviation = zn*zn;
00087            else fdStandardDeviation = 1.;
00088    }
00089 
00090    return ProduceScales(fxIndexes.GetArray(), &xvalue, 0);
00091 }
00092 
00093 
00094 Bool_t TGo4FitDataProfileIter::ShiftToNextPoint() {
00095    fxIndexes[0]+=1;
00096    return (fxIndexes[0]<fiNumPoints);
00097 }

Generated on Thu Oct 28 15:54:12 2010 for Go4-Fitpackagev4.04-2 by  doxygen 1.5.1