h->GetBinContents(i) <<< to check if it's negative
h->SetBinContents(i,0) <<<< to set it to zero
But are you sure you want to distort result like this? Negative bin content can be perfectly sensible information when you subtract histograms.
-Art S.
A.E. Snyder, Group EC \!c*p?/ SLAC Mail Stop #95 ((. .)) Box 4349 | Stanford, Ca, USA, 94309 '\|/` e-mail:snyder_at_slac.stanford.edu o phone:650-926-2701 _ http://www.slac.stanford.edu/~snyder BaBar FAX:650-926-2657 Collaboration
On Tue, 5 Sep 2006, Marco Calviani wrote:
> Hello rooters,
> i have a problem with a histogram: i've subtracted one histogram
> from the other and put the result into another one. However the
> content of some bins is negative. Is it possible in a simple way to
> set to zero the content of negative bins?
>
> Thanks in advance,
> Marco Calviani
>
>
Received on Tue Sep 05 2006 - 19:58:28 MEST
This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:00 MET