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