Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 @sa Overview of the @ref GenVector "physics vector library"
37 */
38
39class BoostX {
40
41public:
42
43 typedef double Scalar;
44
46 kLXX = 0, kLXY = 1, kLXZ = 2, kLXT = 3
47 , kLYX = 4, kLYY = 5, kLYZ = 6, kLYT = 7
48 , kLZX = 8, kLZY = 9, kLZZ = 10, kLZT = 11
49 , kLTX = 12, kLTY = 13, kLTZ = 14, kLTT = 15
50 };
51
53 kXX = 0, kXY = 1, kXZ = 2, kXT = 3
54 , kYY = 4, kYZ = 5, kYT = 6
55 , kZZ = 7, kZT = 8
56 , kTT = 9
57 };
58
59 // ========== Constructors and Assignment =====================
60
61 /**
62 Default constructor (identity transformation)
63 */
64 BoostX();
65
66 /**
67 Construct given a Scalar beta_x
68 */
69 explicit BoostX(Scalar beta_x) { SetComponents(beta_x); }
70
71
72 // The compiler-generated copy ctor, copy assignment, and dtor are OK.
73
74 /**
75 Re-adjust components to eliminate small deviations from a perfect
76 orthosyplectic matrix.
77 */
78 void Rectify();
79
80 // ======== Components ==============
81
82 /**
83 Set components from a Scalar beta_x
84 */
85 void
86 SetComponents (Scalar beta_x);
87
88 /**
89 Get components into a Scalar beta_x
90 */
91 void
92 GetComponents (Scalar& beta_x) const;
93
94
95 /**
96 Retrieve the beta of the Boost
97 */
98 Scalar Beta() const { return fBeta; }
99
100 /**
101 Retrieve the gamma of the Boost
102 */
103 Scalar Gamma() const { return fGamma; }
104
105 /**
106 Set the given beta of the Boost
107 */
109
110 /**
111 The beta vector for this boost
112 */
114 XYZVector BetaVector() const;
115
116 /**
117 Get elements of internal 4x4 symmetric representation, into a data
118 array suitable for direct use as the components of a LorentzRotation
119 Note -- 16 Scalars will be written into the array; if the array is not
120 that large, then this will lead to undefined behavior.
121 */
122 void
123 GetLorentzRotation (Scalar r[]) const;
124
125 // =========== operations ==============
126
127 /**
128 Lorentz transformation operation on a Minkowski ('Cartesian')
129 LorentzVector
130 */
133
134 /**
135 Lorentz transformation operation on a LorentzVector in any
136 coordinate system
137 */
138 template <class CoordSystem>
143 return LorentzVector<CoordSystem> ( r_xyzt );
144 }
145
146 /**
147 Lorentz transformation operation on an arbitrary 4-vector v.
148 Preconditions: v must implement methods x(), y(), z(), and t()
149 and the arbitrary vector type must have a constructor taking (x,y,z,t)
150 */
151 template <class Foreign4Vector>
152 Foreign4Vector
153 operator() (const Foreign4Vector & v) const {
156 return Foreign4Vector ( r_xyzt.X(), r_xyzt.Y(), r_xyzt.Z(), r_xyzt.T() );
157 }
158
159 /**
160 Overload operator * for operation on a vector
161 */
162 template <class A4Vector>
163 inline
164 A4Vector operator* (const A4Vector & v) const
165 {
166 return operator()(v);
167 }
168
169 /**
170 Invert a BoostX in place
171 */
172 void Invert();
173
174 /**
175 Return inverse of a boost
176 */
177 BoostX Inverse() const;
178
179 /**
180 Equality/inequality operators
181 */
182 bool operator == (const BoostX & rhs) const {
183 if( fBeta != rhs.fBeta ) return false;
184 if( fGamma != rhs.fGamma ) return false;
185 return true;
186 }
187
188 bool operator != (const BoostX & rhs) const {
189 return ! operator==(rhs);
190 }
191
192private:
193
194 Scalar fBeta; // boost beta X
195 Scalar fGamma; // boost gamma
196
197}; // BoostX
198
199// ============ Class BoostX ends here ============
200
201
202/**
203 Stream Output and Input
204*/
205// TODO - I/O should be put in the manipulator form
206
207std::ostream & operator<< (std::ostream & os, const BoostX & b);
208
209
210} //namespace Math
211} //namespace ROOT
212
213
214
215
216
217
218
219#endif /* ROOT_Math_GenVector_BoostX */
#define b(i)
Definition RSha256.hxx:100
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Class representing a Lorentz Boost along the X axis, by beta.
Definition BoostX.h:39
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:108
Scalar Beta() const
Retrieve the beta of the Boost.
Definition BoostX.h:98
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:164
BoostX(Scalar beta_x)
Construct given a Scalar beta_x.
Definition BoostX.h:69
Scalar Gamma() const
Retrieve the gamma of the Boost.
Definition BoostX.h:103
bool operator!=(const BoostX &rhs) const
Definition BoostX.h:188
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
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:182
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:113
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 generic LorentzVector in the 4D space-time, using the specified coordinate system ...
Class describing a 4D cartesian coordinate system (x, y, z, t coordinates) or momentum-energy vectors...
Definition PxPyPzE4D.h:44
double beta(double x, double y)
Calculates the beta function.
Namespace for new Math classes and functions.
Rotation3D::Scalar Scalar
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.