source: trunk/MagicSoft/Mars/mastro/MObservatory.h@ 4983

Last change on this file since 4983 was 3957, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 2.4 KB
Line 
1#ifndef MARS_MObservatory
2#define MARS_MObservatory
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7
8class MTime;
9
10class MObservatory : public MParContainer
11{
12public:
13 enum LocationName_t
14 {
15 kMagic1,
16 kWuerzburgCity
17 };
18
19private:
20 LocationName_t fObservatoryKey; //!
21
22 TString fObservatoryName; //! Name of the observatory
23
24 Double_t fLongitude; //! [rad] Longitude of observatory (+ east)
25 Double_t fLatitude; //! [rad] Latitude of observatory (+ north)
26
27 Double_t fSinLatitude; //! Sin component for faster access
28 Double_t fCosLatitude; //! Cos component for faster access
29
30 Double_t fHeight; //! [m] height of observatory
31
32 void Init(const char *name, const char *title);
33
34public:
35 MObservatory(const char *name=NULL, const char *title=NULL);
36 MObservatory(LocationName_t key, const char *name=NULL, const char *title=NULL);
37
38 void Copy(TObject &obj) const
39 {
40 MObservatory &obs = (MObservatory&)obj;
41 obs.fObservatoryName = fObservatoryName;
42 obs.fLongitude = fLongitude;
43 obs.fLatitude = fLatitude;
44 obs.fSinLatitude = fSinLatitude;
45 obs.fCosLatitude = fCosLatitude;
46 obs.fHeight = fHeight;
47 }
48
49 void SetLocation(LocationName_t name);
50
51 void Print(Option_t *o=0) const;
52
53 const TString &GetObservatoryName() const { return fObservatoryName; }
54
55 Double_t GetLatitudeDeg() const { return fLatitude*kRad2Deg; } //[deg]
56 Double_t GetLongitudeDeg() const { return fLongitude*kRad2Deg; } //[deg]
57
58 Double_t GetLatitudeRad() const { return fLatitude; } //[rad]
59 Double_t GetLongitudeRad() const { return fLongitude; } //[rad]
60
61 Double_t GetPhi() const { return fLatitude; } //[rad]
62 Double_t GetElong() const { return fLongitude; } //[rad]
63
64 Double_t GetSinPhi() const { return fSinLatitude; }
65 Double_t GetCosPhi() const { return fCosLatitude; }
66
67 Double_t GetHeight() const { return fHeight; }
68
69 void RotationAngle(Double_t theta, Double_t phi, Double_t &sin, Double_t &cos) const;
70 Double_t RotationAngle(Double_t theta, Double_t phi) const;
71
72 LocationName_t GetObservatoryKey() const { return fObservatoryKey; }
73
74 ClassDef(MObservatory, 0) // class storing observatory locations
75};
76
77#endif
Note: See TracBrowser for help on using the repository browser.