Usage of DeltaR

Hello,

I have started using PtEtaPhiMVector instead of TLorentzVector as it is recommended in ROOT: TLorentzVector Class Reference

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

1 Like

May be @jonas or @moneta can help you.

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

1 Like

I proposed a PR to add it: [math] add DeltaR to GenVector by ferdymercury · Pull Request #18728 · root-project/root · GitHub

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

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.

1 Like