Re: Adding a TObject to a TTree

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Mon, 3 May 2010 08:25:10 +0200


You must create a dictionary for your classes "SpectrometerTrackMomentum", "SpectrometerHits". Also to avoid compilation problems do not name your pointers like your classes.

Rene Brun

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 );
>
> TObjArray* SpectrometerTrackMomentum = new TObjArray();
> tAcceptances->Branch("SpectrometerTrackMomentum", &SpectrometerTrackMomentum, 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
>
> TObjArray, instead, have segmentation violation problems...
>
> Do you have idea concerning that?
>
> Thank you in advance for any suggestion.
> Vito
>
>
>
Received on Mon May 03 2010 - 08:22:35 CEST

This archive was generated by hypermail 2.2.0 : Wed May 05 2010 - 17:50:01 CEST