#include #include #include #include #include #include #include #include using namespace std; void test() { TFile f("test.root", "recreate"); TH2D histo1("histo1", "", 200, -3, 3, 200, -3, 3); TH2D *histo2 = new TH2D("histo2", "", 200, -3, 3, 200, -3, 3); TFile *myfile=new TFile("run-039390x000_.root","open"); gDirectory->pwd(); myfile->ls(); f.cd(); gDirectory->pwd(); Double_t px,py; Int_t nf = 5000; while (nf-- > 0) { gRandom->Rannor(px,py); histo1.Fill(px,py); histo2->Fill(2*px,2*py); } //histo1.FillRandom("gaus"); //histo2->FillRandom("gaus"); histo1.Print(); histo2->Print(); f.ls(); f.Write(); histo1.Print(); histo2->Print(); }