Re: TClonesArray typecasting

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Tue, 14 Nov 2006 19:48:57 +0100


Replace
(TH1F *) bigArr[chan]->Fill(j, value);
by
(TH1F *) bigArr[chan])->Fill(j, value);

Rene Brun

George Locke wrote:
> Hey all,
>
> This is a simple question. i'm using the latest root (5.13.04) on
> windows 2000, compiling with visual C++ 2005 (aka msvc 8).
>
> i filled a TClonesArray with TH1F's, and now i want to fill the
> histograms.
>
> this code returns the error "'Fill' : is not a member of 'TObject'"
> (TH1F *) bigArr[chan]->Fill(j, value);
>
> what should i write instead?
>
> for context:
> i declared the TClones array with this line:
> TClonesArray bigArr("TH1F", 8);
>
> and i filled it with this line:
> new(bigArr[chan]) TH1F(name,title,HIST_SIZE,0,HIST_SIZE);
>
> Thanks for answering such a simple question,
> George
Received on Tue Nov 14 2006 - 19:49:06 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:02 MET