Re: [ROOT] rebin problem

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Jan 16 2001 - 14:23:37 MET


Hi Vitaliy,

TH1::Rebin returns a TH1. You must do:

   TH1F *h1 = new TH1F("h1","h1",256,0,12.5);
   TH1F *hnew = (TH1F*)h1->Rebin(8,"hnew");

Rene Brun

Vitaliy Ziskin wrote:
> 
>         These two lines work as a cint:
> 
>         TH1F *h1 = new ("h1","h1",256,0,12.5);
>         TH1F *hnew = h1->Rebin(8,"hnew");
> 
> However there do not work in a compiled code as:
> 
> #include "TH1.h"
> 
>         TH1F *h1 = new ("h1","h1",256,0,12.5);
>         TH1F *hnew = h1->Rebin(8,"hnew");
> (Give a wrong type error)
> 
> is it just a "feature" or am I doing something wrong?
> 
>                         Sincerely, Vitaliy
> =====================================================================
> Vitaliy Ziskin                                Tel: (617)253-9209
> MIT 26-547                          http://www.lns.mit.edu/people/vziskin/
> 77 Massachusetts Ave
> Cambridge, Ma
> 02139
> ======================================================================
>         "For long you live and high you fly
>          And smiles you'll give and tears you'll cry
>          And all you touch and all you see
>          Is all your life will ever be"--Pink Floyd



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