Re: hist. projection: type conversion problem

From: Axel Naumann <axel_at_fnal.gov>
Date: Wed, 16 Mar 2005 17:58:48 -0600


Hi Boris,
check http://root.cern.ch/root/html/TH2.html#TH2:ProjectionY - TH2::ProjectionY returns a TH1D*, no matter what the TH2 derived class is that you're calling ProjectionY on. So you'll have to store the return type in a TH1D*.
Axel.

Boris Skorodumov wrote:
> Hi all,
>
>
> when i am making projection TH2F to the TH1F i am getting error:
> Error: Illegal initialization of pointer, wrong type TH1D*
> if i am changing definition of my 1d histogram to TH1D - everything ok !
>
> ...............
>
> TH2F *h44 = new TH2F("h44","",2048,0,2048,2048,0,2048);
> TH1F *h4 = h44->ProjectionY("",0,2048,"cut"); not working
>
> TH1D *h4 = h44->ProjectionY("",0,2048,"cut"); working
>
> .....................
>
> Thank you,
>
> Boris.
>
Received on Thu Mar 17 2005 - 00:58:52 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:06 MET