You’ll have to show us your 1dhistogram.txt file for us to figure out what’s going on (and for us to test your simple macro). You should also explain what exactly “doesn’t work” means: what did you expect to happen, or what unexpected thing happened?
You should also tell us how you are running the macro. Are you doing: .L foo.C+, .x foo.C, compiling outside of ROOT with g++, etc.
My guess is that it has to do with the type descriptors that are needed for TTree::ReadFile to properly set up the branches, but without 1dhistogram.txt I can’t tell for sure.
Hey thanks for your input. Yeah I should have been more specific.
it is a macro that is run by the “.x 1d histogram.c” command in CINT.
I have looked through a couple of different things online including:
and
and I have also checked out the Readfile link you point me towards. I tried adding a TBranch.h header file to the macro but that apparently wasn’t the problem.
I wonder where I messed up.
The data file are floats and there is only one column:
Like:
29.10
33.1
55.2
52.10
33.2
42.1
…
…
…
The error message I get is:
Error: Can’t call TTree::Readfile('onedhistogram.txt,“x”) in current scope [directory of my macrofile].c(13)