Logo ROOT   6.10/09
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 
25 namespace ROOT {
26 
27 namespace 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 
37 class BoostX {
38 
39 public:
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  */
106  void SetBeta(Scalar beta) { SetComponents(beta); }
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 
190 private:
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 
205 std::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 */
void SetComponents(Scalar beta_x)
Set components from a Scalar beta_x.
Definition: BoostX.cxx:33
Class describing a generic LorentzVector in the 4D space-time, using the specified coordinate system ...
Definition: LorentzVector.h:48
A4Vector operator*(const A4Vector &v) const
Overload operator * for operation on a vector.
Definition: BoostX.h:162
XYZVector BetaVector() const
Definition: BoostX.cxx:51
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
double Scalar
Definition: BoostX.h:41
void GetComponents(Scalar &beta_x) const
Get components into a Scalar beta_x.
Definition: BoostX.cxx:45
Scalar Beta() const
Retrieve the beta of the Boost.
Definition: BoostX.h:96
BoostX(Scalar beta_x)
Construct given a Scalar beta_x.
Definition: BoostX.h:67
Class representing a Lorentz Boost along the X axis, by beta.
Definition: BoostX.h:37
double beta(double x, double y)
Calculates the beta function.
std::ostream & operator<<(std::ostream &os, const AxisAngle &a)
Stream Output and Input.
Definition: AxisAngle.cxx:91
BoostX Inverse() const
Return inverse of a boost.
Definition: BoostX.cxx:99
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
ELorentzRotationMatrixIndex
Definition: BoostX.h:43
LorentzVector< ROOT::Math::PxPyPzE4D< double > > operator()(const LorentzVector< ROOT::Math::PxPyPzE4D< double > > &v) const
Lorentz transformation operation on a Minkowski (&#39;Cartesian&#39;) LorentzVector.
Definition: BoostX.cxx:83
bool operator==(const BoostX &rhs) const
Equality/inequality operators.
Definition: BoostX.h:180
Class describing a generic displacement vector in 3 dimensions.
TRandom2 r(17)
SVector< double, 2 > v
Definition: Dict.h:5
void SetBeta(Scalar beta)
Set the given beta of the Boost.
Definition: BoostX.h:106
void Invert()
Invert a BoostX in place.
Definition: BoostX.cxx:94
void Rectify()
Re-adjust components to eliminate small deviations from a perfect orthosyplectic matrix.
Definition: BoostX.cxx:64
Namespace for new Math classes and functions.
BoostX()
Default constructor (identity transformation)
Definition: BoostX.cxx:31
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
bool operator!=(const BoostX &rhs) const
Definition: BoostX.h:186
DefaultCoordinateSystemTag Default tag for identifying any coordinate system.
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > XYZVector
The beta vector for this boost.
Definition: BoostX.h:111
Scalar Gamma() const
Retrieve the gamma of the Boost.
Definition: BoostX.h:101