Hi Vincent,
The ability to drill through un-split object in the TBrowser is new and *as
you noticed) not complete yet.
We will check into this case.
In the meantime, you can still access your data simply by typing the corresponding draw command:
mytree->Draw("theTracks.Hits.r");
Note that the @size (when it works :) ) is used to draw an histogram of the number of elements in the collection.
Cheers,
Philippe
From: Vincent Roberfroid [mailto:roberfroid_at_fynu.ucl.ac.be]
Sent: Wednesday, May 18, 2005 8:19 AM
To: Philippe Canal
Cc: roottalk_at_pcroot.cern.ch
Subject: Re: [ROOT] TClonesArray of Tracks with a TClonesArray of Hits as a
data member
Hi Philippe,
Thank you for your answer.
I used root 4.02/00.
But it does not work with root 4.04/02.
When I click on "theTracks.Hits" I get also the same message :
Warning in <TSelectorDraw::ProcessFillObject>: Not implemented for
TClonesArray
I have also an new variable in the Track branch : "@size". But when I click on it I get the following message : Error in <TTreeFormula::DefinedVariable>: Unknown method:GetEntries() in Track
*ERROR 30 :
Bad numerical expression : "Track.GetEntries()"
It is maybe related ?
Vincent
Philippe Canal wrote:
So, how can I do to see the variables r, phi and z of a hit belonging to
a Track ? The split level is good ? Is it possible to have a TClonesArray
in a
TClonesArray include in a TTree ?
It is possible to have a TClonesArray within a TClonesArray. However they
can not be split. To see the data member in the Browser you should use
ROOT 4.04/02 (note that you forgot to mention which version of ROOT you
were using).
Cheers, Philippe. -----Original Message----- From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Vincent Roberfroid Sent: Wednesday, May 18, 2005 4:10 AM To: roottalk_at_pcroot.cern.ch Subject: [ROOT] TClonesArray of Tracks with a TClonesArray of Hits as a data member Dear root users, I have a TTree containg a TClonesArray of Tracks (a class derivating from TObject). And a data member of Track is also a TClonesArray containing Hits (an other class derivating from TObject). So here is the structure : class Track : public TObjectReceived on Wed May 18 2005 - 15:31:11 MEST
{
public : double R; /** track parameters **/ double phi0; int Nhits; ... TClonesArray *Hits; /* all the hits in a TClonesArray */ } Track::Track(axial_track *atrack) /* the constructor - axial_track is just a struct*/
{
R=atrack->R; phi0=atrack->phi0; for(int i=0; i<Nhits;i++) new(Hits->operator[](i)) Hit(atrack->mvdhit[i]); /* Fill the TClonesArray */ } //----------------------------------- class Hit : public TObject
{
public : float r; /** r-phi cluster position **/ float phi; float z; ... } And in the main : TTree *outTTree = new TTree("outTTree","Output TTree"); TCLonesArray *theTracks = new TClonesArray("Track",100); outTTree->Branch("theTracks",&theTracks,4000,2); The code runs well, the variables R, phi0 and Hits are visible in the Track branch, but when I click on Hits I get the following message : Warning in <TSelectorDraw::ProcessFillObject>: Not implemented for TClonesArray So, how can I do to see the variables r, phi and z of a hit belonging to a Track ? The split level is good ? Is it possible to have a TClonesArray in a TClonesArray include in a TTree ? And is it possible to use the TreeViewer with it ? Thanks a lot. Vincent
This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:08 MET