1 | // $Id: EGeometry.hh 3001 2011-11-22 21:46:43Z mabl $ |
---|
2 | // Author: Alessandro Thea 2005/11/14 |
---|
3 | |
---|
4 | /***************************************************************************** |
---|
5 | * ESAF: Euso Simulation and Analysis Framework * |
---|
6 | * * |
---|
7 | * Id: EGeometry * |
---|
8 | * Package: <packagename> * |
---|
9 | * Coordinator: <coordinator> * |
---|
10 | * * |
---|
11 | *****************************************************************************/ |
---|
12 | |
---|
13 | #ifndef __EGEOMETRY_HH__ |
---|
14 | #define __EGEOMETRY_HH__ |
---|
15 | |
---|
16 | #include "EFillable.hh" |
---|
17 | #include <TRotation.h> |
---|
18 | #include <TVector3.h> |
---|
19 | #include <iostream> |
---|
20 | using namespace std; |
---|
21 | |
---|
22 | //////////////////////////////////////////////////////////////////////////////// |
---|
23 | // // |
---|
24 | // EGeometry // |
---|
25 | // // |
---|
26 | // <brief class description> // |
---|
27 | // // |
---|
28 | //////////////////////////////////////////////////////////////////////////////// |
---|
29 | |
---|
30 | class EGeometry : public EFillable { |
---|
31 | public: |
---|
32 | EGeometry(); |
---|
33 | virtual ~EGeometry(); |
---|
34 | |
---|
35 | virtual void Clear( Option_t* = "" ); |
---|
36 | |
---|
37 | Float_t GetFoV() const { return fFoV; } |
---|
38 | |
---|
39 | inline Float_t GetPos( Int_t ) const; |
---|
40 | inline TVector3 GetPos() const; |
---|
41 | |
---|
42 | Float_t GetRadius() const { return fRadius; } |
---|
43 | Float_t GetOpticsRadius() const { return fOpticsRadius; } |
---|
44 | |
---|
45 | const TRotation& GetRotation() const { return fRotation; } |
---|
46 | |
---|
47 | void SetXEulerAngles(Float_t phi, Float_t theta, Float_t psi) |
---|
48 | { fRotation.SetXEulerAngles(phi, theta, psi); } |
---|
49 | |
---|
50 | void SetFoV( Float_t fov ) { fFoV = fov; } |
---|
51 | void SetRadius( Float_t radius ) { fRadius = radius; } |
---|
52 | void SetOpticsRadius(Float_t radius ) { fOpticsRadius = radius;} |
---|
53 | void SetRotation( const TRotation& rot ) { fRotation = rot; } |
---|
54 | inline void SetPos( Int_t , Float_t ); |
---|
55 | inline void SetPos( const TVector3& ); |
---|
56 | |
---|
57 | private: |
---|
58 | |
---|
59 | Float_t fFoV; // field of view of the telescope |
---|
60 | Float_t fRadius; // radius of the telescope |
---|
61 | Float_t fOpticsRadius; // radius of the entrance pupil (not necessary equal to radius of the telescope) |
---|
62 | Float_t fPosX; // position in MES, X |
---|
63 | Float_t fPosY; // position in MES, Y |
---|
64 | Float_t fPosZ; // position in MES, Z |
---|
65 | |
---|
66 | TRotation fRotation; // rotation local->global |
---|
67 | |
---|
68 | ClassDef(EGeometry,1) |
---|
69 | }; |
---|
70 | |
---|
71 | inline TVector3 EGeometry::GetPos() const { |
---|
72 | // return Pos |
---|
73 | return TVector3( fPosX, fPosY, fPosZ ); |
---|
74 | } |
---|
75 | |
---|
76 | inline void EGeometry::SetPos( const TVector3& v ){ |
---|
77 | fPosX = v.X(); |
---|
78 | fPosY = v.Y(); |
---|
79 | fPosZ = v.Z(); |
---|
80 | } |
---|
81 | |
---|
82 | inline Float_t EGeometry::GetPos( Int_t i) const { |
---|
83 | // return Pos component by index |
---|
84 | |
---|
85 | switch(i) { |
---|
86 | case 0: |
---|
87 | return fPosX; |
---|
88 | break; |
---|
89 | case 1: |
---|
90 | return fPosY; |
---|
91 | break; |
---|
92 | case 2: |
---|
93 | return fPosZ; |
---|
94 | break; |
---|
95 | default: |
---|
96 | Error("GetPos(i)", "bad index (%d) returning 0",i); |
---|
97 | } |
---|
98 | return 0.; |
---|
99 | } |
---|
100 | |
---|
101 | inline void EGeometry::SetPos( Int_t i, Float_t x ) { |
---|
102 | // Pos component by index |
---|
103 | |
---|
104 | switch(i) { |
---|
105 | case 0: |
---|
106 | fPosX = x; |
---|
107 | break; |
---|
108 | case 1: |
---|
109 | fPosY = x; |
---|
110 | break; |
---|
111 | case 2: |
---|
112 | fPosZ = x; |
---|
113 | break; |
---|
114 | |
---|
115 | default: |
---|
116 | Error("SetPos(i)", "bad index (%d)",i); |
---|
117 | } |
---|
118 | } |
---|
119 | |
---|
120 | #endif /* __EGEOMETRY_HH__ */ |
---|
121 | |
---|
122 | |
---|