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

/Go4Fit/TGo4FitDataRidge.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 "TGo4FitDataRidge.h"
00017 
00018 #include <iostream.h>
00019 
00020 #include "TArrayD.h"
00021 #include "TArrayF.h"
00022 
00023 TGo4FitDataRidge::TGo4FitDataRidge() :
00024   TGo4FitData(), fxData(this, TGo4FitData::Class()), fiSelectedAxis(0) {
00025 }
00026 
00027 TGo4FitDataRidge::TGo4FitDataRidge(const char* iName, TGo4FitData* Data, Int_t SelectedAxis) :
00028   TGo4FitData(iName,"Histogram transform", dtGraph, kFALSE),
00029   fxData("DataForRidge","Data, used to represent bins for ridge",
00030           this, TGo4FitData::Class(), kTRUE, Data, kTRUE),
00031   fiSelectedAxis(SelectedAxis) {
00032     SetExcludeLessThen(-1e50);
00033 }
00034 
00035 TGo4FitDataRidge::~TGo4FitDataRidge() {
00036 }
00037 
00038 
00039 TGo4FitDataIter* TGo4FitDataRidge::MakeIter() {
00040    return new TGo4FitDataRidgeIter(this);
00041 }
00042 
00043 void TGo4FitDataRidge::FillSlotList(TSeqCollection* list) {
00044    TGo4FitData::FillSlotList(list);
00045    list->Add(&fxData);
00046    if (GetData())
00047      GetData()->FillSlotList(list);
00048 }
00049 
00050 void TGo4FitDataRidge::Print(Option_t* option) const {
00051    TGo4FitData::Print(option);
00052    if (GetData())
00053      GetData()->Print(option);
00054    cout << "  selected axis for transform " << fiSelectedAxis << endl;
00055 }
00056 
00057 ClassImp(TGo4FitDataRidge)
00058 
00059 
00060 // *********************************************************************************
00061 
00062 
00063 TGo4FitDataRidgeIter::TGo4FitDataRidgeIter() : TGo4FitDataIter(),
00064     fxData(0), iter(0), fxOwnScales() {
00065 }
00066 
00067 TGo4FitDataRidgeIter::TGo4FitDataRidgeIter(TGo4FitDataRidge* data) :
00068     TGo4FitDataIter(), fxData(data), iter(0), fxOwnScales() {
00069 }
00070 
00071 TGo4FitDataRidgeIter::~TGo4FitDataRidgeIter() {
00072     if (iter!=0) delete iter;
00073 }
00074 
00075 Bool_t TGo4FitDataRidgeIter::StartReset() {
00076   if (iter!=0) { delete iter; iter = 0; }
00077 
00078   if (fxData==0) return kFALSE;
00079   TGo4FitData* data = fxData->GetData();
00080   if (data==0) return kFALSE;
00081 
00082   if (data->GetDataType() != TGo4FitData::dtHistogram ) {
00083      cout << " Only histogramic data can be used for transform " << endl;
00084      return kFALSE;
00085   }
00086 
00087   iter = data->MakeIter();
00088   if ((iter==0) || (!iter->Reset(kTRUE))) return kFALSE;
00089 
00090   fxOwnScales.Set(iter->ScalesSize()-1); fxOwnScales.Reset(0.);
00091 
00092   return ReserveArrays(iter->IndexesSize(), iter->ScalesSize()-1, kFALSE);
00093 }
00094 
00095 Bool_t TGo4FitDataRidgeIter::ReadCurrentPoint() {
00096   if ((iter==0) || (fxData==0)) return kFALSE;
00097 
00098   if (!GetDeviation())
00099     if (iter->Value()>0.) fdStandardDeviation = 1./iter->Value();
00100                      else fdStandardDeviation = 0.;
00101 
00102   Int_t n1=0;
00103   for (Int_t n=0;n<iter->ScalesSize();n++)
00104     if (n==fxData->GetSelectedAxis()) fdValue = iter->Scales()[n];
00105                                  else fxOwnScales[n1++] = iter->Scales()[n];
00106 
00107   return ProduceScales(iter->Indexes(), fxOwnScales.GetArray(), 0);
00108 }
00109 
00110 Bool_t TGo4FitDataRidgeIter::ShiftToNextPoint() {
00111   if (iter==0) return kFALSE;
00112   Bool_t res = iter->Next(kTRUE);
00113   while (res && (iter->Value()<=0.))
00114     res = iter->Next(kTRUE);
00115   return res;
00116 }
00117 
00118 ClassImp(TGo4FitDataRidgeIter)
00119 
00120 
00121 //----------------------------END OF GO4 SOURCE FILE ---------------------

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