25 #include "TApplication.h" 35 int main(
int argc,
char **argv)
37 TApplication theApp(
"Application",
nullptr,
nullptr);
48 void AddRidge(TH2D *histo,
double a,
double k,
double b,
double xstart,
int numsteps,
int numpoints,
double deviation)
54 for (
int i = 0; i < numsteps; i++) {
55 double y = a * exp(k * x) + b;
57 double alf = TMath::ATan(k * a * exp(k * x)) + TMath::Pi() / 2.;
59 for (
int j = 0; j < numpoints; j++) {
60 double radius = rnd.Gaus(0., deviation);
61 histo->Fill(x + radius * cos(alf), y + radius * sin(alf));
64 x = x + 0.001 * sin(alf);
70 TH2D *histo =
new TH2D(
"Histo",
"Ridge y = a*exp(k*x)+b", 100, 0., 10., 100, 0., 10.);
72 std::cout <<
"Generating histogram " << std::endl;
74 AddRidge(histo, 10, -0.3, 2, 1.5, 10000, 100, 0.3);
76 AddRidge(histo, 10, -0.5, 0, 0.5, 10000, 50, 0.2);
78 AddRidge(histo, 10, -0.1, +2, 3.5, 10000, 50, 0.2);
80 std::cout <<
" Done " << std::endl;
87 Float_t xx[7] = {1.0, 4.0, 9.0, 9.5, 5.0, 2.0, 1.0};
88 Float_t yy[7] = {8.0, 2.5, 2.0, 4.0, 6.0, 9.5, 8.0};
89 return new TCutG(
"RangeCut", 7, xx, yy);
96 new TCanvas(
"Canvas1");
131 fitter.
Print(
"Pars");
134 fitter.
Draw(
"#ridge");
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")
void SetMemoryUsage(Int_t iMemoryUsage)
void SetExcludeLessThen(Double_t limit=0.)
int main(int argc, char **argv)
TGo4FitData * AddData(TGo4FitData *d)
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)
TH2D * MakeRidgeHistogram()
void AddRangeCut(TCutG *cut, Bool_t exclude=kFALSE)
TGo4FitModel * AddModel(TGo4FitModel *m)
void DoActions(Bool_t AllowFitterChange=kFALSE, TObjArray *Actions=nullptr)
void Draw(Option_t *option) override
void SetParsValues(Double_t *pars)
void Print(Option_t *option="") const override