Thanks : how can I make cut in histogram

[color=red]Thanks for the valuable replies . You will be glad to know that i’ve solved my problems using your ideas. Now I color the histogram using the intractive part of the pad. Also I’ve solved the disc space problems[/color].

[color=blue]Now I want to apply a banana cut in a 2D histogram by applying command in the ROOT prompt . Please help.[/color]

see example below

Rene

void cutg2() {
TCutG *mycut = new TCutG(“mycut”,8);
mycut->SetPoint(0,-0.646552,0.932203);
mycut->SetPoint(1,-1.26437,0.105932);
mycut->SetPoint(2,-0.574713,-1.10169);
mycut->SetPoint(3,0.948276,-0.338983);
mycut->SetPoint(4,1.07759,0.720339);
mycut->SetPoint(5,-0.316092,-0.0847458);
mycut->SetPoint(6,-0.45977,0.402542);
mycut->SetPoint(7,-0.646552,0.932203);

TH2F* hpxpy = new TH2F(“hpxpy”,“py vs px”,40,-4,4,40,-4,4);
Double_t px, py;
for (Int_t i = 0; i < 25000; i++) {
gRandom->Rannor(px,py);
hpxpy->Fill(px,py);
}
hpxpy->Draw("[mycut]");
}