A pointer to ROOT object

Dear experts,

I have a ROOT function which has an argument of the following type
TVector3 *v3. I want to call this function inside python.
I do that with the following lines

import ROOT
v3 = None
ROOT.gROOT.ProcessLine ( ‘TVector3 *v3 = new TVector3();’ )
ROOT.gROOT.ProcessLine ( ‘TPython::Bind(v3,“v3”);’ )

then I invoke the function

some_ROOT_function ( v3 )

It works. Everything is OK. But I wonder if there is another way (more
shorter one or more proper one) to create the pointer to TVector3?
If so could you advise me please how to do that?

Sorry if my question has been already discussed previously.

Cheers,
Alexander

Hi,

what’s wrong with:import ROOT v3 = ROOT.TVector3() some_ROOT_function ( v3 )
Cheers,
Wim

Hi,

Hmm… It works also! Sorry for the spam…

Cheers,
Alexander