Hello, Dear rooters.
How I can write data to tree from text file? I plot histogram from text file, but how to do with TTree.
Thanks in advance
60Co_0cm.txt (66.8 KB)
hist.C (223 Bytes)
Hello, Dear rooters.
How I can write data to tree from text file? I plot histogram from text file, but how to do with TTree.
Thanks in advance
60Co_0cm.txt (66.8 KB)
hist.C (223 Bytes)
Your file has only one column. You can simply do:
root [0] auto t = new TTree()
root [1] t->ReadFile("60Co_0cm.txt","x");
root [2] t->Print()
******************************************************************************
*Tree : : *
*Entries : 16384 : Total = 66708 bytes File Size = 0 *
* : : Tree compression factor = 1.00 *
******************************************************************************
*Br 0 :x : x/F *
*Entries : 16384 : Total Size= 66421 bytes All baskets in memory *
*Baskets : 2 : Basket Size= 32000 bytes Compression= 1.00 *
*............................................................................*
root [3] t->Draw("x")
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
root [4]
t->Draw("x : Entry$", "", "L");