Changeset 8802 for trunk/MagicSoft/Cosy/tpoint
- Timestamp:
- 01/09/08 11:45:59 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/tpoint/gui.C
r8766 r8802 485 485 gmaz.SetMarkerStyle(kFullDotMedium);; 486 486 gmzd.SetMarkerStyle(kFullDotMedium); 487 487 488 488 TMinuit minuit(MPointing::GetNumPar()); //initialize TMinuit with a maximum of 5 params 489 489 minuit.SetObjectFit(this); 490 490 minuit.SetPrintLevel(-1); 491 491 minuit.SetFCN(fcn); 492 492 493 493 fBending.SetMinuitParameters(minuit, MPointing::GetNumPar()); // Init Parameters [deg] 494 494 495 495 for (int i=0; i<MPointing::GetNumPar(); i++) 496 496 { … … 500 500 minuit.Release(i); 501 501 } 502 502 503 503 //minuit.Command("SHOW PARAMETERS"); 504 504 //minuit.Command("SHOW LIMITS"); 505 505 506 506 cout << endl; 507 507 cout << "Starting fit..." << endl; … … 509 509 cout << "0.02deg (=1SE) is assumed." << endl; 510 510 cout << endl; 511 511 512 512 Int_t ierflg = 0; 513 513 ierflg = minuit.Migrad(); … … 516 516 ierflg = minuit.Migrad(); 517 517 cout << "Migrad returns " << ierflg << endl << endl; 518 518 519 519 // 520 520 // Get Fit Results … … 524 524 cout << endl; 525 525 //fBending.Save("bending_magic.txt"); 526 527 526 527 528 528 // 529 529 // Make a copy of all list entries … … 533 533 for (int i=0; i<fCoordinates.GetSize(); i++) 534 534 list.Add(new Set(*(Set*)fCoordinates.At(i))); 535 535 536 536 // 537 537 // Correct for Offsets only … … 541 541 for (int i=2; i<MPointing::GetNumPar(); i++) 542 542 par[i]=0; 543 543 544 544 MPointing b2; 545 545 b2.SetParameters(par); … … 989 989 } 990 990 991 voidLoadCollection(TString fname)991 Bool_t LoadCollection(TString fname) 992 992 { 993 993 ifstream fin(fname); … … 995 995 { 996 996 cout << "Collection '" << fname << "' not found!" << endl; 997 return ;997 return kFALSE; 998 998 } 999 999 … … 1013 1013 if (!line.EndsWith(".txt")) 1014 1014 { 1015 cout << "WARNING : " << line << endl;1015 cout << "WARNING - Wring extension: " << line << endl; 1016 1016 continue; 1017 1017 } 1018 1018 1019 LoadStars(line); 1020 } 1021 } 1022 1023 1024 void LoadStars(TString fname="tpoint.txt") 1025 { 1026 if (fname.EndsWith(".col")) 1027 { 1028 LoadCollection(fname); 1029 fFileNameStars = fname; 1030 return; 1031 } 1032 1019 if (!LoadStarFile(line)) 1020 return kFALSE; 1021 } 1022 return kTRUE; 1023 } 1024 1025 Bool_t LoadStarFile(TString fname) 1026 { 1033 1027 const Int_t size = fOriginal.GetSize(); 1034 1028 … … 1041 1035 { 1042 1036 cout << "File '" << fname << "' not found!" << endl; 1043 return ;1037 return kFALSE; 1044 1038 } 1045 1039 … … 1059 1053 cout << " (Total=" << fOriginal.GetSize() << ")" << endl; 1060 1054 1055 return kTRUE; 1056 } 1057 1058 Bool_t LoadStars(TString fname="tpoint.txt") 1059 { 1060 const Bool_t iscol = fname.EndsWith(".col"); 1061 1062 const Bool_t rc = iscol ? LoadCollection(fname) : LoadStarFile(fname); 1063 if (!rc) 1064 return kFALSE; 1065 1061 1066 fFileNameStars = fname; 1067 SetWindowName(fname); 1068 1069 return kTRUE; 1062 1070 } 1063 1071
Note:
See TracChangeset
for help on using the changeset viewer.