ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> >

Dear PyROOT experts,
If I have a tree with a branch of class “vector<ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D > >”, I can set the branch by
value = ROOT.vector(‘ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D >’)()
tree.SetBranchAddress(branchname,value)

Now, if I have a branch with class name “ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D >”, how do I write the line 'value = ’ in this case?

Cheers,
Sami

Sami,

value = ROOT.Math.LorentzVector(ROOT.Math.PxPyPzE4D('double'))The only part that needs to be a string, is “‘double’” as there is no such type in Python. The other types can simply be used in full. Alternatively, the whole template argument to the LorentzVector can be a string, too.

Cheers,
Wim