30#include "TApplication.h"
40int main(
int argc,
char **argv)
42 TApplication theApp(
"Application",
nullptr,
nullptr);
53void AddRidge(TH2D *histo,
double a,
double k,
double b,
double xstart,
int numsteps,
int numpoints,
double deviation)
59 for (
int i = 0; i < numsteps; i++) {
60 double y = a * exp(k * x) + b;
62 double alf = TMath::ATan(k * a * exp(k * x)) + TMath::Pi() / 2.;
64 for (
int j = 0; j < numpoints; j++) {
65 double radius = rnd.Gaus(0., deviation);
66 histo->Fill(x + radius * cos(alf), y + radius * sin(alf));
69 x = x + 0.001 * sin(alf);
75 TH2D *histo =
new TH2D(
"Histo",
"Ridge y = a*exp(k*x)+b", 100, 0., 10., 100, 0., 10.);
77 std::cout <<
"Generating histogram " << std::endl;
79 AddRidge(histo, 10, -0.3, 2, 1.5, 10000, 100, 0.3);
81 AddRidge(histo, 10, -0.5, 0, 0.5, 10000, 50, 0.2);
83 AddRidge(histo, 10, -0.1, +2, 3.5, 10000, 50, 0.2);
85 std::cout <<
" Done " << std::endl;
92 Float_t xx[7] = {1.0, 4.0, 9.0, 9.5, 5.0, 2.0, 1.0};
93 Float_t yy[7] = {8.0, 2.5, 2.0, 4.0, 6.0, 9.5, 8.0};
94 return new TCutG(
"RangeCut", 7, xx, yy);
101 new TCanvas(
"Canvas1");
102 histo->Draw(
"LEGO2");
136 fitter.
Print(
"Pars");
139 fitter.
Draw(
"#ridge");
int main(int argc, char **argv)
TH2D * MakeRidgeHistogram()
void AddRidge(TH2D *histo, double a, double k, double b, double xstart, int numsteps, int numpoints, double deviation)
void SetRange(Int_t naxis, Double_t min, Double_t max)
Includes axis range in consideration.
void AddRangeCut(TCutG *cut, Bool_t exclude=kFALSE)
Add TCutG object as range condition for two-dimensional case.
Data objects, which provides access to generic TH1 ROOT histogram.
Special object to approximate ridges on multi-dimensional histograms.
void SetExcludeLessThen(Double_t limit=0.)
Sets limit to exclude bins, which not less then this limit.
void SetParsNames(const char *name0="Par0", const char *name1="Par1", const char *name2="Par2", const char *name3="Par3", const char *name4="Par4", const char *name5="Par5", const char *name6="Par6", const char *name7="Par7", const char *name8="Par8", const char *name9="Par9")
Set names of first 10 parameters.
void SetParsValues(Double_t *pars)
Set value for all parameters from array.
void DoActions(Bool_t AllowFitterChange=kFALSE, TObjArray *Actions=nullptr)
Executes actions list.
void AddSimpleMinuit()
Creates and add TGo4FitMinuit object to actions list.
Central class of Go4Fit package.
void Print(Option_t *option="") const override
Print containment of fitter.
TGo4FitData * AddData(TGo4FitData *d)
Add data object to fitter.
void SetMemoryUsage(Int_t iMemoryUsage)
Set value of memory usage.
void Draw(Option_t *option) override
Draw fitter on current canvas.
TGo4FitModel * AddModel(TGo4FitModel *m)
Add model component to fitter.