Fwd: Root Framework as Object Oriented DB:help

From: Luca Boncagni <boncagni_at_frascati.enea.it>
Date: Wed, 28 Feb 2007 14:25:45 +0100

Just To Share discussion!

Good Works!

On Wed, 28 Feb 2007 12:45:27 +0100
  Rene Brun <Rene.Brun_at_cern.ch> wrote:
>Luca,
>
>You declare a Tree friend of another Tree only in the
>analysis macro.
>The friend Tree and the main Tree must have similar
>number of entries, such that when doing
> mainTree.GetEntry(i);
>the data in the friend Tree for entry i is also read in
>memory and you can correlate data between
>the two Trees.
>
>You make a Tree TF friend of mainTree, you do not have to
>clone mainTree (this would be very expensive of course).
>

>Rene
>
>Luca Boncagni wrote:
>> On Wed, 28 Feb 2007 10:49:59 +0100
>> Rene Brun <Rene.Brun_at_cern.ch> wrote:
>>> Hi Luca,
>>>
>>> From your description, it looks like TTree is OK for
>>>this job (even
>>> recommended).
>>> You do not need to replace a branch in this case. And if
>>>you need it
>>> is better to create a parallel Tree
>>> that you declare a friend of the original Tree.
>>> TTree is designed to loop quickly on a very large number
>>>of events.
>>> TObject::write allows read/writes, but will not scale
>>>above N
>>> thousands of keys in the same directory.
>>>
>>> Rene
>>>
>>>
>>> Luca Boncagni wrote:
>>>> On Tue, 27 Feb 2007 13:50:00 +0100
>>>> Rene Brun <Rene.Brun_at_cern.ch> wrote:
>>>>> Hi Luca,
>>>>>
>>>>> TTrees are not convenient for multiple writes. They are
>>>>>designed to
>>>>> be write once/read many times.
>>>>> To replace objects, you should use the basic
>>>>>object.Write function
>>>>> or derivatives like
>>>>> TDirectory::WriteObjectAny.
>>>>>
>>>>> To give a more precise advice, I would need to know how
>>>>>many
>>>>> entries you are planning
>>>>> for a given DB and what is the access pattern and
>>>>>frequency.
>>>>>
>>>>> Rene Brun
>>>>
>>>> Hi Rene,
>>>>
>>>> We are talking about Tokamak experiment,
>>>>
>>>> We would archive data for each shot of the machine until
>>>>they need.
>>>>
>>>> Each shot of the machine generate several run of measure
>>>> So each run is a single sample of all measures
>>>> The right dimension of RAW data per shot will be soon
>>>>known..like a
>>>> Terabyte per shot divided in "n" runs depends on
>>>>sampling
>>>> frequency...parameters that will soon known (I hope).
>>>>
>>>>
>>>> I've implemented our Object's hierarchy extendig TObject
>>>>and i've
>>>> produced a shared library with dictionary as explained
>>>>in root User
>>>> guides and all works. The library provides a set of 15
>>>>(in future
>>>> maybe more) Classes that are the basic data set that can
>>>>be read or
>>>> write into file by an user program. Each Class is
>>>>structured with
>>>> subClasses or primitive ROOT datatype Int_t,
>>>>Double_t...or pointers
>>>>
>>>> I've done some basic tests (order of 10Mb) with TFile
>>>>and
>>>> Objec.write methods and it works
>>>> Some Considerations and questions:
>>>>
>>>> Using the same key for an object due to cycle for the
>>>>object (as
>>>> reported in documentation)
>>>>
>>>> Using the TFile::Get(key) method i take the last cycle
>>>>and Using
>>>> TTFile::Get(namecycle) i take the cycle i want
>>>> Using File::Delete(namecycle) i markup as deleted the
>>>>cycle i want
>>>> but do not erase object
>>>> In the hope of use TFiles of ROOT as persistent storage
>>>>we will
>>>> provide some tools for "File optimization" or they
>>>>already exists?
>>>>
>>>>
>>>> How Many File Should I use will depends only by OS File
>>>>dimension OR
>>>> can U give some others consideration except for the
>>>>fact that the
>>>> Best Way of arrange data in the files depends on how
>>>>them should
>>>> projected to the final user and how them should used by
>>>>other user
>>>> Program.
>>>> for example using same files for same objects may speed
>>>>up something?
>>>>
>>>> We want structure the TFile(s) in Folders to give a
>>>>projection of
>>>> data via TBrowser...like a TTree
>>>>
>>>> ...we are thinking one file per shot and run pair
>>>>
>>>>
>>>> Best Regards
>>>>
>>>>
>>>>>
>>>>> Luca Boncagni wrote:
>>>>>> Hi,
>>>>>> We are planning to use root framework to implement an
>>>>>>Object
>>>>>> Oriented Db using TTree.
>>>>>>
>>>>>> here a little question:
>>>>>>
>>>>>> Suppose that we have a TTree with m branches each of
>>>>>>which
>>>>>> contains n events, all stored in a file.
>>>>>>
>>>>>> We see the possibility to get a single Entry of a branch
>>>>>> using TBranch::GetEntry method submitting the entry
>>>>>>number
>>>>>> but we don't know how update a single entry Is this
>>>>>>Possible??
>>>>>>
>>>>>
>>>
>>
>> Thk u Rene,
>> there are some erros in my description ...let me
>>explain:
>>
>> First of all we agree with u :) (and Valery Fine that
>>say that all
>> experimentl measures should write once).
>>
>> We will try to put more Tree in a single "Shot TFile",
>>one for run.
>> This because only the first run of each shot contains a
>>lot of
>> data(terabytes), the others run will only contain some
>>data deriving
>> by calculus from the first run and configurations
>>parameter deriving
>> by a "Reference run" of a "Reference shot" (so by a
>>TTree in some
>> file), so each time is needed i can create a new tree
>>and put new
>> created data.
>>
>> Assuming for a "TFile name" this schema:
>><ExperimentName>_<shot>.root
>>
>> Ex 1:
>>
>> File Exp_1.root
>> Tree1
>> |_Obj1
>> |_Obj2
>>
>> Tree2
>> |_Obj3
>> |_Obj4
>>
>>
>> TreeN
>> |_ObjN
>>
>> Question: Should I make Tree1 Friend of Tree2 and so on
>>each time that
>> i create a new tree or only before reading with some
>>macro?
>>
>> Ex2:
>>
>> Consider the File Exp_1.root of Ex 1 and a new TFile
>>Exp_2.root
>> which references the run say "M" (1<M<=N) of shot 1
>>
>> Question: Could I make friend also them without cloning
>>the content of
>> reference Tree?
>> Thk u Again
>

Rene,
If i put one entry for tree could work?
so i can Delete the tree in the File if some Human error Occurs Received on Wed Feb 28 2007 - 14:25:48 CET

This archive was generated by hypermail 2.2.0 : Wed Feb 28 2007 - 17:50:00 CET