Logo ROOT  
Reference Guide
BoostX.h
Go to the documentation of this file.
1// @(#)root/mathcore:$Id$
2// Authors: W. Brown, M. Fischler, L. Moneta 2005
3
4 /**********************************************************************
5 * *
6 * Copyright (c) 2005 ROOT FNAL MathLib Team *
7 * *
8 * *
9 **********************************************************************/
10
11// Header file for BoostX
12//
13// Created by: Mark Fischler Mon Nov 1 2005
14//
15// Last update: $Id$
16//
17#ifndef ROOT_Math_GenVector_BoostX
18#define ROOT_Math_GenVector_BoostX 1
19
24
25namespace ROOT {
26
27namespace Math {
28
29//__________________________________________________________________________________________
30 /**
31 Class representing a Lorentz Boost along the X axis, by beta.
32 For efficiency, gamma is held as well.
33
34 @ingroup GenVector
35 */
36
37class BoostX {
38
39public:
40
41 typedef double Scalar;
42
44 kLXX = 0, kLXY = 1, kLXZ = 2, kLXT = 3
45 , kLYX = 4, kLYY = 5, kLYZ = 6, kLYT = 7
46 , kLZX = 8, kLZY = 9, kLZZ = 10, kLZT = 11
47 , kLTX = 12, kLTY = 13, kLTZ = 14, kLTT = 15
48 };
49
51 kXX = 0, kXY = 1, kXZ = 2, kXT = 3
52 , kYY = 4, kYZ = 5, kYT = 6
53 , kZZ = 7, kZT = 8
54 , kTT = 9
55 };
56
57 // ========== Constructors and Assignment =====================
58
59 /**
60 Default constructor (identity transformation)
61 */
62 BoostX();
63
64 /**
65 Construct given a Scalar beta_x
66 */
67 explicit BoostX(Scalar beta_x) { SetComponents(beta_x); }
68
69
70 // The compiler-generated copy ctor, copy assignment, and dtor are OK.
71
72 /**
73 Re-adjust components to eliminate small deviations from a perfect
74 orthosyplectic matrix.
75 */
76 void Rectify();
77
78 // ======== Components ==============
79
80 /**
81 Set components from a Scalar beta_x
82 */
83 void
84 SetComponents (Scalar beta_x);
85
86 /**
87 Get components into a Scalar beta_x
88 */
89 void
90 GetComponents (Scalar& beta_x) const;
91
92
93 /**
94 Retrieve the beta of the Boost
95 */
96 Scalar Beta() const { return fBeta; }
97
98 /**
99 Retrieve the gamma of the Boost
100 */
101 Scalar Gamma() const { return fGamma; }
102
103 /**
104 Set the given beta of the Boost
105 */
107
108 /**
109 The beta vector for this boost
110 */
112 XYZVector BetaVector() const;
113
114 /**
115 Get elements of internal 4x4 symmetric representation, into a data
116 array suitable for direct use as the components of a LorentzRotation
117 Note -- 16 Scalars will be written into the array; if the array is not
118 that large, then this will lead to undefined behavior.
119 */
120 void
121 GetLorentzRotation (Scalar r[]) const;
122
123 // =========== operations ==============
124
125 /**
126 Lorentz transformation operation on a Minkowski ('Cartesian')
127 LorentzVector
128 */
131
132 /**
133 Lorentz transformation operation on a LorentzVector in any
134 coordinate system
135 */
136 template <class CoordSystem>
141 return LorentzVector<CoordSystem> ( r_xyzt );
142 }
143
144 /**
145 Lorentz transformation operation on an arbitrary 4-vector v.
146 Preconditions: v must implement methods x(), y(), z(), and t()
147 and the arbitrary vector type must have a constructor taking (x,y,z,t)
148 */
149 template <class Foreign4Vector>
150 Foreign4Vector
151 operator() (const Foreign4Vector & v) const {
154 return Foreign4Vector ( r_xyzt.X(), r_xyzt.Y(), r_xyzt.Z(), r_xyzt.T() );
155 }
156
157 /**
158 Overload operator * for operation on a vector
159 */
160 template <class A4Vector>
161 inline
162 A4Vector operator* (const A4Vector & v) const
163 {
164 return operator()(v);
165 }
166
167 /**
168 Invert a BoostX in place
169 */
170 void Invert();
171
172 /**
173 Return inverse of a boost
174 */
175 BoostX Inverse() const;
176
177 /**
178 Equality/inequality operators
179 */
180 bool operator == (const BoostX & rhs) const {
181 if( fBeta != rhs.fBeta ) return false;
182 if( fGamma != rhs.fGamma ) return false;
183 return true;
184 }
185
186 bool operator != (const BoostX & rhs) const {
187 return ! operator==(rhs);
188 }
189
190private:
191
192 Scalar fBeta; // boost beta X
193 Scalar fGamma; // boost gamma
194
195}; // BoostX
196
197// ============ Class BoostX ends here ============
198
199
200/**
201 Stream Output and Input
202*/
203// TODO - I/O should be put in the manipulator form
204
205std::ostream & operator<< (std::ostream & os, const BoostX & b);
206
207
208} //namespace Math
209} //namespace ROOT
210
211
212
213
214
215
216
217#endif /* ROOT_Math_GenVector_BoostX */
ROOT::R::TRInterface & r
Definition: Object.C:4
#define b(i)
Definition: RSha256.hxx:100
Class representing a Lorentz Boost along the X axis, by beta.
Definition: BoostX.h:37
void SetComponents(Scalar beta_x)
Set components from a Scalar beta_x.
Definition: BoostX.cxx:33
void SetBeta(Scalar beta)
Set the given beta of the Boost.
Definition: BoostX.h:106
Scalar Beta() const
Retrieve the beta of the Boost.
Definition: BoostX.h:96
void Invert()
Invert a BoostX in place.
Definition: BoostX.cxx:94
A4Vector operator*(const A4Vector &v) const
Overload operator * for operation on a vector.
Definition: BoostX.h:162
BoostX(Scalar beta_x)
Construct given a Scalar beta_x.
Definition: BoostX.h:67
Scalar Gamma() const
Retrieve the gamma of the Boost.
Definition: BoostX.h:101
bool operator!=(const BoostX &rhs) const
Definition: BoostX.h:186
void GetComponents(Scalar &beta_x) const
Get components into a Scalar beta_x.
Definition: BoostX.cxx:45
BoostX Inverse() const
Return inverse of a boost.
Definition: BoostX.cxx:99
LorentzVector< ROOT::Math::PxPyPzE4D< double > > operator()(const LorentzVector< ROOT::Math::PxPyPzE4D< double > > &v) const
Lorentz transformation operation on a Minkowski ('Cartesian') LorentzVector.
Definition: BoostX.cxx:83
double Scalar
Definition: BoostX.h:41
ELorentzRotationMatrixIndex
Definition: BoostX.h:43
BoostX()
Default constructor (identity transformation)
Definition: BoostX.cxx:31
XYZVector BetaVector() const
Definition: BoostX.cxx:51
bool operator==(const BoostX &rhs) const
Equality/inequality operators.
Definition: BoostX.h:180
void GetLorentzRotation(Scalar r[]) const
Get elements of internal 4x4 symmetric representation, into a data array suitable for direct use as t...
Definition: BoostX.cxx:56
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > XYZVector
The beta vector for this boost.
Definition: BoostX.h:111
void Rectify()
Re-adjust components to eliminate small deviations from a perfect orthosyplectic matrix.
Definition: BoostX.cxx:64
DefaultCoordinateSystemTag Default tag for identifying any coordinate system.
Class describing a generic displacement vector in 3 dimensions.
Class describing a 4D cartesian coordinate system (x, y, z, t coordinates) or momentum-energy vectors...
Definition: PxPyPzE4D.h:42
double beta(double x, double y)
Calculates the beta function.
Namespace for new Math classes and functions.
std::ostream & operator<<(std::ostream &os, const AxisAngle &a)
Stream Output and Input.
Definition: AxisAngle.cxx:91
Rotation3D::Scalar Scalar
VSD Structures.
Definition: StringConv.hxx:21