{ delete gRandom; gRandom = new TRandom(123456) ; // Setting the seed TH1F *gauss = new TH1F("gauss", "Gauss Distribution", 200, 0, 20); for(int i=0; i<100000; ++i) { double a=gRandom->Gaus(10, 2); gauss->Fill(a); } TF1 *f1 = new TF1("f1", "gaus",0,20); // Orismos tis synartisis f1 gStyle->SetOptFit(111); // Ektypwsi toy apotelesmatos tis prosarmoghs c1=new TCanvas("c1", "Gauss", 700, 400); c1->cd(); gauss->Fit(f1,"","",4,16); // Prosarmogh istogrammatos stin fl apo to 4 ews to 16 }