1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // $Id: EPmtGeo.hh 2044 2005-07-17 01:37:58Z thea $ |
---|
3 | // created May, 24 2004 |
---|
4 | |
---|
5 | #ifndef __EPMTGEO_HH_ |
---|
6 | #define __EPMTGEO_HH_ |
---|
7 | |
---|
8 | #include "TObject.h" |
---|
9 | #include "TVector3.h" |
---|
10 | |
---|
11 | #include "ERunParsFiller.hh" |
---|
12 | |
---|
13 | // EPmtGeo |
---|
14 | // Geographical information of each pmt |
---|
15 | class EPmtGeo: public TObject { |
---|
16 | public: |
---|
17 | EPmtGeo(); |
---|
18 | EPmtGeo( const EPmtGeo& ); |
---|
19 | |
---|
20 | virtual ~EPmtGeo(); |
---|
21 | |
---|
22 | virtual void Copy( TObject& ) const; |
---|
23 | virtual void Clear( Option_t* = ""); |
---|
24 | |
---|
25 | // getters |
---|
26 | inline Int_t GetStartUniqueId() const { return fStartUId; } |
---|
27 | inline Int_t GetLastUniqueId() const { return fLastUId; } |
---|
28 | inline Int_t GetFee() const { return fFee; } |
---|
29 | inline Int_t GetEC() const { return fEC; } |
---|
30 | inline Int_t GetMC() const { return fMC; } |
---|
31 | Float_t GetCenter(Int_t) const; |
---|
32 | Float_t GetNorm(Int_t) const; |
---|
33 | Float_t GetYAxis(Int_t) const; |
---|
34 | Float_t GetXAxis(Int_t) const; |
---|
35 | inline TVector3 GetCenter() const; |
---|
36 | inline TVector3 GetNorm() const; |
---|
37 | inline TVector3 GetYAxis() const; |
---|
38 | inline TVector3 GetXAxis() const; |
---|
39 | |
---|
40 | // setters |
---|
41 | inline void SetStartUniqueId( Int_t uid ) { fStartUId = uid; } |
---|
42 | inline void SetLastUniqueId( Int_t uid ) { fLastUId = uid; } |
---|
43 | inline void SetFee( Int_t fe ) { fFee = fe; } |
---|
44 | inline void SetEC( Int_t ec ) { fEC = ec; } |
---|
45 | inline void SetMC( Int_t mc ) { fMC = mc; } |
---|
46 | inline void SetCenter( const Float_t* ); |
---|
47 | inline void SetNorm( const Float_t* ); |
---|
48 | inline void SetYAxis( const Float_t* ); |
---|
49 | inline void SetCenter( const TVector3& ); |
---|
50 | inline void SetNorm( const TVector3& ); |
---|
51 | inline void SetYAxis( const TVector3& ); |
---|
52 | |
---|
53 | private: |
---|
54 | Int_t fStartUId; // UId of the first pixel |
---|
55 | Int_t fLastUId; // UId of the last pixel |
---|
56 | Int_t fFee; // Fee the pmt belongs to |
---|
57 | Int_t fEC; // EC the pmt belongs to |
---|
58 | Int_t fMC; // MC the pmt belongs to |
---|
59 | |
---|
60 | Float_t fCenterX; // x component of the center of the pmt |
---|
61 | Float_t fCenterY; // y component of the center of the pmt |
---|
62 | Float_t fCenterZ; // z component of the center of the pmt |
---|
63 | |
---|
64 | Float_t fNormX; // x component of the normal vector |
---|
65 | Float_t fNormY; // y component of the normal vector |
---|
66 | Float_t fNormZ; // z component of the normal vector |
---|
67 | |
---|
68 | Float_t fYAxisX; // x component of the pmt y axis |
---|
69 | Float_t fYAxisY; // y component of the pmt y axis |
---|
70 | Float_t fYAxisZ; // z component of the pmt y axis |
---|
71 | |
---|
72 | ClassDef(EPmtGeo,1); |
---|
73 | |
---|
74 | ERunParsVisitable() |
---|
75 | }; |
---|
76 | |
---|
77 | inline TVector3 EPmtGeo::GetCenter() const { |
---|
78 | return TVector3(fCenterX, fCenterY, fCenterZ); |
---|
79 | } |
---|
80 | |
---|
81 | inline TVector3 EPmtGeo::GetNorm() const { |
---|
82 | return TVector3(fNormX, fNormY, fNormZ); |
---|
83 | } |
---|
84 | |
---|
85 | inline TVector3 EPmtGeo::GetYAxis() const { |
---|
86 | return TVector3(fYAxisX, fYAxisY, fYAxisZ); |
---|
87 | } |
---|
88 | |
---|
89 | |
---|
90 | inline TVector3 EPmtGeo::GetXAxis() const { |
---|
91 | TVector3 a; |
---|
92 | a.SetX(fYAxisY*fNormZ-fYAxisZ*fNormY); |
---|
93 | a.SetY(fYAxisZ*fNormX-fYAxisX*fNormZ); |
---|
94 | a.SetZ(fYAxisX*fNormY-fYAxisY*fNormX); |
---|
95 | return a; |
---|
96 | |
---|
97 | } |
---|
98 | |
---|
99 | inline void EPmtGeo::SetCenter( const TVector3& v ) { |
---|
100 | fCenterX = v[0]; |
---|
101 | fCenterY = v[1]; |
---|
102 | fCenterZ = v[2]; |
---|
103 | } |
---|
104 | |
---|
105 | inline void EPmtGeo::SetNorm( const TVector3& v ) { |
---|
106 | fNormX = v[0]; |
---|
107 | fNormY = v[1]; |
---|
108 | fNormZ = v[2]; |
---|
109 | } |
---|
110 | |
---|
111 | inline void EPmtGeo::SetYAxis( const TVector3& v ) { |
---|
112 | fYAxisX = v[0]; |
---|
113 | fYAxisY = v[1]; |
---|
114 | fYAxisZ = v[2]; |
---|
115 | } |
---|
116 | |
---|
117 | inline void EPmtGeo::SetCenter( const Float_t* v ) { |
---|
118 | fCenterX = v[0]; |
---|
119 | fCenterY = v[1]; |
---|
120 | fCenterZ = v[2]; |
---|
121 | } |
---|
122 | |
---|
123 | inline void EPmtGeo::SetNorm( const Float_t* v ) { |
---|
124 | fNormX = v[0]; |
---|
125 | fNormY = v[1]; |
---|
126 | fNormZ = v[2]; |
---|
127 | } |
---|
128 | |
---|
129 | inline void EPmtGeo::SetYAxis( const Float_t* v ) { |
---|
130 | fYAxisX = v[0]; |
---|
131 | fYAxisY = v[1]; |
---|
132 | fYAxisZ = v[2]; |
---|
133 | } |
---|
134 | |
---|
135 | #endif /* __EPMTGEO_HH_ */ |
---|
136 | |
---|