- Timestamp:
- 08/23/04 13:26:22 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mtemp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/MHTelAxisFromStars.cc
r4560 r4705 48 48 #include "MBinning.h" 49 49 50 #include "MStar LocalCam.h"51 #include "MStar LocalPos.h"50 #include "MStarCam.h" 51 #include "MStarPos.h" 52 52 #include "MSkyCamTrans.h" 53 53 #include "MSrcPosCam.h" … … 78 78 fNdoF->SetYTitle("Counts"); 79 79 80 fLog10Chi2 = new TH1D("log10Chi2", "log10Chi2", 60, -10, 5); 81 fLog10Chi2->SetDirectory(NULL); 82 fLog10Chi2->SetXTitle("log10(Chi2)"); 83 fLog10Chi2->SetYTitle("Counts"); 84 80 85 fChi2Prob = new TH1D("Chi2-Prob", "Chi2 probability", 40, 0.0, 1.0); 81 86 fChi2Prob->SetDirectory(NULL); … … 103 108 104 109 fShift = new TH2D("Shift", "Sky-Cam transformnation : (x,y) shift", 105 51, -445, 445, 51, -445, 445);110 72, -534.0707, 534.0707, 72, -534.0707, 534.0707); 106 111 fShift->SetDirectory(NULL); 107 112 fShift->SetZTitle("Counts"); … … 111 116 112 117 fEstPos1 = new TH2D("EstPos1", "Estimated position1", 113 51, -445, 445, 51, -445, 445);118 72, -534.0707, 534.0707, 72, -534.0707, 534.0707); 114 119 fEstPos1->SetDirectory(NULL); 115 120 fEstPos1->SetZTitle("Counts"); 116 fEstPos1->SetXTitle("Estimated position1 x [\\circ]");117 fEstPos1->SetYTitle("Estimated position1 y [\\circ]");121 fEstPos1->SetXTitle("Estimated position1 x [\\circ]"); 122 fEstPos1->SetYTitle("Estimated position1 y [\\circ]"); 118 123 119 124 fEstPos2 = new TH2D("EstPos2", "Estimated position2", 120 51, -445, 445, 51, -445, 445);125 72, -534.0707, 534.0707, 72, -534.0707, 534.0707); 121 126 fEstPos2->SetDirectory(NULL); 122 127 fEstPos2->SetZTitle("Counts"); 123 fEstPos2->SetXTitle("Estimated position2 x [\\circ]"); 124 fEstPos2->SetYTitle("Estimated position2 y [\\circ]"); 125 126 // default input type : results from correlated Gauss fit 127 fInputType = 2; 128 fEstPos2->SetXTitle("Estimated position2 x [\\circ]"); 129 fEstPos2->SetYTitle("Estimated position2 y [\\circ]"); 130 131 fEstPos3 = new TH2D("EstPos3", "Estimated position3", 132 72, -534.0707, 534.0707, 72, -534.0707, 534.0707); 133 fEstPos3->SetDirectory(NULL); 134 fEstPos3->SetZTitle("Counts"); 135 fEstPos3->SetXTitle("Estimated position3 x [\\circ]"); 136 fEstPos3->SetYTitle("Estimated position3 y [\\circ]"); 137 138 139 // default input type : results from Gauss fit 140 fInputType = 1; 128 141 } 129 142 … … 133 146 // 134 147 // type = 0 calculated star positions (by averaging) 135 // type = 1 fitted star positions (by uncorrelated Gauss fit) 136 // type = 2 fitted star positions (by correlated Gauss fit) 148 // type = 1 fitted star positions (by Gauss fit) 137 149 // 138 150 void MHTelAxisFromStars::SetInputType(Int_t type) … … 151 163 MHTelAxisFromStars::~MHTelAxisFromStars() 152 164 { 165 //*fLog << "MHTelAxisFromStars::Destructor" << endl; 166 153 167 delete fNStars; 154 168 delete fNdoF; 169 delete fLog10Chi2; 155 170 delete fChi2Prob; 156 171 delete fNumIter; … … 161 176 delete fEstPos1; 162 177 delete fEstPos2; 178 delete fEstPos3; 163 179 } 164 180 … … 177 193 { 178 194 179 fStar LocalCam = (MStarLocalCam*)plist->FindObject("MStarLocalCam", "MStarLocalCam");180 if (!fStar LocalCam)195 fStarCam = (MStarCam*)plist->FindObject("MStarCam", "MStarCam"); 196 if (!fStarCam) 181 197 { 182 *fLog << err << "MHTelAxisFromStars::SetupFill; container 'MStar LocalCam' not found... aborting." << endl;198 *fLog << err << "MHTelAxisFromStars::SetupFill; container 'MStarCam' not found... aborting." << endl; 183 199 return kFALSE; 184 200 } 185 201 186 202 187 fSource LocalCam = (MStarLocalCam*)plist->FindObject("MSourceLocalCam", "MStarLocalCam");188 if (!fSource LocalCam)203 fSourceCam = (MStarCam*)plist->FindObject("MSourceCam", "MStarCam"); 204 if (!fSourceCam) 189 205 { 190 *fLog << err << "MHTelAxisFromStars::SetupFill; container 'MSourceLocalCam' not found... aborting." << endl; 191 return kFALSE; 206 *fLog << err << "MHTelAxisFromStars::SetupFill; container 'MSourceCam' not found... " << endl; 192 207 } 193 208 … … 226 241 ApplyBinning(*plist, "NStars", fNStars); 227 242 ApplyBinning(*plist, "NdoF", fNdoF); 243 ApplyBinning(*plist, "Log10Chi2",fLog10Chi2); 228 244 ApplyBinning(*plist, "Chi2Prob", fChi2Prob); 229 245 ApplyBinning(*plist, "NumIter", fNumIter); … … 244 260 SetBinning(fEstPos1, &b, &b); 245 261 SetBinning(fEstPos2, &b, &b); 262 SetBinning(fEstPos3, &b, &b); 246 263 } 247 264 else … … 250 267 SetBinning(fEstPos1, bins, bins); 251 268 SetBinning(fEstPos2, bins, bins); 252 } 253 254 //----------------------------------------------- 255 // copy names from MStarLocalCam to the histograms 256 MStarLocalPos *starSource = 0; 257 TIter nextSource(fSourceLocalCam->GetList()); 258 259 starSource = (MStarLocalPos*)nextSource(); 260 if (starSource) 261 { 262 fEstPos1->SetName(starSource->GetName()); 263 264 starSource = (MStarLocalPos*)nextSource(); 269 SetBinning(fEstPos3, bins, bins); 270 } 271 272 273 // copy names from MStarCam to the histograms 274 if (fSourceCam) 275 { 276 *fLog << "Source container exists " << endl; 277 278 MStarPos *starSource = 0; 279 TIter nextSource(fSourceCam->GetList()); 280 281 *fLog << "&nextSource = " << &nextSource << endl; 282 283 starSource = (MStarPos*)nextSource(); 265 284 if (starSource) 266 fEstPos2->SetName(starSource->GetName()); 267 } 285 { 286 *fLog << "name of source container1 : " << starSource->GetName() 287 << endl; 288 289 fEstPos1->SetName(starSource->GetName()); 290 291 starSource = (MStarPos*)nextSource(); 292 if (starSource) 293 { 294 *fLog << "name of source container2 : " << starSource->GetName() 295 << endl; 296 297 298 fEstPos2->SetName(starSource->GetName()); 299 300 starSource = (MStarPos*)nextSource(); 301 if (starSource) 302 { 303 304 *fLog << "name of source container3 : " << starSource->GetName() 305 << endl; 306 307 fEstPos3->SetName(starSource->GetName()); 308 } 309 } 310 } 311 } 312 268 313 269 314 return kTRUE; … … 317 362 MH::ScaleAxis(fEstPos1, scale, scale); 318 363 MH::ScaleAxis(fEstPos2, scale, scale); 364 MH::ScaleAxis(fEstPos3, scale, scale); 319 365 320 366 if (mmscale) … … 328 374 fEstPos2->SetXTitle("Estimated position2 x [mm]"); 329 375 fEstPos2->SetYTitle("Estimated position2 y [mm]"); 376 377 fEstPos3->SetXTitle("Estimated position3 x [mm]"); 378 fEstPos3->SetYTitle("Estimated position3 y [mm]"); 330 379 } 331 380 else … … 339 388 fEstPos2->SetXTitle("Estimated position2 x [\\circ]"); 340 389 fEstPos2->SetYTitle("Estimated position2 y [\\circ]"); 390 391 fEstPos3->SetXTitle("Estimated position3 x [\\circ]"); 392 fEstPos3->SetYTitle("Estimated position3 y [\\circ]"); 341 393 } 342 394 … … 358 410 359 411 360 fNStars ->Fill(fSkyCamTrans->GetNStars(), w); 361 fNdoF ->Fill(fSkyCamTrans->GetNdof(), w); 362 fChi2Prob ->Fill(fSkyCamTrans->GetChiSquareProb(), w); 363 fNumIter ->Fill(fSkyCamTrans->GetNumIter(), w); 364 fLambda ->Fill(fSkyCamTrans->GetLambda(), w); 365 fAlfa ->Fill(fSkyCamTrans->GetAlfa(), w); 412 fNStars ->Fill(fSkyCamTrans->GetNStars(), w); 413 fNdoF ->Fill(fSkyCamTrans->GetNdof(), w); 414 if (fSkyCamTrans->GetChiSquare() > 0.0) 415 fLog10Chi2->Fill( log10(fSkyCamTrans->GetChiSquare() ), w); 416 fChi2Prob ->Fill(fSkyCamTrans->GetChiSquareProb(), w); 417 fNumIter ->Fill(fSkyCamTrans->GetNumIter(), w); 418 fLambda ->Fill(fSkyCamTrans->GetLambda(), w); 419 fAlfa ->Fill(fSkyCamTrans->GetAlfa(), w); 366 420 367 421 … … 390 444 } 391 445 392 393 MStarLocalPos *starSource = 0; 394 TIter nextSource(fSourceLocalCam->GetList()); 395 396 starSource = (MStarLocalPos*)nextSource(); 397 if (starSource) 398 { 399 if (fInputType == 2) 400 { 401 x = scale * starSource->GetMeanXCGFit(); 402 y = scale * starSource->GetMeanYCGFit(); 403 } 404 else if (fInputType == 1) 405 { 406 x = scale * starSource->GetMeanXFit(); 407 y = scale * starSource->GetMeanYFit(); 408 } 409 else 410 { 411 x = scale * starSource->GetMeanXCalc(); 412 y = scale * starSource->GetMeanYCalc(); 413 } 414 415 if (x>lowx && x<higx && y>lowy && y<higy) 416 { 417 fEstPos1 ->Fill(x, y, w); 418 } 419 420 421 starSource = (MStarLocalPos*)nextSource(); 446 if (fSourceCam) 447 { 448 MStarPos *starSource = 0; 449 TIter nextSource(fSourceCam->GetList()); 450 451 starSource = (MStarPos*)nextSource(); 422 452 if (starSource) 423 453 { 424 if (fInputType == 2) 425 { 426 x = scale * starSource->GetMeanXCGFit(); 427 y = scale * starSource->GetMeanYCGFit(); 428 } 429 else if (fInputType == 1) 454 if (fInputType == 1) 430 455 { 431 456 x = scale * starSource->GetMeanXFit(); … … 440 465 if (x>lowx && x<higx && y>lowy && y<higy) 441 466 { 442 fEstPos2 ->Fill(x, y, w); 467 fEstPos1 ->Fill(x, y, w); 468 //fEstPos1->SetName(starSource->GetName()); 469 } 470 471 472 starSource = (MStarPos*)nextSource(); 473 if (starSource) 474 { 475 if (fInputType == 1) 476 { 477 x = scale * starSource->GetMeanXFit(); 478 y = scale * starSource->GetMeanYFit(); 479 } 480 else 481 { 482 x = scale * starSource->GetMeanXCalc(); 483 y = scale * starSource->GetMeanYCalc(); 484 } 485 486 if (x>lowx && x<higx && y>lowy && y<higy) 487 { 488 fEstPos2 ->Fill(x, y, w); 489 //fEstPos2->SetName(starSource->GetName()); 490 } 491 492 starSource = (MStarPos*)nextSource(); 493 if (starSource) 494 { 495 if (fInputType == 1) 496 { 497 x = scale * starSource->GetMeanXFit(); 498 y = scale * starSource->GetMeanYFit(); 499 } 500 else 501 { 502 x = scale * starSource->GetMeanXCalc(); 503 y = scale * starSource->GetMeanYCalc(); 504 } 505 506 if (x>lowx && x<higx && y>lowy && y<higy) 507 { 508 fEstPos3 ->Fill(x, y, w); 509 //fEstPos3->SetName(starSource->GetName()); 510 } 511 } 443 512 } 444 513 } … … 457 526 Bool_t MHTelAxisFromStars::Finalize() 458 527 { 528 //*fLog << "MHTelAxisFromStars::Finalize; fSourceCam = " 529 // << fSourceCam << endl; 459 530 460 531 return kTRUE; … … 475 546 AppendPad(""); 476 547 477 //TCanvas *pad = new TCanvas("TelAxisFromStars", "TelAxis plots", 900, 900);548 //TCanvas *pad = new TCanvas("TelAxisFromStars", "TelAxis plots", 1200, 900); 478 549 //gROOT->SetSelectedPad(NULL); 479 550 480 pad->Divide( 3,3);551 pad->Divide(4,3); 481 552 482 553 pad->cd(1); … … 490 561 pad->cd(3); 491 562 gPad->SetBorderMode(0); 492 f Chi2Prob->Draw(opt);563 fLog10Chi2->Draw(opt); 493 564 494 565 pad->cd(4); 495 566 gPad->SetBorderMode(0); 496 f NumIter->Draw(opt);567 fChi2Prob->Draw(opt); 497 568 498 569 pad->cd(5); 499 570 gPad->SetBorderMode(0); 500 f Lambda->Draw(opt);571 fNumIter->Draw(opt); 501 572 502 573 pad->cd(6); 503 574 gPad->SetBorderMode(0); 575 fLambda->Draw(opt); 576 577 pad->cd(7); 578 gPad->SetBorderMode(0); 504 579 fAlfa->Draw(opt); 505 580 506 pad->cd( 7);581 pad->cd(8); 507 582 gPad->SetBorderMode(0); 508 583 //SetColors(); … … 510 585 fShift->Draw(""); 511 586 512 pad->cd(8); 513 gPad->SetBorderMode(0); 514 //SetColors(); 515 fEstPos1->Draw(""); 516 517 pad->cd(9); 518 gPad->SetBorderMode(0); 519 //SetColors(); 520 fEstPos2->Draw(""); 587 588 //----------------------------------------------- 589 // plot the expected positions of some sources 590 *fLog << "fSourcsCam = " << fSourceCam << endl; 591 592 /* 593 // copy names from MStarCam to the histograms 594 if (fSourceCam) 595 { 596 *fLog << "Source container exists " << endl; 597 598 MStarPos *starSource = 0; 599 TIter nextSource(fSourceCam->GetList()); 600 601 *fLog << "&nextSource = " << &nextSource << endl; 602 603 starSource = (MStarPos*)nextSource(); 604 if (starSource) 605 { 606 *fLog << "name of source container1 : " << starSource->GetName() 607 << endl; 608 609 fEstPos1->SetName(starSource->GetName()); 610 611 starSource = (MStarPos*)nextSource(); 612 if (starSource) 613 { 614 *fLog << "name of source container2 : " << starSource->GetName() 615 << endl; 616 617 618 fEstPos2->SetName(starSource->GetName()); 619 620 starSource = (MStarPos*)nextSource(); 621 if (starSource) 622 { 623 624 *fLog << "name of source container3 : " << starSource->GetName() 625 << endl; 626 627 fEstPos3->SetName(starSource->GetName()); 628 } 629 } 630 } 631 } 632 */ 633 634 635 if (fSourceCam) 636 { 637 *fLog << "MHTelAxisFromSrars::Draw; plotting" << endl; 638 639 pad->cd(9); 640 gPad->SetBorderMode(0); 641 //SetColors(); 642 fEstPos1->Draw(""); 643 644 pad->cd(10); 645 gPad->SetBorderMode(0); 646 //SetColors(); 647 fEstPos2->Draw(""); 648 649 pad->cd(11); 650 gPad->SetBorderMode(0); 651 //SetColors(); 652 fEstPos3->Draw(""); 653 } 521 654 522 655 pad->Modified(); … … 533 666 if (name.Contains("NdoF", TString::kIgnoreCase)) 534 667 return fNdoF; 668 if (name.Contains("Log10Chi2", TString::kIgnoreCase)) 669 return fLog10Chi2; 535 670 if (name.Contains("Chi2Prob", TString::kIgnoreCase)) 536 671 return fChi2Prob; … … 548 683 if (name.Contains("EstPos2", TString::kIgnoreCase)) 549 684 return fEstPos2; 685 if (name.Contains("EstPos3", TString::kIgnoreCase)) 686 return fEstPos3; 550 687 551 688 return NULL; -
trunk/MagicSoft/Mars/mtemp/MHTelAxisFromStars.h
r4560 r4705 11 11 class MSrcPosCam; 12 12 class MSkyCamTrans; 13 class MStar LocalCam;13 class MStarCam; 14 14 15 15 class MHTelAxisFromStars : public MH … … 19 19 TH1D *fNStars; //-> Number of stars 20 20 TH1D *fNdoF; //-> Number of degrees of freedom 21 TH1D *fLog10Chi2; //-> log10(Chi2) 21 22 TH1D *fChi2Prob; //-> Chi2 probability 22 23 TH1D *fNumIter; //-> Number of iterations … … 27 28 TH2D *fEstPos1; //-> Estimated position 1 28 29 TH2D *fEstPos2; //-> Estimated position 2 30 TH2D *fEstPos3; //-> Estimated position 3 29 31 30 MStar LocalCam *fStarLocalCam; //!31 MStar LocalCam *fSourceLocalCam; //!32 MSrcPosCam *fSrcPos; 33 MSkyCamTrans *fSkyCamTrans; 32 MStarCam *fStarCam; //! 33 MStarCam *fSourceCam; 34 MSrcPosCam *fSrcPos; //! 35 MSkyCamTrans *fSkyCamTrans; //! 34 36 35 37 … … 58 60 TH1D *GetHistNStars() { return fNStars; } 59 61 TH1D *GetHistNdoF() { return fNdoF; } 62 TH1D *GetHistLog10Chi2() { return fLog10Chi2; } 60 63 TH1D *GetHistChi2Prob() { return fChi2Prob; } 61 64 … … 68 71 TH2D *GetHistEstPos1() { return fEstPos1; } 69 72 TH2D *GetHistEstPos2() { return fEstPos2; } 73 TH2D *GetHistEstPos3() { return fEstPos3; } 70 74 71 75 void Draw(Option_t *opt=NULL); -
trunk/MagicSoft/Mars/mtemp/MTelAxisFromStars.cc
r4545 r4705 34 34 // 35 35 // Input Containers : 36 // MStar LocalCam[MStarLocalCam], MStarLocalCamSource[MStarLocalCam]36 // MStarCam[MStarCam], MStarCamSource[MStarCam] 37 37 // 38 38 // Output Containers : … … 53 53 #include "MLogManip.h" 54 54 55 #include "MStar LocalCam.h"56 #include "MStar LocalPos.h"55 #include "MStarCam.h" 56 #include "MStarPos.h" 57 57 #include "MSkyCamTrans.h" 58 58 … … 78 78 fFixedRotationAngle = 0.0; 79 79 80 // default type of input is : the result of the correlatedGauss fit80 // default type of input is : the result of the Gauss fit 81 81 // type 0 : result from the weighted average 82 // type 1 : result from the uncorrelatedGauss fit83 fInputType = 2;82 // type 1 : result from the Gauss fit 83 fInputType = 1; 84 84 } 85 85 … … 100 100 { 101 101 102 fStar LocalCam = (MStarLocalCam*)pList->FindObject("MStarLocalCam", "MStarLocalCam");103 if (!fStar LocalCam)102 fStarCam = (MStarCam*)pList->FindObject("MStarCam", "MStarCam"); 103 if (!fStarCam) 104 104 { 105 *fLog << err << "MTelAxisFromStars::PreProcess; container 'MStar LocalCam' not found... aborting." << endl;105 *fLog << err << "MTelAxisFromStars::PreProcess; container 'MStarCam' not found... aborting." << endl; 106 106 return kFALSE; 107 107 } 108 108 109 109 110 fSource LocalCam = (MStarLocalCam*)pList->FindObject("MSourceLocalCam", "MStarLocalCam");111 if (!fSource LocalCam)110 fSourceCam = (MStarCam*)pList->FindObject("MSourceCam", "MStarCam"); 111 if (!fSourceCam) 112 112 { 113 *fLog << err << "MTelAxisFromStars::PreProcess; container 'MSource LocalCam' not found... continue " << endl;113 *fLog << err << "MTelAxisFromStars::PreProcess; container 'MSourceCam' not found... continue " << endl; 114 114 } 115 115 … … 138 138 // 139 139 // type = 0 calculated star positions (by averaging) 140 // type = 1 fitted star positions (by uncorrelated Gauss fit) 141 // type = 2 fitted star positions (by correlated Gauss fit) 140 // type = 1 fitted star positions (by Gauss fit) 142 141 // 143 142 void MTelAxisFromStars::SetInputType(Int_t type) 144 143 { 145 *fLog << all << "MTelAxisFromStars::SetInputType; input type is set equal to : " 146 << type << endl; 144 *fLog << all << "MTelAxisFromStars::SetInputType; input type is set equal to : " 145 << type ; 146 if (type == 0) 147 *fLog << " (calculated star positions)" << endl; 148 else 149 *fLog << " (fitted star positions)" << endl; 147 150 148 151 fInputType = type; … … 197 200 198 201 // get the expected (axy[0], axy[1]) and the measured positions 199 // (bxy[0], bxy[1]) of stars in the camera from MStar LocalCam200 Int_t fNumStars = fStar LocalCam->GetNumStars();202 // (bxy[0], bxy[1]) of stars in the camera from MStarCam 203 Int_t fNumStars = fStarCam->GetNumStars(); 201 204 202 205 if (fNumStars <= 0) … … 229 232 Double_t fChi2Prob; 230 233 231 MStar LocalPos *star = 0;232 TIter next(fStar LocalCam->GetList());234 MStarPos *star = 0; 235 TIter next(fStarCam->GetList()); 233 236 Int_t ix = 0; 234 237 235 238 // loop over all stars 236 while ( (star = (MStar LocalPos*)next()) )239 while ( (star = (MStarPos*)next()) ) 237 240 { 238 241 axy[0][ix] = star->GetXExp(); … … 242 245 { 243 246 // values from averaging 244 bxy[0][ix] = star->GetMeanXCalc(); 245 bxy[1][ix] = star->GetMeanYCalc(); 246 exy[0][0][ix]= star->GetSigmaMinorAxisCalc()*star->GetSigmaMinorAxisCalc(); 247 exy[0][1][ix] = 0.0; 248 exy[1][0][ix] = 0.0; 249 exy[1][1][ix]= star->GetSigmaMajorAxisCalc()*star->GetSigmaMajorAxisCalc(); 247 bxy[0][ix] = star->GetMeanXCalc(); 248 bxy[1][ix] = star->GetMeanYCalc(); 249 250 // this is the error matrix for (MeanXCalc, MeanYCalc); 251 // this is the error matrix which should be used 252 exy[0][0][ix] = star->GetXXErrCalc(); 253 exy[0][1][ix] = star->GetXYErrCalc(); 254 exy[1][0][ix] = star->GetXYErrCalc(); 255 exy[1][1][ix] = star->GetYYErrCalc(); 256 257 //exy[0][0][ix] = star->GetSigmaXCalc()*star->GetSigmaXCalc(); 258 //exy[0][1][ix] = 0.0; 259 //exy[1][0][ix] = 0.0; 260 //exy[1][1][ix] = star->GetSigmaYCalc()*star->GetSigmaYCalc(); 250 261 } 251 262 252 263 else if (fInputType == 1) 253 264 { 254 // values from uncorrelatdGauss fit265 // values from Gauss fit 255 266 bxy[0][ix] = star->GetMeanXFit(); 256 267 bxy[1][ix] = star->GetMeanYFit(); 257 exy[0][0][ix]= star->GetSigmaMinorAxisFit()*star->GetSigmaMinorAxisFit(); 258 exy[0][1][ix] = 0.0; 259 exy[1][0][ix] = 0.0; 260 exy[1][1][ix]= star->GetSigmaMajorAxisFit()*star->GetSigmaMajorAxisFit(); 261 } 262 263 else if (fInputType == 2) 264 { 265 // values from correlatd Gauss fit 266 bxy[0][ix] = star->GetMeanXCGFit(); 267 bxy[1][ix] = star->GetMeanYCGFit(); 268 269 // this is the error matrix for (MeanXCGFit, MeanYCGFit); 268 269 // this is the error matrix for (MeanXFit, MeanYFit); 270 270 // this is the error matrix which should be used 271 exy[0][0][ix] = star->GetXXErr CGFit();272 exy[0][1][ix] = star->GetXYErr CGFit();273 exy[1][0][ix] = star->GetXYErr CGFit();274 exy[1][1][ix] = star->GetYYErr CGFit();275 276 // this is the error matrix constructed from SigmaX CGFit and SigmaYCGFit;271 exy[0][0][ix] = star->GetXXErrFit(); 272 exy[0][1][ix] = star->GetXYErrFit(); 273 exy[1][0][ix] = star->GetXYErrFit(); 274 exy[1][1][ix] = star->GetYYErrFit(); 275 276 // this is the error matrix constructed from SigmaXFit and SigmaYFit; 277 277 // it is used because the errors above are too small, at present 278 //exy[0][0][ix] = star->GetSigmaX CGFit() * star->GetSigmaXCGFit();279 //exy[0][1][ix] = star->GetCorrXY CGFit() *280 // star->GetSigmaX CGFit() * star->GetSigmaYCGFit();278 //exy[0][0][ix] = star->GetSigmaXFit() * star->GetSigmaXFit(); 279 //exy[0][1][ix] = star->GetCorrXYFit() * 280 // star->GetSigmaXFit() * star->GetSigmaYFit(); 281 281 //exy[1][0][ix] = exy[0][1][ix]; 282 //exy[1][1][ix] = star->GetSigmaY CGFit() * star->GetSigmaYCGFit();282 //exy[1][1][ix] = star->GetSigmaYFit() * star->GetSigmaYFit(); 283 283 } 284 284 … … 375 375 //-------------------------------------- 376 376 // Put the estimated position, obtained by transforming the expected 377 // position (0, 377 // position (0,0), into SrcPosCam 378 378 379 379 fSrcPos->SetXY(fD[0], fD[1]); … … 386 386 // and their error matrices esxy[2][2] 387 387 388 // get the expected positions (asxy[1], asxy[2]) from another MStarLocalCam 389 // container (with the name "MSourceLocalCam") 390 Int_t fNumStarsSource = fSourceLocalCam->GetNumStars(); 388 // get the expected positions (asxy[1], asxy[2]) from another MStarCam 389 // container (with the name "MSourceCam") 390 Int_t fNumStarsSource = 0; 391 392 if (fSourceCam) 393 fNumStarsSource = fSourceCam->GetNumStars(); 391 394 392 395 //*fLog << "MTelAxisFromStars::Process; fNumStarsSource = " … … 409 412 esxy[1][1].Set(fNumStarsSource); 410 413 411 MStar LocalPos *starSource = 0;412 TIter nextSource(fSource LocalCam->GetList());414 MStarPos *starSource = 0; 415 TIter nextSource(fSourceCam->GetList()); 413 416 ix = 0; 414 while ( (starSource = (MStar LocalPos*)nextSource()) )417 while ( (starSource = (MStarPos*)nextSource()) ) 415 418 { 416 419 asxy[0][ix] = starSource->GetXExp(); … … 422 425 TransSkyCam(fLambda, fA, fD, fErrD, asxy, bsxy, esxy); 423 426 424 // put the estimated positions into the MStarLocalPos container 425 TIter setnextSource(fSourceLocalCam->GetList()); 427 // put the estimated positions into the MStarCam container 428 // with name "MSourceCam" 429 TIter setnextSource(fSourceCam->GetList()); 426 430 ix = 0; 427 while ( (starSource = (MStarLocalPos*)setnextSource()) ) 428 { 429 if (fInputType == 1) 430 { 431 starSource->SetFitValues(100.0, 100.0, bsxy[0][ix], bsxy[1][ix], 432 sqrt(esxy[0][0][ix]), sqrt(esxy[1][1][ix]), fChi2, fNdof); 433 } 434 else if (fInputType == 2) 435 { 436 Double_t corr = esxy[0][1][ix]/ sqrt( esxy[0][0][ix] * esxy[1][1][ix] ); 437 starSource->SetCGFitValues(100.0, 100.0, bsxy[0][ix], bsxy[1][ix], 438 sqrt(esxy[0][0][ix]), sqrt(esxy[1][1][ix]), corr, 439 esxy[0][0][ix], esxy[0][1][ix], esxy[1][1][ix], 440 fChi2, fNdof); 441 } 431 while ( (starSource = (MStarPos*)setnextSource()) ) 432 { 433 Double_t corr = esxy[0][1][ix]/ sqrt( esxy[0][0][ix] * esxy[1][1][ix] ); 434 starSource->SetFitValues(100.0, 100.0, bsxy[0][ix], bsxy[1][ix], 435 sqrt(esxy[0][0][ix]), sqrt(esxy[1][1][ix]), corr, 436 esxy[0][0][ix], esxy[0][1][ix], esxy[1][1][ix], 437 fChi2, fNdof); 442 438 443 439 ix++; -
trunk/MagicSoft/Mars/mtemp/MTelAxisFromStars.h
r4545 r4705 21 21 22 22 class MSrcPosCam; 23 class MStar LocalCam;23 class MStarCam; 24 24 class MSkyCamTrans; 25 25 … … 28 28 private: 29 29 30 const MStar LocalCam *fStarLocalCam; //!31 const MStar LocalCam *fSourceLocalCam; //!30 const MStarCam *fStarCam; //! 31 const MStarCam *fSourceCam; //! 32 32 33 33 MSrcPosCam *fSrcPos; //!
Note:
See TracChangeset
for help on using the changeset viewer.