Dear All, you may be interested in a macro I wrote to help in making a much more flexible reading of text files into TGraphErrors within root. As you probably know you can read from a datafile suing the constructor TGraphErrors(filename,format) with format ="%lg %lg %lg %lg" if the data are in 4 columns with x y dx dy. Say what if the file contains columns of x dx y dy <pt> d<pt> and you want to read in and plot <pt> vs x. well root does not help you, but the macro I wrote GraphFromFile.C can help you. do a > .L GraphFromFile.C+ >TGraphErrors *gr = GraphFromFile(filename,"x dx dummy dummy y dy") and an graph with the proper data are created. At present only records stating with a '#" are ignored, so it is not completely flexible, but quite good in my opinion. Please see brahms_app/fv_app/analysis/Macros/GraphFromFile.C if you are interested. This may have been invented before, but I did not find it. regards Flemming' -------------------------------------------- Flemming Videbaek Physics Department Bldg 510-D Brookhaven National Laboratory Upton, NY11973 phone: 631-344-4106 cell: 631-681-1596 fax: 631-344-1334 e-mail: videbaek @ bnl gov _______________________________________________ Brahms-dev-l mailing list Brahms-dev-l_at_lists.bnl.gov https://lists.bnl.gov/mailman/listinfo/brahms-dev-lReceived on Mon Jul 23 2007 - 20:44:36 EDT
This archive was generated by hypermail 2.2.0 : Mon Jul 23 2007 - 20:46:03 EDT