Re: [ROOT] "Form" help needed

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Nov 06 2003 - 14:01:22 MET


Hi Daan,

Form is a nice utility, but it accepts only int, double and chars, not float
or shorts.
In your case use a Double_t array or cast (Double_t)zs[0]

Rene Brun

daan wrote:
> 
> Hi,
> 
> I tried to do the following in a root script:
> 
> Float_t zs[4] = {-55, 105, 305, 525};
> TCanvas canv;
> n1f1->Draw("prob:t_phot",Form("z == %f && rho == 9 && phi > 1.3 && phi < 1.5",zs[0]),"");
> 
> The script opens a canvas, displays the date (thanks to SetOptDate()), but
> does not display a plot of the ntuple "n1f1". The Form does not substitute
> the %f with zs[0] and thus a plot cannot be drawn.
> 
> How can I use the Form() then in the selection part of the TNtuple::Draw()
> method?
> 
> daan



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET