11 #pragma implementation
14 #include "CLHEP/Vector/LorentzRotation.h"
15 #include "CLHEP/Vector/LorentzVector.h"
23 HepLorentzRotation & HepLorentzRotation::set (
const HepLorentzVector & ccol1,
24 const HepLorentzVector & ccol2,
25 const HepLorentzVector & ccol3,
26 const HepLorentzVector & ccol4) {
30 ZMpvMetric_t savedMetric = HepLorentzVector::setMetric (TimePositive);
32 if ( ccol4.getT() < 0 ) {
33 std::cerr <<
"HepLorentzRotation::set() - "
34 <<
"column 4 supplied to define transformation has negative T component"
36 *
this = HepLorentzRotation();
111 HepLorentzVector
a, b, c, d;
112 bool isLorentzTransformation =
true;
118 isLorentzTransformation =
false;
126 c = ccol3 - ccol3.dot(d) * d;
129 isLorentzTransformation =
false;
137 b = ccol2 + ccol2.dot(c) * c - ccol2.dot(d) * d;
140 isLorentzTransformation =
false;
148 a = ccol1 + ccol1.dot(b) * b + ccol1.dot(c) * c - ccol1.dot(d) * d;
151 isLorentzTransformation =
false;
159 if ( !isLorentzTransformation ) {
160 std::cerr <<
"HepLorentzRotation::set() - "
161 <<
"cols 1-4 supplied to define transformation form either \n"
162 <<
" a boosted reflection or a tachyonic transformation -- \n"
163 <<
" transformation will be set to Identity " << std::endl;
165 *
this = HepLorentzRotation();
168 if ( isLorentzTransformation ) {
169 mxx = a.x(); myx = a.y(); mzx = a.z(); mtx = a.t();
170 mxy = b.x(); myy = b.y(); mzy = b.z(); mty = b.t();
171 mxz = c.x(); myz = c.y(); mzz = c.z(); mtz = c.t();
172 mxt = d.x(); myt = d.y(); mzt = d.z(); mtt = d.t();
175 HepLorentzVector::setMetric (savedMetric);
180 HepLorentzRotation & HepLorentzRotation::setRows
181 (
const HepLorentzVector & rrow1,
182 const HepLorentzVector & rrow2,
183 const HepLorentzVector & rrow3,
184 const HepLorentzVector & rrow4) {
186 set (rrow1, rrow2, rrow3, rrow4);
188 register double q1, q2, q3;
189 q1 = mxy; q2 = mxz; q3 = mxt;
190 mxy = myx; mxz = mzx; mxt = mtx;
191 myx = q1; mzx = q2; mtx = q3;
192 q1 = myz; q2 = myt; q3 = mzt;
193 myz = mzy; myt = mty; mzt = mtz;
194 mzy = q1; mty = q2; mtz = q3;
198 HepLorentzRotation::HepLorentzRotation (
const HepLorentzVector & ccol1,
199 const HepLorentzVector & ccol2,
200 const HepLorentzVector & ccol3,
201 const HepLorentzVector & ccol4 )
203 set ( ccol1, ccol2, ccol3, ccol4 );