CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
RotationL.cc
Go to the documentation of this file.
1// -*- C++ -*-
2// ---------------------------------------------------------------------------
3//
4// This file is a part of the CLHEP - a Class Library for High Energy Physics.
5//
6// This is the implementation of methods of the HepRotation class which
7// were introduced when ZOOM PhysicsVectors was merged in, which might cause
8// pulling in of LorentzTransformation related code units.
9//
10
11#include "CLHEP/Vector/defs.h"
12#include "CLHEP/Vector/Rotation.h"
13#include "CLHEP/Vector/LorentzRotation.h"
14
15#include <cmath>
16
17namespace CLHEP {
18
19// ---------- distance2 and related member functions:
20//
21// WHy do we have forms for HepLorentzRotation and HepBoost but not for
22// HepBoostX, HepBoostY, HepBoostZ? Because the latter can be gotten by
23// implicit conversion to HepBoost; but if we just had HepLorentzRotation
24// then this would involve double conversion when HepBoostX was used.
25
26double HepRotation::distance2( const HepLorentzRotation & lt ) const {
27 HepAxisAngle a;
28 Hep3Vector b;
29 lt.decompose(b, a);
30 double bet = b.beta();
31 double bet2 = bet*bet;
32 HepRotation r(a);
33 return bet2/(1-bet2) + distance2(r);
34}
35
36double HepRotation::distance2( const HepBoost & lt ) const {
37 return distance2( HepLorentzRotation(lt));
38}
39
40double HepRotation::howNear( const HepLorentzRotation & lt ) const {
41 return std::sqrt( distance2( lt ) );
42}
43
44double HepRotation::howNear( const HepBoost & lt ) const {
45 return std::sqrt( distance2( lt ) );
46}
47
49 double epsilon) const {
50 return distance2( lt ) <= epsilon*epsilon;
51}
52
54 double epsilon) const {
55 return distance2( lt ) <= epsilon*epsilon;
56}
57
58} // namespace CLHEP
59
double beta() const
Definition: SpaceVectorP.cc:28
void decompose(Hep3Vector &boost, HepAxisAngle &rotation) const
double distance2(const HepRotation &r) const
Definition: RotationP.cc:31
bool isNear(const HepRotation &r, double epsilon=Hep4RotationInterface::tolerance) const
Definition: RotationP.cc:43
double howNear(const HepRotation &r) const
Definition: RotationP.cc:39