Hey All
I have a function:
[code]def make_parameters_text_file(fit_result, path_to_save_text_file):
""“Print the RooFitResult printed all nicely to the file ‘pars.txt’”""
# check the path makes sense and fix if nessicary
if not path_to_save_text_file.endswith("/pars.txt"):
if path_to_save_text_file.endswith("/"):
path_to_save_text_file += "pars.txt"
else:
path_to_save_text_file += "/pars.txt"
print "saving parameters to:", path_to_save_text_file
# (re)create output file
text_file = open(path_to_save_text_file, "w")
# print the RooFitResult
fit_result.floatParsFinal().printMultiline(text_file.write, 1111 , True);
text_file.close()
return
[/code]
Which, of course, won’t work because “text_file” is not a C++ ostream. Is there a way to use the RooFitResult’s nice print options?