[quote=“wlav”]Laurence,
my guess is that in more recent versions, the auto-dict generator will kick in; whereas in older versions, you’ll have to supply the dictionary yourself.
Can you check whether “somevariable” has (std::map) methods in the older release?
Cheers,
Wim[/quote]
Hi Wim,
It does have access to the std::map because the following code works:
import ROOT
from ROOT import *
somevariable = ROOT.std.map("int,int")()
somevariable[1] = 2
print somevariable[1]
It only seems to have trouble when I try and make a map which includes ROOT specific objects, eg:
import ROOT
from ROOT import *
somevariable = ROOT.std.map("TString,int")()
When I run this code I get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/cvmfs/atlas.cern.ch/repo/sw/software/i686-slc5-gcc43-opt/17.2.3/sw/lcg/app/releases/ROOT/5.30.05/i686-slc5-gcc43-opt/root/lib/ROOT.py", line 179, in __call__
result = _root.MakeRootTemplateClass( *newargs )
AttributeError: type object 'ROOT' has no attribute 'map<TString,int>'
I’ve tried creating a new dictionary using the command:
but this fails to compile and gives the error message:
In file included from /tmp/rootcint_kaUQ1L.h:3,
from /tmp/IQol24_cint.cxx:1:
/data/lspiller/PhysicsNtuple/PhysicsLight/AutoDict_map_TString_int.cxx:1:25: error: map,TString.h: No such file or directory
Error: external preprocessing failed. :0:
!!!Removing /data/lspiller/PhysicsNtuple/PhysicsLight/AutoDict_map_TString_int_cxx_ACLiC_dict.cxx /data/lspiller/PhysicsNtuple/PhysicsLight/AutoDict_map_TString_int_cxx_ACLiC_dict.h !!!
Error: /cvmfs/atlas.cern.ch/repo/sw/software/i686-slc5-gcc43-opt/17.2.3/sw/lcg/app/releases/ROOT/5.30.05/i686-slc5-gcc43-opt/root/bin/rootcint: error loading headers...
Error in <ACLiC>: Dictionary generation failed!
AutoDict_map_TString_int.cxx:1:25: error: map,TString.h: No such file or directory
2
Cheers,
Laurence