Changeset 4071
- Timestamp:
- 05/14/04 12:24:31 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/MFindStars.cc
r4060 r4071 588 588 Float_t expY = star->GetYExp(); 589 589 590 Float_t max=0; 591 Float_t meanX=0; 592 Float_t meanY=0; 593 Float_t meanSqX=0; 594 Float_t meanSqY=0; 595 Float_t sumCharge=0; 596 UInt_t usedPx=0; 597 598 const Float_t meanPresition = 3.; //[mm] 599 const UInt_t maxNumIterations = 10; 600 UInt_t numIterations = 0; 601 602 do 603 { 590 604 // First define a area of interest around the expected position of the star 591 605 for (UInt_t pix=1; pix<numPixels; pix++) … … 606 620 607 621 // determine mean x and mean y 608 Float_t max=0; 609 Float_t meanX=0; 610 Float_t meanY=0; 611 Float_t meanSqX=0; 612 Float_t meanSqY=0; 613 Float_t sumCharge=0; 614 UInt_t usedPx=0; 622 usedPx=0; 615 623 for(UInt_t pix=0; pix<numPixels; pix++) 616 624 { … … 619 627 usedPx++; 620 628 621 Float_t charge = fDisplay.GetBinContent(pix+1) -fPedestalDC;629 Float_t charge = fDisplay.GetBinContent(pix+1); 622 630 Float_t pixXpos = (*fGeomCam)[pix].GetX(); 623 631 Float_t pixYpos = (*fGeomCam)[pix].GetY(); … … 639 647 meanSqY /= sumCharge; 640 648 641 Float_t rmsX = (meanSqX - meanX*meanX); 642 Float_t rmsY = (meanSqY - meanY*meanY); 649 expX = meanX; 650 expY = meanY; 651 652 if (++numIterations > maxNumIterations) 653 { 654 *fLog << warn << GetName() << "Mean calculation not converge after " << maxNumIterations << " iterations" << endl; 655 break; 656 } 657 658 }while(TMath::Abs(meanX-expX) > meanPresition || TMath::Abs(meanY-expY) > meanPresition); 659 660 Float_t rmsX = (meanSqX - meanX*meanX) - fRingInterest*fRingInterest/12; 661 Float_t rmsY = (meanSqY - meanY*meanY) - fRingInterest*fRingInterest/12; 643 662 644 663 if ( rmsX > 0) … … 647 666 { 648 667 *fLog << warn << " MFindStars::FindStar negative rmsX² " << rmsX << endl; 649 *fLog << warn << " meanSqX " << meanSqX << " meanX " << meanX << " sumCharge " << sumCharge << endl;668 *fLog << warn << " meanSqX " << meanSqX << " meanX " << meanX << " fRingInterest " << fRingInterest << " sumCharge " << sumCharge << endl; 650 669 rmsX = 0.; 651 670 } … … 656 675 { 657 676 *fLog << warn << " MFindStars::FindStar negative rmsY² " << rmsY << endl; 658 *fLog << warn << " meanSqY " << meanSqY << " meanY " << meanY << endl;677 *fLog << warn << " meanSqY " << meanSqY << " meanY " << meanY << " fRingInterest " << fRingInterest << " sumCharge " << sumCharge<< endl; 659 678 rmsY = 0.; 660 679 } 661 680 681 // Substrack pedestal DC 682 sumCharge-=fPedestalDC*usedPx; 683 max-=fPedestalDC; 684 685 662 686 star->SetCalcValues(sumCharge,max,meanX,meanY,rmsX,rmsY); 663 687 664 688 if (rmsX <= 0. || rmsY <= 0.) 665 689 return kFALSE; 690 666 691 667 692 // fit the star spot using TMinuit
Note:
See TracChangeset
for help on using the changeset viewer.