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

TGo4FitDataRidge.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 "TGo4FitDataRidge.h"
00017 
00018 #include "Riostream.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 
00058 // *********************************************************************************
00059 
00060 TGo4FitDataRidgeIter::TGo4FitDataRidgeIter() : TGo4FitDataIter(),
00061     fxData(0), iter(0), fxOwnScales() {
00062 }
00063 
00064 TGo4FitDataRidgeIter::TGo4FitDataRidgeIter(TGo4FitDataRidge* data) :
00065     TGo4FitDataIter(), fxData(data), iter(0), fxOwnScales() {
00066 }
00067 
00068 TGo4FitDataRidgeIter::~TGo4FitDataRidgeIter() {
00069     if (iter!=0) delete iter;
00070 }
00071 
00072 Bool_t TGo4FitDataRidgeIter::StartReset() {
00073   if (iter!=0) { delete iter; iter = 0; }
00074 
00075   if (fxData==0) return kFALSE;
00076   TGo4FitData* data = fxData->GetData();
00077   if (data==0) return kFALSE;
00078 
00079   if (data->GetDataType() != TGo4FitData::dtHistogram ) {
00080      cout << " Only histogramic data can be used for transform " << endl;
00081      return kFALSE;
00082   }
00083 
00084   iter = data->MakeIter();
00085   if ((iter==0) || (!iter->Reset(kTRUE))) return kFALSE;
00086 
00087   fxOwnScales.Set(iter->ScalesSize()-1); fxOwnScales.Reset(0.);
00088 
00089   return ReserveArrays(iter->IndexesSize(), iter->ScalesSize()-1, kFALSE);
00090 }
00091 
00092 Bool_t TGo4FitDataRidgeIter::ReadCurrentPoint() {
00093   if ((iter==0) || (fxData==0)) return kFALSE;
00094 
00095   if (!GetDeviation())
00096    {
00097       if (iter->Value()>0.) 
00098          fdStandardDeviation = 1./iter->Value();
00099       else 
00100          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 
00119 //----------------------------END OF GO4 SOURCE FILE ---------------------

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