22 void exampleTKDE(
int n = 1000) {
30 TH1D *
h1 =
new TH1D(
"h1",
"h1",nbin,xmin,xmax);
34 std::vector<double>
data(
n);
35 for (
int i = 0; i <
n; ++i) {
53 TF1 *
f1 =
new TF1(
"f1",
"0.4*ROOT::Math::normal_pdf(x,1,2)+0.6*ROOT::Math::normal_pdf(x,1.5,7)",xmin,xmax);
64 legend->
AddEntry(f1,
"True function");
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
TF1 * GetDrawnLowerFunction()
This class displays a legend box (TPaveText) containing several legend entries.
Kernel Density Estimation class.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
virtual void Draw(const Option_t *option="")
TF1 * GetDrawnUpperFunction()
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
R__EXTERN TRandom * gRandom
tomato 1-D histogram with a double per channel (see TH1 documentation)}
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
THist< 1, double, THistStatContent, THistStatUncertainty > TH1D
virtual void SetTitle(const char *title)
Change (i.e.
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.