Skip to content
Snippets Groups Projects
Commit 549b0ea1 authored by Rene Brun's avatar Rene Brun
Browse files

Modify the test program to illustrate the new classes TRef and TRefArray.

The following members have been added to Event.h
   TRefArray     *fHighPt;       //array of High Pt tracks only
   TRefArray     *fMuons;        //array of Muon tracks only
   TRef           fLastTrack;    //pointer to last track

In MainEvent (write part) the two arrays are filled in the loop
making the tracks. fLastTrack is set directly in AddTrack.

Split mode can be used to store in separate branches the original
tracks and the two selected track arrays. Only one copy of a track
is stored in the file. When the file is read back, one can read
in any order the TClonesArray of tracks or the other arrays.
If the array fMuons is read and the TClonesArray branches are not
read, fMuons->At(i) will return 0. When the TClonesArray is read,
fMuons->at(i) will return a pointer to the selected track number i
in the TRefArray fMuons. This will point directly to one of the
tracks in the TClonesArray.

Note that the branches fHighPt, fMuons and fLastTrack could also
be stored in separate files (may be friends of the master file).


git-svn-id: http://root.cern.ch/svn/root/trunk@2987 27541ba8-7e3a-0410-8455-c3a389f83636
parent 643f1f4b
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment