19 _line->SetName(GetName());
21 _iline->SetName(
Form(
"I%s", GetName()));
28 _nAcceptedPoints = 100000;
43 _line->SetName(GetName());
45 _iline->SetName(
Form(
"I%s", GetName()));
52 _nAcceptedPoints = 100000;
64 _nAcceptedPoints = 100000;
75 if (_a > 0)
SetName(
Form(
"%s,A=%d", GetName(), _a));
77 _line->SetName(GetName());
78 _iline->SetName(
Form(
"I%s", GetName()));
89 _line->SetName(GetName());
90 _iline->SetName(
Form(
"I%s", GetName()));
100 if (!CheckStatus())
return false;
104 if (n_ == -1)
n = _line->GetN();
107 if (test_) valid = TestPoint(x_, y_);
109 _line->SetPoint(
n, x_, y_);
110 _iline->SetPoint(_iline->GetN(), x_, y_);
124 if (!CheckStatus())
return false;
128 if (n_ == -1)
n = _iline->GetN();
131 if (test_) valid = TestPoint(x_, y_);
132 if (valid) _iline->SetPoint(
n, x_, y_);
145 if (!CheckStatus())
return;
162 if (!CheckStatus())
return false;
164 _line->SetPoint(GetN() - 1, x_, y_);
165 _iline->SetPoint(GetInterpolateN() - 1, x_, y_);
177 if (!CheckStatus())
return;
212 if (!CheckStatus())
return 0;
217 double xtest = GetX();
218 if (GetX(0) > GetX()) xtest = GetX(0);
219 double ytest = GetY();
220 if (GetY(0) > GetY()) ytest = GetY(0);
225 if (GetX(0) < GetX()) min = GetX(0) - 10;
226 else min = GetX() - 10;
227 if (min <= 0.) min += 10.;
231 if (GetX(0) < GetX()) max = GetX() + 10.;
232 else max = GetX(0) + 10.;
237 _ff =
new TF1(GetName(),
Form(
"[0]*TMath::Power(x,%lf)/(TMath::Power((x+[1]),[2]))", _pow), min, max);
238 _ff->SetParameters(p0, 100., 0.4);
242 _ff->GetRange(fmin, fmax);
243 if ((min <= fmin) || (max >= fmax)) {
244 _ff->SetRange(min, max);
248 _fitStatus = _line->Fit(_ff,
"QN");
258 if (!CheckStatus())
return false;
259 if (_pointsCounter >= _nAcceptedPoints)
return false;
262 if ((GetN() >= 10) && (
fit)) {
264 if (_fitStatus != 0)
fit =
false;
270 if (dy_ > 0.) dy = dy_;
272 dy = ((GetInterpolateY() - _pdy) / _z) * 1.;
275 if ((GetN() >= 10) && (
fit)) {
276 double yext = locf->
Eval(x_);
281 else if ((
TMath::Abs(GetInterpolateY() - y_) >= dy)) valid =
false;
293 double ox = GetInterpolateX();
294 double oy = GetInterpolateY();
296 double dist =
TMath::Sqrt((xx - ox) * (xx - ox) + (yy - oy) * (yy - oy));
306 if (!CheckStatus())
return false;
307 return _line->GetN();
317 if (!CheckStatus())
return false;
318 return _iline->GetN();
329 if (!CheckStatus())
return false;
330 return GetX(_line->GetN() - 1);
339 if (!CheckStatus())
return false;
341 if ((n_ <= _line->GetN() - 1) && (n_ >= 0))
n = n_;
343 cout <<
"WARNING: KVSpiderLine::GetX(): Invalid index n = '" << n_ <<
"'." << endl;
346 return _line->GetX()[
n];
356 if (!CheckStatus())
return false;
357 return GetY(_line->GetN() - 1);
366 if (!CheckStatus())
return false;
368 if ((n_ <= _line->GetN() - 1) && (n_ >= 0))
n = n_;
370 cout <<
"WARNING: KVSpiderLine::GetY(): Invalid index n = '" << n_ <<
"'." << endl;
373 return _line->GetY()[
n];
384 if (!CheckStatus())
return false;
385 return GetInterpolateX(_iline->GetN() - 1);
394 if (!CheckStatus())
return false;
396 if ((n_ <= _iline->GetN() - 1) && (n_ >= 0))
n = n_;
398 cout <<
"WARNING: KVSpiderLine::GetInterpolateX(): Invalid index n = '" << n_ <<
"'." << endl;
401 return _iline->GetX()[
n];
411 if (!CheckStatus())
return false;
412 return GetInterpolateY(_iline->GetN() - 1);
421 if (!CheckStatus())
return false;
423 if ((n_ <= _iline->GetN() - 1) && (n_ >= 0))
n = n_;
425 cout <<
"WARNING: KVSpiderLine::GetX(): Invalid index n = '" << n_ <<
"'." << endl;
428 return _iline->GetY()[
n];
440 if (!CheckStatus())
return;
443 if (opt.
Contains(
"same")) com +=
"same";
446 _iline->SetMarkerColor(
kGreen);
447 _iline->SetMarkerSize(0.9);
448 _iline->SetMarkerStyle(21);
449 _iline->SetLineWidth(1);
450 _iline->SetLineColor(
kGreen);
451 _iline->Draw(
Form(
"PL%s", com.
Data()));
456 _line->SetMarkerColor(
kRed);
457 _line->SetMarkerSize(1.3);
458 _line->SetMarkerStyle(20);
459 _line->SetLineWidth(2);
460 _line->SetLineColor(
kRed);
461 if (_line->GetN() <= 1) _line->Draw(
Form(
"P%s", com.
Data()));
462 else _line->Draw(
Form(
"PL%s", com.
Data()));
467 if (GetX(0) > GetX()) zname =
new TLatex(GetX(0), GetY(0), GetName());
468 else zname =
new TLatex(GetX(), GetY(), GetName());
481 if ((!_line) || (!_iline))
return false;
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char * Form(const char *fmt,...)
Part of Spider Identification.
void Sort(bool ascending_=true)
bool ReplaceLastPoint(double x_, double y_)
void Draw(Option_t *opt_="")
double GetInterpolateX() const
virtual bool TestPoint(double x_, double y_, double dy_=-1., bool fit=true)
int GetInterpolateN() const
double GetDistance(double x_, double y_)
bool AddInterpolatePoint(double x_, double y_, bool test_=false, int n_=-1)
bool AddPoint(double x_, double y_, bool test_=false, int n_=-1)
virtual TF1 * GetFunction(double min_=-1., double max_=-1.)
void SetStatus(bool filled_=true)
double GetInterpolateY() const
virtual void SetTextSize(Float_t tsize=1)
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
static Bool_t CompareX(const TGraph *gr, Int_t left, Int_t right)
virtual void Draw(Option_t *option="")
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TString & ReplaceAll(const char *s1, const char *s2)
def fit(model, train_loader, val_loader, num_epochs, batch_size, optimizer, criterion, save_best, scheduler)
double dist(AxisAngle const &r1, AxisAngle const &r2)
std::function< T(T)> GetFunction(const std::string &name)
Double_t Power(Double_t x, Double_t y)
Double_t Sqrt(Double_t x)