# A weird problem with TLorentzVector masses

**URL:** <https://root-forum.cern.ch/t/a-weird-problem-with-tlorentzvector-masses/56905>\
**Category:** ROOT\
**Tags:** cling, root\
**Created:** [October 28, 2023, 10:58pm UTC](https://root-forum.cern.ch/t/a-weird-problem-with-tlorentzvector-masses/56905 "2023-10-28T22:58:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Traruh\_Synred](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/traruh_synred/32/34784_2.png) [@Traruh\_Synred](https://root-forum.cern.ch/u/Traruh_Synred)\
**Post date:** [October 28, 2023, 10:58pm UTC](https://root-forum.cern.ch/t/a-weird-problem-with-tlorentzvector-masses/56905/1 "2023-10-28T22:58:37Z")

</div>

\_ROOT Version:6.28  
\_Platform:Windows 11  
\_Compiler:Cling or I think MS Visual c++

Weird problem with consent masses from virtually the same TLorentzVector. The problem occurs whether I compile or not.

Here are the two 4 vectors. They present different calculations of the same missing momentum vector. That should be a neutrino so that mass should be very small.

It is small for ‘p4AllTooMiss’ but the ‘p4Miss’ mass is absurdly large.

The three vectors and the energy are very close, how can the masses be different?

twoB::p4AllTooMiss: px:-611.468 py:43.8495 pz:-1227.02 E:1371.64 M:1.52588e-05

twoB::p4Miss: px:-611.468 py:43.8499 pz:-1227.02 E:1371.64 M:1.94998

It gets weirder. I decided to extract the components and calculate the masses myself

Here are the results. They agree with the result from TLorentzVector::M();

twoB: MMissSq3.75 MTooMissSq:0

twoB::MMiss:1.93649 MTooMiss:0

The extract 4-vector components are (px,py,pz,E);

twoB:: PMiss:-611.468, 43.8499, -1227.02, 1371.64

twoB:: PTooMiss:-611.468, 43.8495, -1227.02, 1371.64

Here’s the code:

float PxMiss=p4Miss[0];

float PyMiss=p4Miss[1];

float PzMiss=p4Miss[2];

float EMiss=p4Miss[3];

float EPMiss=p4Miss.T();

float PxTooMiss=p4AllTooMiss[0];

float PyTooMiss=p4AllTooMiss[1];

float PzTooMiss=p4AllTooMiss[2];

float ETooMiss=p4AllTooMiss[3];

float EPTooMiss=p4AllTooMiss.T();

float MMissSq=EMiss_EMiss-PxMiss_PxMiss-PyMiss_PyMiss-PzMiss_PzMiss;

float MMiss=sqrt(MMissSq);

float MTooMissSq

=ETooMiss_ETooMiss-PxTooMiss_PxTooMiss-PyTooMiss_PyTooMiss-PzTooMiss_PzTooMiss

---

<div class="post-metadata">

**Author:** ![Traruh\_Synred](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/traruh_synred/32/34784_2.png) [@Traruh\_Synred](https://root-forum.cern.ch/u/Traruh_Synred)\
**Post date:** [October 29, 2023, 3:11am UTC](https://root-forum.cern.ch/t/a-weird-problem-with-tlorentzvector-masses/56905/2 "2023-10-29T03:11:51Z")

</div>

I tried converting to ‘double’. It didn’t help.

twoB::dp4Nu: px:-0.000386937 py:0.000218813 pz:-0.000424162 E:-0.00105851 M:0.000861929  
twoB::p4NuB14S: px:-1560.66 py:1051.24 pz:-354.08 E:1914.72 M:0  
twoB::p4Miss: px:-1560.66 py:1051.24 pz:-354.08 E:1914.72 M:2.45391

This is the difference between two TLorentzVectors that should be the ‘missing’ neutrino. At double precision the combonents are identical, but the masses different.

This makes nosense!

---

<div class="post-metadata">

**Author:** ![Traruh\_Synred](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/traruh_synred/32/34784_2.png) [@Traruh\_Synred](https://root-forum.cern.ch/u/Traruh_Synred)\
**Post date:** [October 30, 2023, 2:07am UTC](https://root-forum.cern.ch/t/a-weird-problem-with-tlorentzvector-masses/56905/3 "2023-10-30T02:07:44Z")

</div>

Well, before anybody had a chance to respond, I found two bugs in my code. Numerical was a read herring.

While nobody repsponded (it was the weekend), it was still useful to try to ‘explain’ it!

Thanks!

---

<div class="post-metadata">

**Author:** ![Traruh\_Synred](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/traruh_synred/32/34784_2.png) [@Traruh\_Synred](https://root-forum.cern.ch/u/Traruh_Synred)\
**Post date:** [October 30, 2023, 2:10am UTC](https://root-forum.cern.ch/t/a-weird-problem-with-tlorentzvector-masses/56905/4 "2023-10-30T02:10:38Z")

</div>

Well one was kind of a numerical bug. I used a numerical unstable method of calculating energy of a decay product. I might not have found this, but for the other bug which was an outright blunder.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [November 13, 2023, 2:10am UTC](https://root-forum.cern.ch/t/a-weird-problem-with-tlorentzvector-masses/56905/5 "2023-11-13T02:10:44Z")

</div>

Closed on November 13, 2023, 2:10am UTC

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