Cuts on histograms and display with original boundaries

Hi,

Right now for my analysis I make the following cuts using the Xaxis :

  histo -> GetXaxis() -> SetRangeUser(xmin,xmax) ;

But when i do that the histogram is drawned in the xmin,xmax range but I want it to be plot in the original range so I can see by eye the cuts applied on the whole shape of my histo.
How can I tell ROOT to plot it in a different x range.

Thanks a lot

{
   TH1F *h = new TH1F("h","h", 100, -3, 3);
   h->FillRandom("gaus",10000);
   h->Draw();   
   TH1F *hc = h->DrawClone("same");
   hc->GetXaxis()->SetRangeUser(0,1);
   hc->SetFillColor(2);   
}

Hi,

Just to continue on this thread I had another question, once I asked on ROOT talk how to restrain my drawing/analysis range :

root.cern.ch/phpBB2/viewtopic.php?t=5508

To day I see indeed it is correct for drawing but for analysis it seems to me that when performing loop upon all bins the program still loops on the original number of bins. I really want something that once applied to my histogram (here cuts) when I use Get-like method upon the modified histogram it gives me the restrained range, number of bins, etc.

Do you see what I am asking for ?

Thanks in advance

SetRangeUser acts on the TAxis limits. It does not change the bin content of the number of bins. So if you loop on all the bins you will get the same result with or without SetRangeUser. If you want only subset of the histogram why don’t you create a new one ? (just a guess) …