void ml_vs_ls() { TH1* h = new TH1F( "h", "Histogrammanpassung", 20, 0, 10 ); TF1* f = new TF1( "f", "0.5*TMath::Gaus( x,5,1 )+exp(-0.5*x)", 0, 10); TF1* ffit = new TF1( "ffit", gaussexpo, 0, 10, 5 ); ffit->SetParameters( 100, 5, 1, 1, -1 ); h->FillRandom( "f", 500 ); h->SetStats( kFALSE ); h->Draw(); h->Fit( "ffit", "E" ); cout << 2*ffit->Integral( 0, 10 ) << endl; ffit->SetLineStyle( 2 ); h->Fit( "ffit", "EL+", "same" ); cout << 2*ffit->Integral( 0, 10 ) << endl; } Double_t gaussexpo( Double_t* x, Double_t* par ) { return par[0]*( TMath::Gaus( x[0], par[1], par[2] ) + par[3] * exp( par[4]*x[0] ) ); }