#include <TwoVector.h>
- Author
Definition at line 45 of file TwoVector.h.
◆ anonymous enum
Enumerator |
---|
X | |
Y | |
NUM_COORDINATES | |
SIZE | |
Definition at line 49 of file TwoVector.h.
◆ Hep2Vector() [1/4]
CLHEP::Hep2Vector::Hep2Vector |
( |
double |
x = 0.0 , |
|
|
double |
y = 0.0 |
|
) |
| |
|
inline |
◆ Hep2Vector() [2/4]
CLHEP::Hep2Vector::Hep2Vector |
( |
const Hep2Vector & |
p | ) |
|
|
inline |
◆ Hep2Vector() [3/4]
◆ Hep2Vector() [4/4]
CLHEP::Hep2Vector::Hep2Vector |
( |
const Hep3Vector & |
| ) |
|
|
explicit |
◆ ~Hep2Vector()
CLHEP::Hep2Vector::~Hep2Vector |
( |
| ) |
|
|
inline |
◆ angle()
◆ compare()
int CLHEP::Hep2Vector::compare |
( |
const Hep2Vector & |
v | ) |
const |
Definition at line 89 of file TwoVector.cc.
89 {
90 if ( dy > v.dy ) {
91 return 1;
92 } else if ( dy < v.dy ) {
93 return -1;
94 } else if ( dx > v.dx ) {
95 return 1;
96 } else if ( dx < v.dx ) {
97 return -1;
98 } else {
99 return 0;
100 }
101}
Referenced by operator<(), operator<=(), operator>(), and operator>=().
◆ dot()
◆ getTolerance()
static double CLHEP::Hep2Vector::getTolerance |
( |
| ) |
|
|
inlinestatic |
◆ howNear()
Definition at line 122 of file TwoVector.cc.
122 {
123 double d = (*
this - p).
mag2();
125 if ( (pdp > 0) && (d < pdp) ) {
126 return std::sqrt (d/pdp);
127 } else if ( (pdp == 0) && (d == 0) ) {
128 return 0;
129 } else {
130 return 1;
131 }
132}
double dot(const Hep2Vector &p) const
◆ howOrthogonal()
Definition at line 163 of file TwoVector.cc.
163 {
164
165
166 double v1v2 = std::fabs(
dot(v));
167 if ( v1v2 == 0 ) {
168 return 0;
169 }
170 double abscross = std::fabs ( dx * v.y() - dy - v.x() );
171 if ( v1v2 >= abscross ) {
172 return 1;
173 } else {
174 return v1v2/abscross;
175 }
176}
◆ howParallel()
Definition at line 134 of file TwoVector.cc.
134 {
135
136
137 double v1v2 = std::fabs(
dot(v));
138 if ( v1v2 == 0 ) {
139
140 return ( (
mag2() == 0) && (v.mag2() == 0) ) ? 0 : 1;
141 }
142 double abscross = std::fabs ( dx * v.y() - dy - v.x() );
143 if ( abscross >= v1v2 ) {
144 return 1;
145 } else {
146 return abscross/v1v2;
147 }
148}
◆ isNear()
bool CLHEP::Hep2Vector::isNear |
( |
const Hep2Vector & |
p, |
|
|
double |
epsilon = tolerance |
|
) |
| const |
Definition at line 117 of file TwoVector.cc.
117 {
118 double limit =
dot(p)*epsilon*epsilon;
119 return ( (*
this - p).
mag2() <= limit );
120}
◆ isOrthogonal()
bool CLHEP::Hep2Vector::isOrthogonal |
( |
const Hep2Vector & |
p, |
|
|
double |
epsilon = tolerance |
|
) |
| const |
Definition at line 178 of file TwoVector.cc.
179 {
180
181
182 double v1v2 = std::fabs(
dot(v));
183 double abscross = std::fabs ( dx * v.y() - dy - v.x() );
184 return ( v1v2 <= epsilon * abscross );
185}
◆ isParallel()
bool CLHEP::Hep2Vector::isParallel |
( |
const Hep2Vector & |
p, |
|
|
double |
epsilon = tolerance |
|
) |
| const |
Definition at line 150 of file TwoVector.cc.
151 {
152
153
154 double v1v2 = std::fabs(
dot(v));
155 if ( v1v2 == 0 ) {
156
157 return ( (
mag2() == 0) && (v.mag2() == 0) );
158 }
159 double abscross = std::fabs ( dx * v.y() - dy - v.x() );
160 return ( abscross <= epsilon * v1v2 );
161}
◆ mag()
double CLHEP::Hep2Vector::mag |
( |
| ) |
const |
|
inline |
◆ mag2()
double CLHEP::Hep2Vector::mag2 |
( |
| ) |
const |
|
inline |
◆ operator Hep3Vector()
Definition at line 85 of file TwoVector.cc.
85 {
86 return Hep3Vector ( dx, dy, 0.0 );
87}
◆ operator!=()
bool CLHEP::Hep2Vector::operator!= |
( |
const Hep2Vector & |
v | ) |
const |
|
inline |
◆ operator()() [1/2]
double & CLHEP::Hep2Vector::operator() |
( |
int |
i | ) |
|
Definition at line 41 of file TwoVector.cc.
41 {
42 static double dummy;
43 switch(i) {
45 return dx;
47 return dy;
48 default:
50 "Hep2Vector::operator() : bad index"));
51 return dummy;
52 }
53}
◆ operator()() [2/2]
double CLHEP::Hep2Vector::operator() |
( |
int |
i | ) |
const |
Definition at line 29 of file TwoVector.cc.
29 {
30 if (i == 0) {
32 }else if (i == 1) {
34 }else{
36 "Hep2Vector::operator(): bad index"));
37 return 0.0;
38 }
39}
◆ operator*=()
◆ operator+=()
◆ operator-()
◆ operator-=()
◆ operator<()
bool CLHEP::Hep2Vector::operator< |
( |
const Hep2Vector & |
v | ) |
const |
Definition at line 107 of file TwoVector.cc.
107 {
109}
int compare(const Hep2Vector &v) const
◆ operator<=()
bool CLHEP::Hep2Vector::operator<= |
( |
const Hep2Vector & |
v | ) |
const |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
bool CLHEP::Hep2Vector::operator== |
( |
const Hep2Vector & |
v | ) |
const |
|
inline |
◆ operator>()
bool CLHEP::Hep2Vector::operator> |
( |
const Hep2Vector & |
v | ) |
const |
◆ operator>=()
bool CLHEP::Hep2Vector::operator>= |
( |
const Hep2Vector & |
v | ) |
const |
◆ operator[]() [1/2]
double & CLHEP::Hep2Vector::operator[] |
( |
int |
i | ) |
|
|
inline |
◆ operator[]() [2/2]
double CLHEP::Hep2Vector::operator[] |
( |
int |
i | ) |
const |
|
inline |
◆ orthogonal()
Hep2Vector CLHEP::Hep2Vector::orthogonal |
( |
| ) |
const |
|
inline |
◆ phi()
double CLHEP::Hep2Vector::phi |
( |
| ) |
const |
|
inline |
◆ r()
double CLHEP::Hep2Vector::r |
( |
| ) |
const |
|
inline |
◆ rotate()
void CLHEP::Hep2Vector::rotate |
( |
double |
angler | ) |
|
Definition at line 55 of file TwoVector.cc.
55 {
56 double s1 = std::sin(angler);
57 double c = std::cos(angler);
58 double xx = dx;
59 dx = c*xx - s1*dy;
60 dy = s1*xx + c*dy;
61}
◆ set()
◆ setMag()
void CLHEP::Hep2Vector::setMag |
( |
double |
r | ) |
|
|
inline |
◆ setPhi()
void CLHEP::Hep2Vector::setPhi |
( |
double |
phi | ) |
|
|
inline |
◆ setPolar()
◆ setR()
void CLHEP::Hep2Vector::setR |
( |
double |
r | ) |
|
|
inline |
◆ setTolerance()
Definition at line 22 of file TwoVector.cc.
22 {
23
24 double oldTolerance (tolerance);
25 tolerance = tol;
26 return oldTolerance;
27}
◆ setX()
void CLHEP::Hep2Vector::setX |
( |
double |
x | ) |
|
|
inline |
◆ setY()
void CLHEP::Hep2Vector::setY |
( |
double |
y | ) |
|
|
inline |
◆ unit()
◆ x()
double CLHEP::Hep2Vector::x |
( |
| ) |
const |
|
inline |
◆ y()
double CLHEP::Hep2Vector::y |
( |
| ) |
const |
|
inline |
◆ operator* [1/3]
◆ operator* [2/3]
◆ operator* [3/3]
◆ operator+
◆ operator-
◆ operator/
Definition at line 63 of file TwoVector.cc.
63 {
64 if (a==0) {
65 ZMthrowA(ZMxpvInfiniteVector(
"Division of Hep2Vector by zero"));
66 }
68}
Hep2Vector(double x=0.0, double y=0.0)
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & |
, |
|
|
const Hep2Vector & |
|
|
) |
| |
|
friend |
Definition at line 70 of file TwoVector.cc.
70 {
71 os << "(" << q.x() << ", " << q.y() << ")";
72 return os;
73}
◆ ZMpvToleranceTicks
const int CLHEP::Hep2Vector::ZMpvToleranceTicks = 100 |
|
static |
The documentation for this class was generated from the following files: