Changeset 1819 for trunk/MagicSoft/Cosy/tpoint
- Timestamp:
- 03/12/03 14:41:29 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/tpoint/tpointfit.C
r1810 r1819 27 27 friend ifstream &operator>>(ifstream &fin, Set &set); 28 28 private: 29 Double_t fOrigStarAz;30 Double_t fOrigStarEl;31 32 29 Double_t fStarAz; 33 30 Double_t fStarEl; … … 47 44 Double_t GetResidual() const 48 45 { 49 Double_t del = fRawEl-fStarEl; 50 Double_t daz = fRawAz-fStarAz; 51 52 Double_t dphi2 = daz/2.; 53 Double_t cos2 = cos(dphi2)*cos(dphi2); 54 Double_t sin2 = sin(dphi2)*sin(dphi2); 55 Double_t d = cos(del)*cos2 - cos(2*fOrigStarEl+del)*sin2; 56 57 Double_t dist = acos(d); 58 59 return dist * 180 / TMath::Pi(); 46 Double_t del = fRawEl-fStarEl; 47 Double_t daz = fRawAz-fStarAz; 48 Double_t dphi2 = daz/2.; 49 Double_t cos2 = cos(dphi2)*cos(dphi2); 50 Double_t sin2 = sin(dphi2)*sin(dphi2); 51 Double_t d = cos(del)*cos2 - cos(fRawEl+fStarEl)*sin2; 52 53 Double_t dist = acos(d); 54 55 return dist * 180 / TMath::Pi(); 60 56 } 61 57 … … 112 108 set.fStarEl = v[1]*TMath::Pi()/180; 113 109 114 set.fOrigStarAz = v[0]*TMath::Pi()/180;115 set.fOrigStarEl = v[1]*TMath::Pi()/180;116 117 110 set.fRawAz = v[2]*TMath::Pi()/180; 118 111 set.fRawEl = v[3]*TMath::Pi()/180; … … 284 277 phi0 += scale*d; 285 278 phi1 -= scale*d; 286 } 287 288 DrawPolLine(pad, r0, phi0, r1, phi1); 289 DrawMarker(pad, r0, phi0, r1, phi1); 279 280 DrawPolLine(pad, r0, phi0, r1, phi1); 281 DrawMarker(pad, r0, phi0, r1, phi1); 282 } 283 else 284 DrawMarker(pad, r1, phi1, 0 ,0); 290 285 } 291 286 … … 296 291 gCoordinates.SetOwner(); 297 292 298 TH1F hres1("Res1", " Residuals before correction ", 10, 0, 180);299 TH1F hres2("Res2", " Residuals after correction ", 10, 0, 1);293 TH1F hres1("Res1", " Residuals before correction ", 10, 0, 4); 294 TH1F hres2("Res2", " Residuals after correction ", 40, 0, 4); 300 295 301 296 hres1.SetXTitle("\\Delta [\\circ]"); … … 316 311 gzd.SetTitle(" \\Delta Zd vs. Zd "); 317 312 318 ifstream fin(" tpoint/tpoint3.txt");313 ifstream fin("/home/tbretz/pc4/results/tpoint3.txt"); 319 314 320 315 while (fin && fin.get()!='\n'); … … 395 390 396 391 // 392 // Correct for Offsets only 393 // 394 double par[16]; 395 bending.GetParameters(par); 396 for (int i=2; i<16; i++) par[i]=0; 397 MBending b2; 398 b2.SetParameters(par); 399 400 // 397 401 // Calculate correction and residuals 398 402 // … … 403 407 ZdAz za = set0.GetStarZdAz()*kRad2Deg; 404 408 405 hres1.Fill(set0.GetResidual()); 409 // 410 // Correct for offsets only 411 // 412 Set set1(set0); 413 set1.Adjust(b2); 414 415 hres1.Fill(set1.GetResidual()); 416 406 417 set0.Adjust(bending); 407 418 hres2.Fill(set0.GetResidual()); … … 412 423 413 424 static int j=0; 414 gdzd.SetPoint(j, za.Az() /* set0.GetStarAz()*/, set0.GetDZd());415 gaz.SetPoint( j, za.Az() /* set0.GetStarAz()*/, dz);416 gdaz.SetPoint(j, za.Zd() /*90-set0.GetStarEl()*/, dz);417 gzd.SetPoint( j, za.Zd() /*90-set0.GetStarEl()*/, set0.GetDZd());425 gdzd.SetPoint(j, za.Az(), set0.GetDZd()); 426 gaz.SetPoint( j, za.Az(), dz); 427 gdaz.SetPoint(j, za.Zd(), dz); 428 gzd.SetPoint( j, za.Zd(), set0.GetDZd()); 418 429 j++; 419 430 } … … 463 474 cout << "Spead after: " << hres2.GetMean() << "deg +- " << hres2.GetRMS() << "deg" << endl; 464 475 cout << "Spead before: " << (int)(hres1.GetMean()*60+.5) << "' +- " << (int)(hres1.GetRMS()*60+.5) << "'" << endl; 476 cout << "Spead before: " << (int)(hres1.GetMean()*60*60/23.4+.5) << "pix +- " << (int)(hres1.GetRMS()*60*60/23.4+.5) << "pix" << endl; 465 477 cout << "Spead after: " << (int)(hres2.GetMean()*60+.5) << "' +- " << (int)(hres2.GetRMS()*60+.5) << "'" << endl; 478 cout << "Spead after: " << (int)(hres2.GetMean()*60*60/23.4+.5) << "pix +- " << (int)(hres2.GetRMS()*60*60/23.4+.5) << "pix" << endl; 466 479 cout << "Spead after: " << (int)(hres2.GetMean()*16384/360+.5) << "SE +- " << (int)(hres2.GetRMS()*16384/360+.5) << "SE" << endl; 467 480 cout << endl; … … 505 518 gPad->Update(); 506 519 for (int i=0; i<gCoordinates.GetSize(); i++) 507 DrawSet(gPad, *(Set*)list.At(i) , 10./hres1.GetMean());520 DrawSet(gPad, *(Set*)list.At(i));//, 10./hres1.GetMean()); 508 521 509 522 c1->cd(3);
Note:
See TracChangeset
for help on using the changeset viewer.