AW: [ROOT] TLorentzVector trouble

From: Peter Malzacher (P.Malzacher@gsi.de)
Date: Thu Feb 22 2001 - 15:15:29 MET


> 1) I want to perform a simple Lorentz Boost. I tried the following code:
>  TLorentzVector v4Beam(0., 0., fEnergy, fEnergy);
>  TLorentzVector v4Target(0., 0., 0, c_fProtonMass);
...
>  TLorentzRotation lzTransform;
>  lzTransform.Boost(-(v4Beam + v4Target).Beta());
>

try
   lzTransform.Boost(-(v4Beam + v4Target).BoostVector());
Boost needs a vector or 3 doubles as argument you provide only one, Beta()
returns
a double.

> 2) I would like to perform rotations of a 4-vector using the standard
> Euler angles. The rotation can be written as R(alpha, beta, gamma). Until
> now I was using the painful way:
>
>  TLorentzVector v4Proton(fX, fY, fZ, fT);  // whatever components
>
>  TLorentzRotation lzRot1, lzRot2, lzRot3, lzTransform;
>  lzRot1.RotateZ(fGamma);
>  lzRot2.RotateY(fBeta);
>  lzRot3.RotateZ(fAlpha);
>  lzTransform = lzRot3 * lzRot2 * lzRot1;
>
>  v4Proton.Transform(lzTransform);

try

lzTransform.RotateZ(fGamma);
lzTransform.RotateY(fBeta);
lzTransform.RotateZ(fAlpha);
v4Proton.Transform(lzTransform);

or shorter:

Since the Rotate functions return a reference to the object
you can chain the rotations and you can use operator *= to
apply the transformation

lzTransform.RotateX(fGamma).RotateY(fBeta).RotateZ(fAlpha);
v4Proton *= lzTransform;

Ciao
Peter Malzacher



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:37 MET