ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BoostY.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BoostY.h
1 // -*- C++ -*-
2 //
3 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
4 //
5 // This is the definition of the HepBoostY class for performing specialized
6 // Lorentz transformations which are pure boosts in the Y direction, on
7 // objects of the HepLorentzVector class.
8 //
9 // HepLorentzRotation is a concrete implementation of Hep4RotationInterface.
10 //
11 // .SS See Also
12 // RotationInterfaces.h
13 // LorentzVector.h LorentzRotation.h
14 // Boost.h
15 //
16 // .SS Author
17 // Mark Fischler
18 
19 #ifndef HEP_BOOSTY_H
20 #define HEP_BOOSTY_H
21 
22 #ifdef GNUPRAGMA
23 #pragma interface
24 #endif
25 
28 
29 namespace CLHEP {
30 
31 // Declarations of classes and global methods
32 class HepBoostY;
33 inline HepBoostY inverseOf ( const HepBoostY & b );
34 class HepBoost;
35 class HepRotation;
36 
41 class HepBoostY {
42 
43 public:
44 
45  // ---------- Constructors and Assignment:
46 
47  inline HepBoostY();
48  // Default constructor. Gives a boost of 0.
49 
50  inline HepBoostY(const HepBoostY & b);
51  inline HepBoostY(HepBoostY && b) = default;
52  // Copy and move constructors.
53 
54  inline HepBoostY & operator = (const HepBoostY & m);
55  inline HepBoostY & operator = (HepBoostY && m) = default;
56  // Copy and move assignment operators.
57 
58  HepBoostY & set (double beta);
59  inline HepBoostY (double beta);
60  // Constructor from beta
61 
62  // ---------- Accessors:
63 
64  inline double beta() const;
65  inline double gamma() const;
66  inline Hep3Vector boostVector() const;
67  inline Hep3Vector getDirection() const;
68 
69  inline double xx() const;
70  inline double xy() const;
71  inline double xz() const;
72  inline double xt() const;
73  inline double yx() const;
74  inline double yy() const;
75  inline double yz() const;
76  inline double yt() const;
77  inline double zx() const;
78  inline double zy() const;
79  inline double zz() const;
80  inline double zt() const;
81  inline double tx() const;
82  inline double ty() const;
83  inline double tz() const;
84  inline double tt() const;
85  // Elements of the matrix.
86 
87  inline HepLorentzVector col1() const;
88  inline HepLorentzVector col2() const;
89  inline HepLorentzVector col3() const;
90  inline HepLorentzVector col4() const;
91  // orthosymplectic column vectors
92 
93  inline HepLorentzVector row1() const;
94  inline HepLorentzVector row2() const;
95  inline HepLorentzVector row3() const;
96  inline HepLorentzVector row4() const;
97  // orthosymplectic row vectors
98 
99  HepRep4x4 rep4x4() const;
100  // 4x4 representation:
101 
103  // Symmetric 4x4 representation.
104 
105 
106  // ---------- Decomposition:
107 
108  void decompose (HepRotation & rotation, HepBoost & boost) const;
109  void decompose (HepAxisAngle & rotation, Hep3Vector & boost) const;
110  // Find R and B such that L = R*B -- trivial, since R is identity
111 
112  void decompose (HepBoost & boost, HepRotation & rotation) const;
113  void decompose (Hep3Vector & boost, HepAxisAngle & rotation) const;
114  // Find R and B such that L = B*R -- trivial, since R is identity
115 
116  // ---------- Comparisons:
117 
118  inline int compare( const HepBoostY & b ) const;
119  // Dictionary-order comparison, in order of beta.
120  // Used in operator<, >, <=, >=
121 
122  inline bool operator == (const HepBoostY & b) const;
123  inline bool operator != (const HepBoostY & b) const;
124  inline bool operator <= (const HepBoostY & b) const;
125  inline bool operator >= (const HepBoostY & b) const;
126  inline bool operator < (const HepBoostY & b) const;
127  inline bool operator > (const HepBoostY & b) const;
128  // Comparisons.
129 
130  inline bool isIdentity() const;
131  // Returns true if a null boost.
132 
133  inline double distance2( const HepBoostY & b ) const;
134  double distance2( const HepBoost & b ) const;
135  // Defined as the distance2 between the vectors (gamma*betaVector)
136 
137  double distance2( const HepRotation & r ) const;
138  double distance2( const HepLorentzRotation & lt ) const;
139  // Decompose lt = B*R; add norm2 to distance2 to between boosts.
140 
141  inline double howNear( const HepBoostY & b ) const;
142  inline double howNear( const HepBoost & b ) const;
143  inline double howNear( const HepRotation & r ) const;
144  inline double howNear( const HepLorentzRotation & lt ) const;
145 
146  inline bool isNear( const HepBoostY & b,
148  inline bool isNear( const HepBoost & b,
150  bool isNear( const HepRotation & r,
152  bool isNear( const HepLorentzRotation & lt,
154 
155  // ---------- Properties:
156 
157  inline double norm2() const;
158  // distance2 (IDENTITY), which is beta^2 * gamma^2
159 
160  void rectify();
161  // sets according to the stored beta
162 
163  // ---------- Application:
164 
165  inline HepLorentzVector operator()( const HepLorentzVector & w ) const;
166  // Transform a Lorentz Vector.
167 
168  inline HepLorentzVector operator* ( const HepLorentzVector & w ) const;
169  // Multiplication with a Lorentz Vector.
170 
171  // ---------- Operations in the group of 4-Rotations
172 
173  HepBoostY operator * (const HepBoostY & b) const;
174  HepLorentzRotation operator * (const HepBoost & b) const;
175  HepLorentzRotation operator * (const HepRotation & r) const;
177  // Product of two Lorentz Rotations (this) * lt - matrix multiplication
178  // Notice that the product of two pure boosts in different directions
179  // is no longer a pure boost.
180 
181  inline HepBoostY inverse() const;
182  // Return the inverse.
183 
184  inline friend HepBoostY inverseOf ( const HepBoostY & b );
185  // global methods to invert.
186 
187  inline HepBoostY & invert();
188  // Inverts the Boost matrix.
189 
190  // ---------- I/O:
191 
192  std::ostream & print( std::ostream & os ) const;
193  // Output form is BOOSTY (beta=..., gamma=...);
194 
195  // ---------- Tolerance
196 
197  static inline double getTolerance();
198  static inline double setTolerance(double tol);
199 
200 protected:
201 
203  ( const HepLorentzVector & w ) const;
204  // Multiplication with a Lorentz Vector.
205 
208 
209  inline HepBoostY (double beta, double gamma);
210 
211  double beta_;
212  double gamma_;
213 
214 }; // HepBoostY
215 
216 inline
217 std::ostream & operator <<
218  ( std::ostream & os, const HepBoostY& b ) {return b.print(os);}
219 
220 } // namespace CLHEP
221 
222 #include "CLHEP/Vector/BoostY.icc"
223 
224 #endif /* HEP_BOOSTY_H */