I have the same problem as illustrated in this post:
[url]Read tree with variable branch size from file
It was never responded to so I hope to pick up the topic. To paraphrase, the following works:
==== sample.txt ====
Len/I:Array[2]/D
2 1.1 2.1
2 3.1 4.1
2 5.1 6.1
root [0] TTree *tree = new TTree()
root [1] tree->ReadFile("sample.txt")
root [2] t->Scan()
***********************************************
* Row * Instance * Len * Array *
***********************************************
* 0 * 0 * 2 * 1.1 *
* 0 * 1 * 2 * 2.1 *
* 1 * 0 * 2 * 3.1 *
* 1 * 1 * 2 * 4.1 *
* 2 * 0 * 2 * 5.1 *
* 2 * 1 * 2 * 6.1 *
***********************************************
(Long64_t)6
Changing the array size to be variable does not work:
==== sample.txt ====
Len/I:Array[Len]/D
1 1.1
2 2.1 3.1
3 4.1 5.1 6.1
root [0] TTree *tree = new TTree()
root [1] tree->ReadFile("sample.txt")
root [2] t->Scan()
***********************************************
* Row * Instance * Len * Array *
***********************************************
* 0 * 0 * 1 * 1.1 *
* 1 * 0 * 2 * 2.1 *
* 1 * 1 * 2 * 6.95e-310 *
* 2 * 0 * 3 * 4.1 *
* 2 * 1 * 3 * 6.95e-310 *
* 2 * 2 * 3 * 2.24e-314 *
***********************************************
(Long64_t)6
The ultimate goal is for a way to write waveforms to an ascii a format (like “nsamples/I:x[nsamples]:y[nsamples]”) that can be easily sucked up by root. I’ve spent enough time on this that I could have written a ascii->tree parser like everyone else does… but now this is just bothering me! Thanks.