00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TGO4FITCOMPONENT_H
00017 #define TGO4FITCOMPONENT_H
00018
00019 #include "TGo4FitParsList.h"
00020 #include "TGo4FitSlot.h"
00021
00022 #include "TArrayD.h"
00023 #include "TArrayI.h"
00024 #include "TObjArray.h"
00025
00026 class TCutG;
00027
00031 class TGo4FitComponent : public TGo4FitParsList, public TGo4FitSlotList {
00032 public:
00033
00037 TGo4FitComponent();
00038
00042 TGo4FitComponent(const char* iName, const char* iTitle);
00043
00047 virtual ~TGo4FitComponent();
00048
00053 TGo4FitParameter* GetAmplPar();
00054
00059 const char* GetAmplName();
00060
00065 const char* GetAmplFullName();
00066
00071 Double_t GetAmplValue();
00072
00076 void SetAmplValue(Double_t iAmpl);
00077
00082 Double_t GetAmplError();
00083
00087 void SetAmplError(Double_t iError);
00088
00093 Bool_t MakeAmpl(Bool_t isFixed = kFALSE);
00094
00098 Bool_t RemoveAmpl();
00099
00103 virtual Bool_t CanAmplTouch() { return kFALSE; }
00104
00109 void SetRange(Int_t naxis, Double_t min, Double_t max);
00110
00114 void ExcludeRange(Int_t naxis, Double_t min, Double_t max);
00115
00120 void SetRangeMin(Int_t naxis, Double_t value);
00121
00126 void SetRangeMax(Int_t naxis, Double_t value);
00127
00132 void AddRangeCut(TCutG* cut, Bool_t exclude = kFALSE);
00133
00138 void ClearRanges(Int_t naxis = -1);
00139
00143 Bool_t IsAnyRangeLimits();
00144
00149 Bool_t GetRangeMin(Int_t naxis, Double_t& value);
00150
00155 Bool_t GetRangeMax(Int_t naxis, Double_t& value);
00156
00160 Int_t GetNumRangeCondition() const { return fxRangeAxis.GetSize()/2; }
00161
00171 void GetRangeCondition(Int_t n, Int_t& typ, Int_t& naxis, Double_t& left, Double_t& right) const;
00172
00178 void SetRangeCondition(Int_t n, Int_t typ, Int_t naxis, Double_t left, Double_t right);
00179
00184 void AddRangeCondition(Int_t typ, Int_t naxis, Double_t left, Double_t right);
00185
00189 void RemoveRangeCondition(Int_t n);
00190
00194 Int_t GetNumRangeCut() const;
00195
00199 TCutG* GetRangeCut(Int_t n) const;
00200
00204 Bool_t IsRangeCutExcluding(Int_t n);
00205
00209 void SetRangeCutExcluding(Int_t n, Bool_t exclude = kTRUE);
00210
00214 void RemoveRangeCut(Int_t n);
00215
00219 Bool_t CheckRangeConditions(const Double_t* values, Int_t numaxis);
00220
00226 virtual void CollectParsTo(TGo4FitParsList& list);
00227
00232 void SetUseBuffers(Bool_t iUse) { fbUseBuffers = iUse; }
00233
00238 Bool_t GetUseBuffers() { return fbUseBuffers; }
00239
00243 virtual void Print(Option_t* option) const;
00244
00245 protected:
00246
00250 TGo4FitParameter* NewParameter(const char* Name, const char* Title, Double_t iValue = 0., Bool_t Fixed = kFALSE, Int_t AtIndx = -1);
00251
00255 TGo4FitParameter* NewAmplitude(const char* Name = 0, Double_t iValue = 0., Bool_t IsFixed = kFALSE, Int_t AtIndx = 0);
00256
00260 Int_t GetAmplIndex() { return fiAmplIndex; }
00261
00265 void SetAmplIndex(Int_t iAmplIndex = -1) { fiAmplIndex = iAmplIndex; }
00266
00267 private:
00268
00272 TArrayI fxRangeAxis;
00273
00277 TArrayD fxRangeValue;
00278
00282 TObjArray fxCuts;
00283
00287 Int_t fiAmplIndex;
00288
00292 Bool_t fbUseBuffers;
00293
00294 ClassDef(TGo4FitComponent,1)
00295 };
00296
00297 #endif // TGO4FITCOMPONENT_H
00298
00299