Logo ROOT   6.10/09
Reference Guide
BoostZ.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 BoostZ
12 //
13 // Created by: Mark Fischler Mon Nov 1 2005
14 //
15 // Last update: $Id$
16 //
17 #ifndef ROOT_Math_GenVector_BoostZ
18 #define ROOT_Math_GenVector_BoostZ 1
19 
24 
25 namespace ROOT {
26 
27  namespace Math {
28 
29 //__________________________________________________________________________________________
30  /**
31  Class representing a Lorentz Boost along the Z axis, by beta.
32  For efficiency, gamma is held as well.
33 
34  @ingroup GenVector
35  */
36 
37 class BoostZ {
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  BoostZ();
63 
64  /**
65  Construct given a Scalar beta_z
66  */
67  explicit BoostZ(Scalar beta_z) { SetComponents(beta_z); }
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_z
82  */
83  void
84  SetComponents (Scalar beta_z);
85 
86  /**
87  Get components into a Scalar beta_z
88  */
89  void
90  GetComponents (Scalar& beta_z) 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 boost 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 BoostZ in place
169  */
170  void Invert();
171 
172  /**
173  Return inverse of a BoostZ
174  */
175  BoostZ Inverse() const;
176 
177  /**
178  Equality/inequality operators
179  */
180  bool operator == (const BoostZ & rhs) const {
181  if( fBeta != rhs.fBeta ) return false;
182  if( fGamma != rhs.fGamma ) return false;
183  return true;
184  }
185  bool operator != (const BoostZ & rhs) const {
186  return ! operator==(rhs);
187  }
188 
189 private:
190 
191  Scalar fBeta; // boost beta z
192  Scalar fGamma; // boost gamma
193 
194 }; // BoostZ
195 
196 // ============ Class BoostZ ends here ============
197 
198 /**
199  Stream Output and Input
200  */
201  // TODO - I/O should be put in the manipulator form
202 
203 std::ostream & operator<< (std::ostream & os, const BoostZ & b);
204 
205 
206 } //namespace Math
207 } //namespace ROOT
208 
209 
210 
211 
212 
213 
214 
215 #endif /* ROOT_Math_GenVector_BoostZ */
A4Vector operator*(const A4Vector &v) const
Overload operator * for boost on a vector.
Definition: BoostZ.h:162
Class describing a generic LorentzVector in the 4D space-time, using the specified coordinate system ...
Definition: LorentzVector.h:48
double Scalar
Definition: BoostZ.h:41
BoostZ(Scalar beta_z)
Construct given a Scalar beta_z.
Definition: BoostZ.h:67
Scalar Beta() const
Retrieve the beta of the Boost.
Definition: BoostZ.h:96
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > XYZVector
The beta vector for this boost.
Definition: BoostZ.h:111
void Rectify()
Re-adjust components to eliminate small deviations from a perfect orthosyplectic matrix.
Definition: BoostZ.cxx:64
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
void GetLorentzRotation(Scalar r[]) const
Get elements of internal 4x4 symmetric representation, into a data array suitable for direct use as t...
Definition: BoostZ.cxx:56
bool operator!=(const BoostZ &rhs) const
Definition: BoostZ.h:185
void SetBeta(Scalar beta)
Set the given beta of the Boost.
Definition: BoostZ.h:106
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
ELorentzRotationMatrixIndex
Definition: BoostZ.h:43
void SetComponents(Scalar beta_z)
Set components from a Scalar beta_z.
Definition: BoostZ.cxx:32
Class describing a generic displacement vector in 3 dimensions.
TRandom2 r(17)
SVector< double, 2 > v
Definition: Dict.h:5
bool operator==(const BoostZ &rhs) const
Equality/inequality operators.
Definition: BoostZ.h:180
BoostZ Inverse() const
Return inverse of a BoostZ.
Definition: BoostZ.cxx:99
Scalar Gamma() const
Retrieve the gamma of the Boost.
Definition: BoostZ.h:101
Class representing a Lorentz Boost along the Z axis, by beta.
Definition: BoostZ.h:37
void Invert()
Invert a BoostZ in place.
Definition: BoostZ.cxx:94
void GetComponents(Scalar &beta_z) const
Get components into a Scalar beta_z.
Definition: BoostZ.cxx:44
XYZVector BetaVector() const
Definition: BoostZ.cxx:50
Namespace for new Math classes and functions.
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
DefaultCoordinateSystemTag Default tag for identifying any coordinate system.
BoostZ()
Default constructor (identity transformation)
Definition: BoostZ.cxx:30
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: BoostZ.cxx:83