#include #include // from ROOT #include "TFile.h" #include "TMath.h" #include "TF1.h" void EvaluateFormulas(){ TFile testfile("testfile.root", "read"); TF1 f1 = *((TF1*)testfile.Get("f1")); f1.Print("V"); std::cout << "function value of f1 at x = 1 is " << f1.Eval(1) << std::endl; TF1* f2 = (TF1*)testfile.Get("f2"); f2->Print("V"); std::cout << "function value of f2 at x = 1 is " << f2->Eval(1) << std::endl; testfile.Close(); }