1 | // $Id: EsafRefFrame.cc 2149 2005-10-04 02:50:53Z thea $ |
---|
2 | // Author: Alessandro Thea 2005/03/21 |
---|
3 | |
---|
4 | /***************************************************************************** |
---|
5 | * ESAF: Euso Simulation and Analysis Framework * |
---|
6 | * * |
---|
7 | * Id: EsafRefFrame * |
---|
8 | * Package: <packagename> * |
---|
9 | * Coordinator: <coordinator> * |
---|
10 | * * |
---|
11 | *****************************************************************************/ |
---|
12 | |
---|
13 | //_____________________________________________________________________________ |
---|
14 | // |
---|
15 | // EsafRefFrame |
---|
16 | // |
---|
17 | // <extensive class description> |
---|
18 | // |
---|
19 | |
---|
20 | #include "EsafRefFrame.hh" |
---|
21 | |
---|
22 | ClassImp(EsafRefFrame) |
---|
23 | |
---|
24 | //_____________________________________________________________________________ |
---|
25 | EsafRefFrame::EsafRefFrame() {// const TVector3& p, const TVector3& x, const TVector3& y, const TVector3& z ) { |
---|
26 | // |
---|
27 | // Constructor |
---|
28 | // |
---|
29 | |
---|
30 | SetAxes(TVector3(1.,0.,0.),TVector3(0.,1.,0.),TVector3(0.,0.,1.)); |
---|
31 | } |
---|
32 | |
---|
33 | //_____________________________________________________________________________ |
---|
34 | EsafRefFrame::~EsafRefFrame() { |
---|
35 | // |
---|
36 | // Destructor |
---|
37 | // |
---|
38 | } |
---|
39 | |
---|
40 | //______________________________________________________________________________ |
---|
41 | void EsafRefFrame::Copy( EsafRefFrame& other ) const { |
---|
42 | // |
---|
43 | // copies this to other |
---|
44 | // |
---|
45 | |
---|
46 | other.fPos = fPos; |
---|
47 | other.fXaxis = fXaxis; |
---|
48 | other.fYaxis = fYaxis; |
---|
49 | other.fZaxis = fZaxis; |
---|
50 | other.fRot2Global = fRot2Global; |
---|
51 | other.fRot2Local = fRot2Local; |
---|
52 | } |
---|
53 | |
---|
54 | //______________________________________________________________________________ |
---|
55 | void EsafRefFrame::SetXEulerRotation( Double_t phi, Double_t theta, Double_t psi) { |
---|
56 | // |
---|
57 | // Set the reference frame axis orientation from through the euler axis |
---|
58 | // |
---|
59 | |
---|
60 | fXaxis.SetXYZ(1.,0.,0.); |
---|
61 | fYaxis.SetXYZ(0.,1.,0.); |
---|
62 | fZaxis.SetXYZ(0.,0.,1.); |
---|
63 | |
---|
64 | // fRot2Local.SetXEulerAngles(phi,theta,psi); |
---|
65 | // fRot2Global = fRot2Local.Inverse(); |
---|
66 | fRot2Global.SetXEulerAngles(phi,theta,psi); |
---|
67 | fRot2Local = fRot2Global.Inverse(); |
---|
68 | |
---|
69 | fXaxis *= fRot2Global; |
---|
70 | fYaxis *= fRot2Global; |
---|
71 | fZaxis *= fRot2Global; |
---|
72 | |
---|
73 | } |
---|
74 | |
---|
75 | //______________________________________________________________________________ |
---|
76 | void EsafRefFrame::SetYEulerRotation( Double_t phi, Double_t theta, Double_t psi) { |
---|
77 | // |
---|
78 | // Set the reference frame axis orientation from through the euler axis |
---|
79 | // |
---|
80 | |
---|
81 | fXaxis.SetXYZ(1.,0.,0.); |
---|
82 | fYaxis.SetXYZ(0.,1.,0.); |
---|
83 | fZaxis.SetXYZ(0.,0.,1.); |
---|
84 | |
---|
85 | // fRot2Local.SetYEulerAngles(phi,theta,psi); |
---|
86 | // fRot2Global = fRot2Local.Inverse(); |
---|
87 | fRot2Global.SetYEulerAngles(phi,theta,psi); |
---|
88 | fRot2Local = fRot2Global.Inverse(); |
---|
89 | |
---|
90 | fXaxis *= fRot2Global; |
---|
91 | fYaxis *= fRot2Global; |
---|
92 | fZaxis *= fRot2Global; |
---|
93 | |
---|
94 | } |
---|