Re: [ROOT] Bug in TNtuple when only one branch is defined

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu May 17 2001 - 11:05:10 MEST


Hi Malcom,

There are two Fill functions for the TNtuple class:

   virtual Int_t   Fill(const Float_t *x);
   virtual Int_t   Fill(Float_t x0, Float_t x1, Float_t x2=0, Float_t x3=0,

In the particular case of one single branch, you should specify a second
dummy argument to Fill or use the first form with an array.

Rene Brun

Malcolm Davidson wrote:
> 
> Dear Developers,
> 
> I believe I've found a bug in TNtuple.Fill() (and presumably in TTree as
> well) when only one branch is defined, to whit
> 
> 1) the normal behaviour say for two branches works fine
>         TNtuple *toto=new TNtuple("toto","toto","wah1:wah2");
>         toto->Fill(20.0,25.0);
> 
> 2) for a single branch
>         TNtuple *toto=new TNtuple("toto","toto","wah1");
>         toto->Fill(20.0)
> causes an error.
> 
> While I'm at it what is the best way to store simple float arrays in ROOT
> files ? Since TArray does not derive from TObject I'm forced to use one
> branch ntuples.
> 
> Kind regards
> 
> Malcolm
> 
> <>------------------------------------------------<>
> Malcolm W. J. Davidson
> CESBIO - UMR 5639 CNES-CNRS-UPS
> 18 Avenue Edouard Belin
> BP 2801
> F-31401 Toulouse Cedex 4  France
> e-mail : davidson@cesbio.cnes.fr
> phone (33)(0)5.61.55.85.84
> fax   (33)(0)5.61.55.85.00
> <>------------------------------------------------<>



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:45 MET