Hi,
when I run this script (test.py which requires also myimodel.C and myfcn.C):
[code]import ROOT
from array import array
ROOT.gROOT.ProcessLine(".L myimodel.C++g")
ROOT.gROOT.ProcessLine(".L myfcn.C++g")
x = array(‘d’,[1.])
p = array(‘d’,[1,2])
fitter = ROOT.Fit.Fitter()
fitdata = ROOT.Fit.BinData(1000,1,ROOT.Fit.BinData.kNoError)
fitdata.Add(0,1)
fitdata.Add(1,2)
fitdata.Add(2,3)
myimodel = ROOT.MyIModel()
myfun = ROOT.MyFCN(fitdata,myimodel)
fitter.FitFCN(myfun,p,3)
fitter.Result().Print(ROOT.cout,ROOT.true)[/code]
I get this output (results of the fit seems to be OK and are omited…):
Info in <TUnixSystem::ACLiC>: creating shared library /home/jiri/workspace/./myimodel_C.so
Info in <TUnixSystem::ACLiC>: creating shared library /home/jiri/workspace/./myfcn_C.so
Error in <TClass::New>: cannot create object of class basic_ostream<char,char_traits<char> >
Error in <TClass::New>: cannot create object of class basic_ios<char,char_traits<char> >
Error in <TClass::New>: cannot create object of class ios_base
TStreamerInfo::Build::0: RuntimeWarning: basic_ios<char,char_traits<char> >: base class ios_base has no streamer or dictionary it will not be saved
TStreamerInfo::Build::0: RuntimeWarning: basic_ostream<char,char_traits<char> >: base class basic_ios<char,char_traits<char> > has no streamer or dictionary it will not be saved
...
i.e. several errors/warnings. The are caused by the last line in the test.py:
fitter.Result().Print(ROOT.cout,ROOT.true)
If one converts the test.py to equivalent test.C script (see attachment) and run test.C under CINT then there are no errors/warnings in the output.
Is there any way how to fix the errors and warnings if one uses pyroot?
Thank you in advance,
Jiri
ROOT revision 34604
myfcn.C (237 Bytes)
myimodel.C (1.3 KB)
test.C (449 Bytes)
test.py (437 Bytes)