Hi,
I am using ROOT v6.04.14 in Debian 8.0. I am saving to a canvas a RooDataSet and a RooGausian, then I save the canvas as a cxx file. When I do
campoverde@johns:~/Test/Test_RooFit2/bin$ root -l roofit_ex.cxx
root [0]
Processing roofit_ex.cxx...
In file included from input_line_9:1:
/nfs/monet_3/home/campoverde/Test/Test_RooFit2/bin/roofit_ex.cxx:652:23: error: use of undeclared identifier 'x'
Double_t gaus_Norm[x]_fx1[114] = {
^
/nfs/monet_3/home/campoverde/Test/Test_RooFit2/bin/roofit_ex.cxx:652:25: error: expected ';' at end of declaration
Double_t gaus_Norm[x]_fx1[114] = {
^
;
/nfs/monet_3/home/campoverde/Test/Test_RooFit2/bin/roofit_ex.cxx:767:23: error: use of undeclared identifier 'x'
Double_t gaus_Norm[x]_fy1[114] = {
^
/nfs/monet_3/home/campoverde/Test/Test_RooFit2/bin/roofit_ex.cxx:767:25: error: expected ';' at end of declaration
Double_t gaus_Norm[x]_fy1[114] = {
^
;
/nfs/monet_3/home/campoverde/Test/Test_RooFit2/bin/roofit_ex.cxx:882:45: error: use of undeclared identifier 'x'
TGraph *graph = new TGraph(114,gaus_Norm[x]_fx1,gaus_Norm[x]_fy1);
^
/nfs/monet_3/home/campoverde/Test/Test_RooFit2/bin/roofit_ex.cxx:882:62: error: use of undeclared identifier 'x'
TGraph *graph = new TGraph(114,gaus_Norm[x]_fx1,gaus_Norm[x]_fy1);
The computer gives me a lot of errors. The same does not happen when I draw in the canvas objects of classes that dont belong to RooFit. How should I fix this? I attached a very short and simple example.
Cheers.
Test_RooFit2.zip (1.77 KB)