18 #include "Riostream.h"
25 #include "TApplication.h"
35 int main(
int argc,
char **argv)
37 TApplication theApp(
"Application", 0, 0);
48 void AddRidge(TH2D* histo,
double a,
double k,
double b,
49 double xstart,
int numsteps,
int numpoints,
double deviation)
55 for(
int i=0;i<numsteps;i++) {
56 double y = a*exp(k*x) + b;
58 double alf = TMath::ATan(k*a*exp(k*x)) + TMath::Pi()/2.;
60 for(
int j=0;j<numpoints;j++) {
61 double radius = rnd.Gaus(0.,deviation);
62 histo->Fill(x + radius*cos(alf), y + radius*sin(alf));
65 x = x + 0.001*sin(alf);
71 TH2D* histo =
new TH2D(
"Histo",
"Ridge y = a*exp(k*x)+b",100,0.,10.,100,0.,10.);
73 std::cout <<
"Generating histogram " << std::endl;
75 AddRidge(histo, 10, -0.3, 2, 1.5, 10000, 100, 0.3);
77 AddRidge(histo, 10, -0.5, 0, 0.5, 10000, 50, 0.2);
79 AddRidge(histo, 10, -0.1, +2, 3.5, 10000, 50, 0.2);
81 std::cout <<
" Done " << std::endl;
88 Float_t xx[7] = { 1.0, 4.0, 9.0, 9.5, 5.0, 2.0, 1.0 };
89 Float_t yy[7] = { 8.0, 2.5, 2.0, 4.0, 6.0, 9.5, 8.0 };
90 return new TCutG(
"RangeCut", 7, xx, yy);
97 new TCanvas(
"Canvas1");
132 fitter.
Print(
"Pars");
135 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")
virtual void Print(Option_t *option) const
void SetMemoryUsage(Int_t iMemoryUsage)
virtual void Draw(Option_t *option)
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)
void DoActions(Bool_t AllowFitterChange=kFALSE, TObjArray *Actions=0)
TH2D * MakeRidgeHistogram()
void AddRangeCut(TCutG *cut, Bool_t exclude=kFALSE)
TGo4FitModel * AddModel(TGo4FitModel *m)
void SetParsValues(Double_t *pars)