Re: TClonesArray typecasting

From: Peter Kvasnicka <kvasnicka_at_ipnp.troja.mff.cuni.cz>
Date: Tue, 14 Nov 2006 20:41:38 +0100 (CET)


Hi,
looks like an additional pair of brackets could do the job, ((TH1F *) bigArr[chan])->Fill(j, value);

Peter

> 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 - 20:37:12 MET

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