Re: fixed bin width

From: John <idarraga_at_cern.ch>
Date: Tue, 8 Jul 2008 10:21:09 -0400


OK, get it ... what I have done in the past is to maintain the values that I am going to use to fill my histogram in a data structure (a simple array for example). Then I figure my limits and proper binning. It is only at the very end that I define the histogram and procced to fill it up from the array. I don't know if you like this idea. If you need an example let me know.

Did you noticed that TH1F::Fill(Double_t x) returns -1 when you enter a value out of range ? That helps you out detecting when you are filling out of the defined range.

cheers,

John Idarraga
UMontreal

Adrian Sevcenco wrote:

> Àstrid Morreale wrote:

>> you could use a tree instead of a Histogram, I think I tree is more
>> flexible in that regard.
> Very true ... this was my first thought and intention .. but i just
> wanted to ask about this ... it would simplify some quick things that
> sometime one have to do ...
> Thanks,
> Best regards,
> Adrian
> 

>> Adrian Sevcenco ha scritto
>> <°> John wrote:
>> <°>> I don't understand your question yet ... when you define a
>> histogram,
>> <°>> you have a fixed number of bins already. When you say " ... keep
>> <°>> scaling the axis range automatically as it is filled ... " you
>> mean the
>> <°>> y axis ?
>> <°>>
>> <°>> regards,
>> <°>>
>> <°>> John Idarraga
>> <°>> UMontreal
>> <°> Well ... my wish is just to define a histogram with lets say 1 bin
>> with
>> <°> the bin width = 1 ... and if i fill with, lets say 15,
>> automatically the
>> <°> histogram will resize to have 16 bins with range extended up to
>> value 16...
>> <°> well... if its too far fetched i will just cope with what i have ...
>> <°> Best regards,
>> <°> Adrian
>> <°>
>> <°>> Adrian Sevcenco wrote:
>> <°>>> Hi,
>> <°>>> Is there a possibility of setting up a histogram with a fixed
>> bin width
>> <°>>> that will keep scaling the axis range automatically as it is
>> filled?
>> <°>>> Thank you,
>> <°>>> Best regards,
>> <°>>> Adrian
>> <°>>>
>> <°>>>
>> <°>>
>> <°>
>>
>>

>> -Àstrid
>>

>> ===============================================
>> http://www.phenix.bnl.gov/~astrid/
>> ================================================
>> Àstrid Morreale
>> University Of California_at_Riverside
>> PHENIX SPIN Physics Group
>> http://www.phenix.bnl.gov/phenix/WWW/physics/spin/
>> E-mail: astrid_at_bnl.gov |Tel(BNL):631-344-7266
>> |Fax(BNL):631-344-3253
>> A_A
>> (-.-)
>> |-|
>> / \
>> | | __
>> | || | | \_/
>> \_||_/_/
>> ¯`·.¸.·´¯`·.¸.·´¯`·.><((((º>
>> ===============================================
>> Vidi ch'un s'affaccia quacchi fungi!!!!!
> Received on Tue Jul 08 2008 - 16:27:38 CEST

This archive was generated by hypermail 2.2.0 : Tue Jul 08 2008 - 17:50:02 CEST