Changeset 2568 for trunk/MagicSoft/Cosy/main
- Timestamp:
- 11/25/03 18:25:49 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/MagicSoft/Cosy/main/MBending.cc ¶
r2518 r2568 61 61 #include <fstream.h> 62 62 #include <iomanip.h> 63 #include <TVector3.h> 63 64 64 65 #include <TMinuit.h> … … 69 70 70 71 #undef DEBUG 71 #define DEBUG(txt) txt72 //#define DEBUG(txt)72 //#define DEBUG(txt) txt 73 #define DEBUG(txt) 73 74 74 75 const Int_t MBending::fNumPar=19; … … 83 84 fCoeff[ 1] = &fIe; fName[ 1] = "IE"; 84 85 fCoeff[ 2] = &fFlop; fName[ 2] = "FLOP"; 85 fCoeff[ 3] = &f Npae; fName[ 3] = "NPAE";86 fCoeff[ 4] = &f Ca; fName[ 4] = "CA";87 fCoeff[ 5] = &f An; fName[ 5] = "AN";88 fCoeff[ 6] = &f Aw; fName[ 6] = "AW";86 fCoeff[ 3] = &fAn; fName[ 3] = "AN"; 87 fCoeff[ 4] = &fAw; fName[ 4] = "AW"; 88 fCoeff[ 5] = &fNpae; fName[ 5] = "NPAE"; 89 fCoeff[ 6] = &fCa; fName[ 6] = "CA"; 89 90 fCoeff[ 7] = &fTf; fName[ 7] = "TF"; 90 91 fCoeff[ 8] = &fTx; fName[ 8] = "TX"; … … 103 104 fDescr[ 1] = "Index Error Zenith Distance"; 104 105 fDescr[ 2] = "Vertical Sag"; 105 fDescr[ 3] = "Az -El Nonperpendicularity";106 fDescr[ 4] = " Left-Right Collimation Error";107 fDescr[ 5] = "Az imuth Axis Misalignment (N-S)";108 fDescr[ 6] = " Azimuth Axis Misalignment (E-W)";106 fDescr[ 3] = "Azimuth Axis Misalignment (N-S)"; 107 fDescr[ 4] = "Azimuth Axis Misalignment (E-W)"; 108 fDescr[ 5] = "Az-El Nonperpendicularity"; 109 fDescr[ 6] = "Left-Right Collimation Error"; 109 110 fDescr[ 7] = "Tube fluxture (sin)"; 110 111 fDescr[ 8] = "Tube fluxture (tan)"; … … 291 292 292 293 DEBUG(cout << setprecision(16)); 293 DEBUG(cout << "Bend 8: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);294 DEBUG(cout << "Bend7: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 294 295 295 296 const AltAz CRX(-fCrx*sin(p.Az()-p.Alt()), fCrx*cos(p.Az()-p.Alt())/cos(p.Alt())); … … 298 299 p += CRY; 299 300 300 DEBUG(cout << "Bend 7: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);301 DEBUG(cout << "Bend6: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 301 302 302 303 const AltAz NRX(fNrx*sin(p.Alt()), -fNrx); … … 305 306 p += NRY; 306 307 307 DEBUG(cout << "Bend 6: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);308 DEBUG(cout << "Bend5: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 308 309 309 310 const AltAz CES(-fEces*sin(p.Alt()), -fAces*sin(p.Az())); … … 312 313 p += CEC; 313 314 314 DEBUG(cout << "Bend 5: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);315 DEBUG(cout << "Bend4: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 315 316 316 317 const AltAz TX(Sign(fTx/tan(p.Alt()), p.Alt()), 0); … … 319 320 p += TF; 320 321 321 DEBUG(cout << "Bend4: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 322 322 323 DEBUG(cout << "Bend3: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 324 325 /* 326 //New Corrections for NPAE and CA: 327 TVector3 v(1.,1.,1.); // Vector in cartesian coordinates 328 329 //Set Azimuth and Elevation 330 v.SetPhi(p.Az()); 331 v.SetTheta(TMath::Pi()/2-p.Alt()); 332 //Rotation Vectors: 333 TVector3 vNpae( cos(p.Az()), sin(p.Az()), 0); 334 TVector3 vCa( -cos(p.Az())*cos(p.Alt()), -sin(p.Az())*cos(p.Alt()), sin(p.Alt())); 335 //Rotate around the vectors vNpae and vCa 336 v.Rotate(fNpae, vNpae); 337 v.Rotate(fCa, vCa); 338 339 p.Az(v.Phi()); 340 p.Alt(TMath::Pi()/2-v.Theta()); 341 */ 342 343 //Old correction terms for Npae and Ca: 344 const AltAz CA(0, -fCa/cos(p.Alt())); 345 p += CA; 346 347 const AltAz NPAE(0, -fNpae*tan(p.Alt())); 348 p += NPAE; 349 350 DEBUG(cout << "Bend2: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 351 352 // New Corrections for AW and AN: 353 TVector3 v2(1.,1.,1.); // Vector in cartesian coordinates 354 // Set Azimuth and Elevation 355 v2.SetPhi(p.Az()); 356 v2.SetTheta(TMath::Pi()/2-p.Alt()); 357 // Rotate around the x- and y-axis 358 v2.RotateX(fAw); 359 v2.RotateY(fAn); 360 // Get Azimuth and Elevation 361 p.Az(v2.Phi()); 362 p.Alt(TMath::Pi()/2-v2.Theta()); 363 364 /* 365 // Old correction terms for An and Aw: 323 366 cout << fAw << " " << cos(p.Az()) << " " << tan(p.Alt()) << endl; 324 367 cout << fAw* cos(p.Az())*tan(p.Alt())*180/3.1415 << endl; … … 328 371 p += AW; 329 372 p += AN; 330 331 DEBUG(cout << "Bend3: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 332 333 const AltAz CA(0, -fCa/cos(p.Alt())); 334 p += CA; 335 336 DEBUG(cout << "Bend2: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 337 338 const AltAz NPAE(0, -fNpae*tan(p.Alt())); 339 p += NPAE; 373 */ 374 375 376 340 377 341 378 DEBUG(cout << "Bend1: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); … … 381 418 DEBUG(cout << "Back1: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 382 419 420 /* 421 //Old correction terms for An and Aw: 422 const AltAz AN(-fAn*cos(p.Az()), -fAn*sin(p.Az())*tan(p.Alt())); 423 const AltAz AW( fAw*sin(p.Az()), -fAw*cos(p.Az())*tan(p.Alt())); 424 p -= AN; 425 p -= AW; 426 */ 427 428 // New Corrections for AN and AW: 429 TVector3 v(1.,1.,1.); // Vector in cartesian coordinates 430 // Set Azimuth and Elevation 431 v.SetPhi(p.Az()); 432 v.SetTheta(TMath::Pi()/2-p.Alt()); 433 // Rotate around the x- and y-axis 434 v.RotateY(-fAn); 435 v.RotateX(-fAw); 436 // Get Azimuth and Elevation 437 p.Az(v.Phi()); 438 p.Alt(TMath::Pi()/2-v.Theta()); 439 440 441 DEBUG(cout << "Back2: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 442 443 //Old Correction terms for Npae and Ca: 383 444 const AltAz NPAE(0, -fNpae*tan(p.Alt())); 384 445 p -= NPAE; 385 446 386 DEBUG(cout << "Back2: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);387 388 447 const AltAz CA(0, -fCa/cos(p.Alt())); 389 448 p -= CA; 390 449 450 /* 451 //New Correction term for Npae and Ca: 452 TVector3 v2(1.,1.,1.); // Vector in cartesian coordinates 453 //Set Azimuth and Elevation 454 v2.SetPhi(p.Az()); 455 v2.SetTheta(TMath::Pi()/2-p.Alt()); 456 //Rotation Vectors: 457 TVector3 vNpae( cos(p.Az()), sin(p.Az()), 0); 458 TVector3 vCa( -cos(p.Az())*cos(p.Alt()), -sin(p.Az())*cos(p.Alt()), sin(p.Alt())); 459 //Rotate around the vectors vCa and vNpae 460 v2.Rotate(-fCa, vCa); 461 v2.Rotate(-fNpae, vNpae); 462 463 p.Az(v2.Phi()); 464 p.Alt(TMath::Pi()/2-v2.Theta()); 465 */ 466 391 467 DEBUG(cout << "Back3: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 392 393 cout << fAw << " " << cos(p.Az()) << " " << tan(p.Alt()) << endl;394 cout << fAw* cos(p.Az())*tan(p.Alt())*180/3.1415 << endl;395 396 const AltAz AN(-fAn*cos(p.Az()), -fAn*sin(p.Az())*tan(p.Alt()));397 const AltAz AW( fAw*sin(p.Az()), -fAw*cos(p.Az())*tan(p.Alt()));398 p -= AN;399 p -= AW;400 401 DEBUG(cout << "Back4: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);402 468 403 469 const AltAz TF(Sign(fTf*cos(p.Alt()), p.Alt()), 0); … … 406 472 //p -= TX; 407 473 408 DEBUG(cout << "Back 5: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);474 DEBUG(cout << "Back4: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 409 475 410 476 const AltAz CEC(-fEcec*cos(p.Alt()), -fAcec*cos(p.Az())); … … 413 479 p -= CES; 414 480 415 DEBUG(cout << "Back 6: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);481 DEBUG(cout << "Back5: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 416 482 417 483 const AltAz NRY(fNry*cos(p.Alt()), -fNry*tan(p.Alt())); … … 420 486 p -= NRX; 421 487 422 DEBUG(cout << "Back 7: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);488 DEBUG(cout << "Back6: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 423 489 424 490 const AltAz CRY(-fCry*cos(p.Az()-p.Alt()), -fCry*sin(p.Az()-p.Alt())/cos(p.Alt())); … … 427 493 p -= CRX; 428 494 429 DEBUG(cout << "Back 8: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);495 DEBUG(cout << "Back7: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl); 430 496 431 497 return p;
Note:
See TracChangeset
for help on using the changeset viewer.