Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4FitDataProfile.cxx

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

Generated on Fri Nov 28 12:59:12 2008 for Go4-v3.04-1 by  doxygen 1.4.2