TTree as a database

William J Deninger (deninger@uiuc.edu)
Sat, 11 Apr 1998 19:53:08 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_0006_01BD6583.73A3D5C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,

I understand that the only way to expand an existing TTree database is =
by adding additional. However, how would one add data to a TTree which =
is relevant to a specific data item of a TObjArray (on an existing =
branch) and maintain a data hiarchial organization?=20

An example: When dealing with particle tracking drift chambers, one =
begins with a set of drift times for each sense wire in a given particle =
track event. These drift times are stored in a drift structure which is =
listed in a TObjArray. =20

Data stored in first branch (called raw) during first pass of data:=20
class TRawData
{=20
Int_t run number,
Int_t fill number,
...
TClonesArray *wires; // wires("TMpxEvent")
}
with=20
class TMpxEvent
{
Int _t index;
Int_t time;
T3DPoint p1;
T3DPoint p2;
...
}

Once this database of particle track events is create, drift spectrums =
are created using the entire data set which map sense wire drift times =
to distances. Now, how would I incorporate this sense wire distance =
information into the TTree such that I can reference it relative to each =
of the sense wire drift structures?

Following first pass, I can do
tree->Draw("wires.time"); // works great.

Following the second pass over data, I would like to do the following:
tree->Draw("wires.distance","time =3D xxx && index =3D xxx");

I understand this can be accomplished by moving all the sense wire data =
(TMpxEvent) directly onto the branch and performing a tree->Fill() for =
each wire, but that would require run_number, fill_number... etc in =
TRawData be written up to 50 times more often than necessary in the =
TFile.

William J Deninger

------=_NextPart_000_0006_01BD6583.73A3D5C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">

Hello,
 
I understand that the only way to expand an existing = TTree=20 database is by adding additional.  However, how would one add data = to a=20 TTree which is relevant to a specific data item of a TObjArray (on an = existing=20 branch) and maintain a data hiarchial organization?
 
An example: When dealing with = particle=20 tracking drift chambers, one begins with a set of drift times for each = sense=20 wire in a given particle track event.  These drift times are stored = in a=20 drift structure which is listed in a TObjArray. 
 
Data stored in first branch (called = raw) during=20 first pass of data:
class TRawData
    Int_t run number,
     Int_t fill = number,
     ...
    TClonesArray *wires; //=20 wires("TMpxEvent")
}
with
class TMpxEvent
{
Int _t index;
Int_t time;
T3DPoint p1;
T3DPoint p2;
...
}
 
Once this database of particle track events is = create, drift=20 spectrums are created using the entire data set which map sense wire = drift times=20 to distances. Now, how would = I=20 incorporate this  sense wire distance information into the TTree = such that=20 I can reference it relative to each of the sense wire drift=20 structures?
 
Following first pass, I can = do
tree->Draw("wires.time"); // works=20 great.
 
Following the second pass over data, = I would=20 like to do the following:
tree->Draw("wires.distance","time =3D xxx = &&=20 index =3D xxx");
 
I understand this can be = accomplished by moving=20 all the sense wire data (TMpxEvent) directly onto the branch and = performing a=20 tree->Fill() for each wire, but that would require run_number, = fill_number...=20 etc in TRawData be written up to 50 times more often than necessary in = the=20 TFile.
 
William J Deninger
 
 
 
------=_NextPart_000_0006_01BD6583.73A3D5C0--