CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
HepGeom Namespace Reference

Classes

class  BasicVector3D
 
class  Normal3D
 
class  Normal3D< double >
 
class  Normal3D< float >
 
class  Plane3D
 
class  Point3D
 
class  Point3D< double >
 
class  Point3D< float >
 
class  Reflect3D
 
class  ReflectX3D
 
class  ReflectY3D
 
class  ReflectZ3D
 
class  Rotate3D
 
class  RotateX3D
 
class  RotateY3D
 
class  RotateZ3D
 
class  Scale3D
 
class  ScaleX3D
 
class  ScaleY3D
 
class  ScaleZ3D
 
class  Transform3D
 
class  Translate3D
 
class  TranslateX3D
 
class  TranslateY3D
 
class  TranslateZ3D
 
class  Vector3D
 
class  Vector3D< double >
 
class  Vector3D< float >
 

Function Documentation

◆ operator*() [1/6]

Normal3D< double > HepGeom::operator* ( const Transform3D m,
const Normal3D< double > &  v 
)
related

Definition at line 51 of file Normal3D.cc.

51 {
52 double vx = v.x(), vy = v.y(), vz = v.z();
53 double xx = m.xx(), xy = m.xy(), xz = m.xz();
54 double yx = m.yx(), yy = m.yy(), yz = m.yz();
55 double zx = m.zx(), zy = m.zy(), zz = m.zz();
56 return Normal3D<double>
57 ((yy*zz-yz*zy)*vx+(yz*zx-yx*zz)*vy+(yx*zy-yy*zx)*vz,
58 (zy*xz-zz*xy)*vx+(zz*xx-zx*xz)*vy+(zx*xy-zy*xx)*vz,
59 (xy*yz-xz*yy)*vx+(xz*yx-xx*yz)*vy+(xx*yy-xy*yx)*vz);
60 }
double zz() const
Definition: Transform3D.h:283
double yz() const
Definition: Transform3D.h:274
double xy() const
Definition: Transform3D.h:262
double zx() const
Definition: Transform3D.h:277
double yx() const
Definition: Transform3D.h:268
double zy() const
Definition: Transform3D.h:280
double xx() const
Definition: Transform3D.h:259
double yy() const
Definition: Transform3D.h:271
double xz() const
Definition: Transform3D.h:265

◆ operator*() [2/6]

Normal3D< float > HepGeom::operator* ( const Transform3D m,
const Normal3D< float > &  v 
)
related

Definition at line 25 of file Normal3D.cc.

25 {
26 double vx = v.x(), vy = v.y(), vz = v.z();
27 double xx = m.xx(), xy = m.xy(), xz = m.xz();
28 double yx = m.yx(), yy = m.yy(), yz = m.yz();
29 double zx = m.zx(), zy = m.zy(), zz = m.zz();
30 return Normal3D<float>
31 ((yy*zz-yz*zy)*vx+(yz*zx-yx*zz)*vy+(yx*zy-yy*zx)*vz,
32 (zy*xz-zz*xy)*vx+(zz*xx-zx*xz)*vy+(zx*xy-zy*xx)*vz,
33 (xy*yz-xz*yy)*vx+(xz*yx-xx*yz)*vy+(xx*yy-xy*yx)*vz);
34 }

◆ operator*() [3/6]

Point3D< double > HepGeom::operator* ( const Transform3D m,
const Point3D< double > &  v 
)
related

Definition at line 42 of file Point3D.cc.

42 {
43 double vx = v.x(), vy = v.y(), vz = v.z();
44 return Point3D<double>
45 (m.xx()*vx + m.xy()*vy + m.xz()*vz + m.dx(),
46 m.yx()*vx + m.yy()*vy + m.yz()*vz + m.dy(),
47 m.zx()*vx + m.zy()*vy + m.zz()*vz + m.dz());
48 }
double dy() const
Definition: Transform3D.h:289
double dz() const
Definition: Transform3D.h:292
double dx() const
Definition: Transform3D.h:286

◆ operator*() [4/6]

Point3D< float > HepGeom::operator* ( const Transform3D m,
const Point3D< float > &  v 
)
related

Definition at line 22 of file Point3D.cc.

22 {
23 double vx = v.x(), vy = v.y(), vz = v.z();
24 return Point3D<float>
25 (m.xx()*vx + m.xy()*vy + m.xz()*vz + m.dx(),
26 m.yx()*vx + m.yy()*vy + m.yz()*vz + m.dy(),
27 m.zx()*vx + m.zy()*vy + m.zz()*vz + m.dz());
28 }

◆ operator*() [5/6]

Vector3D< double > HepGeom::operator* ( const Transform3D m,
const Vector3D< double > &  v 
)
related

Definition at line 42 of file Vector3D.cc.

42 {
43 double vx = v.x(), vy = v.y(), vz = v.z();
44 return Vector3D<double>
45 (m.xx()*vx + m.xy()*vy + m.xz()*vz,
46 m.yx()*vx + m.yy()*vy + m.yz()*vz,
47 m.zx()*vx + m.zy()*vy + m.zz()*vz);
48 }

◆ operator*() [6/6]

Vector3D< float > HepGeom::operator* ( const Transform3D m,
const Vector3D< float > &  v 
)
related

Definition at line 22 of file Vector3D.cc.

22 {
23 double vx = v.x(), vy = v.y(), vz = v.z();
24 return Vector3D<float>
25 (m.xx()*vx + m.xy()*vy + m.xz()*vz,
26 m.yx()*vx + m.yy()*vy + m.yz()*vz,
27 m.zx()*vx + m.zy()*vy + m.zz()*vz);
28 }

◆ operator<<() [1/4]

std::ostream & HepGeom::operator<< ( std::ostream &  os,
const BasicVector3D< double > &  a 
)
related

Definition at line 263 of file BasicVector3D.cc.

265 {
266 return os << "(" << a.x() << "," << a.y() << "," << a.z() << ")";
267 }

◆ operator<<() [2/4]

std::ostream & HepGeom::operator<< ( std::ostream &  os,
const BasicVector3D< float > &  a 
)
related

Definition at line 107 of file BasicVector3D.cc.

109 {
110 return os << "(" << a.x() << "," << a.y() << "," << a.z() << ")";
111 }

◆ operator<<() [3/4]

std::ostream & HepGeom::operator<< ( std::ostream &  os,
const Plane3D< double > &  p 
)
related

Definition at line 29 of file Plane3D.cc.

30 {
31 return os
32 << '(' << p.a() << ',' << p.b() << ',' << p.c() << ',' << p.d() << ')';
33 }
T d() const
Definition: Plane3D.h:95
T b() const
Definition: Plane3D.h:89
T c() const
Definition: Plane3D.h:92
T a() const
Definition: Plane3D.h:86

◆ operator<<() [4/4]

std::ostream & HepGeom::operator<< ( std::ostream &  os,
const Plane3D< float > &  p 
)
related

Definition at line 22 of file Plane3D.cc.

23 {
24 return os
25 << '(' << p.a() << ',' << p.b() << ',' << p.c() << ',' << p.d() << ')';
26 }

◆ operator>>() [1/2]

std::istream & HepGeom::operator>> ( std::istream &  is,
BasicVector3D< double > &  a 
)
related

Definition at line 271 of file BasicVector3D.cc.

272 {
273 // Required format is ( a, b, c ) that is, three numbers, preceded by
274 // (, followed by ), and separated by commas. The three numbers are
275 // taken as x, y, z.
276
277 double x, y, z;
278 char c;
279
280 is >> std::ws >> c;
281 // ws is defined to invoke eatwhite(istream & )
282 // see (Stroustrup gray book) page 333 and 345.
283 if (is.fail() || c != '(' ) {
284 std::cerr
285 << "Could not find required opening parenthesis "
286 << "in input of a BasicVector3D<double>"
287 << std::endl;
288 return is;
289 }
290
291 is >> x >> std::ws >> c;
292 if (is.fail() || c != ',' ) {
293 std::cerr
294 << "Could not find x value and required trailing comma "
295 << "in input of a BasicVector3D<double>"
296 << std::endl;
297 return is;
298 }
299
300 is >> y >> std::ws >> c;
301 if (is.fail() || c != ',' ) {
302 std::cerr
303 << "Could not find y value and required trailing comma "
304 << "in input of a BasicVector3D<double>"
305 << std::endl;
306 return is;
307 }
308
309 is >> z >> std::ws >> c;
310 if (is.fail() || c != ')' ) {
311 std::cerr
312 << "Could not find z value and required close parenthesis "
313 << "in input of a BasicVector3D<double>"
314 << std::endl;
315 return is;
316 }
317
318 a.setX(x);
319 a.setY(y);
320 a.setZ(z);
321 return is;
322 }

◆ operator>>() [2/2]

std::istream & HepGeom::operator>> ( std::istream &  is,
BasicVector3D< float > &  a 
)
related

Definition at line 115 of file BasicVector3D.cc.

116 {
117 // Required format is ( a, b, c ) that is, three numbers, preceded by
118 // (, followed by ), and separated by commas. The three numbers are
119 // taken as x, y, z.
120
121 float x, y, z;
122 char c;
123
124 is >> std::ws >> c;
125 // ws is defined to invoke eatwhite(istream & )
126 // see (Stroustrup gray book) page 333 and 345.
127 if (is.fail() || c != '(' ) {
128 std::cerr
129 << "Could not find required opening parenthesis "
130 << "in input of a BasicVector3D<float>"
131 << std::endl;
132 return is;
133 }
134
135 is >> x >> std::ws >> c;
136 if (is.fail() || c != ',' ) {
137 std::cerr
138 << "Could not find x value and required trailing comma "
139 << "in input of a BasicVector3D<float>"
140 << std::endl;
141 return is;
142 }
143
144 is >> y >> std::ws >> c;
145 if (is.fail() || c != ',' ) {
146 std::cerr
147 << "Could not find y value and required trailing comma "
148 << "in input of a BasicVector3D<float>"
149 << std::endl;
150 return is;
151 }
152
153 is >> z >> std::ws >> c;
154 if (is.fail() || c != ')' ) {
155 std::cerr
156 << "Could not find z value and required close parenthesis "
157 << "in input of a BasicVector3D<float>"
158 << std::endl;
159 return is;
160 }
161
162 a.setX(x);
163 a.setY(y);
164 a.setZ(z);
165 return is;
166 }