Changeset 3517
- Timestamp:
- 03/16/04 08:31:12 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.cc
r3488 r3517 98 98 fDecSource = 0.0; 99 99 fRaSource = 0.0; 100 101 fxSourceold = 25.0; 102 fySourceold = -40.0; 103 fThetaradold = 25.0/kRad2Deg; 104 fPhiradold = 180.0/kRad2Deg; 100 105 } 101 106 … … 130 135 { 131 136 *fLog << "MSourcePosfromStarPos::SetSourceAndStarPosition :" << endl; 132 *fLog << " Source : " << nameSource << " " << decSourceDeg << ":"137 *fLog << " Source (dec) : " << nameSource << " " << decSourceDeg << ":" 133 138 << decSourceMin << ":" << decSourceSec << endl; 134 *fLog << " Star : " << nameStar << " " << decStarDeg << ":" 139 *fLog << " Source (ra) : " << nameSource << " " << raSourceHour << ":" 140 << raSourceMin << ":" << raSourceSec << endl; 141 142 *fLog << " Star (dec) : " << nameStar << " " << decStarDeg << ":" 135 143 << decStarMin << ":" << decStarSec << endl; 144 *fLog << " Star (ra) : " << nameStar << " " << raStarHour << ":" 145 << raStarMin << ":" << raStarSec << endl; 136 146 137 147 // convert into radians … … 143 153 fStars += 1; 144 154 fDecStar.Set(fStars); 155 fRaStar.Set(fStars); 156 fxStar.ResizeTo(fStars,fSize); 157 fyStar.ResizeTo(fStars,fSize); 158 fdxStar.ResizeTo(fStars,fSize); 159 fdyStar.ResizeTo(fStars,fSize); 160 145 161 fDecStar[fStars-1] = (decStarDeg + decStarMin/60.0 + decStarSec/3600.0) 146 162 / kRad2Deg; … … 148 164 * 360.0 / (24.0 * kRad2Deg); 149 165 150 *fLog << all << "MSourcePosfromStarPos::SetSourceAndStarPosition; fDecSource, fRaSource, fDecStar, fRaStar were set to : [radians] " 166 *fLog << all << "MSourcePosfromStarPos::SetSourceAndStarPosition; fStars = " 167 << fStars << endl; 168 *fLog << all << " fDecSource, fRaSource, fDecStar, fRaStar were set to : [radians] " 151 169 << fDecSource << ", " << fRaSource << ", " 152 170 << fDecStar[fStars-1] << ", " << fRaStar[fStars-1] << endl; … … 168 186 { 169 187 *fLog << "MSourcePosfromStarPos::AddStar :" << endl; 170 *fLog << " Star : " << nameStar << " " << decStarDeg << ":"188 *fLog << " Star (dec) : " << nameStar << " " << decStarDeg << ":" 171 189 << decStarMin << ":" << decStarSec << endl; 190 *fLog << " Star (ra) : " << nameStar << " " << raStarHour << ":" 191 << raStarMin << ":" << raStarSec << endl; 172 192 173 193 // convert into radians 174 194 fStars = fDecStar.GetSize() + 1; 175 195 fDecStar.Set(fStars); 196 fRaStar.Set(fStars); 197 fxStar.ResizeTo(fStars,fSize); 198 fyStar.ResizeTo(fStars,fSize); 199 fdxStar.ResizeTo(fStars,fSize); 200 fdyStar.ResizeTo(fStars,fSize); 201 176 202 fDecStar[fStars-1] = (decStarDeg + decStarMin/60.0 + decStarSec/3600.0) 177 203 / kRad2Deg; … … 179 205 * 360.0 / (24.0 * kRad2Deg); 180 206 181 *fLog << all << "MSourcePosfromStarPos::AddStar; fDecStar, fRaStar were set to : [radians] " 207 *fLog << all << "MSourcePosfromStarPos::AddStar; fStars = " << fStars 208 << endl; 209 *fLog << all << " fDecStar, fRaStar were set to : [radians] " 182 210 << fDecStar[fStars-1] << ", " << fRaStar[fStars-1] << endl; 183 211 } … … 345 373 Double_t sinal = a1 * sin(phiTel) * denom; 346 374 375 *fLog << "old thetaTel, phiTel, cosal, sinal = " << thetaTel << ", " 376 << phiTel << ", " << cosal << ", " << sinal << endl; 377 378 347 379 fObservatory->RotationAngle(thetaTel, phiTel, sinal, cosal); 348 380 349 //*fLog << "thetaTel, phiTel, cosal, sinal = " << thetaTel << ", "350 //<< phiTel << ", " << cosal << ", " << sinal << endl;381 *fLog << "new thetaTel, phiTel, cosal, sinal = " << thetaTel << ", " 382 << phiTel << ", " << cosal << ", " << sinal << endl; 351 383 352 384 … … 408 440 Double_t ytilde = -f/z * (sinal*x + cosal*y); 409 441 410 //*fLog << "xtilde, ytile = " << xtilde << ", " << ytilde << endl; 442 //*fLog << "i, xtilde, ytile = " << i << " : " << xtilde << ", " 443 // << ytilde << endl; 411 444 412 445 … … 414 447 // note : in real camera signs are inverted (therefore s = -1.0) 415 448 Double_t s = -1.0; 416 sumx += s * (s*xStar[i] - xtilde) * weightx; 417 sumy += s * (s*yStar[i] - ytilde) * weighty; 449 450 Double_t xs = xStar[i] - s * xtilde; 451 Double_t ys = yStar[i] - s * ytilde; 452 453 *fLog << "i, xs, ys = " << i << " : " << xs << ", " 454 << ys << endl; 455 456 sumx += xs * weightx; 457 sumy += ys * weighty; 418 458 } 419 459 //----------------------------------------------------- … … 444 484 *fLog << all << "MSourcePosfromStarPos::ReInit; run = " << run << endl; 445 485 446 // define default values for source position and (theta, phi)447 Double_t xSource_def = 51.0;448 Double_t ySource_def = -59.0;449 Double_t theta_def = 25.0;450 Double_t phi_def = 90.0;451 486 452 487 //------------------------------------------------------------------- … … 461 496 Double_t thetarad = fThetaTel[i]; 462 497 Double_t phirad = fPhiTel[i]; 498 499 if (fabs(thetarad*kRad2Deg+1.0) < 0.001) 500 thetarad = fThetaradold; 501 else 502 fThetaradold = thetarad; 503 if (fabs(phirad*kRad2Deg+1.0) < 0.001) 504 phirad = fPhiradold; 505 else 506 fPhiradold = phirad; 507 463 508 fMcEvt->SetTelescopeTheta(thetarad); 464 509 fMcEvt->SetTelescopePhi(phirad); … … 496 541 fSrcPos->SetXY(fxSource, fySource); 497 542 543 fxSourceold = fxSource; 544 fySourceold = fySource; 545 498 546 *fLog << all << "MSourcePosfromStarPos::ReInit; fRunNr, fxSource, fySource = " 499 547 << fRunNr[i] << ", " << fxSource << " +- " << fdxSource … … 505 553 { 506 554 // set default values 507 fxSource = xSource_def;508 fySource = ySource_def;555 fxSource = fxSourceold; 556 fySource = fySourceold; 509 557 fSrcPos->SetXY(fxSource, fySource); 510 558 fSrcPos->SetReadyToSave(); 559 511 560 512 561 *fLog << warn << "MSourcePosfromStarPos::ReInit; no information on source position for run number = " … … 523 572 524 573 // set default values 525 fxSource = xSource_def;526 fySource = ySource_def;574 fxSource = fxSourceold; 575 fySource = fySourceold; 527 576 fSrcPos->SetXY(fxSource, fySource); 528 577 fSrcPos->SetReadyToSave(); 529 578 530 Double_t thetadeg = theta_def; 531 Double_t thetarad = thetadeg / kRad2Deg; 579 Double_t thetarad = fThetaradold; 532 580 fMcEvt->SetTelescopeTheta(thetarad); 533 581 534 Double_t phideg = phi_def; 535 Double_t phirad = phideg / kRad2Deg; 582 Double_t phirad = fPhiradold; 536 583 fMcEvt->SetTelescopePhi(phirad); 537 584 fMcEvt->SetReadyToSave(); … … 541 588 *fLog << warn << " set xSource, ySource = " << fxSource << ", " 542 589 << fySource << " mm" << endl; 543 *fLog << warn << " set theta, phi = " << theta deg << ", "544 << phi deg << " deg" << endl;590 *fLog << warn << " set theta, phi = " << thetarad*kRad2Deg << ", " 591 << phirad*kRad2Deg << " deg" << endl; 545 592 546 593 … … 577 624 *fLog << "MSourcePosfromStarPos::FixSize; fix size of arrays : fRuns = " 578 625 << fRuns << ", fStars = " << fStars << endl; 626 *fLog << " first run : " << fRunNr[0] << ", last run : " 627 << fRunNr[fRuns-1] << endl; 579 628 580 629 fSize = fRuns; … … 644 693 645 694 *fIn >> ival; 695 696 646 697 647 698 //*fLog << fRuns <<"th run : " << ival << endl; … … 655 706 // read mjdS, hmsS, mjdE, hmsE 656 707 // these data are present only for ON data (fStars > 0) 708 /* 657 709 if (fStars > 0) 658 710 { … … 667 719 *fIn >> val; 668 720 } 721 */ 669 722 670 723 *fIn >> val; … … 691 744 { 692 745 *fIn >> val; 693 fxStar(i, fRuns-1) = val / fMm2Deg;; 746 //fxStar(i, fRuns-1) = val / fMm2Deg; 747 fxStar(i, fRuns-1) = val; 694 748 //*fLog << "val, fxStar(i, fRuns-1) = " << val << ", " 695 749 // << fxStar(i, fRuns-1) << endl; 696 750 697 751 *fIn >> val; 698 fyStar(i, fRuns-1) = val / fMm2Deg; 752 //fyStar(i, fRuns-1) = val / fMm2Deg; 753 fyStar(i, fRuns-1) = val; 699 754 //*fLog << "val, fyStar(i, fRuns-1) = " << val << ", " 700 755 // << fyStar(i, fRuns-1) << endl; 701 756 702 757 703 *fIn >> val;758 //*fIn >> val; 704 759 //*fLog << "y=dxStar = " << val << endl; 705 760 706 fdxStar(i, fRuns-1) = val / fMm2Deg; 707 *fIn >> val; 761 //fdxStar(i, fRuns-1) = val / fMm2Deg; 762 //fdxStar(i, fRuns-1) = val; 763 fdxStar(i, fRuns-1) = 1.0; 764 //*fIn >> val; 708 765 //*fLog << "y=dyStar = " << val << endl; 709 766 710 fdyStar(i, fRuns-1) = val / fMm2Deg; 767 //fdyStar(i, fRuns-1) = val / fMm2Deg; 768 //fdyStar(i, fRuns-1) = val; 769 fdyStar(i, fRuns-1) = 1.0; 711 770 } 712 771 … … 785 844 786 845 846 847 848 -
trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.h
r3488 r3517 75 75 TMatrixD fdyStar; 76 76 77 Double_t fxSourceold; 78 Double_t fySourceold; 79 Double_t fThetaradold; 80 Double_t fPhiradold; 77 81 78 82 Bool_t OpenNextFile();
Note:
See TracChangeset
for help on using the changeset viewer.