CoordinateSystem_ROOT.cc
Go to the documentation of this file.
1 #include <io/CoordinateSystem_ROOT.h>
2 
3 #include <det/Detector.h>
4 
5 #include <utl/Point.h>
6 #include <utl/Vector.h>
7 #include <utl/CoordinateSystemPtr.h>
8 #include <utl/CoordinateSystem.h>
9 #include <utl/TransformationMatrix.h>
10 
11 #include <fwk/LocalCoordinateSystem.h>
12 
13 #include <iostream>
14 using namespace std;
15 
16 using namespace io;
17 using namespace utl;
18 
19 
20 CoordinateSystem_ROOT::CoordinateSystem_ROOT(const utl::CoordinateSystemPtr& cs)
21 {
22  const utl::Point p(0, 0, 0, cs);
24  const utl::CoordinateSystemPtr siteCS = det::Detector::GetInstance().GetSiteCoordinateSystem();
25  const utl::Point::Triple t = p.GetCoordinates(siteCS);
26  fOrigin.SetXYZ(t.get<0>(), t.get<1>(), t.get<2>());
27  const utl::TransformationMatrix M = cs->GetTransformationTo(augerCS);
28  fxx = M.fTransform.xx();
29  fxy = M.fTransform.xy();
30  fxz = M.fTransform.xz();
31  fyx = M.fTransform.yx();
32  fyy = M.fTransform.yy();
33  fyz = M.fTransform.yz();
34  fzx = M.fTransform.zx();
35  fzy = M.fTransform.zy();
36  fzz = M.fTransform.zz();
37  fdx = M.fTransform.dx();
38  fdy = M.fTransform.dy();
39  fdz = M.fTransform.dz();
40 }
41 
42 
43 void
45  const
46 {
47  utl::Point p(fOrigin.x(), fOrigin.y(), fOrigin.z(),
48  det::Detector::GetInstance().GetSiteCoordinateSystem());
49 
51 
52  class TC : public HepGeom::Transform3D {
53  public:
54  TC(const double xx, const double xy, const double xz, const double dx,
55  const double yx, const double yy, const double yz, const double dy,
56  const double zx, const double zy, const double zz, const double dz)
57  : HepGeom::Transform3D(xx, xy, xz, dx,
58  yx, yy, yz, dy,
59  zx, zy, zz, dz) { }
60  };
61 
62  const TransformationMatrix TM(TC(fxx, fxy, fxz, fdx,
63  fyx, fyy, fyz, fdy,
64  fzx, fzy, fzz, fdz));
65 
67 }
void operator>>(const Event &theEvent, IoSdEvent &rawSEvent)
Point object.
Definition: Point.h:32
boost::tuple< double, double, double > Triple
Coordinate triple for easy getting or setting of coordinates.
Definition: BasicVector.h:147
Transformations matrices for afine transformations.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
static Policy::type FromTransformation(const TransformationMatrix &theTrafo, const CoordinateSystemPtr &theCS)
Construct from transformation matrix.
static Policy::type Create(const utl::Point &theOrigin)
Create the standard local coordinate system for a Point.
InternalTransform fTransform
The concrete transformation object.

, generated on Tue Sep 26 2023.