{
"cells": [
{
"cell_type": "markdown",
"id": "cf1f91f3",
"metadata": {},
"source": [
"# mathcoreGenVector\n",
"Example macro testing available methods and operation of the GenVector classes.\n",
"\n",
"The results are compared and check at the\n",
"numerical precision levels.\n",
"Some small discrepancy can appear when the macro\n",
"is executed on different architectures where it has been calibrated (Power PC G5)\n",
"The macro is divided in 4 parts:\n",
" - testVector3D : tests of the 3D Vector classes\n",
" - testPoint3D : tests of the 3D Point classes\n",
" - testLorentzVector : tests of the 4D LorentzVector classes\n",
" - testVectorUtil : tests of the utility functions of all the vector classes\n",
"\n",
"To execute the macro type in:\n",
"\n",
"```cpp\n",
"root[0] .x mathcoreGenVector.C\n",
"```\n",
"\n",
"\n",
"\n",
"\n",
"**Author:** Lorenzo Moneta \n",
"This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Tuesday, May 19, 2026 at 08:25 PM."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "6fa48146",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:25:44.241103Z",
"iopub.status.busy": "2026-05-19T20:25:44.240991Z",
"iopub.status.idle": "2026-05-19T20:25:44.252887Z",
"shell.execute_reply": "2026-05-19T20:25:44.252338Z"
}
},
"outputs": [],
"source": [
"%%cpp -d\n",
"#include \"TMatrixD.h\"\n",
"#include \"TVectorD.h\"\n",
"#include \"TMath.h\"\n",
"\n",
"#include \"Math/Point3D.h\"\n",
"#include \"Math/Vector3D.h\"\n",
"#include \"Math/Vector4D.h\"\n",
"#include \"Math/GenVector/Rotation3D.h\"\n",
"#include \"Math/GenVector/EulerAngles.h\"\n",
"#include \"Math/GenVector/AxisAngle.h\"\n",
"#include \"Math/GenVector/Quaternion.h\"\n",
"#include \"Math/GenVector/RotationX.h\"\n",
"#include \"Math/GenVector/RotationY.h\"\n",
"#include \"Math/GenVector/RotationZ.h\"\n",
"#include \"Math/GenVector/RotationZYX.h\"\n",
"#include \"Math/GenVector/LorentzRotation.h\"\n",
"#include \"Math/GenVector/Boost.h\"\n",
"#include \"Math/GenVector/BoostX.h\"\n",
"#include \"Math/GenVector/BoostY.h\"\n",
"#include \"Math/GenVector/BoostZ.h\"\n",
"#include \"Math/GenVector/Transform3D.h\"\n",
"#include \"Math/GenVector/Plane3D.h\"\n",
"#include \"Math/GenVector/VectorUtil.h\"\n",
"\n",
"using namespace ROOT::Math;\n",
"\n",
"int ntest = 0;\n",
"int nfail = 0;\n",
"int ok = 0;"
]
},
{
"cell_type": "markdown",
"id": "34d103fb",
"metadata": {},
"source": [
" Definition of a helper function: "
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "00911cbe",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:25:44.254234Z",
"iopub.status.busy": "2026-05-19T20:25:44.254118Z",
"iopub.status.idle": "2026-05-19T20:25:44.264861Z",
"shell.execute_reply": "2026-05-19T20:25:44.264232Z"
}
},
"outputs": [],
"source": [
"%%cpp -d\n",
"int compare( double v1, double v2, const char* name, double Scale = 1.0) {\n",
" ntest = ntest + 1;\n",
"\n",
" // numerical double limit for epsilon\n",
" double eps = Scale* 2.22044604925031308e-16;\n",
" int iret = 0;\n",
" double delta = v2 - v1;\n",
" double d = 0;\n",
" if (delta < 0 ) delta = - delta;\n",
" if (v1 == 0 || v2 == 0) {\n",
" if (delta > eps ) {\n",
" iret = 1;\n",
" }\n",
" }\n",
" // skip case v1 or v2 is infinity\n",
" else {\n",
" d = v1;\n",
"\n",
" if ( v1 < 0) d = -d;\n",
" // add also case when delta is small by default\n",
" if ( delta/d > eps && delta > eps )\n",
" iret = 1;\n",
" }\n",
"\n",
" if (iret == 0)\n",
" std::cout << \".\";\n",
" else {\n",
" int pr = std::cout.precision (18);\n",
" int discr;\n",
" if (d != 0)\n",
" discr = int(delta/d/eps);\n",
" else\n",
" discr = int(delta/eps);\n",
"\n",
" std::cout << \"\\nDiscrepancy in \" << name << \"() : \" << v1 << \" != \" << v2 << \" discr = \" << discr\n",
" << \" (Allowed discrepancy is \" << eps << \")\\n\";\n",
" std::cout.precision (pr);\n",
" nfail = nfail + 1;\n",
" }\n",
" return iret;\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "a08dd5fe",
"metadata": {},
"source": [
" Definition of a helper function: "
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "65bb6f7a",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:25:44.266165Z",
"iopub.status.busy": "2026-05-19T20:25:44.266052Z",
"iopub.status.idle": "2026-05-19T20:25:44.314200Z",
"shell.execute_reply": "2026-05-19T20:25:44.313498Z"
}
},
"outputs": [],
"source": [
"%%cpp -d\n",
"int testVector3D() {\n",
" std::cout << \"\\n************************************************************************\\n \"\n",
" << \" Vector 3D Test\"\n",
" << \"\\n************************************************************************\\n\";\n",
"\n",
" XYZVector v1(0.01, 0.02, 16);\n",
"\n",
" std::cout << \"Test Cartesian-Polar : \" ;\n",
"\n",
" Polar3DVector v2(v1.R(), v1.Theta(), v1.Phi() );\n",
"\n",
" ok = 0;\n",
" ok+= compare(v1.X(), v2.X(), \"x\");\n",
" ok+= compare(v1.Y(), v2.Y(), \"y\");\n",
" ok+= compare(v1.Z(), v2.Z(), \"z\");\n",
" ok+= compare(v1.Phi(), v2.Phi(), \"phi\");\n",
" ok+= compare(v1.Theta(), v2.Theta(), \"theta\");\n",
" ok+= compare(v1.R(), v2.R(), \"r\");\n",
" ok+= compare(v1.Eta(), v2.Eta(), \"eta\");\n",
" ok+= compare(v1.Rho(), v2.Rho(), \"rho\");\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
"\n",
" std::cout << \"Test Cartesian-CylindricalEta : \";\n",
"\n",
" RhoEtaPhiVector v3( v1.Rho(), v1.Eta(), v1.Phi() );\n",
"\n",
" ok = 0;\n",
" ok+= compare(v1.X(), v3.X(), \"x\");\n",
" ok+= compare(v1.Y(), v3.Y(), \"y\");\n",
" ok+= compare(v1.Z(), v3.Z(), \"z\");\n",
" ok+= compare(v1.Phi(), v3.Phi(), \"phi\");\n",
" ok+= compare(v1.Theta(), v3.Theta(), \"theta\");\n",
" ok+= compare(v1.R(), v3.R(), \"r\");\n",
" ok+= compare(v1.Eta(), v3.Eta(), \"eta\");\n",
" ok+= compare(v1.Rho(), v3.Rho(), \"rho\");\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
"\n",
" std::cout << \"Test Cartesian-Cylindrical : \";\n",
"\n",
" RhoZPhiVector v4( v1.Rho(), v1.Z(), v1.Phi() );\n",
"\n",
" ok = 0;\n",
" ok+= compare(v1.X(), v4.X(), \"x\");\n",
" ok+= compare(v1.Y(), v4.Y(), \"y\");\n",
" ok+= compare(v1.Z(), v4.Z(), \"z\");\n",
" ok+= compare(v1.Phi(), v4.Phi(), \"phi\");\n",
" ok+= compare(v1.Theta(), v4.Theta(), \"theta\");\n",
" ok+= compare(v1.R(), v4.R(), \"r\");\n",
" ok+= compare(v1.Eta(), v4.Eta(), \"eta\");\n",
" ok+= compare(v1.Rho(), v4.Rho(), \"rho\");\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
"\n",
" std::cout << \"Test Operations : \" ;\n",
"\n",
" ok = 0;\n",
" double Dot = v1.Dot(v2);\n",
" ok+= compare( Dot, v1.Mag2(),\"dot\" );\n",
" XYZVector vcross = v1.Cross(v2);\n",
" ok+= compare( vcross.R(), 0,\"cross\" );\n",
"\n",
" XYZVector vscale1 = v1*10;\n",
" XYZVector vscale2 = vscale1/10;\n",
" ok+= compare( v1.R(), vscale2.R(), \"scale\");\n",
"\n",
" XYZVector vu = v1.Unit();\n",
" ok+= compare(v2.Phi(),vu.Phi(),\"unit Phi\");\n",
" ok+= compare(v2.Theta(),vu.Theta(),\"unit Theta\");\n",
" ok+= compare(1.0,vu.R(),\"unit \");\n",
"\n",
" XYZVector q1 = v1;\n",
" RhoEtaPhiVector q2(1.0,1.0,1.0);\n",
"\n",
" XYZVector q3 = q1 + q2;\n",
" XYZVector q4 = q3 - q2;\n",
"\n",
" ok+= compare( q4.X(), q1.X(), \"op X\" );\n",
" ok+= compare( q4.Y(), q1.Y(), \"op Y\" );\n",
" ok+= compare( q4.Z(), q1.Z(), \"op Z\" );\n",
"\n",
" // test operator ==\n",
" XYZVector w1 = v1;\n",
" Polar3DVector w2 = v2;\n",
" RhoEtaPhiVector w3 = v3;\n",
" RhoZPhiVector w4 = v4;\n",
" ok+= compare( w1 == v1, static_cast(true), \"== XYZ\");\n",
" ok+= compare( w2 == v2, static_cast(true), \"== Polar\");\n",
" ok+= compare( w3 == v3, static_cast(true), \"== RhoEtaPhi\");\n",
" ok+= compare( w4 == v4, static_cast(true), \"== RhoZPhi\");\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
"\n",
" //test setters\n",
" std::cout << \"Test Setters : \" ;\n",
"\n",
" q2.SetXYZ(q1.X(), q1.Y(), q1.Z() );\n",
"\n",
" ok+= compare( q2.X(), q1.X(), \"setXYZ X\" );\n",
" ok+= compare( q2.Y(), q1.Y(), \"setXYZ Y\" );\n",
" ok+= compare( q2.Z(), q1.Z(), \"setXYZ Z\" );\n",
"\n",
" q2.SetCoordinates( 2.0*q1.Rho(), q1.Eta(), q1.Phi() );\n",
" XYZVector q1s = 2.0*q1;\n",
" ok+= compare( q2.X(), q1s.X(), \"set X\" );\n",
" ok+= compare( q2.Y(), q1s.Y(), \"set Y\" );\n",
" ok+= compare( q2.Z(), q1s.Z(), \"set Z\" );\n",
"\n",
" if (ok == 0) std::cout << \"\\t\\t OK \" << std::endl;\n",
"\n",
" std::cout << \"Test Linear Algebra conversion: \" ;\n",
"\n",
" XYZVector vxyz1(1.,2.,3.);\n",
"\n",
" TVectorD vla1(3);\n",
" vxyz1.Coordinates().GetCoordinates(vla1.GetMatrixArray() );\n",
"\n",
" TVectorD vla2(3);\n",
" vla2[0] = 1.; vla2[1] = -2.; vla2[2] = 1.;\n",
"\n",
" XYZVector vxyz2;\n",
" vxyz2.SetCoordinates(&vla2[0]);\n",
"\n",
" ok = 0;\n",
" double prod1 = vxyz1.Dot(vxyz2);\n",
" double prod2 = vla1*vla2;\n",
" ok+= compare( prod1, prod2, \"la test\" );\n",
"\n",
" if (ok == 0) std::cout << \"\\t\\t OK \" << std::endl;\n",
"\n",
" return ok;\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "1ef69cec",
"metadata": {},
"source": [
" Definition of a helper function: "
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "d6ed3bc7",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:25:44.315578Z",
"iopub.status.busy": "2026-05-19T20:25:44.315458Z",
"iopub.status.idle": "2026-05-19T20:25:44.334339Z",
"shell.execute_reply": "2026-05-19T20:25:44.333734Z"
}
},
"outputs": [],
"source": [
"%%cpp -d\n",
"int testPoint3D() {\n",
" std::cout << \"\\n************************************************************************\\n \"\n",
" << \" Point 3D Tests\"\n",
" << \"\\n************************************************************************\\n\";\n",
"\n",
" XYZPoint p1(1.0, 2.0, 3.0);\n",
"\n",
" std::cout << \"Test Cartesian-Polar : \";\n",
"\n",
" Polar3DPoint p2(p1.R(), p1.Theta(), p1.Phi() );\n",
"\n",
" ok = 0;\n",
" ok+= compare(p1.x(), p2.X(), \"x\");\n",
" ok+= compare(p1.y(), p2.Y(), \"y\");\n",
" ok+= compare(p1.z(), p2.Z(), \"z\");\n",
" ok+= compare(p1.phi(), p2.Phi(), \"phi\");\n",
" ok+= compare(p1.theta(), p2.Theta(), \"theta\");\n",
" ok+= compare(p1.r(), p2.R(), \"r\");\n",
" ok+= compare(p1.eta(), p2.Eta(), \"eta\");\n",
" ok+= compare(p1.rho(), p2.Rho(), \"rho\");\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
"\n",
" std::cout << \"Test Polar-CylindricalEta : \";\n",
"\n",
" RhoEtaPhiPoint p3( p2.Rho(), p2.Eta(), p2.Phi() );\n",
"\n",
" ok = 0;\n",
" ok+= compare(p2.X(), p3.X(), \"x\");\n",
" ok+= compare(p2.Y(), p3.Y(), \"y\");\n",
" ok+= compare(p2.Z(), p3.Z(), \"z\",3);\n",
" ok+= compare(p2.Phi(), p3.Phi(), \"phi\");\n",
" ok+= compare(p2.Theta(), p3.Theta(), \"theta\");\n",
" ok+= compare(p2.R(), p3.R(), \"r\");\n",
" ok+= compare(p2.Eta(), p3.Eta(), \"eta\");\n",
" ok+= compare(p2.Rho(), p3.Rho(), \"rho\");\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
"\n",
" std::cout << \"Test operations : \";\n",
"\n",
" //std::cout << \"\\nTest Dot and Cross products with Vectors : \";\n",
" Polar3DVector vperp(1.,p1.Theta() + TMath::PiOver2(),p1.Phi() );\n",
" double Dot = p1.Dot(vperp);\n",
" ok+= compare( Dot, 0.0,\"dot\", 10 );\n",
"\n",
" XYZPoint vcross = p1.Cross(vperp);\n",
" ok+= compare( vcross.R(), p1.R(),\"cross mag\" );\n",
" ok+= compare( vcross.Dot(vperp), 0.0,\"cross dir\" );\n",
"\n",
" XYZPoint pscale1 = 10*p1;\n",
" XYZPoint pscale2 = pscale1/10;\n",
" ok+= compare( p1.R(), pscale2.R(), \"scale\");\n",
"\n",
" // test operator ==\n",
" ok+= compare( p1 == pscale2, static_cast(true), \"== Point\");\n",
"\n",
" //RhoEtaPhiPoint q1 = p1; ! constructor yet not working in CLING\n",
" RhoEtaPhiPoint q1; q1 = p1;\n",
" q1.SetCoordinates(p1.Rho(),2.0, p1.Phi() );\n",
"\n",
" Polar3DVector v2(p1.R(), p1.Theta(),p1.Phi());\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
"\n",
" return ok;\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "82d73ead",
"metadata": {},
"source": [
" Definition of a helper function: "
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "03025c99",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:25:44.335647Z",
"iopub.status.busy": "2026-05-19T20:25:44.335508Z",
"iopub.status.idle": "2026-05-19T20:25:44.379983Z",
"shell.execute_reply": "2026-05-19T20:25:44.379312Z"
}
},
"outputs": [],
"source": [
"%%cpp -d\n",
"int testLorentzVector() {\n",
" std::cout << \"\\n************************************************************************\\n \"\n",
" << \" Lorentz Vector Tests\"\n",
" << \"\\n************************************************************************\\n\";\n",
"\n",
" XYZTVector v1(1.0, 2.0, 3.0, 4.0);\n",
"\n",
" std::cout << \"Test XYZT - PtEtaPhiE Vectors: \";\n",
"\n",
" PtEtaPhiEVector v2( v1.Rho(), v1.Eta(), v1.Phi(), v1.E() );\n",
"\n",
" ok = 0;\n",
" ok+= compare(v1.Px(), v2.X(), \"x\");\n",
" ok+= compare(v1.Py(), v2.Y(), \"y\");\n",
" ok+= compare(v1.Pz(), v2.Z(), \"z\", 2);\n",
" ok+= compare(v1.E(), v2.T(), \"e\");\n",
" ok+= compare(v1.Phi(), v2.Phi(), \"phi\");\n",
" ok+= compare(v1.Theta(), v2.Theta(), \"theta\");\n",
" ok+= compare(v1.Pt(), v2.Pt(), \"pt\");\n",
" ok+= compare(v1.M(), v2.M(), \"mass\", 5);\n",
" ok+= compare(v1.Et(), v2.Et(), \"et\");\n",
" ok+= compare(v1.Mt(), v2.Mt(), \"mt\", 3);\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
"\n",
" std::cout << \"Test XYZT - PtEtaPhiM Vectors: \";\n",
"\n",
" PtEtaPhiMVector v3( v1.Rho(), v1.Eta(), v1.Phi(), v1.M() );\n",
"\n",
" ok = 0;\n",
" ok+= compare(v1.Px(), v3.X(), \"x\");\n",
" ok+= compare(v1.Py(), v3.Y(), \"y\");\n",
" ok+= compare(v1.Pz(), v3.Z(), \"z\", 2);\n",
" ok+= compare(v1.E(), v3.T(), \"e\");\n",
" ok+= compare(v1.Phi(), v3.Phi(), \"phi\");\n",
" ok+= compare(v1.Theta(), v3.Theta(), \"theta\");\n",
" ok+= compare(v1.Pt(), v3.Pt(), \"pt\");\n",
" ok+= compare(v1.M(), v3.M(), \"mass\", 5);\n",
" ok+= compare(v1.Et(), v3.Et(), \"et\");\n",
" ok+= compare(v1.Mt(), v3.Mt(), \"mt\", 3);\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
"\n",
" std::cout << \"Test PtEtaPhiE - PxPyPzM Vect.: \";\n",
"\n",
" PxPyPzMVector v4( v3.X(), v3.Y(), v3.Z(), v3.M() );\n",
"\n",
" ok = 0;\n",
" ok+= compare(v4.Px(), v3.X(), \"x\");\n",
" ok+= compare(v4.Py(), v3.Y(), \"y\");\n",
" ok+= compare(v4.Pz(), v3.Z(), \"z\",2);\n",
" ok+= compare(v4.E(), v3.T(), \"e\");\n",
" ok+= compare(v4.Phi(), v3.Phi(), \"phi\");\n",
" ok+= compare(v4.Theta(), v3.Theta(), \"theta\");\n",
" ok+= compare(v4.Pt(), v3.Pt(), \"pt\");\n",
" ok+= compare(v4.M(), v3.M(), \"mass\",5);\n",
" ok+= compare(v4.Et(), v3.Et(), \"et\");\n",
" ok+= compare(v4.Mt(), v3.Mt(), \"mt\",3);\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
"\n",
" std::cout << \"Test operations : \";\n",
"\n",
" ok = 0;\n",
" double Dot = v1.Dot(v2);\n",
" ok+= compare( Dot, v1.M2(),\"dot\" , 10 );\n",
"\n",
" XYZTVector vscale1 = v1*10;\n",
" XYZTVector vscale2 = vscale1/10;\n",
" ok+= compare( v1.M(), vscale2.M(), \"scale\");\n",
"\n",
" XYZTVector q1 = v1;\n",
" PtEtaPhiEVector q2(1.0,1.0,1.0,5.0);\n",
"\n",
" XYZTVector q3 = q1 + q2;\n",
" XYZTVector q4 = q3 - q2;\n",
"\n",
" ok+= compare( q4.x(), q1.X(), \"op X\" );\n",
" ok+= compare( q4.y(), q1.Y(), \"op Y\" );\n",
" ok+= compare( q4.z(), q1.Z(), \"op Z\" );\n",
" ok+= compare( q4.t(), q1.E(), \"op E\" );\n",
"\n",
" // test operator ==\n",
" XYZTVector w1 = v1;\n",
" PtEtaPhiEVector w2 = v2;\n",
" PtEtaPhiMVector w3 = v3;\n",
" PxPyPzMVector w4 = v4;\n",
" ok+= compare( w1 == v1, static_cast(true), \"== PxPyPzE\");\n",
" ok+= compare( w2 == v2, static_cast(true), \"== PtEtaPhiE\");\n",
" ok+= compare( w3 == v3, static_cast(true), \"== PtEtaPhiM\");\n",
" ok+= compare( w4 == v4, static_cast(true), \"== PxPyPzM\");\n",
"\n",
" // test gamma beta and boost\n",
" XYZVector b = q1.BoostToCM();\n",
" double beta = q1.Beta();\n",
" double gamma = q1.Gamma();\n",
"\n",
" ok += compare( b.R(), beta, \"beta\" );\n",
" ok += compare( gamma, 1./sqrt( 1 - beta*beta ), \"gamma\");\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
"\n",
" //test setters\n",
" std::cout << \"Test Setters : \" ;\n",
"\n",
" q2.SetXYZT(q1.Px(), q1.Py(), q1.Pz(), q1.E() );\n",
"\n",
" ok+= compare( q2.X(), q1.X(), \"setXYZT X\" );\n",
" ok+= compare( q2.Y(), q1.Y(), \"setXYZT Y\" );\n",
" ok+= compare( q2.Z(), q1.Z(), \"setXYZT Z\" ,2);\n",
" ok+= compare( q2.T(), q1.E(), \"setXYZT E\" );\n",
"\n",
" q2.SetCoordinates( 2.0*q1.Rho(), q1.Eta(), q1.Phi(), 2.0*q1.E() );\n",
" XYZTVector q1s = q1*2.0;\n",
" ok+= compare( q2.X(), q1s.X(), \"set X\" );\n",
" ok+= compare( q2.Y(), q1s.Y(), \"set Y\" );\n",
" ok+= compare( q2.Z(), q1s.Z(), \"set Z\" ,2);\n",
" ok+= compare( q2.T(), q1s.T(), \"set E\" );\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
"\n",
" return ok;\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "9a84194a",
"metadata": {},
"source": [
" Definition of a helper function: "
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "6dec5c10",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:25:44.381393Z",
"iopub.status.busy": "2026-05-19T20:25:44.381274Z",
"iopub.status.idle": "2026-05-19T20:25:44.407461Z",
"shell.execute_reply": "2026-05-19T20:25:44.406882Z"
}
},
"outputs": [],
"source": [
"%%cpp -d\n",
"int testVectorUtil() {\n",
" std::cout << \"\\n************************************************************************\\n \"\n",
" << \" Utility Function Tests\"\n",
" << \"\\n************************************************************************\\n\";\n",
"\n",
" std::cout << \"Test Vector utility functions : \";\n",
"\n",
" XYZVector v1(1.0, 2.0, 3.0);\n",
" Polar3DVector v2pol(v1.R(), v1.Theta()+TMath::PiOver2(), v1.Phi() + 1.0);\n",
" // mixedmethods not yet impl.\n",
" XYZVector v2; v2 = v2pol;\n",
"\n",
" ok = 0;\n",
" ok += compare( VectorUtil::DeltaPhi(v1,v2), 1.0, \"deltaPhi Vec\");\n",
"\n",
" RhoEtaPhiVector v2cyl(v1.Rho(), v1.Eta() + 1.0, v1.Phi() + 1.0);\n",
" v2 = v2cyl;\n",
"\n",
" ok += compare( VectorUtil::DeltaR(v1,v2), sqrt(2.0), \"DeltaR Vec\");\n",
"\n",
" XYZVector vperp = v1.Cross(v2);\n",
" ok += compare( VectorUtil::CosTheta(v1,vperp), 0.0, \"costheta Vec\");\n",
" ok += compare( VectorUtil::Angle(v1,vperp), TMath::PiOver2(), \"angle Vec\");\n",
"\n",
" if (ok == 0) std::cout << \"\\t\\t OK \" << std::endl;\n",
"\n",
"\n",
" std::cout << \"Test Point utility functions : \";\n",
"\n",
" XYZPoint p1(1.0, 2.0, 3.0);\n",
" Polar3DPoint p2pol(p1.R(), p1.Theta()+TMath::PiOver2(), p1.Phi() + 1.0);\n",
" // mixedmethods not yet impl.\n",
" XYZPoint p2; p2 = p2pol;\n",
"\n",
" ok = 0;\n",
" ok += compare( VectorUtil::DeltaPhi(p1,p2), 1.0, \"deltaPhi Point\");\n",
"\n",
" RhoEtaPhiPoint p2cyl(p1.Rho(), p1.Eta() + 1.0, p1.Phi() + 1.0);\n",
" p2 = p2cyl;\n",
" ok += compare( VectorUtil::DeltaR(p1,p2), sqrt(2.0), \"DeltaR Point\");\n",
"\n",
" XYZPoint pperp(vperp.X(), vperp.Y(), vperp.Z());\n",
" ok += compare( VectorUtil::CosTheta(p1,pperp), 0.0, \"costheta Point\");\n",
" ok += compare( VectorUtil::Angle(p1,pperp), TMath::PiOver2(), \"angle Point\");\n",
"\n",
" if (ok == 0) std::cout << \"\\t\\t OK \" << std::endl;\n",
"\n",
" std::cout << \"LorentzVector utility funct.: \";\n",
"\n",
" XYZTVector q1(1.0, 2.0, 3.0,4.0);\n",
" PtEtaPhiEVector q2cyl(q1.Pt(), q1.Eta()+1.0, q1.Phi() + 1.0, q1.E() );\n",
" XYZTVector q2; q2 = q2cyl;\n",
"\n",
" ok = 0;\n",
" ok += compare( VectorUtil::DeltaPhi(q1,q2), 1.0, \"deltaPhi LVec\");\n",
" ok += compare( VectorUtil::DeltaR(q1,q2), sqrt(2.0), \"DeltaR LVec\");\n",
"\n",
" XYZTVector qsum = q1+q2;\n",
" ok += compare( VectorUtil::InvariantMass(q1,q2), qsum.M(), \"InvMass\");\n",
"\n",
" if (ok == 0) std::cout << \"\\t\\t OK \" << std::endl;\n",
"\n",
" return ok;\n",
"}"
]
},
{
"cell_type": "markdown",
"id": "536ee908",
"metadata": {},
"source": [
" Definition of a helper function: "
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "345610f2",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:25:44.409491Z",
"iopub.status.busy": "2026-05-19T20:25:44.409371Z",
"iopub.status.idle": "2026-05-19T20:25:44.503147Z",
"shell.execute_reply": "2026-05-19T20:25:44.502382Z"
}
},
"outputs": [],
"source": [
"%%cpp -d\n",
"int testRotation() {\n",
" std::cout << \"\\n************************************************************************\\n \"\n",
" << \" Rotation and Transformation Tests\"\n",
" << \"\\n************************************************************************\\n\";\n",
"\n",
" std::cout << \"Test Vector Rotations : \";\n",
" ok = 0;\n",
"\n",
" XYZPoint v(1.,2,3.);\n",
"\n",
" double pi = TMath::Pi();\n",
" // initiate rotation with some non -trivial angles to test all matrix\n",
" EulerAngles r1( pi/2.,pi/4., pi/3 );\n",
" Rotation3D r2(r1);\n",
" // only operator= is in CLING for the other rotations\n",
" Quaternion r3; r3 = r2;\n",
" AxisAngle r4; r4 = r3;\n",
" RotationZYX r5; r5 = r2;\n",
"\n",
" XYZPoint v1 = r1 * v;\n",
" XYZPoint v2 = r2 * v;\n",
" XYZPoint v3 = r3 * v;\n",
" XYZPoint v4 = r4 * v;\n",
" XYZPoint v5 = r5 * v;\n",
"\n",
" ok+= compare(v1.X(), v2.X(), \"x\",2);\n",
" ok+= compare(v1.Y(), v2.Y(), \"y\",2);\n",
" ok+= compare(v1.Z(), v2.Z(), \"z\",2);\n",
"\n",
" ok+= compare(v1.X(), v3.X(), \"x\",2);\n",
" ok+= compare(v1.Y(), v3.Y(), \"y\",2);\n",
" ok+= compare(v1.Z(), v3.Z(), \"z\",2);\n",
"\n",
" ok+= compare(v1.X(), v4.X(), \"x\",5);\n",
" ok+= compare(v1.Y(), v4.Y(), \"y\",5);\n",
" ok+= compare(v1.Z(), v4.Z(), \"z\",5);\n",
"\n",
" ok+= compare(v1.X(), v5.X(), \"x\",2);\n",
" ok+= compare(v1.Y(), v5.Y(), \"y\",2);\n",
" ok+= compare(v1.Z(), v5.Z(), \"z\",2);\n",
"\n",
" // test with matrix\n",
" double rdata[9];\n",
" r2.GetComponents(rdata, rdata+9);\n",
" TMatrixD m(3,3,rdata);\n",
" double vdata[3];\n",
" v.GetCoordinates(vdata);\n",
" TVectorD q(3,vdata);\n",
" TVectorD q2 = m*q;\n",
"\n",
" XYZPoint v6;\n",
" v6.SetCoordinates( q2.GetMatrixArray() );\n",
"\n",
" ok+= compare(v1.X(), v6.X(), \"x\");\n",
" ok+= compare(v1.Y(), v6.Y(), \"y\");\n",
" ok+= compare(v1.Z(), v6.Z(), \"z\");\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
" else std::cout << std::endl;\n",
"\n",
" std::cout << \"Test Axial Rotations : \";\n",
" ok = 0;\n",
"\n",
" RotationX rx( pi/3);\n",
" RotationY ry( pi/4);\n",
" RotationZ rz( 4*pi/5);\n",
"\n",
" Rotation3D r3x(rx);\n",
" Rotation3D r3y(ry);\n",
" Rotation3D r3z(rz);\n",
"\n",
" Quaternion qx; qx = rx;\n",
" Quaternion qy; qy = ry;\n",
" Quaternion qz; qz = rz;\n",
"\n",
" RotationZYX rzyx( rz.Angle(), ry.Angle(), rx.Angle() );\n",
"\n",
" XYZPoint vrot1 = rx * ry * rz * v;\n",
" XYZPoint vrot2 = r3x * r3y * r3z * v;\n",
"\n",
" ok+= compare(vrot1.X(), vrot2.X(), \"x\");\n",
" ok+= compare(vrot1.Y(), vrot2.Y(), \"y\");\n",
" ok+= compare(vrot1.Z(), vrot2.Z(), \"z\");\n",
"\n",
" vrot2 = qx * qy * qz * v;\n",
"\n",
" ok+= compare(vrot1.X(), vrot2.X(), \"x\",2);\n",
" ok+= compare(vrot1.Y(), vrot2.Y(), \"y\",2);\n",
" ok+= compare(vrot1.Z(), vrot2.Z(), \"z\",2);\n",
"\n",
" vrot2 = rzyx * v;\n",
"\n",
" ok+= compare(vrot1.X(), vrot2.X(), \"x\");\n",
" ok+= compare(vrot1.Y(), vrot2.Y(), \"y\");\n",
" ok+= compare(vrot1.Z(), vrot2.Z(), \"z\");\n",
"\n",
" // now inverse (first x then y then z)\n",
" vrot1 = rz * ry * rx * v;\n",
" vrot2 = r3z * r3y * r3x * v;\n",
"\n",
" ok+= compare(vrot1.X(), vrot2.X(), \"x\");\n",
" ok+= compare(vrot1.Y(), vrot2.Y(), \"y\");\n",
" ok+= compare(vrot1.Z(), vrot2.Z(), \"z\");\n",
"\n",
" XYZPoint vinv1 = rx.Inverse()*ry.Inverse()*rz.Inverse()*vrot1;\n",
"\n",
" ok+= compare(vinv1.X(), v.X(), \"x\",2);\n",
" ok+= compare(vinv1.Y(), v.Y(), \"y\");\n",
" ok+= compare(vinv1.Z(), v.Z(), \"z\");\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
" else std::cout << std::endl;\n",
"\n",
"\n",
" std::cout << \"Test Rotations by a PI angle : \";\n",
" ok = 0;\n",
"\n",
" double b[4] = { 6,8,10,3.14159265358979323 };\n",
" AxisAngle arPi(b,b+4 );\n",
" Rotation3D rPi(arPi);\n",
" AxisAngle a1; a1 = rPi;\n",
" ok+= compare(arPi.Axis().X(), a1.Axis().X(),\"x\");\n",
" ok+= compare(arPi.Axis().Y(), a1.Axis().Y(),\"y\");\n",
" ok+= compare(arPi.Axis().Z(), a1.Axis().Z(),\"z\");\n",
" ok+= compare(arPi.Angle(), a1.Angle(),\"angle\");\n",
"\n",
" EulerAngles ePi; ePi=rPi;\n",
" EulerAngles e1; e1=Rotation3D(a1);\n",
" ok+= compare(ePi.Phi(), e1.Phi(),\"phi\");\n",
" ok+= compare(ePi.Theta(), e1.Theta(),\"theta\");\n",
" ok+= compare(ePi.Psi(), e1.Psi(),\"ps1\");\n",
"\n",
" if (ok == 0) std::cout << \"\\t\\t OK \" << std::endl;\n",
" else std::cout << std::endl;\n",
"\n",
" std::cout << \"Test Inversions : \";\n",
" ok = 0;\n",
"\n",
" EulerAngles s1 = r1.Inverse();\n",
" Rotation3D s2 = r2.Inverse();\n",
" Quaternion s3 = r3.Inverse();\n",
" AxisAngle s4 = r4.Inverse();\n",
" RotationZYX s5 = r5.Inverse();\n",
"\n",
" // Euler angles not yet impl.\n",
" XYZPoint p = s2 * r2 * v;\n",
"\n",
" ok+= compare(p.X(), v.X(), \"x\",10);\n",
" ok+= compare(p.Y(), v.Y(), \"y\",10);\n",
" ok+= compare(p.Z(), v.Z(), \"z\",10);\n",
"\n",
"\n",
" p = s3 * r3 * v;\n",
"\n",
" ok+= compare(p.X(), v.X(), \"x\",10);\n",
" ok+= compare(p.Y(), v.Y(), \"y\",10);\n",
" ok+= compare(p.Z(), v.Z(), \"z\",10);\n",
"\n",
" p = s4 * r4 * v;\n",
" // axis angle inversion not very precise\n",
" ok+= compare(p.X(), v.X(), \"x\",1E9);\n",
" ok+= compare(p.Y(), v.Y(), \"y\",1E9);\n",
" ok+= compare(p.Z(), v.Z(), \"z\",1E9);\n",
"\n",
" p = s5 * r5 * v;\n",
"\n",
" ok+= compare(p.X(), v.X(), \"x\",10);\n",
" ok+= compare(p.Y(), v.Y(), \"y\",10);\n",
" ok+= compare(p.Z(), v.Z(), \"z\",10);\n",
"\n",
"\n",
" Rotation3D r6(r5);\n",
" Rotation3D s6 = r6.Inverse();\n",
"\n",
" p = s6 * r6 * v;\n",
"\n",
" ok+= compare(p.X(), v.X(), \"x\",10);\n",
" ok+= compare(p.Y(), v.Y(), \"y\",10);\n",
" ok+= compare(p.Z(), v.Z(), \"z\",10);\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
" else std::cout << std::endl;\n",
"\n",
" // test Rectify\n",
" std::cout << \"Test rectify : \";\n",
" ok = 0;\n",
"\n",
" XYZVector u1(0.999498,-0.00118212,-0.0316611);\n",
" XYZVector u2(0,0.999304,-0.0373108);\n",
" XYZVector u3(0.0316832,0.0372921,0.998802);\n",
" Rotation3D rr(u1,u2,u3);\n",
" // check orto-normality\n",
" XYZPoint vrr = rr* v;\n",
" ok+= compare(v.R(), vrr.R(), \"R\",1.E9);\n",
"\n",
" if (ok == 0) std::cout << \"\\t\\t OK \" << std::endl;\n",
" else std::cout << std::endl;\n",
"\n",
" std::cout << \"Test Transform3D : \";\n",
" ok = 0;\n",
"\n",
" XYZVector d(1.,-2.,3.);\n",
" Transform3D t(r2,d);\n",
"\n",
" XYZPoint pd = t * v;\n",
" // apply directly rotation\n",
" XYZPoint vd = r2 * v + d;\n",
"\n",
" ok+= compare(pd.X(), vd.X(), \"x\");\n",
" ok+= compare(pd.Y(), vd.Y(), \"y\");\n",
" ok+= compare(pd.Z(), vd.Z(), \"z\");\n",
"\n",
" // test with matrix\n",
" double tdata[12];\n",
" t.GetComponents(tdata);\n",
" TMatrixD mt(3,4,tdata);\n",
" double vData[4]; // needs a vector of dim 4\n",
" v.GetCoordinates(vData);\n",
" vData[3] = 1;\n",
" TVectorD q0(4,vData);\n",
"\n",
" TVectorD qt = mt*q0;\n",
"\n",
" ok+= compare(pd.X(), qt(0), \"x\");\n",
" ok+= compare(pd.Y(), qt(1), \"y\");\n",
" ok+= compare(pd.Z(), qt(2), \"z\");\n",
"\n",
" // test inverse\n",
"\n",
" Transform3D tinv = t.Inverse();\n",
"\n",
" p = tinv * t * v;\n",
"\n",
" ok+= compare(p.X(), v.X(), \"x\",10);\n",
" ok+= compare(p.Y(), v.Y(), \"y\",10);\n",
" ok+= compare(p.Z(), v.Z(), \"z\",10);\n",
"\n",
" // test construct inverse from translation first\n",
"\n",
" Transform3D tinv2 ( r2.Inverse(), r2.Inverse() *( -d) ) ;\n",
" p = tinv2 * t * v;\n",
"\n",
" ok+= compare(p.X(), v.X(), \"x\",10);\n",
" ok+= compare(p.Y(), v.Y(), \"y\",10);\n",
" ok+= compare(p.Z(), v.Z(), \"z\",10);\n",
"\n",
" // test from only rotation and only translation\n",
" Transform3D ta( EulerAngles(1.,2.,3.) );\n",
" Transform3D tb( XYZVector(1,2,3) );\n",
" Transform3D tc( Rotation3D(EulerAngles(1.,2.,3.)) , XYZVector(1,2,3) );\n",
" Transform3D td( ta.Rotation(), ta.Rotation() * XYZVector(1,2,3) ) ;\n",
"\n",
" ok+= compare( tc == tb*ta, static_cast(true), \"== Rot*Tra\");\n",
" ok+= compare( td == ta*tb, static_cast(true), \"== Rot*Tra\");\n",
"\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
" else std::cout << std::endl;\n",
"\n",
" std::cout << \"Test Plane3D : \";\n",
" ok = 0;\n",
"\n",
" // test transform a 3D plane\n",
"\n",
" XYZPoint p1(1,2,3);\n",
" XYZPoint p2(-2,-1,4);\n",
" XYZPoint p3(-1,3,2);\n",
" Plane3D plane(p1,p2,p3);\n",
"\n",
" XYZVector n = plane.Normal();\n",
" // normal is perpendicular to vectors on the planes obtained from subtracting the points\n",
" ok+= compare(n.Dot(p2-p1), 0.0, \"n.v12\",10);\n",
" ok+= compare(n.Dot(p3-p1), 0.0, \"n.v13\",10);\n",
" ok+= compare(n.Dot(p3-p2), 0.0, \"n.v23\",10);\n",
"\n",
" Plane3D plane1 = t(plane);\n",
"\n",
" // transform the points\n",
" XYZPoint pt1 = t(p1);\n",
" XYZPoint pt2 = t(p2);\n",
" XYZPoint pt3 = t(p3);\n",
" Plane3D plane2(pt1,pt2,pt3);\n",
"\n",
" XYZVector n1 = plane1.Normal();\n",
" XYZVector n2 = plane2.Normal();\n",
"\n",
" ok+= compare(n1.X(), n2.X(), \"a\",10);\n",
" ok+= compare(n1.Y(), n2.Y(), \"b\",10);\n",
" ok+= compare(n1.Z(), n2.Z(), \"c\",10);\n",
" ok+= compare(plane1.HesseDistance(), plane2.HesseDistance(), \"d\",10);\n",
"\n",
" // check distances\n",
" ok += compare(plane1.Distance(pt1), 0.0, \"distance\",10);\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
" else std::cout << std::endl;\n",
"\n",
" std::cout << \"Test LorentzRotation : \";\n",
" ok = 0;\n",
"\n",
" XYZTVector lv(1.,2.,3.,4.);\n",
"\n",
" // test from rotx (using boosts and 3D rotations not yet impl.)\n",
" // rx,ry and rz already defined\n",
" Rotation3D r3d = rx*ry*rz;\n",
"\n",
" LorentzRotation rlx(rx);\n",
" LorentzRotation rly(ry);\n",
" LorentzRotation rlz(rz);\n",
"\n",
" LorentzRotation rl0 = rlx*rly*rlz;\n",
" LorentzRotation rl1( r3d);\n",
"\n",
" XYZTVector lv0 = rl0 * lv;\n",
"\n",
" XYZTVector lv1 = rl1 * lv;\n",
"\n",
" XYZTVector lv2 = r3d * lv;\n",
"\n",
" ok+= compare(lv1== lv2,true,\"V0==V2\");\n",
" ok+= compare(lv1== lv2,true,\"V1==V2\");\n",
"\n",
" double rlData[16];\n",
" rl0.GetComponents(rlData);\n",
" TMatrixD ml(4,4,rlData);\n",
" double lvData[4];\n",
" lv.GetCoordinates(lvData);\n",
" TVectorD ql(4,lvData);\n",
"\n",
" TVectorD qlr = ml*ql;\n",
"\n",
" ok+= compare(lv1.X(), qlr(0), \"x\");\n",
" ok+= compare(lv1.Y(), qlr(1), \"y\");\n",
" ok+= compare(lv1.Z(), qlr(2), \"z\");\n",
" ok+= compare(lv1.E(), qlr(3), \"t\");\n",
"\n",
" // test inverse\n",
" lv0 = rl0 * rl0.Inverse() * lv;\n",
"\n",
" ok+= compare(lv0.X(), lv.X(), \"x\");\n",
" ok+= compare(lv0.Y(), lv.Y(), \"y\");\n",
" ok+= compare(lv0.Z(), lv.Z(), \"z\");\n",
" ok+= compare(lv0.E(), lv.E(), \"t\");\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
" else std::cout << std::endl;\n",
"\n",
" // test Boosts\n",
" std::cout << \"Test Boost : \";\n",
" ok = 0;\n",
"\n",
" Boost bst( 0.3,0.4,0.5); // boost (must be <= 1)\n",
"\n",
" XYZTVector lvb = bst ( lv );\n",
"\n",
" LorentzRotation rl2 (bst);\n",
"\n",
" XYZTVector lvb2 = rl2 (lv);\n",
"\n",
" // test with lorentz rotation\n",
" ok+= compare(lvb.X(), lvb2.X(), \"x\");\n",
" ok+= compare(lvb.Y(), lvb2.Y(), \"y\");\n",
" ok+= compare(lvb.Z(), lvb2.Z(), \"z\");\n",
" ok+= compare(lvb.E(), lvb2.E(), \"t\");\n",
" ok+= compare(lvb.M(), lv.M(), \"m\",50); // m must stay constant\n",
"\n",
" // test inverse\n",
" lv0 = bst.Inverse() * lvb;\n",
"\n",
" ok+= compare(lv0.X(), lv.X(), \"x\",5);\n",
" ok+= compare(lv0.Y(), lv.Y(), \"y\",5);\n",
" ok+= compare(lv0.Z(), lv.Z(), \"z\",3);\n",
" ok+= compare(lv0.E(), lv.E(), \"t\",3);\n",
"\n",
" XYZVector brest = lv.BoostToCM();\n",
" bst.SetComponents( brest.X(), brest.Y(), brest.Z() );\n",
"\n",
" XYZTVector lvr = bst * lv;\n",
"\n",
" ok+= compare(lvr.X(), 0.0, \"x\",10);\n",
" ok+= compare(lvr.Y(), 0.0, \"y\",10);\n",
" ok+= compare(lvr.Z(), 0.0, \"z\",10);\n",
" ok+= compare(lvr.M(), lv.M(), \"m\",10);\n",
"\n",
" if (ok == 0) std::cout << \"\\t OK \" << std::endl;\n",
" else std::cout << std::endl;\n",
" return ok;\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "047e9c98",
"metadata": {
"collapsed": false,
"execution": {
"iopub.execute_input": "2026-05-19T20:25:44.504782Z",
"iopub.status.busy": "2026-05-19T20:25:44.504660Z",
"iopub.status.idle": "2026-05-19T20:25:45.284181Z",
"shell.execute_reply": "2026-05-19T20:25:45.283478Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"************************************************************************\n",
" Vector 3D Test\n",
"************************************************************************\n",
"Test Cartesian-Polar : ........\t OK \n",
"Test Cartesian-CylindricalEta : ........\t OK \n",
"Test Cartesian-Cylindrical : ........\t OK \n",
"Test Operations : .............\t OK \n",
"Test Setters : ......\t\t OK \n",
"Test Linear Algebra conversion: .\t\t OK \n",
"\n",
"************************************************************************\n",
" Point 3D Tests\n",
"************************************************************************\n",
"Test Cartesian-Polar : ........\t OK \n",
"Test Polar-CylindricalEta : ........\t OK \n",
"Test operations : .....\t OK \n",
"\n",
"************************************************************************\n",
" Lorentz Vector Tests\n",
"************************************************************************\n",
"Test XYZT - PtEtaPhiE Vectors: ..........\t OK \n",
"Test XYZT - PtEtaPhiM Vectors: ..........\t OK \n",
"Test PtEtaPhiE - PxPyPzM Vect.: ..........\t OK \n",
"Test operations : ............\t OK \n",
"Test Setters : ........\t OK \n",
"\n",
"************************************************************************\n",
" Utility Function Tests\n",
"************************************************************************\n",
"Test Vector utility functions : ....\t\t OK \n",
"Test Point utility functions : ....\t\t OK \n",
"LorentzVector utility funct.: ...\t\t OK \n",
"\n",
"************************************************************************\n",
" Rotation and Transformation Tests\n",
"************************************************************************\n",
"Test Vector Rotations : ...............\t OK \n",
"Test Axial Rotations : ...............\t OK \n",
"Test Rotations by a PI angle : .......\t\t OK \n",
"Test Inversions : ...............\t OK \n",
"Test rectify : .\t\t OK \n",
"Test Transform3D : ..............\t OK \n",
"Test Plane3D : ........\t OK \n",
"Test LorentzRotation : ..........\t OK \n",
"Test Boost : .............\t OK \n",
"\n",
"\n",
"Number of tests 224 failed = 0\n"
]
}
],
"source": [
"testVector3D();\n",
"testPoint3D();\n",
"testLorentzVector();\n",
"testVectorUtil();\n",
"testRotation();\n",
"\n",
"std::cout << \"\\n\\nNumber of tests \" << ntest << \" failed = \" << nfail << std::endl;"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "ROOT C++",
"language": "c++",
"name": "root"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".C",
"mimetype": " text/x-c++src",
"name": "c++"
}
},
"nbformat": 4,
"nbformat_minor": 5
}