Re: Adding a TObject to a TTree

From: Suvayu Ali <fatkasuvayu_at_gmail.com>
Date: Sat, 1 May 2010 23:57:47 -0700


Hi Vito,

I have only used TClonesArray, so I will try to answer only that part of your question.

On Saturday 01 May 2010 11:46 PM, Vito Palladino wrote:
>
> Dear Rooters,
>
> I'm "simply" trying to save some tobjects in a tree, in particular a TClonesArray and a TObjArray.
> The code I'm using is:
>
> TClonesArray* SpectrometerHits = new TClonesArray();
> tAcceptances->Branch( "SpectrometerHits",&SpectrometerHits, 256000, 0 );
>
>....
> My problem is different these two cases:
>
> TClonesArray gives the error message:
> Error in<TTree::Bronch>: TClonesArray with no class defined in branch: SpectrometerHits
>

I think you need to declare them like this,

TClonesArray SpectrometerHits("myClassName", nelements); tAcceptances->Branch( "SpectrometerHits",&SpectrometerHits, 256000, 0 );

> Thank you in advance for any suggestion.
> Vito
>

GL

-- 
Suvayu

Open source is the future. It sets us free.
Received on Sun May 02 2010 - 08:57:59 CEST

This archive was generated by hypermail 2.2.0 : Sun May 02 2010 - 17:50:01 CEST