Skip to content
Snippets Groups Projects
  • Rene Brun's avatar
    549b0ea1
    Modify the test program to illustrate the new classes TRef and TRefArray. · 549b0ea1
    Rene Brun authored
    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
    549b0ea1
    History
    Modify the test program to illustrate the new classes TRef and TRefArray.
    Rene Brun authored
    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