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 Mon Jul 24 2006 - 20:31:09 MEST
This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:00 MET