What is the command to import a basic ntuple file?

I have ntuple data files I would like to use to build histograms with. Is it possible to read these into ROOT in a simple way?

TFile f("your_ntuple_file.root");
Your-nutple->Draw();

This is very basic. You better read a bit the doc, or look at the few examples (all from the ROOT web site).

[quote=“couet”] TFile f("your_ntuple_file.root"); Your-nutple->Draw();

This is very basic. You better read a bit the doc, or look at the few examples (all from the ROOT web site).[/quote]

I have plain tabulated sets of numbers that I want to analyze with ROOT. So in case that’s not clear, these files were not created with ROOT. I need to import them.

Using the above command on those files produces the error message

Error in TFile::Init: your_ntuple_file.root not a ROOT file

This does not seem to work.

Ah ok so you do not have a Ntuple file as you said in your 1st post.
In that case use:
root.cern.ch/root/html/TTree.html#TTree:ReadFile

[quote=“couet”]Ah ok so you do not have a Ntuple file as you said in your 1st post.
In that case use:
root.cern.ch/root/html/TTree.html#TTree:ReadFile[/quote]

Yes, I do have ntuple files, which are just a simple tabulated set of numbers. That’s what ntuple means. What were you referring to?

In my mind: Ntuple file <==> ROOT File … :slight_smile: that was a shortcut …
But you are right a ntuple can reside in an ASSCI file.
Use the method I recommended to transform your ASCII file into a ROOT Tree.

Is it correct to create a Tree and then fill it by using the ReadFile? What is a simple way to plot two variables against each other to make sure it read the data correctly? I am not sure that this did what I wanted it to even though I did not get an error.

http://root.cern.ch/download/doc/ROOTUsersGuideHTML/ch12.html
http://root.cern.ch/download/doc/ROOTUsersGuideHTML/ch12s20.html
http://root.cern.ch/root/html/TTree.html#TTree:Draw@2