GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4FitDataRidge.cxx
Go to the documentation of this file.
1 // $Id: TGo4FitDataRidge.cxx 2749 2020-04-16 10:05:15Z 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 fuer 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 <iostream>
17 
19  TGo4FitData(), fxData(this, TGo4FitData::Class()), fiSelectedAxis(0) {
20 }
21 
22 TGo4FitDataRidge::TGo4FitDataRidge(const char* iName, TGo4FitData* Data, Int_t SelectedAxis) :
23  TGo4FitData(iName,"Histogram transform", dtGraph, kFALSE),
24  fxData("DataForRidge","Data, used to represent bins for ridge",
25  this, TGo4FitData::Class(), kTRUE, Data, kTRUE),
26  fiSelectedAxis(SelectedAxis) {
27  SetExcludeLessThen(-1e50);
28 }
29 
31 }
32 
33 
35  return new TGo4FitDataRidgeIter(this);
36 }
37 
38 void TGo4FitDataRidge::FillSlotList(TSeqCollection* list) {
40  list->Add(&fxData);
41  if (GetData())
42  GetData()->FillSlotList(list);
43 }
44 
45 void TGo4FitDataRidge::Print(Option_t* option) const {
46  TGo4FitData::Print(option);
47  if (GetData())
48  GetData()->Print(option);
49  std::cout << " selected axis for transform " << fiSelectedAxis << std::endl;
50 }
51 
52 
53 // *********************************************************************************
54 
56  fxData(0), iter(0), fxOwnScales() {
57 }
58 
60  TGo4FitDataIter(), fxData(data), iter(0), fxOwnScales() {
61 }
62 
64  if (iter!=0) delete iter;
65 }
66 
68  if (iter!=0) { delete iter; iter = 0; }
69 
70  if (fxData==0) return kFALSE;
71  TGo4FitData* data = fxData->GetData();
72  if (data==0) return kFALSE;
73 
74  if (data->GetDataType() != TGo4FitData::dtHistogram ) {
75  std::cout << " Only histogramic data can be used for transform " << std::endl;
76  return kFALSE;
77  }
78 
79  iter = data->MakeIter();
80  if ((iter==0) || (!iter->Reset(kTRUE))) return kFALSE;
81 
82  fxOwnScales.Set(iter->ScalesSize()-1); fxOwnScales.Reset(0.);
83 
84  return ReserveArrays(iter->IndexesSize(), iter->ScalesSize()-1, kFALSE);
85 }
86 
88  if ((iter==0) || (fxData==0)) return kFALSE;
89 
90  if (!GetDeviation())
91  {
92  if (iter->Value()>0.)
94  else
96  }
97  Int_t n1=0;
98  for (Int_t n=0;n<iter->ScalesSize();n++)
99  if (n==fxData->GetSelectedAxis()) fdValue = iter->Scales()[n];
100  else fxOwnScales[n1++] = iter->Scales()[n];
101 
102  return ProduceScales(iter->Indexes(), fxOwnScales.GetArray(), 0);
103 }
104 
106  if (iter==0) return kFALSE;
107  Bool_t res = iter->Next(kTRUE);
108  while (res && (iter->Value()<=0.))
109  res = iter->Next(kTRUE);
110  return res;
111 }
112 
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
virtual Bool_t Reset(Bool_t UseRanges=kTRUE)
virtual Bool_t StartReset()
virtual Bool_t ShiftToNextPoint()
virtual Bool_t Next(Bool_t UseRanges=kTRUE)
Int_t GetDataType() const
Definition: TGo4FitData.h:57
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