Changeset 4617 for trunk/MagicSoft/Cosy/tpoint/gui.C
- Timestamp:
- 08/16/04 10:44:26 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/tpoint/gui.C
r4587 r4617 41 41 Double_t fRawEl; 42 42 43 Double_t fMag; 43 44 public: 44 45 Set(Double_t sel=0, Double_t saz=0, Double_t rel=0, Double_t raz=0) : … … 46 47 fStarEl(sel*TMath::DegToRad()), 47 48 fRawAz(raz*TMath::DegToRad()), 48 fRawEl(rel*TMath::DegToRad()) 49 { 50 } 51 49 fRawEl(rel*TMath::DegToRad()), fMag(-25) 50 { 51 } 52 53 Double_t GetMag() const { return fMag; } 52 54 Double_t GetResidual(Double_t *err=0) const 53 55 { … … 102 104 fRawAz = set.fRawAz; 103 105 fRawEl = set.fRawEl; 106 fMag = set.fMag; 104 107 } 105 108 … … 150 153 } while (str[0]=='#'); 151 154 152 Float_t v[4]; 153 sscanf(str.Data(), "%f %f %f %f", v, v+1, v+2, v+3); 155 Float_t v[4], mag; 156 Int_t n = sscanf(str.Data(), "%f %f %f %f %*f %*f %*f %*f %*f %*f %f", v, v+1, v+2, v+3, &mag); 157 if (n<4) 158 { 159 cout << "Read: ERROR - Not enough numbers" << endl; 160 return fin; 161 } 162 set.fMag = n<5 ? -25 : mag; 154 163 155 164 set.fStarAz = v[0]*TMath::DegToRad(); … … 404 413 TGraph graz; 405 414 TGraph grzd; 415 TGraph grmag; 416 TGraph gmaz; 417 TGraph gmzd; 406 418 407 419 gdaz.SetTitle(" \\Delta Az vs. Zd "); … … 411 423 gzd.SetTitle(" \\Delta Zd vs. Zd "); 412 424 425 gmaz.SetTitle(" \\Delta Az vs. Mag "); 426 gmzd.SetTitle(" \\Delta Zd vs. Mag "); 427 413 428 graz.SetTitle(" \\Delta vs. Az "); 414 429 grzd.SetTitle(" \\Delta vs. Zd "); 430 grmag.SetTitle(" \\Delta vs. Mag "); 415 431 416 432 TMinuit minuit(MBending::GetNumPar()); //initialize TMinuit with a maximum of 5 params … … 502 518 gaz.SetPoint( i, za.Az(), dz); 503 519 gzd.SetPoint( i, za.Zd(), set0.GetDZd()); 520 if (set0.GetMag()>=-20) 521 { 522 grmag.SetPoint(i, set0.GetMag(), set0.GetResidual()); 523 gmaz.SetPoint( i, set0.GetMag(), dz); 524 gmzd.SetPoint( i, set0.GetMag(), set0.GetDZd()); 525 } 504 526 } 505 527 … … 577 599 gdaz.SetMaximum(absmax1); 578 600 gdzd.SetMaximum(absmax2); 601 gmaz.SetMaximum(absmax1); 602 gmzd.SetMaximum(absmax2); 579 603 graz.SetMaximum(absmax3); 580 604 grzd.SetMaximum(absmax3); 605 grmag.SetMaximum(absmax3); 581 606 gaz.SetMinimum(-absmax1); 582 607 gzd.SetMinimum(-absmax2); 583 608 gdaz.SetMinimum(-absmax1); 584 609 gdzd.SetMinimum(-absmax2); 610 gmaz.SetMinimum(-absmax1); 611 gmzd.SetMinimum(-absmax2); 585 612 graz.SetMinimum(0); 586 613 grzd.SetMinimum(0); 614 grmag.SetMinimum(0); 587 615 588 616 c1=new TCanvas("CanvGraphs", "Graphs"); 589 c1->Divide( 2,3,0,0);617 c1->Divide(3,3,0,0); 590 618 591 619 TLine line; … … 615 643 line.DrawLine(g->GetXaxis()->GetXmin(), -360./16384, g->GetXaxis()->GetXmax(), -360./16384); 616 644 cout << "Mean dAz: " << g->GetMean(2) << " \xb1 " << g->GetRMS(2) << endl; 617 645 618 646 c1->cd(3); 647 gPad->SetBorderMode(0); 648 gPad->SetGridx(); 649 gPad->SetGridy(); 650 g=(TGraph*)gmaz.DrawClone("A*"); 651 g->SetBit(kCanDelete); 652 g->GetHistogram()->SetXTitle("Mag"); 653 g->GetHistogram()->SetYTitle("\\Delta Az [\\circ]"); 654 line.DrawLine(g->GetXaxis()->GetXmin(), 360./16384, g->GetXaxis()->GetXmax(), 360./16384); 655 line.DrawLine(g->GetXaxis()->GetXmin(), -360./16384, g->GetXaxis()->GetXmax(), -360./16384); 656 657 c1->cd(4); 619 658 gPad->SetBorderMode(0); 620 659 gPad->SetGridx(); … … 629 668 cout << endl; 630 669 631 c1->cd( 4);670 c1->cd(5); 632 671 gPad->SetBorderMode(0); 633 672 gPad->SetGridx(); … … 640 679 line.DrawLine(g->GetXaxis()->GetXmin(), -360./16384, g->GetXaxis()->GetXmax(), -360./16384); 641 680 642 c1->cd(5); 681 c1->cd(6); 682 gPad->SetBorderMode(0); 683 gPad->SetGridx(); 684 gPad->SetGridy(); 685 g=(TGraph*)gmzd.DrawClone("A*"); 686 g->SetBit(kCanDelete); 687 g->GetHistogram()->SetXTitle("Mag"); 688 g->GetHistogram()->SetYTitle("\\Delta Zd [\\circ]"); 689 line.DrawLine(g->GetXaxis()->GetXmin(), 360./16384, g->GetXaxis()->GetXmax(), 360./16384); 690 line.DrawLine(g->GetXaxis()->GetXmin(), -360./16384, g->GetXaxis()->GetXmax(), -360./16384); 691 692 c1->cd(7); 643 693 gPad->SetBorderMode(0); 644 694 gPad->SetGridx(); … … 650 700 line.DrawLine(g->GetXaxis()->GetXmin(), 360./16384, g->GetXaxis()->GetXmax(), 360./16384); 651 701 652 c1->cd( 6);702 c1->cd(8); 653 703 gPad->SetBorderMode(0); 654 704 gPad->SetGridx(); … … 660 710 line.DrawLine(g->GetXaxis()->GetXmin(), 360./16384, g->GetXaxis()->GetXmax(), 360./16384); 661 711 712 c1->cd(9); 713 gPad->SetBorderMode(0); 714 gPad->SetGridx(); 715 gPad->SetGridy(); 716 g=(TGraph*)grmag.DrawClone("A*"); 717 g->SetBit(kCanDelete); 718 g->GetHistogram()->SetXTitle("Mag"); 719 g->GetHistogram()->SetYTitle("\\Delta [\\circ]"); 720 line.DrawLine(g->GetXaxis()->GetXmin(), 360./16384, g->GetXaxis()->GetXmax(), 360./16384); 662 721 663 722 … … 784 843 // Opens an open dialog 785 844 // 786 TString OpenDialog( )845 TString OpenDialog(EFileDialogMode mode=kFDOpen) 787 846 { 788 847 static const char *gOpenTypes[] = … … 800 859 fi.fIniDir = StrDup(dir); 801 860 802 new TGFileDialog(fClient->GetRoot(), this, kFDOpen, &fi);861 new TGFileDialog(fClient->GetRoot(), this, mode, &fi); 803 862 804 863 if (!fi.fFilename) … … 833 892 return kTRUE; 834 893 case kTbLoad: 835 fBending.Load( "bending_new.txt");894 fBending.Load(OpenDialog()); 836 895 DisplayBending(); 837 896 return kTRUE; 838 897 case kTbSave: 839 fBending.Save( "bending_new.txt");898 fBending.Save(OpenDialog(kFDSave)); 840 899 return kTRUE; 841 900 case kTbLoadStars: … … 1041 1100 ((TGCheckButton*)fList->FindWidget(0))->SetState(kButtonDown); 1042 1101 ((TGCheckButton*)fList->FindWidget(1))->SetState(kButtonDown); 1043 ((TGCheckButton*)fList->FindWidget(3))->SetState(kButtonDown);1044 ((TGCheckButton*)fList->FindWidget(4))->SetState(kButtonDown);1045 ((TGCheckButton*)fList->FindWidget(5))->SetState(kButtonDown);1046 1102 ((TGCheckButton*)fList->FindWidget(6))->SetState(kButtonDown); 1047 ((TGCheckButton*)fList->FindWidget(7))->SetState(kButtonDown); 1103 ((TGCheckButton*)fList->FindWidget(10))->SetState(kButtonDown); 1104 ((TGCheckButton*)fList->FindWidget(12))->SetState(kButtonDown); 1105 ((TGCheckButton*)fList->FindWidget(17))->SetState(kButtonDown); 1048 1106 1049 1107 SetWindowName("TPoint Fitting Window");
Note:
See TracChangeset
for help on using the changeset viewer.