Changeset 8725 for trunk/MagicSoft/Mars/mpointing/MPointing.h
- Timestamp:
- 09/02/07 14:53:56 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mpointing/MPointing.h
r8593 r8725 4 4 #ifndef ROOT_TArrayD 5 5 #include <TArrayD.h> 6 #endif 7 8 #ifndef ROOT_TVector2 9 #include <TVector2.h> 6 10 #endif 7 11 … … 19 23 //#include "coord.h" 20 24 //#else 21 #include <TVector2.h>22 25 class AltAz : public TVector2 23 26 { … … 51 54 { 52 55 private: 53 static const Int_t fgNumPar; 56 enum { 57 kIA, // [rad] Index Error in Elevation 58 kIE, // [rad] Index Error in Azimuth 59 kFLOP, // [rad] Vertical Sag 60 kAN, // [rad] Az-El Nonperpendicularity 61 kAW, // [rad] Left-Right Collimation Error 62 kNPAE, // [rad] Azimuth Axis Misalignment (N-S) 63 kCA, // [rad] Azimuth Axis Misalignment (E-W) 64 kTF, // [rad] Tube fluxture (sin) 65 kTX, // [rad] Tube fluxture (tan) 66 kECES, // [rad] Nasmyth rotator displacement, horizontal 67 kACES, // [rad] Nasmyth rotator displacement, vertical 68 kECEC, // [rad] Alt/Az Coude Displacement (N-S) 69 kACEC, // [rad] Alt/Az Coude Displacement (E-W) 70 kNRX, // [rad] Elevation Centering Error (sin) 71 kNRY, // [rad] Azimuth Centering Error (sin) 72 kCRX, // [rad] Elevation Centering Error (cos) 73 kCRY, // [rad] Azimuth Centering Error (cos) 74 kMAGIC1, // [rad] Magic Term (what is it?) 75 kMAGIC2, // [rad] Magic Term (what is it?) 76 kPX, // [rad] Starguider calibration fixed offset x 77 kPY, // [rad] Starguider calibration fixed offset y 78 kDX, // [rad] Starguider calibration additional offset dx 79 kDY, // [rad] Starguider calibration additional offset dy 80 kNumPar // Number of elements 81 }; 82 54 83 55 84 Double_t fIe ; // [rad] Index Error in Elevation … … 73 102 Double_t fMagic2; // [rad] Magic Term (what is it?) 74 103 104 Double_t fPx; // [rad] Starguider calibration fixed offset x 105 Double_t fPy; // [rad] Starguider calibration fixed offset y 106 Double_t fDx; // [rad] Starguider calibration additional offset dx 107 Double_t fDy; // [rad] Starguider calibration additional offset dy 108 75 109 Double_t **fCoeff; //! 76 110 TString *fNames; //! … … 83 117 void Clear(Option_t *o="") 84 118 { 85 for (int i=0; i< fgNumPar; i++)119 for (int i=0; i<kNumPar; i++) 86 120 { 87 121 *fCoeff[i] = 0; 88 fError[i] = 0;122 fError[i] = -1; 89 123 } 90 124 } … … 94 128 95 129 public: 96 MPointing() { fError.Set(fgNumPar);Init(); Clear(); }97 MPointing(const char *name) { fError.Set(fgNumPar);Init(); Clear(); Load(name); }130 MPointing() : fError(kNumPar) { Init(); Clear(); } 131 MPointing(const char *name) : fError(kNumPar) { Init(); Clear(); Load(name); } 98 132 virtual ~MPointing() { delete [] fNames; delete [] fCoeff; delete [] fDescr; } 99 133 … … 117 151 ZdAz operator()(const ZdAz &zdaz, void (*fcn)(ZdAz &zdaz, Double_t *par)) const 118 152 { 119 Double_t par[ fgNumPar];153 Double_t par[kNumPar]; 120 154 GetParameters(par); 121 155 ZdAz za = zdaz; … … 126 160 AltAz operator()(const AltAz &aaz, void (*fcn)(AltAz &aaz, Double_t *par)) const 127 161 { 128 Double_t par[ fgNumPar];162 Double_t par[kNumPar]; 129 163 GetParameters(par); 130 164 AltAz aa = aaz; … … 135 169 TVector3 operator()(const TVector3 &aaz, void (*fcn)(TVector3 &aaz, Double_t *par)) const 136 170 { 137 Double_t par[ fgNumPar];171 Double_t par[kNumPar]; 138 172 GetParameters(par); 139 173 TVector3 v = aaz; … … 174 208 } 175 209 176 void SetParameters(const Double_t *par, Int_t n= fgNumPar);177 void GetParameters(Double_t *par, Int_t n= fgNumPar) const;210 void SetParameters(const Double_t *par, Int_t n=kNumPar); 211 void GetParameters(Double_t *par, Int_t n=kNumPar) const; 178 212 179 213 void SetParameters(const TArrayD &par) … … 183 217 void GetParameters(TArrayD &par) const 184 218 { 185 par.Set( fgNumPar);219 par.Set(kNumPar); 186 220 GetParameters(par.GetArray()); 187 221 } … … 189 223 { 190 224 par = fError; 191 for (int i=0; i< fgNumPar; i++)225 for (int i=0; i<kNumPar; i++) 192 226 par[i] *= TMath::RadToDeg(); 193 227 } … … 217 251 */ 218 252 219 static const Int_t GetNumPar() { return fgNumPar; } 220 221 ClassDef(MPointing, 1) // Pointing Model for MAGIC 253 TVector2 GetDxy() const { return TVector2(fDx, fDy)*TMath::RadToDeg(); } 254 255 Double_t GetPx() const { return fPx*TMath::RadToDeg(); } 256 Double_t GetPy() const { return fPy*TMath::RadToDeg(); } 257 258 Bool_t IsPxValid() const { return fError[kPX]>0; } 259 Bool_t IsPyValid() const { return fError[kPY]>0; } 260 261 static const Int_t GetNumPar() { return kNumPar; } 262 263 ClassDef(MPointing, 2) // Pointing Model for MAGIC 222 264 }; 223 265
Note:
See TracChangeset
for help on using the changeset viewer.