#ifndef __CINT__ #include #include #include #include #include "TMath.h" #include "TH1.h" #include "TH1D.h" #include "TCanvas.h" #endif { Long_t i; // // Fill histogram // h1 = new TH3D("h3f","Test fill",100,-1.,1.,100,-1.,1.,100,-1.,1.); for (i=1;i<3000000000;i++) { //h1->Fill(gRandom->Gaus(0,1),gRandom->Gaus(0,1),gRandom->Gaus(0,1),1.); h1->Fill(0.,0.,0.); } h1->Print(); // // Writes histos to file.... // gROOT->ProcessLine(".! rm -f test_hist.root"); TFile *fout= new TFile("test_hist.root","new"); fout->cd(); h1->Write(); fout->Close("R"); std::cout<<" histogram written on file"<cd(); c1->SetLogx(0); c1->SetLogy(0); h1->Draw(); gPad->Draw(); return; }