Is there is implementation of a way to scale a lorentz vector’s magnitude and keeping its angles the same?

Thanks

MK

Is there is implementation of a way to scale a lorentz vector’s magnitude and keeping its angles the same?

Thanks

MK

If Root decides to implement this, note that they should do it “both” ways:

(1) Assuming the mass stays the same (e.g., scaling a reconstructed muon)

(2) Assuming mass is scaled by same factor (e.g., composite objects like jets)

Cheers,

Charles

If Root decides to implement this, note that they should do it “both” ways:

(1) Assuming the mass stays the same (e.g., scaling a reconstructed muon)

(2) Assuming mass is scaled by same factor (e.g., composite objects like jets)

Cheers,

Charles[/quote]

Yes I agree, and should have stated such. Thank you for the add-on.

Regards

MK

Hi,

for both TLorentzVector and ROOT::Math::LorentzVector you can use the operator * to scale the vector. It will scale all the 4 components.

```
ROOT::Math::XYZTVector v(1,2,3,4);
v *= 10; // scale by a factor 10
```

If you want to scale only the momentum and keep the mass constant just get the spatial components using Vect()

and scale those.

Best Regards

Lorenzo

[quote=“moneta”]for both TLorentzVector and ROOT::Math::LorentzVector you can use the operator * to scale the vector. It will scale all the 4 components.

```
ROOT::Math::XYZTVector v(1,2,3,4);
v *= 10; // scale by a factor 10
```

[/quote]

Ahh… Didn’t know that. Good!

This is something that almost everybody who plays with four vectors eventually does. It would be a nice thing to add as a member function (named ‘constMassScale()’ or something like that).

Cheers,

Charles

Hi,

we could add this function, however this can be done easly like in the code below and this avoid mis-interpretation of the function:

```
TLorentzVector v(.....);
v.SetZYZM(scale * v.X(). scale * v.Y(), scale * v.Z(), v.M() );
```

or if using the ROOT::Math::LorentzVector classes

```
ROOT::Math::XYZTVector v(....);
v = ROOT::Math::PxPyPzMVector(scale * v.X(), scale * v.Y(), scale * v.Z(), v.M() );
```

Lorenzo