16 #include "Riostream.h"
24 fxRangeAxis(), fxRangeValue(), fxCuts(), fiAmplIndex(-1), fbUseBuffers(kFALSE) {
29 fxRangeAxis(), fxRangeValue(), fxCuts(), fiAmplIndex(-1), fbUseBuffers(kFALSE) {
110 if ((naxis1<0) && (naxis2>0)) {
116 if ((naxis1>0) && (naxis2<0)) {
139 Int_t naxis1, naxis2;
140 Double_t value1, value2;
143 case 0: naxis1 = -(naxis+1); value1 = left;
144 naxis2 = +(naxis+1); value2 = right;
146 case 1: naxis1 = +(naxis+1); value1 = left;
147 naxis2 = -(naxis+1); value2 = right;
149 case 2: naxis1 = -(naxis+1); value1 = left;
150 naxis2 = 0; value2 = 0.;
152 case 3: naxis1 = +(naxis+1); value1 = right;
153 naxis2 = 0; value2 = 0.;
202 Int_t indx = 0, dindx = 0;
204 if ( TMath::Abs(
fxRangeAxis[indx]) != (naxis+1) ) {
215 if ((naxis==0) || (naxis==1))
fxCuts.Delete();
231 return fxCuts.GetLast()+1;
235 return (n>=0) && (n<=
fxCuts.GetLast()) ? dynamic_cast<TCutG*> (
fxCuts.At(n)) : 0;
240 return cut==0 ? kFALSE : cut->TestBit(
kExcludeCut);
258 Bool_t isany = kFALSE;
259 for(Int_t indx=0;indx<
fxRangeAxis.GetSize();indx+=2)
262 if( (!isany) || (zn<value) ) value = zn;
269 Double_t* arr = naxis == 0 ? cut->GetX() : cut->GetY();
270 Double_t zn = arr[0];
271 for(Int_t i=1;i<cut->GetN();i++)
272 if(arr[i]<zn) zn = arr[i];
273 if( (!isany) || (zn<value) ) value = zn;
281 Bool_t isany = kFALSE;
283 for(Int_t indx=0;indx<
fxRangeAxis.GetSize();indx+=2) {
286 if( (!isany) || (zn>value) ) value = zn;
293 Double_t* arr = naxis == 0 ? cut->GetX() : cut->GetY();
295 for(Int_t i=1;i<cut->GetN();i++)
296 if(arr[i]>zn) zn = arr[i];
297 if( (!isany) || (zn>value) ) value = zn;
309 Bool_t res1 = kTRUE, res2 = kTRUE;
311 Bool_t isanycond = kFALSE;
313 for(Int_t naxis=0;naxis<numaxis;naxis++) {
314 Char_t resaxis1 = kTRUE, resaxis2 = kFALSE;
315 Bool_t isany = kFALSE;
316 for(Int_t ncond=0;ncond<condsize;ncond++) {
318 Int_t typ, axisnumber;
319 Double_t left, right;
322 if (axisnumber != naxis)
continue;
327 if((values[naxis]>=left) && (values[naxis]<=right)) resaxis2 = kTRUE;
330 if((values[naxis]>=left) && (values[naxis]<=right)) resaxis1 = kFALSE;
332 case 2:
if(values[naxis]<left) resaxis1 = kFALSE;
break;
333 case 3:
if(values[naxis]>right) resaxis1 = kFALSE;
break;
337 res1 = res1 && resaxis1;
338 if (!isany) resaxis2 = kTRUE;
339 res2 = res2 && resaxis2;
340 isanycond = isanycond || isany;
344 if ( res1 && !(isanycond && res2) && (numaxis>1) && (
GetNumRangeCut()>0)) {
348 if (cut->IsInside(values[0],values[1]))
350 if (cut->TestBit(
kExcludeCut)) { res1 = kFALSE;
break; }
351 else { res2 = kTRUE;
break; }
372 std::cout <<
"***************************************************************************" << std::endl;
375 std::cout <<
" Amplitude index: " <<
fiAmplIndex << std::endl;
378 if (ncond==0) std::cout <<
" Range selection: " << std::endl;
380 Double_t left, right;
383 std::cout <<
" axis " << naxis <<
" ";
386 case 0: std::cout <<
" select range from " << left <<
" to " << right;
break;
387 case 1: std::cout <<
" exclude range from " << left <<
" to " << right;
break;
388 case 2: std::cout <<
" set left bound to " << left;
break;
389 case 3: std::cout <<
" set right bound to " << right;
break;
392 std::cout << std::endl;
397 if (cut->TestBit(
kExcludeCut)) std::cout <<
" Exclude";
else std::cout <<
" Include";
398 std::cout <<
" axises ranges, using TCutG object " << std::endl;
Bool_t IsAnyRangeLimits()
virtual void Print(Option_t *option) const
TGo4FitParameter * InsertPar(TGo4FitParameter *par, Int_t indx)
Bool_t CheckRangeConditions(const Double_t *values, Int_t numaxis)
Int_t GetNumRangeCut() const
TGo4FitSlot * GetSlot(Int_t nslot)
void ClearRanges(Int_t naxis=-1)
void SetRangeCondition(Int_t n, Int_t typ, Int_t naxis, Double_t left, Double_t right)
Int_t GetNumRangeCondition() const
const char * GetAmplFullName()
void SetRangeCutExcluding(Int_t n, Bool_t exclude=kTRUE)
void SetRangeMin(Int_t naxis, Double_t value)
TGo4FitParameter * GetPar(Int_t n)
void SetAmplError(Double_t iError)
virtual void Print(Option_t *option) const
TGo4FitParameter * NewParameter(const char *Name, const char *Title, Double_t iValue=0., Bool_t Fixed=kFALSE, Int_t AtIndx=-1)
const char * GetFullName()
void SetAmplValue(Double_t iAmpl)
TGo4FitParameter * NewAmplitude(const char *Name=0, Double_t iValue=0., Bool_t IsFixed=kFALSE, Int_t AtIndx=0)
void SetAmplIndex(Int_t iAmplIndex=-1)
TCutG * GetRangeCut(Int_t n) const
void SetRange(Int_t naxis, Double_t min, Double_t max)
void Print(Option_t *option) const
Double_t GetError() const
void AddRangeCut(TCutG *cut, Bool_t exclude=kFALSE)
void SetRangeMax(Int_t naxis, Double_t value)
Bool_t RemoveParByIndex(Int_t indx)
void GetRangeCondition(Int_t n, Int_t &typ, Int_t &naxis, Double_t &left, Double_t &right) const
virtual void CollectParsTo(TGo4FitParsList &list)
void SetValue(Double_t iValue)
void RemoveRangeCut(Int_t n)
Double_t GetValue() const
Bool_t IsRangeCutExcluding(Int_t n)
void RemoveRangeCondition(Int_t n)
void AddRangeCondition(Int_t typ, Int_t naxis, Double_t left, Double_t right)
Bool_t MakeAmpl(Bool_t isFixed=kFALSE)
Bool_t GetRangeMin(Int_t naxis, Double_t &value)
const char * GetAmplName()
virtual TGo4FitParameter * Get(Int_t n)
TObject * GetObject() const
void ExcludeRange(Int_t naxis, Double_t min, Double_t max)
void SetFixed(Bool_t iFixed)
virtual void CollectParsTo(TGo4FitParsList &list)
TGo4FitParameter * AddPar(TGo4FitParameter *par)
virtual ~TGo4FitComponent()
Bool_t GetRangeMax(Int_t naxis, Double_t &value)
void SetError(Double_t iError)
TGo4FitParameter * GetAmplPar()