Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
25namespace 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 @sa Overview of the @ref GenVector "physics vector library"
37 */
38
39class BoostZ {
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 BoostZ();
65
66 /**
67 Construct given a Scalar beta_z
68 */
69 explicit BoostZ(Scalar beta_z) { SetComponents(beta_z); }
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_z
84 */
85 void
86 SetComponents (Scalar beta_z);
87
88 /**
89 Get components into a Scalar beta_z
90 */
91 void
92 GetComponents (Scalar& beta_z) 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 boost 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 BoostZ in place
171 */
172 void Invert();
173
174 /**
175 Return inverse of a BoostZ
176 */
177 BoostZ Inverse() const;
178
179 /**
180 Equality/inequality operators
181 */
182 bool operator == (const BoostZ & rhs) const {
183 if( fBeta != rhs.fBeta ) return false;
184 if( fGamma != rhs.fGamma ) return false;
185 return true;
186 }
187 bool operator != (const BoostZ & rhs) const {
188 return ! operator==(rhs);
189 }
190
191private:
192
193 Scalar fBeta; // boost beta z
194 Scalar fGamma; // boost gamma
195
196}; // BoostZ
197
198// ============ Class BoostZ ends here ============
199
200/**
201 Stream Output and Input
202 */
203 // TODO - I/O should be put in the manipulator form
204
205std::ostream & operator<< (std::ostream & os, const BoostZ & b);
206
207
208} //namespace Math
209} //namespace ROOT
210
211
212
213
214
215
216
217#endif /* ROOT_Math_GenVector_BoostZ */
#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 Z axis, by beta.
Definition BoostZ.h:39
Scalar Beta() const
Retrieve the beta of the Boost.
Definition BoostZ.h:98
Scalar Gamma() const
Retrieve the gamma of the Boost.
Definition BoostZ.h:103
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
void Invert()
Invert a BoostZ in place.
Definition BoostZ.cxx:94
DisplacementVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > XYZVector
The beta vector for this boost.
Definition BoostZ.h:113
BoostZ(Scalar beta_z)
Construct given a Scalar beta_z.
Definition BoostZ.h:69
A4Vector operator*(const A4Vector &v) const
Overload operator * for boost on a vector.
Definition BoostZ.h:164
XYZVector BetaVector() const
Definition BoostZ.cxx:50
bool operator==(const BoostZ &rhs) const
Equality/inequality operators.
Definition BoostZ.h:182
void SetComponents(Scalar beta_z)
Set components from a Scalar beta_z.
Definition BoostZ.cxx:32
void Rectify()
Re-adjust components to eliminate small deviations from a perfect orthosyplectic matrix.
Definition BoostZ.cxx:64
void GetComponents(Scalar &beta_z) const
Get components into a Scalar beta_z.
Definition BoostZ.cxx:44
LorentzVector< ROOT::Math::PxPyPzE4D< double > > operator()(const LorentzVector< ROOT::Math::PxPyPzE4D< double > > &v) const
Lorentz transformation operation on a Minkowski ('Cartesian') LorentzVector.
Definition BoostZ.cxx:83
bool operator!=(const BoostZ &rhs) const
Definition BoostZ.h:187
BoostZ Inverse() const
Return inverse of a BoostZ.
Definition BoostZ.cxx:99
void SetBeta(Scalar beta)
Set the given beta of the Boost.
Definition BoostZ.h:108
BoostZ()
Default constructor (identity transformation)
Definition BoostZ.cxx:30
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
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...