Hi,
is there any way i can import an ascii (tab separated) 2d histogram into root?
Thanks,
Jens
Hi,
is there any way i can import an ascii (tab separated) 2d histogram into root?
Thanks,
Jens
Do you really mean a 2-D histogram?
In this case you have to know the number of points in X and Y somewhere.
In case you meant just a set of N points X,Y, you can have a look
at the TGraph constructor
TGraph(const char *filename, const char *format="%lg %lg", Option_t *option="");
For example TGrapg g(“myfile.dat”);
will automatically create a TGraph object from the list of points in myfile.dat.
If you really meant a 2-D histogram, you can write a short script
looping on the points in teh file and filling the histogram.
You can see an example reading an ascii file in $ROOTSYS/tutorials/basic.C
Rene