TParticle::Momentum()

Dear ROOTers,

I am facing the following problem, I declare a pointer to a TLorentzVector as:

TLorentzVector *V = 0x0;

and would like to instantiate V with the TParticle::Momentum() method. Suppose I have a TParticle *particle already initialize, I tried the instruction:
particle->Momentum( *V ) but it failed ???

What do I miss?

Many thanks
R

Hi R,

You are dereferencing an invalid pointer by calling ā€œ*vā€; there is no object at memory address 0. Instead, do the following:

TLorentzVector V; particle->Momentum( V )
Axel.