Re: How to split object to diff. files ?

Rene Brun (brun@hpbrun.cern.ch)
Thu, 25 Jun 1998 22:39:54 +0200 (METDST)


Nikolay,
In order to make a meaningful comment, I would like to know
a bit more about your data model;
- How many tracks do you expect per event
- How many hits per track
- How many hits in total

You can redirect a branch to a separate file via
TBranch::SetFile

My preference would be for a track class like
class Track : public TObject {
TArrayS fListOfHits; //array of indices in the hits TClonesArray
Float_t fChi2; etc

Having pointers to the TClonesArray will not work if you split
to a different file or branch.
Space for a pointer will typically be 4 times the space
for an index.
The index will be highly compressed.
You can always make an operator [i] hiding the index
and pointing directly to the TClonesArray.

I would put the list of Tracks in either a TList
or better in a TObjArray.

Rene Brun

On Fri, 26 Jun 1998, Nikolay I. Root wrote:

> Dear ROOT team.
>
> First at all - thank you for help on my previous mail.
>
> I have Q's about splitting complicated objects to different branches.
> Let me consider the example :
> 'track is a collection of hits' ==>
>
> class Track : public TList { /* summary info */ }
>
> All "hits" are contained in one TClonesArray and
> "list part of track" - just a pointers to individual hits.
> Also 'track' has 'summary info' as data fields
>
> Q1: how to split :
> 'hits' --> file1 (trivial)
> 'list part of track' --> file2 ????
> 'summary info' --> file3 ?
>
>
> The second question - 'how to use tape archive ?'
>
> We have a some simple implementation of tape archive (perl scripts +
> mSQL DB) and Q. about 'interfacing' root and existing software.
>
> How to ask 'gSystem' to notify me about 'un-existing file' exceptions ?
> Are there other tips that I need to know ?
> Or other simple solution (or examples !) exists ???
> What is the 'best way' in that case ?
>
> Thanks in advance!
>
> Nikolay Root
> BINP, Novosibirsk
> email : nroot@inp.nsk.su
>
>