GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4FitDataRidge.cxx
Go to the documentation of this file.
1 // $Id: TGo4FitDataRidge.cxx 933 2013-01-29 15:27:58Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "TGo4FitDataRidge.h"
15 
16 #include "Riostream.h"
17 #include "TArrayD.h"
18 #include "TArrayF.h"
19 
21  TGo4FitData(), fxData(this, TGo4FitData::Class()), fiSelectedAxis(0) {
22 }
23 
24 TGo4FitDataRidge::TGo4FitDataRidge(const char* iName, TGo4FitData* Data, Int_t SelectedAxis) :
25  TGo4FitData(iName,"Histogram transform", dtGraph, kFALSE),
26  fxData("DataForRidge","Data, used to represent bins for ridge",
27  this, TGo4FitData::Class(), kTRUE, Data, kTRUE),
28  fiSelectedAxis(SelectedAxis) {
29  SetExcludeLessThen(-1e50);
30 }
31 
33 }
34 
35 
37  return new TGo4FitDataRidgeIter(this);
38 }
39 
40 void TGo4FitDataRidge::FillSlotList(TSeqCollection* list) {
42  list->Add(&fxData);
43  if (GetData())
44  GetData()->FillSlotList(list);
45 }
46 
47 void TGo4FitDataRidge::Print(Option_t* option) const {
48  TGo4FitData::Print(option);
49  if (GetData())
50  GetData()->Print(option);
51  std::cout << " selected axis for transform " << fiSelectedAxis << std::endl;
52 }
53 
54 
55 // *********************************************************************************
56 
58  fxData(0), iter(0), fxOwnScales() {
59 }
60 
62  TGo4FitDataIter(), fxData(data), iter(0), fxOwnScales() {
63 }
64 
66  if (iter!=0) delete iter;
67 }
68 
70  if (iter!=0) { delete iter; iter = 0; }
71 
72  if (fxData==0) return kFALSE;
73  TGo4FitData* data = fxData->GetData();
74  if (data==0) return kFALSE;
75 
76  if (data->GetDataType() != TGo4FitData::dtHistogram ) {
77  std::cout << " Only histogramic data can be used for transform " << std::endl;
78  return kFALSE;
79  }
80 
81  iter = data->MakeIter();
82  if ((iter==0) || (!iter->Reset(kTRUE))) return kFALSE;
83 
84  fxOwnScales.Set(iter->ScalesSize()-1); fxOwnScales.Reset(0.);
85 
86  return ReserveArrays(iter->IndexesSize(), iter->ScalesSize()-1, kFALSE);
87 }
88 
90  if ((iter==0) || (fxData==0)) return kFALSE;
91 
92  if (!GetDeviation())
93  {
94  if (iter->Value()>0.)
96  else
98  }
99  Int_t n1=0;
100  for (Int_t n=0;n<iter->ScalesSize();n++)
101  if (n==fxData->GetSelectedAxis()) fdValue = iter->Scales()[n];
102  else fxOwnScales[n1++] = iter->Scales()[n];
103 
104  return ProduceScales(iter->Indexes(), fxOwnScales.GetArray(), 0);
105 }
106 
108  if (iter==0) return kFALSE;
109  Bool_t res = iter->Next(kTRUE);
110  while (res && (iter->Value()<=0.))
111  res = iter->Next(kTRUE);
112  return res;
113 }
114 
virtual ~TGo4FitDataRidge()
TGo4FitSlot fxData
Bool_t ProduceScales(const Int_t *index, const Double_t *ownscales, const Double_t *ownwidths)
Double_t fdStandardDeviation
Definition: TGo4FitData.h:622
TGo4FitDataIter * MakeIter()
virtual void Print(Option_t *option) const
TGo4FitDataRidge * fxData
virtual TGo4FitDataIter * MakeIter()
Definition: TGo4FitData.h:165
Double_t fdValue
Definition: TGo4FitData.h:621
void SetExcludeLessThen(Double_t limit=0.)
Definition: TGo4FitData.h:107
virtual Bool_t ReadCurrentPoint()
virtual void Print(Option_t *option) const
const Int_t GetDataType()
Definition: TGo4FitData.h:57
virtual Bool_t Reset(Bool_t UseRanges=kTRUE)
virtual Bool_t StartReset()
virtual Bool_t ShiftToNextPoint()
virtual Bool_t Next(Bool_t UseRanges=kTRUE)
Bool_t ReserveArrays(Int_t NumDimen, Int_t NumOwnAxis, Bool_t HasWidth)
virtual void FillSlotList(TSeqCollection *list)
Bool_t GetDeviation()
virtual void FillSlotList(TSeqCollection *list)
TGo4FitDataIter * iter
Double_t Value() const
Definition: TGo4FitData.h:514
const Int_t * Indexes() const
Definition: TGo4FitData.h:464
const Double_t * Scales() const
Definition: TGo4FitData.h:479
Int_t IndexesSize() const
Definition: TGo4FitData.h:459
TGo4FitData * GetData() const
Int_t ScalesSize() const
Definition: TGo4FitData.h:474