Changeset 2407 for trunk/MagicSoft/Cosy/main
- Timestamp:
- 10/20/03 15:54:10 (21 years ago)
- Location:
- trunk/MagicSoft/Cosy/main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/main/MBending.cc
r1810 r2407 1 /* ======================================================================== *\ 2 ! 3 ! * 4 ! * This file is part of MARS, the MAGIC Analysis and Reconstruction 5 ! * Software. It is distributed to you in the hope that it can be a useful 6 ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes. 7 ! * It is distributed WITHOUT ANY WARRANTY. 8 ! * 9 ! * Permission to use, copy, modify and distribute this software and its 10 ! * documentation for any purpose is hereby granted without fee, 11 ! * provided that the above copyright notice appear in all copies and 12 ! * that both that copyright notice and this permission notice appear 13 ! * in supporting documentation. It is provided "as is" without express 14 ! * or implied warranty. 15 ! * 16 ! 17 ! 18 ! Author(s): Thomas Bretz, 2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! 20 ! Copyright: MAGIC Software Development, 2000-2003 21 ! 22 ! 23 \* ======================================================================== */ 24 25 ///////////////////////////////////////////////////////////////////////////// 26 // 27 // MBending 28 // 29 // Double_t fIe ; // [rad] Index Error in Elevation 30 // Double_t fIa ; // [rad] Index Error in Azimuth 31 // 32 // Double_t fFlop ; // [rad] Vertical Sag 33 // * do not use if not data: Zd<0 34 // 35 // Double_t fNpae ; // [rad] Az-El Nonperpendicularity 36 // 37 // Double_t fCa ; // [rad] Left-Right Collimation Error 38 // 39 // Double_t fAn ; // [rad] Azimuth Axis Misalignment (N-S) 40 // Double_t fAw ; // [rad] Azimuth Axis Misalignment (E-W) 41 // 42 // Double_t fTf ; // [rad] Tube fluxture (sin) 43 // * same as ecec if no data: Zd<0 44 // Double_t fTx ; // [rad] Tube fluxture (tan) 45 // * do not use with NPAE if no data: Zd<0 46 // 47 // Double_t fNrx ; // [rad] Nasmyth rotator displacement, horizontan 48 // Double_t fNry ; // [rad] Nasmyth rotator displacement, vertical 49 // 50 // Double_t fCrx ; // [rad] Alt/Az Coude Displacement (N-S) 51 // Double_t fCry ; // [rad] Alt/Az Coude Displacement (E-W) 52 // 53 // Double_t fEces ; // [rad] Elevation Centering Error (sin) 54 // Double_t fAces ; // [rad] Azimuth Centering Error (sin) 55 // Double_t fEcec ; // [rad] Elevation Centering Error (cos) 56 // Double_t fAcec ; // [rad] Azimuth Centering Error (cos) 57 // 58 //////////////////////////////////////////////////////////////////////////// 1 59 #include "MBending.h" 2 60 … … 10 68 ClassImp(MBending); 11 69 70 const Int_t MBending::fNumPar=19; 71 72 void MBending::Init() 73 { 74 fCoeff = new Double_t*[fNumPar]; 75 fName = new TString[fNumPar]; 76 fDescr = new TString[fNumPar]; 77 78 fCoeff[ 0] = &fIa; fName[ 0] = "IA"; 79 fCoeff[ 1] = &fIe; fName[ 1] = "IE"; 80 fCoeff[ 2] = &fFlop; fName[ 2] = "FLOP"; 81 fCoeff[ 3] = &fNpae; fName[ 3] = "NPAE"; 82 fCoeff[ 4] = &fCa; fName[ 4] = "CA"; 83 fCoeff[ 5] = &fAn; fName[ 5] = "AN"; 84 fCoeff[ 6] = &fAw; fName[ 6] = "AW"; 85 fCoeff[ 7] = &fTf; fName[ 7] = "TF"; 86 fCoeff[ 8] = &fTx; fName[ 8] = "TX"; 87 fCoeff[ 9] = &fEces; fName[ 9] = "ECES"; 88 fCoeff[10] = &fAces; fName[10] = "ACES"; 89 fCoeff[11] = &fEcec; fName[11] = "ECEC"; 90 fCoeff[12] = &fAcec; fName[12] = "ACEC"; 91 fCoeff[13] = &fNrx; fName[13] = "NRX"; 92 fCoeff[14] = &fNry; fName[14] = "NRY"; 93 fCoeff[15] = &fCrx; fName[15] = "CRX"; 94 fCoeff[16] = &fCry; fName[16] = "CRY"; 95 fCoeff[17] = &fMagic1; fName[17] = "MAGIC1"; 96 fCoeff[18] = &fMagic2; fName[18] = "MAGIC2"; 97 98 fDescr[ 0] = "Index Error Azimuth"; 99 fDescr[ 1] = "Index Error Zenith Distance"; 100 fDescr[ 2] = "Vertical Sag"; 101 fDescr[ 3] = "Az-El Nonperpendicularity"; 102 fDescr[ 4] = "Left-Right Collimation Error"; 103 fDescr[ 5] = "Azimuth Axis Misalignment (N-S)"; 104 fDescr[ 6] = "Azimuth Axis Misalignment (E-W)"; 105 fDescr[ 7] = "Tube fluxture (sin)"; 106 fDescr[ 8] = "Tube fluxture (tan)"; 107 fDescr[ 9] = "Elevation Centering Error (sin)"; 108 fDescr[10] = "Azimuth Centering Error (sin)"; 109 fDescr[11] = "Elevation Centering Error (cos)"; 110 fDescr[12] = "Azimuth Centering Error (cos)"; 111 fDescr[13] = "Nasmyth rotator displacement (horizontal)"; 112 fDescr[14] = "Nasmyth rotator displacement (vertical)"; 113 fDescr[15] = "Alt/Az Coude Displacement (N-S)"; 114 fDescr[16] = "Alt/Az Coude Displacement (E-W)"; 115 fDescr[17] = "n/a"; 116 fDescr[18] = "n/a"; 117 } 12 118 void MBending::Reset() 13 119 { … … 62 168 cout << endl; 63 169 64 cout << " & = Name ValueSigma" << endl;65 cout << "------------------------------------------ " << endl;170 cout << " & = Name Value Sigma" << endl; 171 cout << "--------------------------------------------------" << endl; 66 172 67 173 while (fin) … … 90 196 91 197 fin >> val; 92 cout << str << "\t" << val << "°\t";198 cout << str << "\t" << setw(11) << val << "° \t"; 93 199 val *= kDeg2Rad; 94 200 95 if (str=="IA") fIa = val; 96 if (str=="IE") fIe = val; 97 if (str=="CA") fCa = val; 98 if (str=="AN") fAn = val; 99 if (str=="AW") fAw = val; 100 if (str=="NRX") fNrx = val; 101 if (str=="NRY") fNry = val; 102 if (str=="CRX") fCrx = val; 103 if (str=="CRY") fCry = val; 104 if (str=="NPAE") fNpae = val; 105 if (str=="ECES") fEces = val; 106 if (str=="ACES") fAces = val; 107 if (str=="ECEC") fEcec = val; 108 if (str=="ACEC") fAcec = val; 109 //if (str=="MAGIC1") fMagic1 = val; 110 //if (str=="MAGIC2") fMagic2 = val; 201 Double_t *dest=NULL; 202 203 if (str=="IA") dest = &fIa; 204 if (str=="IE") dest = &fIe; 205 if (str=="FLOP") dest = &fFlop; 206 if (str=="NPAE") dest = &fNpae; 207 if (str=="CA") dest = &fCa; 208 if (str=="AN") dest = &fAn; 209 if (str=="AW") dest = &fAw; 210 if (str=="TF") dest = &fTf; 211 if (str=="TX") dest = &fTx; 212 if (str=="NRX") dest = &fNrx; 213 if (str=="NRY") dest = &fNry; 214 if (str=="CRX") dest = &fCrx; 215 if (str=="CRY") dest = &fCry; 216 if (str=="ECES") dest = &fEces; 217 if (str=="ACES") dest = &fAces; 218 if (str=="ECEC") dest = &fEcec; 219 if (str=="ACEC") dest = &fAcec; 220 221 if (dest) 222 *dest = val; 111 223 112 224 fin >> val; 113 cout << val*kDeg2Rad << endl; 225 cout << setw(9) << val << "°" << endl; 226 227 // Find corresponding error 228 for (int i=0; i<MBending::GetNumPar(); i++) 229 if (dest==fCoeff[i]) 230 { 231 fError[i] = val*kDeg2Rad; 232 break; 233 } 114 234 } 115 235 cout << endl; … … 143 263 fout << "S 00 000000 000000 0000000" << endl; 144 264 fout << setprecision(8); 145 fout << " IA " << kRad2Deg*fIa << " -1" << endl; 146 fout << " IE " << kRad2Deg*fIe << " -1" << endl; 147 fout << " CA " << kRad2Deg*fNpae << " -1" << endl; 148 fout << " NPAE " << kRad2Deg*fCa << " -1" << endl; 149 fout << " AN " << kRad2Deg*fAn << " -1" << endl; 150 fout << " AW " << kRad2Deg*fAw << " -1" << endl; 151 fout << " NRX " << kRad2Deg*fNrx << " -1" << endl; 152 fout << " NRY " << kRad2Deg*fNry << " -1" << endl; 153 fout << " CRX " << kRad2Deg*fCrx << " -1" << endl; 154 fout << " CRY " << kRad2Deg*fCry << " -1" << endl; 155 fout << " ECES " << kRad2Deg*fEces << " -1" << endl; 156 fout << " ACES " << kRad2Deg*fAces << " -1" << endl; 157 fout << " ECEC " << kRad2Deg*fEcec << " -1" << endl; 158 fout << " ACEC " << kRad2Deg*fAcec << " -1" << endl; 159 //fout << " MAGIC1 " << -kRad2Deg*fMagic1 << " -1" << endl; 160 //fout << " MAGIC2 " << -kRad2Deg*fMagic2 << " -1" << endl; 265 for (int i=0; i<fNumPar; i++) 266 { 267 fout << " " << setw(6) << GetName(i) << " "; 268 fout << setw(13) << *fCoeff[i]*kRad2Deg << " "; 269 fout << setw(11) << fError[i]*kRad2Deg << endl; 270 } 161 271 fout << "END" << endl; 272 } 273 274 Double_t MBending::Sign(Double_t val, Double_t alt) 275 { 276 // Some pointing corrections are defined as Delta ZA, which 277 // is (P. Wallace) defined [0,90]deg while Alt is defined 278 // [0,180]deg 279 return (TMath::Pi()/2-alt < 0 ? -val : val); 162 280 } 163 281 … … 167 285 // zdaz [rad] 168 286 AltAz p = aa; 287 288 const AltAz CRX(-fCrx*sin(p.Az()-p.Alt()), fCrx*cos(p.Az()-p.Alt())/cos(p.Alt())); 289 const AltAz CRY(-fCry*cos(p.Az()-p.Alt()), -fCry*sin(p.Az()-p.Alt())/cos(p.Alt())); 290 p += CRX; 291 p += CRY; 292 293 const AltAz NRX(fNrx*sin(p.Alt()), -fNrx); 294 const AltAz NRY(fNry*cos(p.Alt()), -fNry*tan(p.Alt())); 295 p += NRX; 296 p += NRY; 169 297 170 298 const AltAz CES(-fEces*sin(p.Alt()), -fAces*sin(p.Az())); … … 173 301 p += CEC; 174 302 175 // const AltAz MAGIC(0, -fMagic1*tan(p.Alt())-fMagic2); 176 // p += MAGIC; 177 178 const AltAz CRX(-fCrx*sin(p.Az()-p.Alt()), fCrx*cos(p.Az()-p.Alt())/cos(p.Alt())); 179 const AltAz CRY(-fCry*cos(p.Az()-p.Alt()), -fCry*sin(p.Az()-p.Alt())/cos(p.Alt())); 180 p += CRX; 181 p += CRY; 182 183 const AltAz NRX(fNrx*sin(p.Alt()), -fNrx); 184 const AltAz NRY(fNry*cos(p.Alt()), -fNry*tan(p.Alt())); 185 p += NRX; 186 p += NRY; 187 188 // const AltAz MAGIC(-fMagic1*sin(p.Az()-fMagic2), 0); 189 // p += MAGIC; 303 const AltAz TX(Sign(fTx/tan(p.Alt()), p.Alt()), 0); 304 const AltAz TF(Sign(fTf*cos(p.Alt()), p.Alt()), 0); 305 p += TX; 306 p += TF; 190 307 191 308 const AltAz AW( fAw*sin(p.Az()), -fAw*cos(p.Az())*tan(p.Alt())); … … 194 311 p += AN; 195 312 196 // const AltAz MAGIC(-fMagic1*sin(p.Az()-fMagic2), 0);197 // p += MAGIC;198 199 313 const AltAz CA(0, -fCa/cos(p.Alt())); 200 314 p += CA; … … 202 316 const AltAz NPAE(0, -fNpae*tan(p.Alt())); 203 317 p += NPAE; 318 319 const AltAz FLOP(Sign(fFlop, p.Alt()), 0); 320 p += FLOP; 204 321 205 322 const AltAz I(fIe, fIa); … … 217 334 const AltAz I(fIe, fIa); 218 335 p -= I; 336 337 const AltAz FLOP(Sign(fFlop, p.Alt()), 0); 338 p -= FLOP; 219 339 220 340 const AltAz NPAE(0, -fNpae*tan(p.Alt())); … … 229 349 p -= AW; 230 350 231 // const AltAz MAGIC(-fMagic1*sin(p.Az()-fMagic2), 0); 232 // p -= MAGIC; 351 const AltAz TF(Sign(fTf*cos(p.Alt()), p.Alt()), 0); 352 const AltAz TX(Sign(fTx/tan(p.Alt()), p.Alt()), 0); 353 p -= TF; 354 p -= TX; 355 356 const AltAz CEC(-fEcec*cos(p.Alt()), -fAcec*cos(p.Az())); 357 const AltAz CES(-fEces*sin(p.Alt()), -fAces*sin(p.Az())); 358 p -= CEC; 359 p -= CES; 233 360 234 361 const AltAz NRY(fNry*cos(p.Alt()), -fNry*tan(p.Alt())); … … 241 368 p -= CRY; 242 369 p -= CRX; 243 244 const AltAz CEC(-fEcec*cos(p.Alt()), -fAcec*cos(p.Az()));245 const AltAz CES(-fEces*sin(p.Alt()), -fAces*sin(p.Az()));246 p -= CEC;247 p -= CES;248 370 249 371 return p; … … 272 394 Clear(); 273 395 274 switch (n) 275 { 276 case 16: 277 fMagic2=par[15]/kRad2Deg; // Magic User Defined 278 case 15: 279 fMagic1=par[14]/kRad2Deg; // Magic User Defined 280 case 14: 281 fAcec =par[13]/kRad2Deg; // Azimuth Centering Error (cos) 282 case 13: 283 fEcec =par[12]/kRad2Deg; // Elevation Centering Error (cos) 284 case 12: 285 fAces =par[11]/kRad2Deg; // Azimuth Centering Error (sin) 286 case 11: 287 fEces =par[10]/kRad2Deg; // Elevation Centering Error (sin) 288 case 10: 289 fCry =par[9] /kRad2Deg; // Alt/Az Coude Displacement (E-W) 290 case 9: 291 fCrx =par[8] /kRad2Deg; // Alt/Az Coude Displacement (N-S) 292 case 8: 293 fNry =par[7] /kRad2Deg; // Nasmyth rotator displacement, vertical 294 case 7: 295 fNrx =par[6] /kRad2Deg; // Nasmyth rotator displacement, horizontan 296 case 6: 297 fAw =par[5] /kRad2Deg; // Azimuth Axis Misalignment (E-W) 298 case 5: 299 fAn =par[4] /kRad2Deg; // Azimuth Axis Misalignment (N-S) 300 case 4: 301 fCa =par[3] /kRad2Deg; // Left-Right Collimation Error 302 case 3: 303 fNpae =par[2] /kRad2Deg; // Az-El Nonperpendicularity 304 case 2: 305 fIe =par[1] /kRad2Deg; // Index Error in Elevation 306 case 1: 307 fIa =par[0] /kRad2Deg; // Index Error in Azimuth 308 } 396 while (n--) 397 *fCoeff[n] = par[n]/kRad2Deg; 309 398 } 310 399 311 400 void MBending::GetParameters(Double_t *par, Int_t n) const 312 401 { 313 switch (n) 314 { 315 case 16: 316 par[15]=kRad2Deg*fMagic2; // 317 case 15: 318 par[14]=kRad2Deg*fMagic1; // 319 case 14: 320 par[13]=kRad2Deg*fAcec; // Azimuth Centering Error (cos) 321 case 13: 322 par[12]=kRad2Deg*fEcec; // Elevation Centering Error (cos) 323 case 12: 324 par[11]=kRad2Deg*fAces; // Azimuth Centering Error (sin) 325 case 11: 326 par[10]=kRad2Deg*fEces; // Elevation Centering Error (sin) 327 case 10: 328 par[9] =kRad2Deg*fCry; // Alt/Az Coude Displacement (E-W) 329 case 9: 330 par[8] =kRad2Deg*fCrx; // Alt/Az Coude Displacement (N-S) 331 case 8: 332 par[7] =kRad2Deg*fNry; // Nasmyth rotator displacement, vertical 333 case 7: 334 par[6] =kRad2Deg*fNrx; // Nasmyth rotator displacement, horizontan 335 case 6: 336 par[5] =kRad2Deg*fAw; // Azimuth Axis Misalignment (E-W) 337 case 5: 338 par[4] =kRad2Deg*fAn; // Azimuth Axis Misalignment (N-S) 339 case 4: 340 par[3] =kRad2Deg*fCa; // Left-Right Collimation Error 341 case 3: 342 par[2] =kRad2Deg*fNpae; // Az-El Nonperpendicularity 343 case 2: 344 par[1] =kRad2Deg*fIe; // Index Error in Elevation 345 case 1: 346 par[0] =kRad2Deg*fIa; // Index Error in Azimuth 347 } 402 while (n--) 403 par[n] = *fCoeff[n]*kRad2Deg; 348 404 } 349 405 … … 351 407 { 352 408 if (n<0) 353 n = 16;409 n = fNumPar; 354 410 355 411 Int_t ierflg = 0; 356 412 357 switch (n) 358 { 359 case 16: 360 m.mnparm(15,"MAGIC2", fMagic2*kRad2Deg, 1, -360, 360, ierflg); 361 case 15: 362 m.mnparm(14,"MAGIC1", fMagic1*kRad2Deg, 1, -360, 360, ierflg); 363 case 14: 364 m.mnparm(13,"ACEC", fAcec*kRad2Deg, 1, -360, 360, ierflg); 365 case 13: 366 m.mnparm(12,"ECEC", fEcec*kRad2Deg, 1, -360, 360, ierflg); 367 case 12: 368 m.mnparm(11,"ACES", fAcec*kRad2Deg, 1, -360, 360, ierflg); 369 case 11: 370 m.mnparm(10,"ECES", fEcec*kRad2Deg, 1, -360, 360, ierflg); 371 case 10: 372 m.mnparm(9, "CRY", fCry*kRad2Deg, 1, -360, 360, ierflg); 373 case 9: 374 m.mnparm(8, "CRX", fCrx*kRad2Deg, 1, -360, 360, ierflg); 375 case 8: 376 m.mnparm(7, "NRY", fNry*kRad2Deg, 1, -360, 360, ierflg); 377 case 7: 378 m.mnparm(6, "NRX", fNrx*kRad2Deg, 1, -360, 360, ierflg); 379 case 6: 380 m.mnparm(5, "AW", fAw*kRad2Deg, 1, -360, 360, ierflg); 381 case 5: 382 m.mnparm(4, "AN", fAn*kRad2Deg, 1, -360, 360, ierflg); 383 case 4: 384 m.mnparm(3, "CA", fCa*kRad2Deg, 1, -360, 360, ierflg); 385 case 3: 386 m.mnparm(2, "NPAE", fNpae*kRad2Deg, 1, -360, 360, ierflg); 387 case 2: 388 m.mnparm(1, "IE", fIe*kRad2Deg, 1, -90, 90, ierflg); 389 case 1: 390 m.mnparm(0, "IA", fIa*kRad2Deg, 1, -360, 360, ierflg); 391 } 413 while (n--) 414 m.mnparm(n, fName[n], *fCoeff[n]*kRad2Deg, 1, -360, 360, ierflg); 392 415 } 393 416 … … 397 420 n = m.GetNumPars(); 398 421 399 Double_t err; 400 401 switch (n) 402 { 403 case 16: 404 m.GetParameter(15, fMagic2, err); 405 fMagic2 /= kRad2Deg; 406 case 15: 407 m.GetParameter(14, fMagic1, err); 408 fMagic1 /= kRad2Deg; 409 case 14: 410 m.GetParameter(13, fAcec, err); 411 fAcec /= kRad2Deg; 412 case 13: 413 m.GetParameter(12, fEcec, err); 414 fEcec /= kRad2Deg; 415 case 12: 416 m.GetParameter(11, fAces, err); 417 fAces /= kRad2Deg; 418 case 11: 419 m.GetParameter(10, fEces, err); 420 fEces /= kRad2Deg; 421 case 10: 422 m.GetParameter(9, fCry, err); 423 fCry /= kRad2Deg; 424 case 9: 425 m.GetParameter(8, fCrx, err); 426 fCrx /= kRad2Deg; 427 case 8: 428 m.GetParameter(7, fNry, err); 429 fNry /= kRad2Deg; 430 case 7: 431 m.GetParameter(6, fNrx, err); 432 fNrx /= kRad2Deg; 433 case 6: 434 m.GetParameter(5, fAw, err); 435 fAw /= kRad2Deg; 436 case 5: 437 m.GetParameter(4, fAn, err); 438 fAn /= kRad2Deg; 439 case 4: 440 m.GetParameter(3, fCa, err); 441 fCa /= kRad2Deg; 442 case 3: 443 m.GetParameter(2, fNpae, err); 444 fNpae /= kRad2Deg; 445 case 2: 446 m.GetParameter(1, fIe, err); 447 fIe /= kRad2Deg; 448 case 1: 449 m.GetParameter(0, fIa, err); 450 fIa /= kRad2Deg; 422 while (n--) 423 { 424 m.GetParameter(n, *fCoeff[n], fError[n]); 425 *fCoeff[n] /= kRad2Deg; 426 fError[n] /= kRad2Deg; 451 427 } 452 428 } … … 480 456 Double_t par, err; 481 457 482 switch (n) 483 { 484 case 16: 485 m.GetParameter(15, par, err); 486 cout << " 15 MAGIC2: " << setw(8) << par << " +- " << setw(4) << err << endl; 487 case 15: 488 m.GetParameter(14, par, err); 489 cout << " 14 MAGIC1: " << setw(8) << par << " +- " << setw(4) << err << endl; 490 case 14: 491 m.GetParameter(13, par, err); 492 cout << " 13 ACEC: " << setw(8) << par << " +- " << setw(4) << err << " Azimuth Centering Error (cos)" << endl; 493 case 13: 494 m.GetParameter(12, par, err); 495 cout << " 12 ECEC: " << setw(8) << par << " +- " << setw(4) << err << " Elevation Centering Error (cos)" << endl; 496 case 12: 497 m.GetParameter(11, par, err); 498 cout << " 11 ACES: " << setw(8) << par << " +- " << setw(4) << err << " Azimuth Centering Error (sin)" << endl; 499 case 11: 500 m.GetParameter(10, par, err); 501 cout << " 10 ECES: " << setw(8) << par << " +- " << setw(4) << err << " Elevation Centering Error (sin)" << endl; 502 case 10: 503 m.GetParameter(9, par, err); 504 cout << " 9 CRY: " << setw(8) << par << " +- " << setw(4) << err << " Alt/Az Coude Displacement (E-W)" << endl; 505 case 9: 506 m.GetParameter(8, par, err); 507 cout << " 8 CRX: " << setw(8) << par << " +- " << setw(4) << err << " Alt/Az Coude Displacement (N-S)" << endl; 508 case 8: 509 m.GetParameter(7, par, err); 510 cout << " 7 NRY: " << setw(8) << par << " +- " << setw(4) << err << " Nasmyth rotator displacement, vertical" << endl; 511 case 7: 512 m.GetParameter(6, par, err); 513 cout << " 6 NRX: " << setw(8) << par << " +- " << setw(4) << err << " Nasmyth rotator displacement, horizontan" << endl; 514 case 6: 515 m.GetParameter(5, par, err); 516 cout << " 5 AW: " << setw(8) << par << " +- " << setw(4) << err << " Azimuth Axis Misalignment (E-W)" << endl; 517 case 5: 518 m.GetParameter(4, par, err); 519 cout << " 4 AN: " << setw(8) << par << " +- " << setw(4) << err << " Azimuth Axis Misalignment (N-S)" << endl; 520 case 4: 521 m.GetParameter(3, par, err); 522 cout << " 3 CA: " << setw(8) << par << " +- " << setw(4) << err << " Left-Right Collimation Error" << endl; 523 case 3: 524 m.GetParameter(2, par, err); 525 cout << " 2 NPAE: " << setw(8) << par << " +- " << setw(4) << err << " Az-El Nonperpendicularity" << endl; 526 case 2: 527 m.GetParameter(1, par, err); 528 cout << " 1 IE: " << setw(8) << par << " +- " << setw(4) << err << " Index Error Elevation (Offset)" << endl; 529 case 1: 530 m.GetParameter(0, par, err); 531 cout << " 0 IA: " << setw(8) << par << " +- " << setw(4) << err << " Index Error Azimuth (Offset)" << endl; 532 } 533 } 458 while (n--) 459 { 460 m.GetParameter(n, par, err); 461 cout << Form(" %2d %6s: ", n, (const char*)fName[n]); 462 cout << setw(8) << par << " \xb1 " << setw(6) << err << endl; 463 } 464 } -
trunk/MagicSoft/Cosy/main/MBending.h
r1953 r2407 3 3 4 4 #include "coord.h" 5 6 #ifndef ROOT_TArrayD 7 #include <TArrayD.h> 8 #endif 5 9 6 10 class TMinuit; … … 9 13 { 10 14 private: 15 static const Int_t fNumPar; 16 11 17 Double_t fIe ; // [rad] Index Error in Elevation 12 18 Double_t fIa ; // [rad] Index Error in Azimuth 19 Double_t fFlop ; // [rad] Vertical Sag 20 Double_t fNpae ; // [rad] Az-El Nonperpendicularity 13 21 Double_t fCa ; // [rad] Left-Right Collimation Error 14 22 Double_t fAn ; // [rad] Azimuth Axis Misalignment (N-S) 15 23 Double_t fAw ; // [rad] Azimuth Axis Misalignment (E-W) 16 Double_t fNpae ; // [rad] Az-El Nonperpendicularity 17 Double_t fNrx ; // [rad] Nasmyth rotator displacement, horizontan 24 Double_t fTf ; // [rad] Tube fluxture (sin) 25 Double_t fTx ; // [rad] Tube fluxture (tan) 26 Double_t fNrx ; // [rad] Nasmyth rotator displacement, horizontal 18 27 Double_t fNry ; // [rad] Nasmyth rotator displacement, vertical 19 28 Double_t fCrx ; // [rad] Alt/Az Coude Displacement (N-S) … … 26 35 Double_t fMagic2; // [rad] Magic Term (what is it?) 27 36 37 Double_t **fCoeff; //! 38 TString *fName; //! 39 TString *fDescr; //! 40 41 TArrayD fError; 42 43 void Init(); 28 44 29 45 void Clear() 30 46 { 31 fIe =0 ; // Index Error in Elevation 32 fIa =0 ; // Index Error in Azimuth 33 fCa =0 ; // Left-Right Collimation Error 34 fAn =0 ; // Azimuth Axis Misalignment (N-S) 35 fAw =0 ; // Azimuth Axis Misalignment (E-W) 36 fNpae=0 ; // Az-El Nonperpendicularity 37 fNrx =0 ; // Nasmyth rotator displacement, horizontan 38 fNry =0 ; // Nasmyth rotator displacement, vertical 39 fCrx =0 ; // Alt/Az Coude Displacement (N-S) 40 fCry =0 ; // Alt/Az Coude Displacement (E-W) 41 fEces=0 ; // Elevation Centering Error (sin) 42 fAces=0 ; // Azimuth Centering Error (sin) 43 fEcec=0 ; // Elevation Centering Error (cos) 44 fAcec=0 ; // Azimuth Centering Error (cos) 45 fMagic1=0; // Azimuth Centering Error (cos) 46 fMagic2=0; // Azimuth Centering Error (cos) 47 for (int i=0; i<fNumPar; i++) 48 { 49 *fCoeff[i] = 0; 50 fError[i] = 0; 51 } 47 52 } 48 53 54 static Double_t Sign(Double_t val, Double_t alt); 55 49 56 public: 50 MBending() { Clear(); } 51 MBending(const char *name) { Clear(); Load(name); } 57 MBending() { fError.Set(fNumPar); Init(); Clear(); } 58 MBending(const char *name) { fError.Set(fNumPar); Init(); Clear(); Load(name); } 59 virtual ~MBending() { delete fName; delete fCoeff; delete fDescr; } 52 60 53 61 void Load(const char *name); … … 67 75 ZdAz operator()(const ZdAz &zdaz, void (*fcn)(ZdAz &zdaz, Double_t *par)) const 68 76 { 69 Double_t par[ 16];77 Double_t par[fNumPar]; 70 78 GetParameters(par); 71 79 ZdAz za = zdaz; … … 76 84 AltAz operator()(const AltAz &aaz, void (*fcn)(AltAz &aaz, Double_t *par)) const 77 85 { 78 Double_t par[ 16];86 Double_t par[fNumPar]; 79 87 GetParameters(par); 80 88 AltAz aa = aaz; … … 83 91 } 84 92 85 void SetParameters(const Double_t *par, Int_t n=16); 86 void GetParameters(Double_t *par, Int_t n=16) const; 93 void SetParameters(const Double_t *par, Int_t n=fNumPar); 94 void GetParameters(Double_t *par, Int_t n=fNumPar) const; 95 96 void SetParameters(const TArrayD &par) 97 { 98 SetParameters(par.GetArray(), par.GetSize()); 99 } 100 void GetParameters(TArrayD &par) const 101 { 102 par.Set(fNumPar); 103 GetParameters(par.GetArray()); 104 } 105 void GetError(TArrayD &par) const 106 { 107 par = fError; 108 for (int i=0; i<fNumPar; i++) 109 par[i] *= kRad2Deg; 110 } 87 111 88 112 void SetMinuitParameters(TMinuit &m, Int_t n=-1) const; 89 113 void GetMinuitParameters(TMinuit &m, Int_t n=-1); 90 114 void PrintMinuitParameters(TMinuit &m, Int_t n=-1) const; 115 116 const TString &GetName(int i) const { return fName[i]; } 117 const TString &GetDescription(int i) const { return fDescr[i]; } 91 118 92 119 /* … … 107 134 */ 108 135 136 static const Int_t GetNumPar() { return fNumPar; } 109 137 ClassDef(MBending, 1) 110 138 };
Note:
See TracChangeset
for help on using the changeset viewer.