// lt-5.cc // A ZOOM PhysicsVectors tutorial example // // Tutorial example 5 for the LorentzTransformation class: // // Applying LorentzTransformations // // * Applying LorentzTransformations to vectors // * Applying LorentzTransformations to a collection of vectors // Key lines are marked by // <------------- // Get the LorentzTransformation class #include "ZMutility/ZMenvironment.h" #include "PhysicsVectors/LorentzTransformation.h" #include "PhysicsVectors/LorentzVector.h" #include "PhysicsVectors/Rotation.h" ZM_USING_NAMESPACE( zmpv ) USING( std::cout ) USING( std::endl ) // These classes themselves pull in FixedTypes, but just to // remind ourselves that we are using Float8, not double, for // 64-bit floats... #include "ZMutility/FixedTypes.h" ZM_USING_NAMESPACE( zmfxt ) // This example will use iostream output, so get that -- // in a portable way. #include "ZMutility/iostream" using std::cout; using std::endl; // This example tests the container methods and as such needs // to include the following - I picked list, any container // would be fine. #include using std::list; const Float8 PI = 3.1415926535897931; int main() { // (See tutorial examples lt-1, lt-2, and lt-4 for the respective // LorentzBoosts, LorentzTransformations, and LorentzBoosts along // a coordinate axis. See example lv-1 for how to construct and // access LorentzVectors.) LorentzBoost b1( UnitVector(.3, .4, .9), .59 ); LorentzBoost b2( .6, -.3, .1 ); LorentzBoostX bx1( .98 ); LorentzBoostY by1( .54 ); Rotation r1 ( -PI/3, PI/6, -PI/4 ); LorentzTransformation lt1 ( b1, r1 ); LorentzTransformation lt2 ( r1, b2 ); LorentzVector w1( 5, 7, 11, Tcomponent(13) ); LorentzVector w2( 1, 4, 9, Tcomponent(16) ); LorentzVector w3( -1, .5, -.25, Tcomponent(.125) ); LorentzVector w4, w5, w6; // ***** Applying LorentzTransformations to vectors // The following examples all follow the same form, but each // is presented for the sake of clarity. // Here is how to apply a LorentzBoost to a 4-vector: //--------------------------------------------------- w4 = b1(w1); // <------------- cout << "w1 = " << w1 << endl; cout << "b1 = " << b1 << endl; cout << "So, b1(w1) = " << w4 << endl << endl; cout << "b2 = " << b2 << endl; cout << "b2(w1) = " << b2(w1) << endl << endl; // <------------- // Here is how to apply a LorentzTransformation to a 4-vector: //------------------------------------------------------------ w5 = lt1(w3); // <------------- cout << "w3 = " << w3 << endl; cout << "lt1 = " << lt1 << endl; cout << "lt1(w3) = " << lt1 << endl << endl; // You can of course assign back to the vector to which you're // applying the transformation w5 = lt2(w5); // <------------- cout << "lt2 = " << lt2 << endl; cout << "After the application of lt2,\n w5 = " << w5 << endl << endl; // Here is how to apply a LorentzBoost Along a // Coordinate Axis to a 4-vector: //-------------------------------------------- w6 = bx1(w2); // <------------- cout << "w2 = " << w2 << endl; cout << "bx1 = " << bx1 << endl; cout << "bx1(w2) = " << w6 << endl << endl; return 0; } /* end of main */