Try:
TLorentzVector scalar; scalar.SetPtEtaPhiM(ip->pt(), ip->eta(), ip->phi(), ip->mass());
See also: