BasicVector.cc
Go to the documentation of this file.
1 
9 #include <utl/config.h>
10 #include <utl/BasicVector.h>
11 #include <utl/TransformationMatrix.h>
12 #include <CLHEP/Geometry/Point3D.h>
13 #include <CLHEP/Geometry/Vector3D.h>
14 #include <cmath>
15 
16 using std::sin;
17 using std::cos;
18 
19 
20 namespace utl {
21 
22  template<class HepVector>
23  HepVector
25  const
26  {
27  CoordinateSystemValid(newCoordinateSystem);
28  return HepVector(fCoordinateSystem->GetTransformationTo(newCoordinateSystem).fTransform * fVector);
29  }
30 
31 
32  template<class HepVector>
33  double
35  const double phi,
36  const double /*z*/)
37  const
38  {
39  return rho * cos(phi);
40  }
41 
42 
43  template<class HepVector>
44  double
46  const double phi,
47  const double /*z*/)
48  const
49  {
50  return rho * sin(phi);
51  }
52 
53 
54  template<class HepVector>
55  double
57  const double /*phi*/,
58  const double z)
59  const
60  {
61  return z;
62  }
63 
64 
65  template<class HepVector>
66  double
68  const double theta,
69  const double phi)
70  const
71  {
72  return r * cos(phi) * sin(theta);
73  }
74 
75 
76  template<class HepVector>
77  double
79  const double theta,
80  const double phi)
81  const
82  {
83  return r * sin(phi) * sin(theta);
84  }
85 
86 
87  template<class HepVector>
88  double
90  const double theta,
91  const double /*phi*/)
92  const
93  {
94  return r * cos(theta);
95  }
96 
97 
98  template<class HepVector>
100 
101 
102  template<class HepVector>
104 
105 
106  template<class HepVector>
108 
109 
110  template<class HepVector>
111  const double BasicVector<HepVector>::fgEpsilon = 1e-9;
112 
113 
114  template<class HepVector>
115  const char* const BasicVector<HepVector>::CoordinateType::fgKindTags[] = { "cartesian", "cylindrical", "spherical" };
116 
117 
118  // instantiations
119  template class BasicVector<HepGeom::Point3D<double>>;
122 
123 }
virtual double X(double rho, double phi, double z) const override
Definition: BasicVector.cc:34
virtual double Z(double rho, double phi, double z) const override
Definition: BasicVector.cc:56
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Basic vector class template for geometry.
Definition: BasicVector.h:42
DataType TransformedVector(const CoordinateSystemPtr &newCoordinateSystem) const
Definition: BasicVector.cc:24
virtual double Z(double r, double theta, double phi) const override
Definition: BasicVector.cc:89
Class to have a type for indicating cylindrical coordinate components.
Definition: BasicVector.h:127
Class to have a type for indicating spherical coordinate components.
Definition: BasicVector.h:138
void CoordinateSystemValid(const CoordinateSystemPtr &theCoordinateSystem)
virtual double Y(double rho, double phi, double z) const override
Definition: BasicVector.cc:45
virtual double X(double r, double theta, double phi) const override
Definition: BasicVector.cc:67
virtual double Y(double r, double theta, double phi) const override
Definition: BasicVector.cc:78
Class to have a type for indicating cartesian coordinate components.
Definition: BasicVector.h:116

, generated on Tue Sep 26 2023.