Sum of two object phydics

Hello Expert,

Sorry for the naive question!
I have two object physics one from the TruthMET and the other one is from the truth particle (dark photon).
I would like to add the dark photon to the missing energy transverse.

I tried with TLorentzVector But I have got the wrong result.
please find below part of my code:
for(const auto& MET : *truth_MET) {
MET_4vec.SetPtEtaPhiE(MET->mpx(), MET->mpy(), 0, MET->met());
for (const auto * tp : *truthPC){

Darkphoton_mom.SetPtEtaPhiE(tp->px(), tp->py(), tp->pz(), tp->pt());
MET_4vec += Darkphoton_mom;
Sum_MET_Dark = MET_4vec.Pt();

Can someone help me if my method is right or there is another way to compute this addition?

Your help is very appreciated!



You could also ask this question on the root forum but the problem is that you’re setting the variables wrong: SetPtEtaPhiE expects to get x.Pt(), x.Eta(), x.Phi(), x.E(). There’s another function that sets things like you’re asking.

That being said, if you’re only asking for p_{\rm T} maybe it’s better to use TVector2.