Changeset 4051
- Timestamp:
- 05/11/04 19:47:22 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mtemp
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/MFindStars.cc
r4037 r4051 30 30 #include "MFindStars.h" 31 31 32 #include <TMinuit.h> 33 #include <TStopwatch.h> 32 34 #include <TTimer.h> 33 35 #include <TString.h> … … 40 42 #include "MAstroCamera.h" 41 43 #include "MMcConfigRunHeader.h" 44 45 #include "MMinuitInterface.h" 42 46 43 47 #include "MLog.h" … … 59 63 using namespace std; 60 64 61 MFindStars::MFindStars(const char *name, const char *title) 65 const Float_t sqrt2 = sqrt(2.); 66 const Float_t sqrt3 = sqrt(3.); 67 68 Bool_t HandleInput() 69 { 70 TTimer timer("gSystem->ProcessEvents();", 50, kFALSE); 71 while (1) 72 { 73 // 74 // While reading the input process gui events asynchronously 75 // 76 timer.TurnOn(); 77 cout << "Type 'q' to exit, <return> to go on: " << endl; 78 char q; 79 cin >> q; 80 TString input = q; 81 timer.TurnOff(); 82 83 if (input=="q\n") 84 return kFALSE; 85 86 if (input=="\n") 87 return kTRUE; 88 }; 89 } 90 91 92 //______________________________________________________________________________ 93 // 94 // The 2D gaussian fucntion used to fit the spot of the star 95 // 96 static Double_t func(float x,float y,Double_t *par) 97 { 98 Double_t value=par[0]*exp(-(x-par[1])*(x-par[1])/(2*par[2]*par[2]))*exp(-(y-par[3])*(y-par[3])/(2*par[4]*par[4])); 99 return value; 100 } 101 102 //______________________________________________________________________________ 103 // 104 // Function used by Minuit to do the fit 105 // 106 static void fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag) 107 { 108 109 MFindStars* find = (MFindStars*)gMinuit->GetObjectFit(); 110 MHCamera* display = (MHCamera*)find->GetDisplay(); 111 Float_t ped = find->GetPedestalDC(); 112 // Float_t rms = find->GetPedestalRMSDC(); 113 MGeomCam& geom = (MGeomCam&)display->GetGeomCam(); 114 115 UInt_t numPixels = geom.GetNumPixels(); 116 117 //calculate chisquare 118 Double_t chisq = 0; 119 Double_t delta; 120 Double_t x,y,z; 121 Double_t errorz = 0.2; //[uA] 122 123 UInt_t usedPx=0; 124 for (UInt_t pixid=1; pixid<numPixels; pixid++) 125 { 126 z = display->GetBinContent(pixid+1)-ped; 127 128 if (display->IsUsed(pixid) && z > 0.) 129 { 130 x = geom[pixid].GetX(); 131 y = geom[pixid].GetY(); 132 133 if (errorz > 0.0) 134 { 135 usedPx++; 136 delta = (z-func(x,y,par))/errorz; 137 chisq += delta*delta; 138 } 139 else 140 cerr << " TMinuit::fcn errorz[" << pixid << "] " << errorz << endl; 141 } 142 } 143 f = chisq; 144 145 find->SetChisquare(chisq); 146 find->SetDegreesofFreedom(usedPx); 147 } 148 149 MFindStars::MFindStars(const char *name, const char *title): fNumVar(5) 62 150 { 63 151 fName = name ? name : "MFindStars"; … … 71 159 fPixelsUsed.Set(577); 72 160 fPixelsUsed.Reset((Char_t)kTRUE); 161 162 //Fitting(Minuit) initialitation 163 const Float_t pixelSize = 31.5; //[mm] 164 165 fVname = new TString[fNumVar]; 166 fVinit.Set(fNumVar); 167 fStep.Set(fNumVar); 168 fLimlo.Set(fNumVar); 169 fLimup.Set(fNumVar); 170 fFix.Set(fNumVar); 171 172 fVname[0] = "max"; 173 fVinit[0] = 10.*fMaxNumIntegratedEvents; 174 fStep[0] = fVinit[0]/sqrt2; 175 fLimlo[0] = fMinDCForStars; 176 fLimup[0] = 30.*fMaxNumIntegratedEvents; 177 fFix[0] = 0; 178 179 fVname[1] = "meanx"; 180 fVinit[1] = 0.; 181 fStep[1] = fVinit[0]/sqrt2; 182 fLimlo[1] = -600.; 183 fLimup[1] = 600.; 184 fFix[1] = 0; 185 186 fVname[2] = "sigmaminor"; 187 fVinit[2] = pixelSize; 188 fStep[2] = fVinit[0]/sqrt2; 189 fLimlo[2] = pixelSize/(2*sqrt3); 190 fLimup[2] = 500.; 191 fFix[2] = 0; 192 193 fVname[3] = "meany"; 194 fVinit[3] = 0.; 195 fStep[3] = fVinit[0]/sqrt2; 196 fLimlo[3] = -600.; 197 fLimup[3] = 600.; 198 fFix[3] = 0; 199 200 fVname[4] = "sigmamajor"; 201 fVinit[4] = pixelSize; 202 fStep[4] = fVinit[0]/sqrt2; 203 fLimlo[4] = pixelSize/(2*sqrt3); 204 fLimup[4] = 500.; 205 fFix[4] = 0; 206 207 fObjectFit = NULL; 208 // fMethod = "SIMPLEX"; 209 // fMethod = "MIGRAD"; 210 fMethod = "MINIMIZE"; 211 fNulloutput = kFALSE; 73 212 } 74 213 … … 85 224 86 225 fDisplay.SetGeometry(*fGeomCam); 226 fDisplay.SetUsed(fPixelsUsed); 87 227 88 228 fCurr = (MCameraDC*)pList->FindObject(AddSerialNumber("MCameraDC")); … … 171 311 Int_t MFindStars::Process() 172 312 { 313 UInt_t numPixels = fGeomCam->GetNumPixels(); 314 TArrayC origPixelsUsed; 315 origPixelsUsed.Set(numPixels); 316 173 317 if (fNumIntegratedEvents >= fMaxNumIntegratedEvents) 174 318 { 319 175 320 if (fDrive) 176 321 { … … 185 330 else 186 331 { 187 UInt_t numPixels = fGeomCam->GetNumPixels();188 TArrayC origPixelsUsed;189 origPixelsUsed.Set(numPixels);332 //Fist delete the previus stars in the list 333 fStars->GetList()->Delete(); 334 // 190 335 191 336 for (UInt_t pix=1; pix<numPixels; pix++) … … 194 339 origPixelsUsed[pix]=(Char_t)kTRUE; 195 340 else 196 origPixelsUsed[pix]=(Char_t)kFALSE;341 origPixelsUsed[pix]=(Char_t)kFALSE; 197 342 } 198 343 199 Float_t ped; 200 Float_t rms; 201 DCPedestalCalc(ped, rms); 202 fMinDCForStars = fMinDCForStars>(ped+5*rms)?fMinDCForStars:(ped+5*rms); 203 204 *fLog << dbg << " DC pedestal = " << ped << " pedestal rms = " << rms << endl; 344 DCPedestalCalc(fPedestalDC, fPedestalRMSDC); 345 fMinDCForStars = fMinDCForStars>(fPedestalDC+5*fPedestalRMSDC)?fMinDCForStars:(fPedestalDC+5*fPedestalRMSDC); 346 347 *fLog << dbg << " DC pedestal = " << fPedestalDC << " pedestal rms = " << fPedestalRMSDC << endl; 205 348 *fLog << dbg << " fMinDCForStars " << fMinDCForStars << endl; 206 349 … … 211 354 while(FindPixelWithMaxDC(maxPixelDC, maxPixel)) 212 355 { 213 *fLog << dbg << "Star candidate maxDC(" << setw(3) << maxPixelDC << " uA) x position(" << setw(3) << maxPixel.GetX() << " mm) x position(" << setw(3) << maxPixel.GetY() << " mm)" << endl; 214 356 215 357 MStarLocalPos *starpos = new MStarLocalPos; 216 358 starpos->SetExpValues(maxPixelDC,maxPixel.GetX(),maxPixel.GetY()); 217 starpos->SetCalcValues(maxPixelDC,maxPixel .GetX(),maxPixel.GetY(),fRingInterest/2,fRingInterest/2);218 starpos->SetFitValues(maxPixelDC,maxPixel .GetX(),maxPixel.GetY(),fRingInterest/2,fRingInterest/2);359 starpos->SetCalcValues(maxPixelDC,maxPixelDC,maxPixel.GetX(),maxPixel.GetY(),fRingInterest/2,fRingInterest/2); 360 starpos->SetFitValues(maxPixelDC,maxPixelDC,maxPixel.GetX(),maxPixel.GetY(),fRingInterest/2,fRingInterest/2,0.,1); 219 361 fStars->GetList()->Add(starpos); 220 362 … … 235 377 *fLog << inf << GetName() << " Found " << fStars->GetList()->GetSize() << " stars candidates in the camera." << endl; 236 378 379 380 for (UInt_t pix=1; pix<numPixels; pix++) 381 { 382 if (fDisplay.IsUsed(pix)) 383 origPixelsUsed[pix]=(Char_t)kTRUE; 384 else 385 origPixelsUsed[pix]=(Char_t)kFALSE; 386 } 387 237 388 TIter Next(fStars->GetList()); 238 389 MStarLocalPos* star; 239 390 while ((star=(MStarLocalPos*)Next())) 240 {241 FindStar(star);242 ShadowStar(star);243 }391 { 392 FindStar(star); 393 ShadowStar(star); 394 } 244 395 245 396 //After finding stars reset all vairables 246 397 fDisplay.Reset(); 398 fDisplay.SetUsed(origPixelsUsed); 247 399 fNumIntegratedEvents=0; 248 400 } 401 402 for (UInt_t pix=1; pix<numPixels; pix++) 403 { 404 if (fDisplay.IsUsed(pix)) 405 origPixelsUsed[pix]=(Char_t)kTRUE; 406 else 407 origPixelsUsed[pix]=(Char_t)kFALSE; 408 409 } 249 410 250 411 fDisplay.AddCamContent(*fCurr); 251 412 fNumIntegratedEvents++; 413 fDisplay.SetUsed(origPixelsUsed); 414 252 415 253 416 return kTRUE; … … 267 430 268 431 for (Int_t idx=0; idx<npix; idx++) 432 { 269 433 fPixelsUsed[blindpixels[idx]]=(Char_t)kFALSE; 270 434 *fLog << dbg << "MFindStars::SetBlindPixels fDisplay.IsUsed(" <<blindpixels[idx] << ") kFALSE" << endl; 435 } 436 271 437 fDisplay.SetUsed(fPixelsUsed); 272 438 } … … 304 470 305 471 dchist.Fit("func","QR0"); 472 // Remove the comments if you want to go through the file 473 // event-by-event: 474 // HandleInput(); 306 475 307 476 UInt_t aproxnumdegrees = 6*(bin-dchist.GetMaximumBin()); … … 344 513 for(Int_t nextNeighbor=0; nextNeighbor<numNextNeighbors; nextNeighbor++) 345 514 { 346 if(fDisplay.IsUsed(pix)) 347 { 348 UInt_t swneighbor = g.GetNeighbor(nextNeighbor); 349 350 351 352 353 354 355 356 515 UInt_t swneighbor = g.GetNeighbor(nextNeighbor); 516 if(fDisplay.IsUsed(swneighbor)) 517 { 518 dc[1] = fDisplay.GetBinContent(swneighbor+1); 519 if (dc[1] < fMinDCForStars) 520 continue; 521 522 dcsum = dc[0] + dc[1]; 523 524 if(dcsum > maxDC*2) 525 { 357 526 if(dc[0]>=dc[1]) 358 527 { 359 360 361 maxDC = dc[0];528 maxPixIdx[0] = pix; 529 maxPixIdx[1] = swneighbor; 530 maxDC = dc[0]; 362 531 } 363 532 else … … 367 536 maxDC = dc[1]; 368 537 } 369 370 371 372 538 } 539 } 540 } 541 } 373 542 } 374 543 … … 377 546 378 547 maxPix = (*fGeomCam)[maxPixIdx[0]]; 548 549 *fLog << dbg << "Star candidate maxDC(" << setw(3) << maxDC << " uA) x position(" << setw(3) << maxPix.GetX() << " mm) x position(" << setw(3) << maxPix.GetY() << " mm) swnumber(" << maxPixIdx[0] << ")" << endl; 550 379 551 return kTRUE; 380 552 } … … 415 587 fDisplay.SetUsed(fPixelsUsed); 416 588 417 // determine mean x and mean y of the selected px 589 // determine mean x and mean y 590 Float_t max=0; 418 591 Float_t meanX=0; 419 592 Float_t meanY=0; … … 432 605 Float_t pixYpos = (*fGeomCam)[pix].GetY(); 433 606 607 if (charge>max) max=charge; 434 608 meanX += charge*pixXpos; 435 609 meanY += charge*pixYpos; … … 450 624 Float_t rmsY = TMath::Sqrt(meanSqY - meanY*meanY); 451 625 452 star->SetCalcValues(sumCharge,meanX,meanY,rmsX,rmsY); 626 star->SetCalcValues(sumCharge,max,meanX,meanY,rmsX,rmsY); 627 628 629 // fit the star spot using TMinuit 630 631 for (UInt_t pix=1; pix<numPixels; pix++) 632 if (fDisplay.IsUsed(pix)) 633 *fLog << dbg << "[fit the star spot] fDisplay.IsUsed(" << pix << ") kTRUE" << endl; 634 635 //Initialate variables for fit 636 fVinit[0] = star->GetMaxCalc()-fPedestalDC; 637 fLimlo[0] = fMinDCForStars-fPedestalDC; 638 fLimup[0] = fLimup[0]-fPedestalDC; 639 fVinit[1] = meanX; 640 fVinit[2] = rmsX; 641 fVinit[3] = meanY; 642 fVinit[4] = rmsY; 643 //Init steps 644 for(Int_t i=0; i<fNumVar; i++) 645 if (fVinit[i] != 0) 646 fStep[i] = TMath::Abs(fVinit[i]/sqrt2); 647 // 648 649 TStopwatch clock; 650 clock.Start(); 651 652 *fLog << dbg << " before calling CallMinuit" << endl; 653 654 MMinuitInterface inter; 655 Bool_t rc = inter.CallMinuit(fcn, fVname, 656 fVinit, fStep, fLimlo, fLimup, fFix, 657 this, fMethod, fNulloutput); 453 658 659 *fLog << dbg << "after calling CallMinuit" << endl; 660 *fLog << dbg << "Time spent for the minimization in MINUIT : " << endl;; 661 clock.Stop(); 662 clock.Print(); 663 664 Double_t integratedCharge; 665 Double_t maxFit, maxFitError; 666 Double_t meanXFit, meanXFitError; 667 Double_t sigmaMinorAxis, sigmaMinorAxisError; 668 Double_t meanYFit, meanYFitError; 669 Double_t sigmaMajorAxis, sigmaMajorAxisError; 670 Float_t chisquare = GetChisquare(); 671 Int_t dregrees = GetDegreesofFreedom()-fNumVar; 672 673 if (rc) 674 { 675 gMinuit->GetParameter(0,maxFit, maxFitError); 676 gMinuit->GetParameter(1,meanXFit,meanXFitError); 677 gMinuit->GetParameter(2,sigmaMinorAxis,sigmaMinorAxisError); 678 gMinuit->GetParameter(3,meanYFit,meanYFitError); 679 gMinuit->GetParameter(4,sigmaMajorAxis,sigmaMajorAxisError); 680 681 //FIXME: Do the integral properlly 682 integratedCharge = 0.; 683 684 685 } 686 else 687 { 688 maxFit = 0.; 689 meanXFit = 0.; 690 sigmaMinorAxis = 0.; 691 meanYFit = 0.; 692 sigmaMajorAxis = 0.; 693 integratedCharge = 0.; 694 } 695 696 697 698 star->SetFitValues(integratedCharge,maxFit,meanXFit,meanYFit,sigmaMinorAxis,sigmaMajorAxis,chisquare,dregrees); 699 700 // reset the display to the starting values 454 701 fDisplay.SetUsed(origPixelsUsed); 455 702 456 return kTRUE;703 return rc; 457 704 } 458 705 … … 479 726 else 480 727 { 481 482 shadowPx++;728 fPixelsUsed[pix]=(Char_t)kFALSE; 729 shadowPx++; 483 730 } 484 731 } -
trunk/MagicSoft/Mars/mtemp/MFindStars.h
r4037 r4051 51 51 Float_t fMinDCForStars; //[uA] 52 52 53 Float_t fPedestalDC; //[ua] 54 Float_t fPedestalRMSDC; //[ua] 55 56 //Fitting(Minuit) variables 57 const Int_t fNumVar; 58 Float_t fTempChisquare; 59 Int_t fTempDegreesofFreedom; 60 61 TString *fVname; 62 TArrayD fVinit; 63 TArrayD fStep; 64 TArrayD fLimlo; 65 TArrayD fLimup; 66 TArrayI fFix; 67 TObject *fObjectFit; 68 TString fMethod; 69 Bool_t fNulloutput; 70 53 71 Bool_t DCPedestalCalc(Float_t &ped, Float_t &rms); 54 72 Bool_t FindPixelWithMaxDC(Float_t &maxDC, MGeomPix &maxPix); … … 68 86 void SetBlindPixels(TArrayS blindpixels); 69 87 88 void SetChisquare(Float_t chi) {fTempChisquare=chi;} 89 void SetDegreesofFreedom(Int_t free) {fTempDegreesofFreedom=free;} 70 90 91 MHCamera* GetDisplay() { return &fDisplay; } 92 Float_t GetPedestalDC() { return fPedestalDC; } 93 Float_t GetPedestalRMSDC() { return fPedestalRMSDC; } 94 95 Float_t GetChisquare() {return fTempChisquare;} 96 Int_t GetDegreesofFreedom() {return fTempDegreesofFreedom;} 97 98 71 99 ClassDef(MFindStars, 0) // Tool to find stars from DC Currents 72 100 }; -
trunk/MagicSoft/Mars/mtemp/MStarLocalCam.cc
r4037 r4051 79 79 } 80 80 81 void MStarLocalCam::Paint(Option_t *o) 82 { 83 TIter Next(fStars); 84 MStarLocalPos* star; 85 while ((star=(MStarLocalPos*)Next())) 86 star->Paint(o); 87 } 88 81 89 void MStarLocalCam::Print(Option_t *o) const 82 90 { 83 //loop to extract position of stars on the camera84 91 TIter Next(fStars); 85 92 MStarLocalPos* star; … … 88 95 { 89 96 *fLog << inf << "Star[" << starnum << "] info:" << endl; 90 star->Print( );97 star->Print(o); 91 98 starnum++; 92 99 } -
trunk/MagicSoft/Mars/mtemp/MStarLocalCam.h
r3808 r4051 30 30 TList *GetList() const { return fStars; } 31 31 32 void Print(Option_t *o="") const; 32 void Paint(Option_t *o=NULL); 33 void Print(Option_t *o=NULL) const; 33 34 34 35 ClassDef(MStarLocalCam, 1) // Storage Container for star positions in the camera -
trunk/MagicSoft/Mars/mtemp/MStarLocalPos.cc
r4037 r4051 53 53 54 54 fMagCalc = 0.; 55 fMaxCalc = 0.; 55 56 fMeanXCalc = 0.; 56 57 fMeanYCalc = 0.; … … 61 62 62 63 fMagFit = 0.; 64 fMaxFit = 0.; 63 65 fMeanXFit = 0.; 64 66 fMeanYFit = 0.; 65 67 fSigmaMinorAxisFit = 0.; 66 68 fSigmaMajorAxisFit = 0.; 67 fChisquarenDof = 0.; 69 fChiSquare = 0.; 70 fNdof = 0; 68 71 69 72 } … … 76 79 } 77 80 78 void MStarLocalPos::SetCalcValues(Float_t mag, Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis)81 void MStarLocalPos::SetCalcValues(Float_t mag, Float_t max, Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis) 79 82 { 80 83 fMagCalc = mag; 84 fMaxCalc = max; 81 85 fMeanXCalc = x; 82 86 fMeanYCalc = y; … … 85 89 } 86 90 87 void MStarLocalPos::SetFitValues(Float_t mag, Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis)91 void MStarLocalPos::SetFitValues(Float_t mag, Float_t max, Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis, Float_t chiSquare, Int_t ndof) 88 92 { 89 93 fMagFit = mag; 94 fMaxFit = max; 90 95 fMeanXFit = x; 91 96 fMeanYFit = y; 92 97 fSigmaMinorAxisFit = sigmaMinorAxis; 93 98 fSigmaMajorAxisFit = sigmaMajorAxis; 99 fChiSquare = chiSquare; 100 fNdof = ndof; 94 101 } 95 102 103 // -------------------------------------------------------------------------- 104 // 105 // Paint the ellipse corresponding to the parameters 106 // 96 107 void MStarLocalPos::Paint(Option_t *opt) 97 {} 108 { 109 //Print a cross in the expected position 110 111 if (fSigmaMinorAxisCalc>0. && fSigmaMajorAxisCalc>0.) 112 { 113 TEllipse ecalc(fMeanXCalc, fMeanYCalc, fSigmaMinorAxisCalc, fSigmaMajorAxisCalc, 0, 360, 0); 114 ecalc.SetLineWidth(2); 115 ecalc.SetLineColor(kRed); 116 ecalc.Paint(); 117 } 118 119 if (fSigmaMinorAxisFit>0. || fSigmaMajorAxisFit>0.) 120 { 121 TEllipse efit(fMeanXFit, fMeanYFit, fSigmaMinorAxisFit, fSigmaMajorAxisFit, 0, 360, 0); 122 efit.SetLineWidth(2); 123 efit.SetLineColor(kBlack); 124 efit.Paint(); 125 } 126 } 98 127 99 128 void MStarLocalPos::Print(Option_t *opt) const 100 129 { 101 *fLog << inf << "Star position:" << endl; 102 *fLog << inf << " Expected \t X " << setw(4) << fXExp << " mm \tY " << setw(4) << fYExp << " mm" << endl; 103 *fLog << inf << " Calcultated \t X " << setw(4) << fMeanXCalc << " mm \tY " << setw(4) << fMeanYCalc << " mm" << endl; 104 *fLog << inf << " Fitted \t X " << setw(4) << fMeanXFit << " mm \tY " << setw(4) << fMeanYFit << " mm" << endl; 105 *fLog << inf << "Star size:" << endl; 106 *fLog << inf << " Calcultated \t X " << setw(4) << fSigmaMinorAxisCalc << " mm \tY " << setw(4) << fSigmaMajorAxisCalc << " mm" << endl; 107 *fLog << inf << " Fitted \t X " << setw(4) << fSigmaMinorAxisFit << " mm \tY " << setw(4) << fSigmaMajorAxisFit << " mm" << endl; 130 TString o = opt; 131 132 if (o.Contains("mag", TString::kIgnoreCase) || opt == NULL) 133 { 134 *fLog << inf << "Star maginitude:" << endl; 135 *fLog << inf << " Expected \t" << setw(4) << fMagExp << endl; 136 *fLog << inf << " Calcultated \t " << setw(4) << fMagCalc << endl; 137 *fLog << inf << " Fitted \t " << setw(4) << fMagFit << endl; 138 } 139 140 if (o.Contains("max", TString::kIgnoreCase) || opt == NULL) 141 { 142 *fLog << inf << "Star Maximum:" << endl; 143 *fLog << inf << " Calcultated \t " << setw(4) << fMaxCalc << " uA" << endl; 144 *fLog << inf << " Fitted \t " << setw(4) << fMaxFit << " uA" << endl; 145 } 146 147 if (o.Contains("pos", TString::kIgnoreCase) || opt == NULL) 148 { 149 *fLog << inf << "Star position:" << endl; 150 *fLog << inf << " Expected \t X " << setw(4) << fXExp << " mm \tY " << setw(4) << fYExp << " mm" << endl; 151 *fLog << inf << " Calcultated \t X " << setw(4) << fMeanXCalc << " mm \tY " << setw(4) << fMeanYCalc << " mm" << endl; 152 *fLog << inf << " Fitted \t X " << setw(4) << fMeanXFit << " mm \tY " << setw(4) << fMeanYFit << " mm" << endl; 153 } 154 155 if (o.Contains("siz", TString::kIgnoreCase) || opt == NULL) 156 { 157 *fLog << inf << "Star size:" << endl; 158 *fLog << inf << " Calcultated \t X " << setw(4) << fSigmaMinorAxisCalc << " mm \tY " << setw(4) << fSigmaMajorAxisCalc << " mm" << endl; 159 *fLog << inf << " Fitted \t X " << setw(4) << fSigmaMinorAxisFit << " mm \tY " << setw(4) << fSigmaMajorAxisFit << " mm" << endl; 160 } 161 162 if (o.Contains("chi", TString::kIgnoreCase) || opt == NULL) 163 { 164 *fLog << inf << "Star Fit Quality:" << endl; 165 *fLog << inf << " ChiSquare/Ndof \t " << setw(3) << fChiSquare << "/" << fNdof << endl; 166 } 108 167 } -
trunk/MagicSoft/Mars/mtemp/MStarLocalPos.h
r3808 r4051 19 19 20 20 Float_t fMagCalc; 21 Float_t fMaxCalc; //[uA] 21 22 Float_t fMeanXCalc; //[mm] 22 23 Float_t fMeanYCalc; //[mm] … … 27 28 28 29 Float_t fMagFit; 30 Float_t fMaxFit; //[uA] 29 31 Float_t fMeanXFit; //[mm] 30 32 Float_t fMeanYFit; //[mm] 31 33 Float_t fSigmaMinorAxisFit; //[mm] 32 34 Float_t fSigmaMajorAxisFit; //[mm] 33 Float_t fChisquarenDof; 35 Float_t fChiSquare; 36 Int_t fNdof; 34 37 35 38 public: … … 43 46 44 47 Float_t GetMagCalc() {return fMagCalc;} 48 Float_t GetMaxCalc() {return fMaxCalc;} 45 49 Float_t GetMeanXCalc() {return fMeanXCalc;} 46 50 Float_t GetMeanYCalc() {return fMeanYCalc;} … … 49 53 50 54 Float_t GetMagFit() {return fMagFit;} 55 Float_t GetMaxFit() {return fMaxFit;} 51 56 Float_t GetMeanXFit() {return fMeanXFit;} 52 57 Float_t GetMeanYFit() {return fMeanYFit;} 53 58 Float_t GetSigmaMinorAxisFit() {return fSigmaMinorAxisFit;} 54 59 Float_t GetSigmaMajorAxisFit() {return fSigmaMajorAxisFit;} 55 Float_t GetChisquarenDof() {return fChisquarenDof;} 60 Float_t GetChiSquare() {return fChiSquare;} 61 Float_t GetNdof() {return fNdof;} 62 Float_t GetChiSquareNdof() {return fChiSquare/fNdof;} 63 64 // Float_t GetMeanX(); 65 // Float_t GetMeanY(); 66 // Float_t GetSigmaMinorAxis(); 67 // Float_t GetSigmaMajorAxis(); 56 68 57 69 void Reset(); 58 70 59 71 void SetExpValues(Float_t mag, Float_t x, Float_t y); 60 void SetCalcValues(Float_t mag, Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis);61 void SetFitValues(Float_t mag, Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis);72 void SetCalcValues(Float_t mag, Float_t max, Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis); 73 void SetFitValues(Float_t mag, Float_t max, Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis, Float_t chi, Int_t ndof); 62 74 63 75 void Paint(Option_t *opt=NULL); 64 76 void Print(Option_t *opt=NULL) const; 65 77 66 ClassDef(MStarLocalPos, 1) // Container that holds 78 ClassDef(MStarLocalPos, 1) // Container that holds the star information in the PMT camera 67 79 }; 68 80
Note:
See TracChangeset
for help on using the changeset viewer.