# Usage of DeltaR

**URL:** <https://root-forum.cern.ch/t/usage-of-deltar/63543>\
**Category:** Newbie\
**Created:** [May 13, 2025, 11:11am UTC](https://root-forum.cern.ch/t/usage-of-deltar/63543 "2025-05-13T11:11:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![martis](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@martis](https://root-forum.cern.ch/u/martis)\
**Post date:** [May 13, 2025, 11:11am UTC](https://root-forum.cern.ch/t/usage-of-deltar/63543/1 "2025-05-13T11:11:32Z")

</div>

Hello,

I have started using PtEtaPhiMVector instead of TLorentzVector as it is recommended in [ROOT: TLorentzVector Class Reference](https://root.cern.ch/doc/master/classTLorentzVector.html)

So, my question can be rather basic: Is it an easy way to compute DeltaPhi or DeltaR as it was done with TLorentzVector ?

Thanks  
Salva

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [May 13, 2025, 11:35am UTC](https://root-forum.cern.ch/t/usage-of-deltar/63543/2 "2025-05-13T11:35:20Z")

</div>

May be @jonas or @moneta can help you.

---

<div class="post-metadata">

**Author:** ![martis](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@martis](https://root-forum.cern.ch/u/martis)\
**Post date:** [May 13, 2025, 1:03pm UTC](https://root-forum.cern.ch/t/usage-of-deltar/63543/3 "2025-05-13T13:03:40Z")

</div>

Just to give some extra information about my original query. With TLorenzVectors, DeltaR between 2 TLorentzVectors is simply computed with: v1.DeltaR(v2)

While if v1 and v2 were PtEtaPhiMVector, if I try the same: v1.DeltaR(v2), then I obtain the following error: error: no member named ‘DeltaR’ in ‘ROOT::Math::LorentzVector\<ROOT::Math::PtEtaPhiM4D \>’

Cheers  
Salva

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [May 14, 2025, 6:23pm UTC](https://root-forum.cern.ch/t/usage-of-deltar/63543/4 "2025-05-14T18:23:15Z")

</div>

I proposed a PR to add it: [[math] add DeltaR to GenVector by ferdymercury · Pull Request #18728 · root-project/root · GitHub](https://github.com/root-project/root/pull/18728/files)

---

<div class="post-metadata">

**Author:** ![Huang-Brown](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/huang-brown/32/33599_2.png) [@Huang-Brown](https://root-forum.cern.ch/u/Huang-Brown)\
**Post date:** [June 11, 2025, 8:06am UTC](https://root-forum.cern.ch/t/usage-of-deltar/63543/5 "2025-06-11T08:06:10Z")

</div>

I think I am running into the same problem. I don’t understand much about it as it seems that DeltaR is included in Math::LorentzVector: [ROOT: ROOT::Math::LorentzVector\< CoordSystem \> Class Template Reference](https://root.cern.ch/doc/master/classROOT_1_1Math_1_1LorentzVector.html#ab8b20d37e08c8ea51576a07a98c2c183)

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [June 11, 2025, 9:42am UTC](https://root-forum.cern.ch/t/usage-of-deltar/63543/6 "2025-06-11T09:42:36Z")

</div>

Hi!  
DeltaR was added very recently. So it might be that your ROOT version does not yet have it. In the meantime, you will have to build from master branch instead.
