- Timestamp:
- 06/22/07 18:03:08 (17 years ago)
- Location:
- trunk/MagicSoft/Mars/mpointing
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mpointing/MPointing.cc
r4966 r8593 90 90 #define DEBUG(txt) 91 91 92 const Int_t MPointing::f NumPar=19;92 const Int_t MPointing::fgNumPar=19; 93 93 94 94 void MPointing::Init(const char *name, const char *title) … … 97 97 fTitle = title ? title : "Pointing correction model for the MAGIC telescope"; 98 98 99 fCoeff = new Double_t*[f NumPar];100 fNames = new TString[f NumPar];101 fDescr = new TString[f NumPar];99 fCoeff = new Double_t*[fgNumPar]; 100 fNames = new TString[fgNumPar]; 101 fDescr = new TString[fgNumPar]; 102 102 103 103 fCoeff[ 0] = &fIa; fNames[ 0] = "IA"; … … 146 146 } 147 147 148 voidMPointing::Load(const char *name)148 Bool_t MPointing::Load(const char *name) 149 149 { 150 150 /* … … 164 164 { 165 165 *fLog << err << "ERROR - Cannot open file '" << name << "'" << endl; 166 return ;166 return kFALSE; 167 167 } 168 168 … … 174 174 { 175 175 *fLog << err << "Error: This in not a model correcting the star position (" << c << ")" << endl; 176 return ;176 return kFALSE; 177 177 } 178 178 … … 200 200 TString str; 201 201 fin >> str; 202 if (!fin) 203 { 204 *fLog << err << "ERROR - Reading file " << name << endl; 205 return kFALSE; 206 } 202 207 203 208 if (str=="END") … … 226 231 // Find parameter 227 232 Int_t n = -1; 228 for (int i=0; i<f NumPar; i++)233 for (int i=0; i<fgNumPar; i++) 229 234 if (str==fNames[i]) 230 235 { … … 237 242 *fLog << inf << setw(9) << val << "°" << endl; 238 243 244 if (!fin) 245 { 246 *fLog << err << "ERROR - Reading line " << str << endl; 247 return kFALSE; 248 } 249 250 if (n<0) 251 { 252 *fLog << warn << "WARNING - Parameter " << str << " unknown." << endl; 253 continue; 254 } 255 239 256 // corresponding error 240 257 fError[n] = val*TMath::DegToRad(); 241 258 } 242 259 *fLog << inf << endl; 243 } 244 245 void MPointing::Save(const char *name) 260 261 return kTRUE; 262 } 263 264 Bool_t MPointing::Save(const char *name) 246 265 { 247 266 /* … … 261 280 { 262 281 cout << "Error: Cannot open file '" << name << "'" << endl; 263 return ;282 return kFALSE; 264 283 } 265 284 … … 270 289 fout << "S 00 000000 000000 0000000" << endl; 271 290 fout << setprecision(8); 272 for (int i=0; i<f NumPar; i++)291 for (int i=0; i<fgNumPar; i++) 273 292 { 274 293 fout << " " << setw(6) << GetVarName(i) << " "; … … 277 296 } 278 297 fout << "END" << endl; 298 299 return kTRUE; 279 300 } 280 301 … … 652 673 { 653 674 if (n<0) 654 n = f NumPar;675 n = fgNumPar; 655 676 656 677 Int_t ierflg = 0; -
trunk/MagicSoft/Mars/mpointing/MPointing.h
r7214 r8593 51 51 { 52 52 private: 53 static const Int_t f NumPar;53 static const Int_t fgNumPar; 54 54 55 55 Double_t fIe ; // [rad] Index Error in Elevation … … 83 83 void Clear(Option_t *o="") 84 84 { 85 for (int i=0; i<f NumPar; i++)85 for (int i=0; i<fgNumPar; i++) 86 86 { 87 87 *fCoeff[i] = 0; … … 94 94 95 95 public: 96 MPointing() { fError.Set(f NumPar); Init(); Clear(); }97 MPointing(const char *name) { fError.Set(f NumPar); Init(); Clear(); Load(name); }98 virtual ~MPointing() { delete fNames; delete fCoeff; deletefDescr; }99 100 voidLoad(const char *name);101 voidSave(const char *name);96 MPointing() { fError.Set(fgNumPar); Init(); Clear(); } 97 MPointing(const char *name) { fError.Set(fgNumPar); Init(); Clear(); Load(name); } 98 virtual ~MPointing() { delete [] fNames; delete [] fCoeff; delete [] fDescr; } 99 100 Bool_t Load(const char *name); 101 Bool_t Save(const char *name); 102 102 103 103 void Reset(); … … 117 117 ZdAz operator()(const ZdAz &zdaz, void (*fcn)(ZdAz &zdaz, Double_t *par)) const 118 118 { 119 Double_t par[f NumPar];119 Double_t par[fgNumPar]; 120 120 GetParameters(par); 121 121 ZdAz za = zdaz; … … 126 126 AltAz operator()(const AltAz &aaz, void (*fcn)(AltAz &aaz, Double_t *par)) const 127 127 { 128 Double_t par[f NumPar];128 Double_t par[fgNumPar]; 129 129 GetParameters(par); 130 130 AltAz aa = aaz; … … 135 135 TVector3 operator()(const TVector3 &aaz, void (*fcn)(TVector3 &aaz, Double_t *par)) const 136 136 { 137 Double_t par[f NumPar];137 Double_t par[fgNumPar]; 138 138 GetParameters(par); 139 139 TVector3 v = aaz; … … 174 174 } 175 175 176 void SetParameters(const Double_t *par, Int_t n=f NumPar);177 void GetParameters(Double_t *par, Int_t n=f NumPar) const;176 void SetParameters(const Double_t *par, Int_t n=fgNumPar); 177 void GetParameters(Double_t *par, Int_t n=fgNumPar) const; 178 178 179 179 void SetParameters(const TArrayD &par) … … 183 183 void GetParameters(TArrayD &par) const 184 184 { 185 par.Set(f NumPar);185 par.Set(fgNumPar); 186 186 GetParameters(par.GetArray()); 187 187 } … … 189 189 { 190 190 par = fError; 191 for (int i=0; i<f NumPar; i++)191 for (int i=0; i<fgNumPar; i++) 192 192 par[i] *= TMath::RadToDeg(); 193 193 } … … 217 217 */ 218 218 219 static const Int_t GetNumPar() { return f NumPar; }219 static const Int_t GetNumPar() { return fgNumPar; } 220 220 221 221 ClassDef(MPointing, 1) // Pointing Model for MAGIC
Note:
See TracChangeset
for help on using the changeset viewer.