Contents of Tutorial Examples for PhysicsVectors Classes These examples are organized by classes or groups of closely related classes. Each group of classes has several example programs. These contents extract the items covered by each program. Each "- ...whatever" item listed is in the example program as: // Here is how to ...whatever... ------------------------------ (1) SpaceVector and UnitVector ------------------------------ sv-1.cc --- Construction and component access * Constructing SpaceVectors and Output to ostreams - construct a vector from x, y, z. - construct a vector from r, theta, phi. - construct a vector from rho, phi, z: - output a SpaceVector: * Constructing an array of SpaceVectors - construct an array of SpaceVectors * Using different forms of coordinates - obtain the polar coordinates of a SpaceVector: - obtain the Cartesian coordinates of a SpaceVector: * Changing individual components - change the y Cartesian component, keeping x and z fixed: - change the r Spherical polar component, theta and phi fixed: - change all three components at once: * Using pseudorapidity instead of theta - obtain eta of a vector - construct a vector with known pseudorapidity: - use eta just like the coordinate theta: sv-2.cc --- Vector Properties and Arithmetic * Linear arithmetic - add, subtract, multiply by scalars, and so forth. Simple addition and subtraction Multiplication -- from either side Division by a scalar Modify and assign operators * Dot and cross products - take a dot product v1.dot(v2) - take a cross product v1.cross(v2) * Vector properties - find the magnitude of a vector - find relativistic beta and gamma sv-3.cc --- UnitVectors * Constructing UnitVectors - construct a unit vector from theta, phi - construct a vector by normalizing x, y, z - construct a vector by normalizing a SpaceVector - construct an array of UnitVectors * Using different forms of coordinates - obtain the polar coordinates of a UnitVector: - obtain the Cartesian coordinates of a UnitVector: * Changing individual components - change phi or theta, keeping the other fixed - change phi and theta at once * The coordinate axis UnitVectors - use X_HAT, Y_HAT and Z_HAT sv-4.cc --- Comparing Vectors * Exact Comparisons - apply exact comparisons to vectors * Relative difference - determine if two vectors are "nearly equal" boolean isNear quantitative howNear absolute difference - control the tolerance used to determine near equality * DeltaR - find deltaR = sqrt ((delta_eta)**2 + (delta_phi)**2) * Parallel and Orthogonal - determine if two vectors are nearly parallel - determine if two vectors are nearly orthogonal sv-5.cc --- Projections and Angles * Projection along a direction - obtain a projection along the Z axis - obtain a projection along an arbitrary axis * Perpendicular parts - obtain scalar perp() or its square - obtain vector perpendicular part * The angle between two vectors - find theta or cos theta - use a UnitVector as the reference direction - find eta, the pseudorapidity along a direction * Decomposition into polar and azimuthal parts - decompose an angle relative to the Z axis - decompose an angle relative to an arbitraty axis sv-6.cc --- Rotating SpaceVectors and UnitVectors * Rotating around a given axis - rotate a vector about a UnitVector axis - supply a non-zero SpaceVector axis - form a new vector by rotating an existing vector * Rotating around a coordinate axis - rotate around Z with a minimal amount of computation * Rotations by Euler Angles - rotate a vector using Euler Angles sv-7.cc --- Cylindrical Coordinates * Constructing vectors in Cylindrical Coordinates - construct a vector by supplying rho, phi, z - access cylindrical coordinates of a vector * Modifying Cylindrical Components of a Vector - modify theta while keeping rho and phi fixed - modify eta while keeping rho and phi fixed - modify rho, phi, and z together. ----------------- (2) LorentzVector ----------------- lv-1.cc --- Construction and component access * Constructing LorentzVectors and output to ostreams - construct a 4-vector from x, y, z, t. - construct a vector from a SpaceVector and t. - Construct an array of LorentzVectors * Changing individual components - change one Cartesian component, keeping the others fixed: - change just the Space part keeping t fixed - change all four components at once * Working with the SpaceVector part of a LorentzVector - determine polar or cylindrical coordinates * X_HAT4, Y_HAT4, Z_HAT4, and T_HAT4 lv-2.cc --- Properties and Arithmetic * Linear arithmetic - add, subtract, multiply by scalars, and so forth. Simple addition and subtraction Multiplication -- from either side Division by a scalar Modify and assign operators * Dot product - take a dot product w1.dot(w2) * Single-4-vector properties - find the invariant magnitude squared - find the Euclidean Norm - plus and minus parts relative to Z relative to an arbitrary direction * Various norms and comparisons - find invariant square of differnce between 4-vectors - test relative nearness in Euclidean sense - test relative nearness in Center of Mass frame lv-3.cc --- Relativistic Kinematics * Determining light-cone nature of a 4-vector - determine if the 4-vector is timelike or spacelike - determine if the 4-vector is close to lightlike - control tolerance for determining isLightlike * Invariant mass calculation - find the rest mass associated with a LorentzVector - find the invariant mass of a pair of 4-vectors - find the invariant mass of a collection of 4-vectors * Relativistic properties - find beta and gamma - find pseudorapidity and rapidity * Boosts defined by 4-vectors - Find boost to rest frame of a 4-vector - Find boost to rest frame of two 4-vectors - Find boost to rest frame of a collection of 4-vectors lv-4.cc --- Boosts and Rotations of LorentzVectors * Boosting along a given axis - boost along an arbitrary axis - boost along a coordinate axis * Rotating a 4-vector - rotate a about an arbitrary axis - rotate about a spical coordinate axis - rotate a 4-vector using Euler Angles ------------ (3) Rotation ------------ ro-1.cc --- Construction and component access * Constructing Rotations * Output to ostreams - construct a Rotation from phi, theta, and psi - output a Rotation - construct a Rotation from an EulerAngles object - construct a Rotation from an arbitrary axis and an angle - construct a Rotation from the columns of the matrix - construct a Rotation from a matrix representation * Constructing an array of Rotations - construct an array of Rotation::IDENTITY rotations * Using different forms of components - obtain the axis and angle of a Rotation - obtain the Euler angles for a Rotation - use AxisAngle and EulerAngles to get components * Changing individual components - change the rotation amount delta. - change the axis of rotation - change Euler angles - change multiple components at once * Components of the matrix representation - obtain individual matrix components - obtain rows of the matrix - obtain a 3x3 matrix representing a Rotation ro-2.cc --- Arithmetic and Comparison * Linear arithmetic - Multiply Rotations * Inversion - find the inverse of a Rotation - invert a Rotation in place * Comparing Rotations - apply exact comparisons to Rotations - determine if two Rotations are "nearly equal" - control the tolerance used to determine near equality ro-3.cc --- Applying Rotations to 3- and 4-vectors * Applying to vectors - apply a Rotation to a vector to form a new vector - apply a Rotation to a 4-vector to rotate the space part * Applying a Rotation to a collection of vectors - apply a Rotation to each element of a vector of SpaceVectors ro-4.cc --- Coordinate Axis Rotations * Constructing Coordinate Axis Rotations - construct a RotationZ from the angle delta * Components of the matrix representation - obtain individual matrix components - obtain a 3x3 matrix representing a Coordnate Axis Rotation * Multiplication and Inversion - multiply Axis Rotations of like form - multiply Axis Rotations to give a generic Rotation - find the inverse of an Axis Rotation * Comparisons - apply exact comparisons to Axis Rotations - determine if two Axis Rotations are "nearly equal" boolean isNear quantitative howNear - determine if an Axis Rotation is near a generic Rotation * Applying to vectors - apply a RotationX to a vector to form a new vector - apply a RotationY to a 4-vector to rotate the space part - apply a RotationZ to each element of a list of vectors -------------------------- (4) LorentzTransformations -------------------------- lt-1.cc --- Constructing and accessing LorentzBoosts * Constructing LorentzBoosts * Output to ostreams - construct a LorentzBoost from a direction and a scalar beta - ooutput a LorentzBoost - construct a LorentzBoost from a SpaceVector - construct a LorentzBoost from three beta components - construct a LorentzBoost from a symmetric matrix representation * Constructing an array of LorentzBoost - construct an array of LorentzBoost::IDENTITY boosts * Using different forms of components - obtain the direction of a LorentzBoost - obtain the beta and gamma values of a LorentzBoost - obtain a SpaceVector representing a LorentzBoost - obtain a 4x4 symmetric matrix representing a LorentzBoost - obtain individual matrix components * Changing individual componennts - modify beta - modify the direction - modify multiple components at one time lt-2.cc --- Constructing and accessing LorentzTransformations * Constructing LorentzTransformations * Output to ostreams - construct a LorentzTransformation from a Rotation - output a LorentzTransformation - construct a LorentzTransformation from a LorentzBoost - construct a LorentzTransformation from a LorentzBoost and a Rotation - construct a LorentzTransformation from a set of LorentzVectors - construct a LorentzTransformation from a matrix representation * Constructing an array of LorentzTransformations - construct an array of LorentzTransformation::IDENTITY transformations * Using different forms of components - decompose into a Rotation and a LorentzBoost - obtain a 4x4 matrix representing a LorentzTransformation - obtain individual matrix components - obtain rows of the matrix * Changing individual components - change rows or columns of the matrix - change multiple components at once lt-3.cc --- LorentzTransformation arithmetic and comparison * Linear arithmetic - mutliply LorentzTransformations - multiply LorentzBoosts * Inversion - find the inverse of a LorentzTransformation - invert a LorentzTransformation in place - find the inverse of a LorentzBoost - invert a LorentzBoost in place * Comparing LorentzTransformations - apply exact comparisons to LorentzTransformations - determine if two LorentzTransformations are "nearly equal" - apply exact comparisons to LorentzBoosts - determine if two LorentzBoosts are "nearly equal" - control the tolerance used to determine near equality lt-4.cc --- LorentzBoosts Along a Coordinate Axis * Constructing Coordinate Axis Boosts - construct a LorentzBoostZ from a value beta * Components of the matrix representation - obtain a 4x4 matrix representing a Coordinate Axis Boost - obtain individual matrix components * Multiplication and Inversion - multiply Axis Boosts of like form - multiply Axis Boosts to give a generic Boost - find the inverse of an Axis Boost - invert an Axis Boost in place * Comparisons - apply exact comparisons to Axis Boosts - determine if two Axis Boosts are "nearly equal" - determine if an Axis Boost is near a generic LorentzBoost lt-5.cc --- Applying LorentzTransformations * Applying LorentzTransformations to vectors - apply a LorentzBoost to a 4-vector - apply a LorentzTransformation to a 4-vector - apply a LorentzBoost along a Coordinate Axis to a 4-vector * Applying a LorentzTransformation to a collection of vectors - apply a LorentzBoost to each element of a list of vectors - apply a LorentzTransformation to each element of a list of vectors - apply a LorentzBoost Along a Coordinate Axis to each element of a list of vectors