TCanvas *cvs = new TCanvas("cvs", "");
TH2D *hist = new TH2D("hist", "", 100, 0, 100, 100, 0, 100);
hist -> Fill(10, 20);
hist -> Fill(40, 60);
hist -> Draw("colz");
TCutG *mycut = (TCutG *) cvs -> WaitPrimitive("CUTG", "CutG");
mycut -> SetName("mycut");
TTree -> CopyTree("mycut");