Re: Help on histogram

From: Chris Powell <cpowell001_at_gmail.com>
Date: Wed, 1 Dec 2010 18:44:21 -0800


To create a 1-d histogram use:

> TH1F *hist = new TH1F("hist", "title; x axis; y axis", nBins, xMin, xMax);

Where (xMax-xMin)/nBins is the bin width. Then given your generated numbers x1, x2, etc., use:

> hist->Fill(x1);
> hist->Fill(x2);

.
.
... etc.

to fill the histogram. From this you can get the mean (TH1F::GetMean()) and RMS (TH1F::GetRMS()) of the distribution.

Hope that helps,
Chris

On Dec 1, 2010, at 18:02, <abraham1_at_nmsu.edu> wrote:

> Dear All
> I was trying to analyse a set of data I already generated(100 raw numbers with 3
> significant figures). I wanted to make histogram with fixed bin size to study their
> distribution and if possible to find the width.
> I've been working with Root 2/3 months, but I'm having trouble on inserting raw data .
> I appreciate your suggestions
>
> Abraham
>
>
>
> ----- Original Message -----
> From: Peter Elmer <Peter.Elmer_at_cern.ch>
> Date: Monday, November 29, 2010 2:43 am
> Subject: [ROOT] ROOT 5.27/06{a,b} patch releases
> To: roottalk_at_root.cern.ch
>

>> Hi,
>> 
>> It looks like a couple of patch releases were made on top of ROOT 
>> 5.27/06in the past 6 weeks, but there is no documentation about 
>> them... (Or at 
>> least I could not find it.)
>> 
>> Could a patch page be put up to document what is in those two 
>> patch 
>> releases? 
>> 
>> (This would be useful independently of whether patch releases 
>> will 
>> continue to be made for 5.27/06 after 5.28/00 comes out...)
>> 
>>                              thanks,
>>                                Pete
>> 
>> --------------------------------------------------------------------
>> -----
>> Peter Elmer     E-mail: Peter.Elmer_at_cern.ch      Phone: +41 (22) 
>> 767-4644
>> Address: CERN Division PPE, Bat. 32 2C-14, CH-1211 Geneva 23, 
>> Switzerland---------------------------------------------------------
>> ----------------
>> 
>> 

>
> Abraham G Meles
>
Received on Thu Dec 02 2010 - 03:45:11 CET

This archive was generated by hypermail 2.2.0 : Thu Dec 02 2010 - 23:50:02 CET