Changeset 3598 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 03/26/04 05:53:16 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.cc
r3534 r3598 88 88 fdPhiTel.Set(fSize); 89 89 90 fDecStar.Set(1); 91 fRaStar.Set(1); 92 fxStar.ResizeTo(1,fSize); 93 fyStar.ResizeTo(1,fSize); 94 fdxStar.ResizeTo(1,fSize); 95 fdyStar.ResizeTo(1,fSize); 90 Int_t fRows = 1; 91 fDecStar.Set(fRows); 92 fRaStar.Set(fRows); 93 fxStar.ResizeTo(fRows,fSize); 94 fyStar.ResizeTo(fRows,fSize); 95 fdxStar.ResizeTo(fRows,fSize); 96 fdyStar.ResizeTo(fRows,fSize); 96 97 97 98 fStars = 0; … … 194 195 195 196 // convert into radians 196 fStars = fDecStar.GetSize() +1;197 fStars += 1; 197 198 fDecStar.Set(fStars); 198 199 fRaStar.Set(fStars); … … 274 275 275 276 *fLog << "read data" << endl; 277 278 // read "fStarsRead" = no.of (x,y) pairs to be read 279 *fIn >> fStarsRead; 280 276 281 while (1) 277 282 { … … 294 299 if (fDecSource == 0.0 || fRaSource == 0.0 || fStars == 0) 295 300 { 296 *fLog << warn << "MSourcePosfromStarPos::PreProcess; there are no sky coordinates defined for the source or from stars; fStars = " << fStars 301 *fLog << warn << "MSourcePosfromStarPos::PreProcess; there are no sky coordinates defined for the source or from stars; fStars, fStarsRead = " 302 << fStars << ", " << fStarsRead 297 303 << endl; 298 304 } … … 482 488 Bool_t MSourcePosfromStarPos::ReInit(MParList *pList) 483 489 { 490 //if (1 == 1) return kTRUE; 491 484 492 485 493 Int_t run = fRun->GetRunNumber(); … … 519 527 520 528 521 if (fStars > 0 )529 if (fStars > 0 && fStars == fStarsRead) 522 530 { 523 531 TArrayD xStar(fxStar.GetNrows()); … … 624 632 void MSourcePosfromStarPos::FixSize() 625 633 { 626 *fLog << "MSourcePosfromStarPos::FixSize; fix size of arrays : fRuns = "627 << fRuns << ", fStars = " << fStars << endl;628 *fLog << " first run : " << fRunNr[0] << ", last run : "629 << fRunNr[fRuns-1] << endl;630 631 634 fSize = fRuns; 635 if (fRuns <= 0) 636 fSize = 1; 632 637 633 638 fRunNr.Set(fSize); … … 639 644 640 645 Int_t fRows = fxStar.GetNrows(); 641 if (fRows <= 0)642 fRows = 1;643 646 fxStar.ResizeTo(fRows, fSize); 644 647 fyStar.ResizeTo(fRows, fSize); 645 648 fdxStar.ResizeTo(fRows, fSize); 646 649 fdyStar.ResizeTo(fRows, fSize); 650 651 *fLog << "MSourcePosfromStarPos::FixSize; fix size of arrays : fStars = " 652 << fStars << ", fRuns = " << fRuns << ", fRows = " << fRows 653 << ", fSize = " << fSize << endl; 654 *fLog << " first run : " << fRunNr[0] << ", last run : " 655 << fRunNr[fRuns-1] << endl; 647 656 } 648 657 … … 657 666 658 667 // extend size of arrays if necessary 659 if ( fRuns >= (fSize-1))668 if ( fRuns >= fSize ) 660 669 { 661 670 fSize += 100; … … 669 678 670 679 Int_t fRows = fxStar.GetNrows(); 671 if (fRows <= 0)672 fRows = 1;673 680 fxStar.ResizeTo(fRows, fSize); 674 681 fyStar.ResizeTo(fRows, fSize); 675 682 fdxStar.ResizeTo(fRows, fSize); 676 683 fdyStar.ResizeTo(fRows, fSize); 684 685 *fLog << "MSourcePosfromStarPos::ReadData(); size of arrays has been increased to (fRows, fSize) = (" 686 << fRows << ", " << fSize << ")" << endl; 677 687 } 678 688 … … 694 704 //*fIn >> val; 695 705 //------------------- 706 696 707 697 708 … … 700 711 *fIn >> ival; 701 712 713 if (fIn->eof()) 714 return; 715 702 716 // run number must be greater than 10000 703 if (fabs( (Double_t)ival) < 10000)717 if (fabs(ival) < 10000) 704 718 { 705 719 *fLog << err << "===========> Error when reading file with theta and phi <=========" … … 711 725 712 726 fRuns += 1; 713 //*fLog << fRuns <<"th run : " << ival << endl;727 *fLog << fRuns <<"th run : " << ival << endl; 714 728 715 729 fRunNr.AddAt(ival, fRuns-1); … … 755 769 // input is in [deg], convert to [mm] 756 770 757 //*fLog << "ReadData : fStars = " << fStars << endl; 758 for (Int_t i=0; i<fStars; i++) 759 { 760 *fIn >> val; 761 //fxStar(i, fRuns-1) = val / fMm2Deg; 762 fxStar(i, fRuns-1) = val; 763 //*fLog << "val, fxStar(i, fRuns-1) = " << val << ", " 764 // << fxStar(i, fRuns-1) << endl; 765 766 *fIn >> val; 767 //fyStar(i, fRuns-1) = val / fMm2Deg; 768 fyStar(i, fRuns-1) = val; 769 //*fLog << "val, fyStar(i, fRuns-1) = " << val << ", " 770 // << fyStar(i, fRuns-1) << endl; 771 772 773 //*fIn >> val; 774 //*fLog << "y=dxStar = " << val << endl; 775 776 //fdxStar(i, fRuns-1) = val / fMm2Deg; 777 //fdxStar(i, fRuns-1) = val; 778 fdxStar(i, fRuns-1) = 1.0; 779 //*fIn >> val; 780 //*fLog << "y=dyStar = " << val << endl; 781 782 //fdyStar(i, fRuns-1) = val / fMm2Deg; 783 //fdyStar(i, fRuns-1) = val; 784 fdyStar(i, fRuns-1) = 1.0; 785 } 786 771 //*fLog << "ReadData : fStarsRead = " << fStarsRead << endl; 772 773 for (Int_t i=0; i<fStarsRead; i++) 774 { 775 *fIn >> val; 776 if (i<fStars) fxStar(i, fRuns-1) = val; 777 778 *fIn >> val; 779 if (i<fStars) fyStar(i, fRuns-1) = val; 780 781 //*fIn >> val; 782 // if (i < fStars) fdxStar(i, fRuns-1) = val; 783 if (i < fStars) fdxStar(i, fRuns-1) = 1.0; 784 785 //*fIn >> val; 786 // if (i < fStars) fdyStar(i, fRuns-1) = val; 787 if (i < fStars) fdyStar(i, fRuns-1) = 1.0; 788 } 787 789 } 788 790 -
trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.h
r3531 r3598 53 53 Int_t fSize; // final number of runs 54 54 Int_t fStars; // number of stars 55 Int_t fStarsRead; // number of (x,y) pairs to be read 55 56 56 57
Note:
See TracChangeset
for help on using the changeset viewer.