# Getting NaN with Boost

Hi all,

In my code[1], when I apply the `Boost` to a `TLorentzVector` then for many events the magnitude of its three vector becomes `NaN`. I am unable to understand this.

Please let me know if you thing I am doing some mistake.

with regards,
Ram

[1]

``````1845     //// --------------------------- costheta1
1846     TVector3 boostV1 = -(thep4Z1.BoostVector());
1849     TLorentzVector p4M21_BV1( p4M21 );
1853     p4M21_BV1.Boost( boostV1 );
// Output of below term becomes `NaN`
1866     cout<<"\t p4M21_BV1.Vect().Mag() = "<< p4M21_BV1.Vect().Mag() << endl;
``````

Hi Ram,

what is the reproducer, i.e. the numerical values of the vector and the boost?

Cheers,
D

Dear @dpiparo,

For one event the couts are :

``````            boostV1.Mag() = 1.00631
p4M21.Vect().Mag() = 241.002
boost (x,y,z) = -0.435062      -0.468955       -0.776833
``````

So, the operation `p4M21_BV1.Boost( boostV1 );` makes `p4M21_BV1` a NaN quantity.

with regards,
Ram

Hi,

what are the components of p4M21 ?

Cheers,
D

Dear @dpiparo,

Sorry, I can’t send for same events. I am sending details for another event, where it was NaN.

``````	 boostV1.Mag() = 1.00695
p4M21.Vect().Mag() = 529.541
p4M21(pt, eta, phi, mass) = 434.889	-0.648351	2.69861	17.9739
boost (x,y,z) = 0.124555	-0.259521	-0.964925
p4M21_BV1.Vect().Mag() = -nan
``````
``````	 boostV1.Mag() = 1.00695
``````

Doesn’t the fact that this magnitude is larger than 1 indicate that the two frames have a relative velocity larger than the speed of light? Probably the Lorentz vector `thep4Z1` is already wrong.

right, what is its content? Based on that, could you create a reproducer for the issue? If you manage, it’s a ROOT problem, if not, I am afraid that something is not under control on your side.

Cheers and thanks for insisting,
D

ahhh… Yes…

My silly mistake. I was somehow mistaking boost vector (which is beta = v/c) by the gamma. So, thinking that it may range from 1 to infinity.

Thank you very much @suhl and @dpiparo

with regards,
Ram

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.