How to write a TClonesArray to a TTree
The following tests can be run Interactive tests
Batch tests: same as above but with no graphics
root -b -q tcl.C
root -b -q tcl.C++
root -b -q "tcl.C(1)"
root -b -q "tcl.C++(1)"
void tclwrite(
Int_t split)
{
TFile f(
"tcl.root",
"recreate");
T.
Branch(
"tcl",&arr,256000,split);
for (
Int_t ev=0;ev<10000;ev++) {
if(nlines < 0) nlines = 1;
for (
Int_t i=0;i<nlines;i++) {
new(ar[i])
TLine(x1,y1,x2,y2);
}
}
}
void tclread()
{
TH2F *h2 =
new TH2F(
"h2",
"center of lines",40,0,1,40,0,1);
for (
Int_t i=0;i<nlines;i++) {
}
}
}
{
tclwrite(split);
tclread();
}
- Author
- Rene Brun
Definition in file tcl.C.