TLorentzVector v(1.0, 2.0, 3.0, 4.0);
TLorentzVector v1(1.0, 2.0, 3.0, 4.0); TLorentzVector v2(5.0, 6.0, 7.0, 8.0); TLorentzVector sum = v1 + v2;
TLorentzVector v1(1.0, 2.0, 3.0, 4.0); TLorentzVector v2(5.0, 6.0, 7.0, 8.0); double mass = (v1 + v2).M();This will compute the invariant mass of the sum of v1 and v2. Overall, TLorentzVector is a useful class for representing and manipulating four-vectors in high-energy physics.