00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TGO4FITCOMPONENT_H
00015 #define TGO4FITCOMPONENT_H
00016
00017 #include "TGo4FitParsList.h"
00018 #include "TGo4FitSlot.h"
00019
00020 #include "TArrayD.h"
00021 #include "TArrayI.h"
00022 #include "TObjArray.h"
00023
00024 class TCutG;
00025
00029 class TGo4FitComponent : public TGo4FitParsList, public TGo4FitSlotList {
00030 public:
00031
00035 TGo4FitComponent();
00036
00040 TGo4FitComponent(const char* iName, const char* iTitle);
00041
00045 virtual ~TGo4FitComponent();
00046
00051 TGo4FitParameter* GetAmplPar();
00052
00057 const char* GetAmplName();
00058
00063 const char* GetAmplFullName();
00064
00069 Double_t GetAmplValue();
00070
00074 void SetAmplValue(Double_t iAmpl);
00075
00080 Double_t GetAmplError();
00081
00085 void SetAmplError(Double_t iError);
00086
00091 Bool_t MakeAmpl(Bool_t isFixed = kFALSE);
00092
00096 Bool_t RemoveAmpl();
00097
00101 virtual Bool_t CanAmplTouch() { return kFALSE; }
00102
00107 void SetRange(Int_t naxis, Double_t min, Double_t max);
00108
00112 void ExcludeRange(Int_t naxis, Double_t min, Double_t max);
00113
00118 void SetRangeMin(Int_t naxis, Double_t value);
00119
00124 void SetRangeMax(Int_t naxis, Double_t value);
00125
00130 void AddRangeCut(TCutG* cut, Bool_t exclude = kFALSE);
00131
00136 void ClearRanges(Int_t naxis = -1);
00137
00141 Bool_t IsAnyRangeLimits();
00142
00147 Bool_t GetRangeMin(Int_t naxis, Double_t& value);
00148
00153 Bool_t GetRangeMax(Int_t naxis, Double_t& value);
00154
00158 Int_t GetNumRangeCondition() const { return fxRangeAxis.GetSize()/2; }
00159
00169 void GetRangeCondition(Int_t n, Int_t& typ, Int_t& naxis, Double_t& left, Double_t& right) const;
00170
00176 void SetRangeCondition(Int_t n, Int_t typ, Int_t naxis, Double_t left, Double_t right);
00177
00182 void AddRangeCondition(Int_t typ, Int_t naxis, Double_t left, Double_t right);
00183
00187 void RemoveRangeCondition(Int_t n);
00188
00192 Int_t GetNumRangeCut() const;
00193
00197 TCutG* GetRangeCut(Int_t n) const;
00198
00202 Bool_t IsRangeCutExcluding(Int_t n);
00203
00207 void SetRangeCutExcluding(Int_t n, Bool_t exclude = kTRUE);
00208
00212 void RemoveRangeCut(Int_t n);
00213
00217 Bool_t CheckRangeConditions(const Double_t* values, Int_t numaxis);
00218
00224 virtual void CollectParsTo(TGo4FitParsList& list);
00225
00230 void SetUseBuffers(Bool_t iUse) { fbUseBuffers = iUse; }
00231
00236 Bool_t GetUseBuffers() { return fbUseBuffers; }
00237
00241 virtual void Print(Option_t* option) const;
00242
00243 protected:
00244
00248 TGo4FitParameter* NewParameter(const char* Name, const char* Title, Double_t iValue = 0., Bool_t Fixed = kFALSE, Int_t AtIndx = -1);
00249
00253 TGo4FitParameter* NewAmplitude(const char* Name = 0, Double_t iValue = 0., Bool_t IsFixed = kFALSE, Int_t AtIndx = 0);
00254
00258 Int_t GetAmplIndex() { return fiAmplIndex; }
00259
00263 void SetAmplIndex(Int_t iAmplIndex = -1) { fiAmplIndex = iAmplIndex; }
00264
00265 private:
00266
00270 TArrayI fxRangeAxis;
00271
00275 TArrayD fxRangeValue;
00276
00280 TObjArray fxCuts;
00281
00285 Int_t fiAmplIndex;
00286
00290 Bool_t fbUseBuffers;
00291
00292 ClassDef(TGo4FitComponent,1)
00293 };
00294
00295 #endif // TGO4FITCOMPONENT_H