Re: Filling a TH1

From: Vassili Maroussov <Vassili.Maroussov_at_cern.ch>
Date: Tue, 25 Jul 2006 14:52:34 +0200


Dear Martin and Philippe,

thank you very much. The use of the "Project" method of TTree is almost exactly what I was looking for. It allows to retain control over nbin, min and max.

Cheers,

Vassili.

Martin Simard wrote:

>Hi Vassili,
>
>there is also a function "Project" if you don't want to Draw histogram
>everytime you fill histograms.
>
>TCut Cut1 ="any cuts you want"
>TH1F *h1 = new TH1F("h1","h1",nbin,min,max);
>ntuple_name->Project("h1","leafname",Cut1);
>
>Cheers,
>Martin
>
>On Mon, 24 Jul 2006, Philippe Canal wrote:
>
>
>
>>Hi Vassili,
>>
>>We have the reverse interface (TTree::Draw) which can fill an
>>histogram from a tree give a leaf and histogram
>>T->Draw("leafname>>histoname");
>>
>>Cheers,
>>Philippe.
>>
>>-----Original Message-----
>>From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch]
>>On Behalf Of Vassili Maroussov
>>Sent: Monday, July 24, 2006 10:20 AM
>>To: roottalk_at_pcroot.cern.ch
>>Subject: [ROOT] Filling a TH1
>>
>>Dear ROOTers,
>>
>>I'm wondering whether there is a function in ROOT to fill a TH1 with a
>>single reference to a branch/leaf of a tree, with no setting a branch
>>address and explicit looping over all entries in the user code; a
>>function with signature like TH1.Fill(TLeaf,...)
>>
>>Regards,
>>
>>Vassili.
>>
>>
>>
>>
>>
Received on Tue Jul 25 2006 - 14:52:41 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:00 MET