Hi,
This may be a trivial issue for experienced python users, but I’m quite stuck with it right now.
I have a class in C++ which I’d like to use from PyROOT. The constructor of this class receives the pointer to an integer in its constructor, with something like this:
MyClass::MyClass( Int_t* pointer );
I can successfully generate a dictionary for this class using rootcint, I also manage to load this dictionary from PyROOT, after which the class itself seems to be known to ROOT, because I can try to instantiate an object of this type. However the instantiation fails with this message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: none of the 2 overloaded methods succeeded. Full details:
IsoMuonFeatureD3PDObject::IsoMuonFeatureD3PDObject(Int_t* master, const char* prefix = "trig_L2_isomuonfeature_") =>
could not convert argument 1
IsoMuonFeatureD3PDObject::IsoMuonFeatureD3PDObject(const D3PDReader::IsoMuonFeatureD3PDObject&) =>
could not convert argument 1
In this case I was trying to instantiate the object like this:
[code]>>> myint = 0
obj = ROOT.D3PDReader.IsoMuonFeatureD3PDObject( myint )[/code]
On the C++ side using a pointer like this is the most elegant solution. But if you tell me that I won’t be able to use this code from python, then I’ll have to re-consider how to implement the C++ class.
Cheers,
Attila