10#include <Math/Boost.h>
11#include <Math/AxisAngle.h>
12#include <Math/LorentzRotation.h>
13#include <Math/Vector3D.h>
43 static ROOT::Math::LorentzRotation
rotateLabToCms(
const ROOT::Math::XYZVector& boostVector,
44 double cmsAngleXZ,
double cmsAngleYZ)
47 ROOT::Math::LorentzRotation boost(ROOT::Math::Boost(-1.*boostVector));
50 ROOT::Math::XYZVector zaxis(0., 0., 1.);
53 double tanAngleXZ = tan(cmsAngleXZ);
54 double tanAngleYZ = tan(cmsAngleYZ);
55 double Norm = 1 /
sqrt(1 + pow(tanAngleXZ, 2) + pow(tanAngleYZ, 2));
56 ROOT::Math::XYZVector electronCMS(Norm * tanAngleXZ, Norm * tanAngleYZ, Norm);
59 ROOT::Math::XYZVector rotAxis = zaxis.Cross(electronCMS);
60 double rotangle = asin(rotAxis.R());
63 ROOT::Math::LorentzRotation rotation(ROOT::Math::AxisAngle(rotAxis, -rotangle));
66 ROOT::Math::LorentzRotation trans = rotation * boost;
Class implementing general Lorentz Transformation between LAB and CMS system.
static ROOT::Math::LorentzRotation rotateLabToCms(const ROOT::Math::XYZVector &boostVector, double cmsAngleXZ, double cmsAngleYZ)
Function takes 3D boostVector and angles of the HER momentum in the CM system obtained by pure boost.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.