Changeset 1810 for trunk/MagicSoft/Cosy/main
- Timestamp:
- 03/11/03 13:52:48 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/main/MBending.cc
r1808 r1810 107 107 if (str=="ECEC") fEcec = val; 108 108 if (str=="ACEC") fAcec = val; 109 if (str=="MAGIC1") fMagic1 = val;110 if (str=="MAGIC2") fMagic2 = val;109 //if (str=="MAGIC1") fMagic1 = val; 110 //if (str=="MAGIC2") fMagic2 = val; 111 111 112 112 fin >> val; … … 143 143 fout << "S 00 000000 000000 0000000" << endl; 144 144 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;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; 161 161 fout << "END" << endl; 162 162 } … … 173 173 p += CEC; 174 174 175 // const AltAz MAGIC(0, -fMagic1*tan(p.Alt())-fMagic2); 176 // p += MAGIC; 177 175 178 const AltAz CRX(-fCrx*sin(p.Az()-p.Alt()), fCrx*cos(p.Az()-p.Alt())/cos(p.Alt())); 176 179 const AltAz CRY(-fCry*cos(p.Az()-p.Alt()), -fCry*sin(p.Az()-p.Alt())/cos(p.Alt())); … … 183 186 p += NRY; 184 187 185 const AltAz MAGIC(-fMagic1*sin(p.Az()-fMagic2), 0);186 p += MAGIC;188 // const AltAz MAGIC(-fMagic1*sin(p.Az()-fMagic2), 0); 189 // p += MAGIC; 187 190 188 191 const AltAz AW( fAw*sin(p.Az()), -fAw*cos(p.Az())*tan(p.Alt())); … … 191 194 p += AN; 192 195 193 // const AltAz MAGIC(-fMagic1*sin(p.Az()-fMagic2), 0); 194 // p += MAGIC; 195 196 // const AltAz MAGIC(-fMagic1*sin(p.Az()-fMagic2), 0); 197 // p += MAGIC; 196 198 197 199 const AltAz CA(0, -fCa/cos(p.Alt())); … … 227 229 p -= AW; 228 230 229 const AltAz MAGIC(-fMagic1*sin(p.Az()-fMagic2), 0);230 p -= MAGIC;231 // const AltAz MAGIC(-fMagic1*sin(p.Az()-fMagic2), 0); 232 // p -= MAGIC; 231 233 232 234 const AltAz NRY(fNry*cos(p.Alt()), -fNry*tan(p.Alt())); … … 285 287 fEces =par[10]/kRad2Deg; // Elevation Centering Error (sin) 286 288 case 10: 287 fCry =par[9] /kRad2Deg;// Alt/Az Coude Displacement (E-W)289 fCry =par[9] /kRad2Deg; // Alt/Az Coude Displacement (E-W) 288 290 case 9: 289 fCrx =par[8] /kRad2Deg;// Alt/Az Coude Displacement (N-S)291 fCrx =par[8] /kRad2Deg; // Alt/Az Coude Displacement (N-S) 290 292 case 8: 291 fNry =par[7] /kRad2Deg;// Nasmyth rotator displacement, vertical293 fNry =par[7] /kRad2Deg; // Nasmyth rotator displacement, vertical 292 294 case 7: 293 fNrx =par[6] /kRad2Deg;// Nasmyth rotator displacement, horizontan295 fNrx =par[6] /kRad2Deg; // Nasmyth rotator displacement, horizontan 294 296 case 6: 295 fAw =par[5] /kRad2Deg;// Azimuth Axis Misalignment (E-W)297 fAw =par[5] /kRad2Deg; // Azimuth Axis Misalignment (E-W) 296 298 case 5: 297 fAn =par[4] /kRad2Deg;// Azimuth Axis Misalignment (N-S)299 fAn =par[4] /kRad2Deg; // Azimuth Axis Misalignment (N-S) 298 300 case 4: 299 fCa =par[3] /kRad2Deg;// Left-Right Collimation Error301 fCa =par[3] /kRad2Deg; // Left-Right Collimation Error 300 302 case 3: 301 fNpae =par[2] /kRad2Deg;// Az-El Nonperpendicularity303 fNpae =par[2] /kRad2Deg; // Az-El Nonperpendicularity 302 304 case 2: 303 fIe =par[1] /kRad2Deg;// Index Error in Elevation305 fIe =par[1] /kRad2Deg; // Index Error in Elevation 304 306 case 1: 305 fIa =par[0] /kRad2Deg;// Index Error in Azimuth307 fIa =par[0] /kRad2Deg; // Index Error in Azimuth 306 308 } 307 309 } … … 312 314 { 313 315 case 16: 314 par[15]= fMagic2*kRad2Deg; //316 par[15]=kRad2Deg*fMagic2; // 315 317 case 15: 316 par[14]= fMagic1*kRad2Deg; //318 par[14]=kRad2Deg*fMagic1; // 317 319 case 14: 318 par[13]= fAcec*kRad2Deg; // Azimuth Centering Error (cos)320 par[13]=kRad2Deg*fAcec; // Azimuth Centering Error (cos) 319 321 case 13: 320 par[12]= fEcec*kRad2Deg; // Elevation Centering Error (cos)322 par[12]=kRad2Deg*fEcec; // Elevation Centering Error (cos) 321 323 case 12: 322 par[11]= fAces*kRad2Deg; // Azimuth Centering Error (sin)324 par[11]=kRad2Deg*fAces; // Azimuth Centering Error (sin) 323 325 case 11: 324 par[10]= fEces*kRad2Deg; // Elevation Centering Error (sin)326 par[10]=kRad2Deg*fEces; // Elevation Centering Error (sin) 325 327 case 10: 326 par[9] =fCry*kRad2Deg;// Alt/Az Coude Displacement (E-W)328 par[9] =kRad2Deg*fCry; // Alt/Az Coude Displacement (E-W) 327 329 case 9: 328 par[8] =fCrx*kRad2Deg;// Alt/Az Coude Displacement (N-S)330 par[8] =kRad2Deg*fCrx; // Alt/Az Coude Displacement (N-S) 329 331 case 8: 330 par[7] =fNry*kRad2Deg;// Nasmyth rotator displacement, vertical332 par[7] =kRad2Deg*fNry; // Nasmyth rotator displacement, vertical 331 333 case 7: 332 par[6] =fNrx*kRad2Deg;// Nasmyth rotator displacement, horizontan334 par[6] =kRad2Deg*fNrx; // Nasmyth rotator displacement, horizontan 333 335 case 6: 334 par[5] =fAw*kRad2Deg;// Azimuth Axis Misalignment (E-W)336 par[5] =kRad2Deg*fAw; // Azimuth Axis Misalignment (E-W) 335 337 case 5: 336 par[4] =fAn*kRad2Deg;// Azimuth Axis Misalignment (N-S)338 par[4] =kRad2Deg*fAn; // Azimuth Axis Misalignment (N-S) 337 339 case 4: 338 par[3] =fCa*kRad2Deg;// Left-Right Collimation Error340 par[3] =kRad2Deg*fCa; // Left-Right Collimation Error 339 341 case 3: 340 par[2] =fNpae*kRad2Deg; // Az-El Nonperpendicularity342 par[2] =kRad2Deg*fNpae; // Az-El Nonperpendicularity 341 343 case 2: 342 par[1] =fIe*kRad2Deg;// Index Error in Elevation344 par[1] =kRad2Deg*fIe; // Index Error in Elevation 343 345 case 1: 344 par[0] =fIa*kRad2Deg;// Index Error in Azimuth346 par[0] =kRad2Deg*fIa; // Index Error in Azimuth 345 347 } 346 348 } … … 349 351 { 350 352 if (n<0) 351 n = m.GetNumPars();353 n = 16; 352 354 353 355 Int_t ierflg = 0; … … 357 359 case 16: 358 360 m.mnparm(15,"MAGIC2", fMagic2*kRad2Deg, 1, -360, 360, ierflg); 359 // cout << "Init 3 CA: " << fCa << endl;360 361 case 15: 361 362 m.mnparm(14,"MAGIC1", fMagic1*kRad2Deg, 1, -360, 360, ierflg); 362 // cout << "Init 3 CA: " << fCa << endl;363 363 case 14: 364 364 m.mnparm(13,"ACEC", fAcec*kRad2Deg, 1, -360, 360, ierflg); 365 // cout << "Init 3 CA: " << fCa << endl;366 365 case 13: 367 366 m.mnparm(12,"ECEC", fEcec*kRad2Deg, 1, -360, 360, ierflg); 368 // cout << "Init 3 CA: " << fCa << endl;369 367 case 12: 370 368 m.mnparm(11,"ACES", fAcec*kRad2Deg, 1, -360, 360, ierflg); 371 // cout << "Init 3 CA: " << fCa << endl;372 369 case 11: 373 370 m.mnparm(10,"ECES", fEcec*kRad2Deg, 1, -360, 360, ierflg); 374 // cout << "Init 3 CA: " << fCa << endl;375 371 case 10: 376 372 m.mnparm(9, "CRY", fCry*kRad2Deg, 1, -360, 360, ierflg); 377 // cout << "Init 3 CA: " << fCa << endl;378 373 case 9: 379 374 m.mnparm(8, "CRX", fCrx*kRad2Deg, 1, -360, 360, ierflg); 380 // cout << "Init 3 CA: " << fCa << endl;381 375 case 8: 382 376 m.mnparm(7, "NRY", fNry*kRad2Deg, 1, -360, 360, ierflg); 383 // cout << "Init 3 CA: " << fCa << endl;384 377 case 7: 385 378 m.mnparm(6, "NRX", fNrx*kRad2Deg, 1, -360, 360, ierflg); 386 // cout << "Init 3 CA: " << fCa << endl;387 379 case 6: 388 380 m.mnparm(5, "AW", fAw*kRad2Deg, 1, -360, 360, ierflg); 389 // cout << "Init 3 CA: " << fCa << endl;390 381 case 5: 391 382 m.mnparm(4, "AN", fAn*kRad2Deg, 1, -360, 360, ierflg); 392 // cout << "Init 3 CA: " << fCa << endl;393 383 case 4: 394 384 m.mnparm(3, "CA", fCa*kRad2Deg, 1, -360, 360, ierflg); 395 // cout << "Init 3 CA: " << fCa << endl;396 385 case 3: 397 386 m.mnparm(2, "NPAE", fNpae*kRad2Deg, 1, -360, 360, ierflg); 398 // cout << "Init 2 NPAE: " << fNpae << endl;399 387 case 2: 400 m.mnparm(1, "IE", fIe*kRad2Deg, 1, -360, 360, ierflg); 401 // cout << "Init 1 IE: " << fIe << endl; 388 m.mnparm(1, "IE", fIe*kRad2Deg, 1, -90, 90, ierflg); 402 389 case 1: 403 390 m.mnparm(0, "IA", fIa*kRad2Deg, 1, -360, 360, ierflg); 404 // cout << "Init 0 IA: " << fIa << endl;405 391 } 406 392 } … … 408 394 void MBending::GetMinuitParameters(TMinuit &m, Int_t n=-1) 409 395 { 410 if (n<0 )396 if (n<0 || n>m.GetNumPars()) 411 397 n = m.GetNumPars(); 412 398 … … 465 451 } 466 452 } 467 453 /* 454 void FormatPar(TMinuit &m, Int_t n) 455 { 456 Double_t par, err; 457 m.GetParameter(n, par, err); 458 459 int expp = (int)log10(par); 460 int expe = (int)log10(err); 461 462 if (err<2*pow(10, expe)) 463 expe--; 464 465 Int_t exp = expe>expp ? expp : expe; 466 467 par = (int)(par/pow(10, exp)) * pow(10, exp); 468 err = (int)(err/pow(10, exp)) * pow(10, exp); 469 470 cout << par << " +- " << err << flush; 471 } 472 */ 468 473 void MBending::PrintMinuitParameters(TMinuit &m, Int_t n=-1) const 469 474 { … … 471 476 n = m.GetNumPars(); 472 477 478 cout << setprecision(3); 479 473 480 Double_t par, err; 474 481 … … 477 484 case 16: 478 485 m.GetParameter(15, par, err); 479 cout << " 15 MAGIC2: " << par << " +- " <<err << endl;486 cout << " 15 MAGIC2: " << setw(8) << par << " +- " << setw(4) << err << endl; 480 487 case 15: 481 488 m.GetParameter(14, par, err); 482 cout << " 14 MAGIC1: " << par << " +- " <<err << endl;489 cout << " 14 MAGIC1: " << setw(8) << par << " +- " << setw(4) << err << endl; 483 490 case 14: 484 491 m.GetParameter(13, par, err); 485 cout << " 13 ACEC: " << par << " +- " << err<< endl;492 cout << " 13 ACEC: " << setw(8) << par << " +- " << setw(4) << err << " Azimuth Centering Error (cos)" << endl; 486 493 case 13: 487 494 m.GetParameter(12, par, err); 488 cout << " 12 ECEC: " << par << " +- " << err<< endl;495 cout << " 12 ECEC: " << setw(8) << par << " +- " << setw(4) << err << " Elevation Centering Error (cos)" << endl; 489 496 case 12: 490 497 m.GetParameter(11, par, err); 491 cout << " 11 ACES: " << par << " +- " << err<< endl;498 cout << " 11 ACES: " << setw(8) << par << " +- " << setw(4) << err << " Azimuth Centering Error (sin)" << endl; 492 499 case 11: 493 500 m.GetParameter(10, par, err); 494 cout << " 10 ECES: " << par << " +- " << err<< endl;501 cout << " 10 ECES: " << setw(8) << par << " +- " << setw(4) << err << " Elevation Centering Error (sin)" << endl; 495 502 case 10: 496 503 m.GetParameter(9, par, err); 497 cout << " 9 CRY: " << par << " +- " << err<< endl;504 cout << " 9 CRY: " << setw(8) << par << " +- " << setw(4) << err << " Alt/Az Coude Displacement (E-W)" << endl; 498 505 case 9: 499 506 m.GetParameter(8, par, err); 500 cout << " 8 CRX: " << par << " +- " << err<< endl;507 cout << " 8 CRX: " << setw(8) << par << " +- " << setw(4) << err << " Alt/Az Coude Displacement (N-S)" << endl; 501 508 case 8: 502 509 m.GetParameter(7, par, err); 503 cout << " 7 NRY: " << par << " +- " << err<< endl;510 cout << " 7 NRY: " << setw(8) << par << " +- " << setw(4) << err << " Nasmyth rotator displacement, vertical" << endl; 504 511 case 7: 505 512 m.GetParameter(6, par, err); 506 cout << " 6 NRX: " << par << " +- " << err<< endl;513 cout << " 6 NRX: " << setw(8) << par << " +- " << setw(4) << err << " Nasmyth rotator displacement, horizontan" << endl; 507 514 case 6: 508 515 m.GetParameter(5, par, err); 509 cout << " 5 AW: " << par << " +- " << err<< endl;516 cout << " 5 AW: " << setw(8) << par << " +- " << setw(4) << err << " Azimuth Axis Misalignment (E-W)" << endl; 510 517 case 5: 511 518 m.GetParameter(4, par, err); 512 cout << " 4 AN: " << par << " +- " << err<< endl;519 cout << " 4 AN: " << setw(8) << par << " +- " << setw(4) << err << " Azimuth Axis Misalignment (N-S)" << endl; 513 520 case 4: 514 521 m.GetParameter(3, par, err); 515 cout << " 3 CA: " << par << " +- " << err<< endl;522 cout << " 3 CA: " << setw(8) << par << " +- " << setw(4) << err << " Left-Right Collimation Error" << endl; 516 523 case 3: 517 524 m.GetParameter(2, par, err); 518 cout << " 2 NPAE: " << par << " +- " << err<< endl;525 cout << " 2 NPAE: " << setw(8) << par << " +- " << setw(4) << err << " Az-El Nonperpendicularity" << endl; 519 526 case 2: 520 527 m.GetParameter(1, par, err); 521 cout << " 1 IE: " << par << " +- " << err<< endl;528 cout << " 1 IE: " << setw(8) << par << " +- " << setw(4) << err << " Index Error Elevation (Offset)" << endl; 522 529 case 1: 523 530 m.GetParameter(0, par, err); 524 cout << " 0 IA: " << par << " +- " << err<< endl;525 } 526 } 531 cout << " 0 IA: " << setw(8) << par << " +- " << setw(4) << err << " Index Error Azimuth (Offset)" << endl; 532 } 533 }
Note:
See TracChangeset
for help on using the changeset viewer.