Following simple syntax not working for latest pyROOT
lxplus$ python3
Python 3.6.8 (default, Apr 2 2020, 13:34:55)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
>>> x=ROOT.RooRealVar("x", "x", -10, 10)
RooFit v3.60 -- Developed by Wouter Verkerke and David Kirkby
Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
All rights reserved, please read http://roofit.sourceforge.net/license.txt
>>> y=ROOT.RooRealVar("y", "y", -10, 10)
>>> roofor=ROOT.RooFormulaVar("gen", "x*y", ROOT.RooArgList(x,y))
>>> roofor.formula()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'RooFormulaVar' object has no attribute 'formula'
the functionâs visibility was changed to private when RooFormula was updated from a ROOT5 formula to a ROOT6 formula.
I guess that can be reverted, but give me a bit of time to check if itâs safe.
One question:
Do you want to change the formula or just read access? I.e., a const & or just a reference to it?
But on lxplus by default gcc-4.8.5 is used and nightly version is not available for this compiler. I tried setting alias for gcc/g++ 9.2.0 as
alias gcc='/cvmfs/sft.cern.ch/lcg/releases/gcc/9.2.0/x86_64-centos7/bin/gcc'
alias g++='/cvmfs/sft.cern.ch/lcg/releases/gcc/9.2.0/x86_64-centos7/bin/g++'
But it doesnât work, while doing import ROOT in python3, it gives *** Break *** segmentation violation error.
Could give some details on how to correctly use nightly version of ROOT in lxplus?
Somebody updated the nightlies page, and left out the information that you need dev3python3 for python3.
This worked for me:
$ source /cvmfs/sft.cern.ch/lcg/views/dev3python3/latest/x86_64-centos7-gcc8-opt/setup.sh
$ python3 -c "import ROOT; x = ROOT.RooRealVar('x', 'x', 0); x.Print()"
RooFit v3.60 -- Developed by Wouter Verkerke and David Kirkby
Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
All rights reserved, please read http://roofit.sourceforge.net/license.txt
RooRealVar::x = 0 C L(-INF - +INF)
(The nightlies page will soon mention an easier way to get ROOT and correct compiler in one go.)