void test(){ TFile *rootfile =new TFile("test.root","recreate"); TH1D *hist =new TH1D("hist","",100,-3.,3.); hist->FillRandom("gaus",1E+6); hist->Draw(); hist->Write(); rootfile->Close(); return; }