CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Vector
src
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
#ifdef GNUPRAGMA
12
#pragma implementation
13
#endif
14
15
#include "CLHEP/Vector/defs.h"
16
#include "CLHEP/Vector/Rotation.h"
17
#include "CLHEP/Vector/LorentzRotation.h"
18
19
#include <cmath>
20
21
namespace
CLHEP
{
22
23
// ---------- distance2 and related member functions:
24
//
25
// WHy do we have forms for HepLorentzRotation and HepBoost but not for
26
// HepBoostX, HepBoostY, HepBoostZ? Because the latter can be gotten by
27
// implicit conversion to HepBoost; but if we just had HepLorentzRotation
28
// then this would involve double conversion when HepBoostX was used.
29
30
double
HepRotation::distance2
(
const
HepLorentzRotation
& lt )
const
{
31
HepAxisAngle
a
;
32
Hep3Vector
b
;
33
lt.
decompose
(
b
,
a
);
34
double
bet =
b
.beta();
35
double
bet2 = bet*bet;
36
HepRotation
r(
a
);
37
return
bet2/(1-bet2) +
distance2
(r);
38
}
39
40
double
HepRotation::distance2
(
const
HepBoost
& lt )
const
{
41
return
distance2
(
HepLorentzRotation
(lt));
42
}
43
44
double
HepRotation::howNear
(
const
HepLorentzRotation
& lt )
const
{
45
return
std::sqrt(
distance2
( lt ) );
46
}
47
48
double
HepRotation::howNear
(
const
HepBoost
& lt )
const
{
49
return
std::sqrt(
distance2
( lt ) );
50
}
51
52
bool
HepRotation::isNear
(
const
HepLorentzRotation
& lt,
53
double
epsilon)
const
{
54
return
distance2
( lt ) <= epsilon*epsilon;
55
}
56
57
bool
HepRotation::isNear
(
const
HepBoost
& lt,
58
double
epsilon)
const
{
59
return
distance2
( lt ) <= epsilon*epsilon;
60
}
61
62
}
// namespace CLHEP
63
CLHEP::HepAxisAngle
Definition:
Geometry/CLHEP/Vector/AxisAngle.h:37
a
@ a
Definition:
testCategories.cc:125
b
@ b
Definition:
testCategories.cc:125
CLHEP::HepRotation::howNear
double howNear(const HepRotation &r) const
Definition:
RotationP.cc:43
CLHEP::HepRotation::isNear
bool isNear(const HepRotation &r, double epsilon=Hep4RotationInterface::tolerance) const
Definition:
RotationP.cc:47
CLHEP::HepRotation
Definition:
Geometry/CLHEP/Vector/Rotation.h:48
CLHEP::HepLorentzRotation
Definition:
Geometry/CLHEP/Vector/LorentzRotation.h:54
CLHEP
Definition:
ClhepVersion.h:13
CLHEP::HepBoost
Definition:
Geometry/CLHEP/Vector/Boost.h:43
CLHEP::Hep3Vector
Definition:
Geometry/CLHEP/Vector/ThreeVector.h:41
CLHEP::HepRotation::distance2
double distance2(const HepRotation &r) const
Definition:
RotationP.cc:35
CLHEP::HepLorentzRotation::decompose
void decompose(Hep3Vector &boost, HepAxisAngle &rotation) const
Definition:
LorentzRotationD.cc:48
Generated by
1.8.17