Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
25namespace ROOT {
26
27namespace 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 @sa Overview of the @ref GenVector "physics vector library"
37 */
38
39class BoostY {
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 BoostY();
65
66 /**
67 Construct given a Scalar beta_y
68 */
69 explicit BoostY(Scalar beta_y) { SetComponents(beta_y); }
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_y
84 */
85 void
86 SetComponents (Scalar beta_y);
87
88 /**
89 Get components into a Scalar beta_y
90 */
91 void
92 GetComponents (Scalar& beta_y) 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 rotation 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 BoostY in place
171 */
172 void Invert();
173
174 /**
175 Return inverse of a rotation
176 */
177 BoostY Inverse() const;
178
179 /**
180 Equality/inequality operators
181 */
182 bool operator == (const BoostY & rhs) const {
183 if( fBeta != rhs.fBeta ) return false;
184 if( fGamma != rhs.fGamma ) return false;
185 return true;
186 }
187 bool operator != (const BoostY & rhs) const {
188 return ! operator==(rhs);
189 }
190
191private:
192
193 Scalar fBeta; // beta Y of the Boost
194 Scalar fGamma; // gamma of the Boost
195
196}; // BoostY
197
198// ============ Class BoostY ends here ============
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 BoostY & b);
206
207
208} //namespace Math
209} //namespace ROOT
210
211
212
213
214
215
216
217#endif /* ROOT_Math_GenVector_BoostY */
#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 Y axis, by beta.
Definition BoostY.h:39
void SetBeta(Scalar beta)
Set the given beta of the Boost.
Definition BoostY.h:108
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > XYZVector
The beta vector for this boost.
Definition BoostY.h:113
BoostY Inverse() const
Return inverse of a rotation.
Definition BoostY.cxx:98
BoostY(Scalar beta_y)
Construct given a Scalar beta_y.
Definition BoostY.h:69
XYZVector BetaVector() const
Definition BoostY.cxx:50
void Invert()
Invert a BoostY in place.
Definition BoostY.cxx:93
BoostY()
Default constructor (identity transformation)
Definition BoostY.cxx:30
A4Vector operator*(const A4Vector &v) const
Overload operator * for rotation on a vector.
Definition BoostY.h:164
void SetComponents(Scalar beta_y)
Set components from a Scalar beta_y.
Definition BoostY.cxx:32
LorentzVector< ROOT::Math::PxPyPzE4D< double > > operator()(const LorentzVector< ROOT::Math::PxPyPzE4D< double > > &v) const
Lorentz transformation operation on a Minkowski ('Cartesian') LorentzVector.
Definition BoostY.cxx:82
void GetComponents(Scalar &beta_y) const
Get components into a Scalar beta_y.
Definition BoostY.cxx:44
Scalar Beta() const
Retrieve the beta of the Boost.
Definition BoostY.h:98
bool operator!=(const BoostY &rhs) const
Definition BoostY.h:187
Scalar Gamma() const
Retrieve the gamma of the Boost.
Definition BoostY.h:103
bool operator==(const BoostY &rhs) const
Equality/inequality operators.
Definition BoostY.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 BoostY.cxx:55
void Rectify()
Re-adjust components to eliminate small deviations from a perfect orthosyplectic matrix.
Definition BoostY.cxx:63
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.