void chi2_prob() { TH1* h = new TH1F( "h", "#chi^{2}-Wahrscheinlichkeit", 10, 0, 25 ); h->SetStats( kFALSE ); h->SetXTitle( "#chi^{2}" ); h->SetYTitle( "P_{#chi^{2}}" ); h->Draw(); TF1* f = new TF1("f", prob, 0, 25, 1 ); for( int i = 2; i <= 10; i +=2 ) { f->SetParameter( 0, i ); f->SetLineColor( i+1 ); f->DrawCopy( "same" ); } } double prob( double* x, double* par ) { return TMath::Prob( x[0], par[0] ); }