Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
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 49 of file Normal3D.cc.

49 {
50 double vx = v.x(), vy = v.y(), vz = v.z();
51 double xx = m.xx(), xy = m.xy(), xz = m.xz();
52 double yx = m.yx(), yy = m.yy(), yz = m.yz();
53 double zx = m.zx(), zy = m.zy(), zz = m.zz();
54 return Normal3D<double>
55 ((yy*zz-yz*zy)*vx+(yz*zx-yx*zz)*vy+(yx*zy-yy*zx)*vz,
56 (zy*xz-zz*xy)*vx+(zz*xx-zx*xz)*vy+(zx*xy-zy*xx)*vz,
57 (xy*yz-xz*yy)*vx+(xz*yx-xx*yz)*vy+(xx*yy-xy*yx)*vz);
58 }
double zz() const
Definition: Transform3D.h:281
double yz() const
Definition: Transform3D.h:272
double xy() const
Definition: Transform3D.h:260
double zx() const
Definition: Transform3D.h:275
double yx() const
Definition: Transform3D.h:266
double zy() const
Definition: Transform3D.h:278
double xx() const
Definition: Transform3D.h:257
double yy() const
Definition: Transform3D.h:269
double xz() const
Definition: Transform3D.h:263

◆ operator*() [2/6]

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

Definition at line 23 of file Normal3D.cc.

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

◆ operator*() [3/6]

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

Definition at line 40 of file Point3D.cc.

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

◆ operator*() [4/6]

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

Definition at line 20 of file Point3D.cc.

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

◆ operator*() [5/6]

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

Definition at line 40 of file Vector3D.cc.

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

◆ operator*() [6/6]

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

Definition at line 20 of file Vector3D.cc.

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

◆ operator<<() [1/4]

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

Definition at line 261 of file BasicVector3D.cc.

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

◆ operator<<() [2/4]

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

Definition at line 105 of file BasicVector3D.cc.

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

◆ operator<<() [3/4]

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

Definition at line 27 of file Plane3D.cc.

28 {
29 return os
30 << '(' << p.a() << ',' << p.b() << ',' << p.c() << ',' << p.d() << ')';
31 }
T d() const
Definition: Plane3D.h:93
T b() const
Definition: Plane3D.h:87
T c() const
Definition: Plane3D.h:90
T a() const
Definition: Plane3D.h:84

◆ operator<<() [4/4]

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

Definition at line 20 of file Plane3D.cc.

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

◆ operator>>() [1/2]

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

Definition at line 269 of file BasicVector3D.cc.

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

◆ operator>>() [2/2]

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

Definition at line 113 of file BasicVector3D.cc.

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