{ // Create a directory and a 3D histogram TDirectory dir1 ("first_dir", "first_dir"); dir1.cd(); TH3D h3d_1 ("h3d", "First dataset", 30, -5, 5, 30, -5, 5, 30, -5, 5); // fill this histogram with a 3D gaussian for (int i = 0; i < 100000; i++) h3d_1->Fill (gRandom->Gaus(), gRandom->Gaus(), gRandom->Gaus()); // create a xy projection and draw it h3d_1->Project3D("xy"); h3d_xy->Draw("cont1"); // see the created objects in this directory dir1.ls(); // Create another directory and 3D histogram TDirectory dir2 ("second_dir", "second_dir"); dir2.cd(); TH3D h3d_2 ("h3d", "Second dataset", 30, -5, 5, 30, -5, 5, 30, -5, 5); // fill this histogram with a 3D landau distribution for (int i = 0; i < 100000; i++) h3d_2->Fill (gRandom->Landau(), gRandom->Landau(), gRandom->Landau()); // create a xy projection of this dataset h3d_2->Project3D("xy"); // see the created objects in this directory dir2.ls(); }