Changeset 4546
- Timestamp:
- 08/09/04 16:23:06 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4545 r4546 54 54 and MHTelAxisFromStars 55 55 was added 56 57 * mtemp/MFindStars.[h,cc] 58 - add correlated Gauss fit 56 59 57 60 -
trunk/MagicSoft/Mars/mtemp/MFindStars.cc
r4429 r4546 15 15 ! * 16 16 ! 17 ! Author(s): Robert Wagner, 2/2004 <mailto:rwagner@mppmu.mpg.de> 18 ! Author(s): Javier López , 4/2004 <mailto:jlopez@ifae.es> 17 ! Author(s): Robert Wagner, 2/2004 <mailto:rwagner@mppmu.mpg.de> 18 ! Javier López , 4/2004 <mailto:jlopez@ifae.es> 19 ! Wolfgang Wittek, 8/2004 <mailto:wittek@mppmu.mpg.de> 19 20 ! 20 21 ! Copyright: MAGIC Software Development, 2000-2004 … … 39 40 #include <TH1F.h> 40 41 #include <TF1.h> 42 #include <TEllipse.h> 43 41 44 42 45 #include "MObservatory.h" … … 70 73 //______________________________________________________________________________ 71 74 // 72 // The 2D gaussian fucntion used to fit the spot of the star75 // The 2D uncorrelated gaussian function used to fit the spot of the star 73 76 // 74 77 static Double_t func(float x,float y,Double_t *par) 75 78 { 76 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])); 79 Double_t value=par[0]*exp( -(x-par[1])*(x-par[1])/(2*par[2]*par[2]) ) 80 *exp( -(y-par[3])*(y-par[3])/(2*par[4]*par[4]) ); 77 81 return value; 78 82 } … … 80 84 //______________________________________________________________________________ 81 85 // 86 // The 2D correlated gaussian function used to fit the spot of the star 87 // 88 static Double_t funcCG(float x,float y,Double_t *par) 89 { 90 Double_t temp = 1.0-par[5]*par[5]; 91 // Double_t value = par[0] / (2.0*TMath::Pi()*par[2]*par[4]*sqrt(temp)) 92 Double_t value = par[0] 93 * exp( -0.5/temp * ( (x-par[1])*(x-par[1])/(par[2]*par[2]) 94 -2.0*par[5] * (x-par[1])*(y-par[3])/(par[2]*par[4]) 95 + (y-par[3])*(y-par[3])/(par[4]*par[4]) ) ); 96 return value; 97 } 98 99 //______________________________________________________________________________ 100 // 82 101 // Function used by Minuit to do the fit 83 102 // … … 87 106 MParList* plist = (MParList*)gMinuit->GetObjectFit(); 88 107 MTaskList* tlist = (MTaskList*)plist->FindObject("MTaskList"); 89 MFindStars* find = (MFindStars*)tlist->FindObject("MFindStars"); 90 MStarLocalCam* stars = (MStarLocalCam*)plist->FindObject("MStarLocalCam"); 91 MGeomCam* geom = (MGeomCam*)plist->FindObject("MGeomCam"); 108 MFindStars* find = (MFindStars*)tlist->FindObject("MFindStars"); 109 MStarLocalCam* stars = 110 (MStarLocalCam*)plist->FindObject("MStarLocalCam","MStarLocalCam"); 111 MGeomCam* geom = (MGeomCam*)plist->FindObject("MGeomCam"); 92 112 93 113 MHCamera& display = (MHCamera&)find->GetDisplay(); … … 100 120 UInt_t numPixels = geom->GetNumPixels(); 101 121 122 // fix the correlation if requested 123 if ( find->GetUseCorrelatedGauss() && find->GetFixCorrelation() ) 124 { 125 Double_t tandel; 126 if (par[1] != 0.0) 127 tandel = par[3]/par[1]; 128 else 129 tandel = 1.e10; 130 Double_t cxx = par[2]*par[2]; 131 Double_t cyy = par[4]*par[4]; 132 par[5] = tandel/(tandel*tandel-1.0) * (cyy-cxx)/sqrt(cxx*cyy); 133 } 134 102 135 //calculate chisquare 103 136 Double_t chisq = 0; … … 109 142 for (UInt_t pixid=1; pixid<numPixels; pixid++) 110 143 { 144 145 111 146 if (display.IsUsed(pixid)) 112 147 { 113 148 x = (*geom)[pixid].GetX(); 114 149 y = (*geom)[pixid].GetY(); 115 z = display.GetBinContent(pixid+1)-(pixid>lastInnerPixel?outerped:innerped); 150 151 z = display.GetBinContent(pixid+1) 152 - (pixid>lastInnerPixel?outerped:innerped); 116 153 errorz=(pixid>lastInnerPixel?outerrms:innerrms); 154 117 155 118 156 if (errorz > 0.0) 119 157 { 120 158 usedPx++; 121 delta = (z-func(x,y,par))/errorz; 122 chisq += delta*delta; 159 160 Double_t fu; 161 if (find->GetUseCorrelatedGauss()) 162 fu = funcCG(x,y,par); 163 else 164 fu = func(x,y,par); 165 166 delta = (z-fu) / errorz; 167 chisq += delta*delta; 168 169 if (iflag == 3) 170 { 171 gLog << "fcn : usedPx, pixid, content, pedestal,z, fu, errorz, delta = " 172 << usedPx << ", " << pixid << ", " 173 << display.GetBinContent(pixid+1) << ", " 174 << (pixid>lastInnerPixel?outerped:innerped) 175 << ", " << z << ", " << fu << ", " << errorz 176 << ", " << delta << endl; 177 } 123 178 } 124 179 else … … 130 185 find->SetChisquare(chisq); 131 186 find->SetDegreesofFreedom(usedPx); 187 188 //gLog << "fcn : chisq, usedPx = " << chisq << ", " << usedPx << endl; 132 189 } 133 190 191 //------------------------------------------------------------------------- 192 // 193 // Constructor 194 // 195 134 196 MFindStars::MFindStars(const char *name, const char *title): 135 fGeomCam(NULL), fCurr(NULL), fTimeCurr(NULL), fDrive(NULL), fStars(NULL), fNumVar(5) 197 fGeomCam(NULL), fCurr(NULL), fTimeCurr(NULL), fDrive(NULL), fStars(NULL), 198 fNumVar(6) 136 199 { 137 200 fName = name ? name : "MFindStars"; 138 201 fTitle = title ? title : "Tool to find stars from DC Currents"; 202 203 // the correlated Gauss function 204 // is fitted by default 205 fNumVar = 6; 206 fUseCorrelatedGauss = kTRUE; 207 fFixCorrelation = kFALSE; 139 208 140 209 fNumIntegratedEvents=0; … … 149 218 const Float_t pixelSize = 31.5; //[mm] 150 219 fMinuitPrintOutLevel = -1; 220 //fMinuitPrintOutLevel = 3; 151 221 152 222 fVname = new TString[fNumVar]; … … 171 241 fFix[1] = 0; 172 242 173 fVname[2] = "sigma minor";243 fVname[2] = "sigmax"; 174 244 fVinit[2] = pixelSize; 175 245 fStep[2] = fVinit[2]/sqrt2; … … 185 255 fFix[3] = 0; 186 256 187 fVname[4] = "sigma major";257 fVname[4] = "sigmay"; 188 258 fVinit[4] = pixelSize; 189 259 fStep[4] = fVinit[4]/sqrt2; … … 192 262 fFix[4] = 0; 193 263 264 if (fUseCorrelatedGauss) 265 { 266 fVname[5] = "xycorr"; 267 fVinit[5] = 0.0; 268 fStep[5] = 0.1; 269 fLimlo[5] = -1.0; 270 fLimup[5] = 1.0; 271 fFix[5] = 0; 272 } 273 194 274 fObjectFit = NULL; 195 275 // fMethod = "SIMPLEX"; … … 200 280 // Set output level 201 281 // fLog->SetOutputLevel(3); // No dbg messages 282 283 fGeometryFile=""; 284 fBSCFile=""; 202 285 } 286 287 //------------------------------------------------------------------------- 288 // 289 // Set 'fUseCorrelatedGauss' and 'fFixCorrelation' flag 290 // 291 // if 'fUseCorrelatedGauss' is TRUE a 2dim Gaussian with correlation 292 // will be fitted 293 // if 'fFixCorrelation' is TRUE the orientation of the 2dim Gaussian 294 // will be kept fixed at the angle delta, 295 // where tan(delta) = ymean/xmean 296 297 void MFindStars::SetUseCorrelatedGauss(Bool_t usecorrgauss, Bool_t fixcorr) 298 { 299 fUseCorrelatedGauss = usecorrgauss; 300 fFixCorrelation = fixcorr; 301 302 if (usecorrgauss) 303 fNumVar = 6; 304 else 305 fNumVar = 5; 306 } 307 308 //------------------------------------------------------------------------- 309 // 310 // PreProcess 311 // 203 312 204 313 Int_t MFindStars::PreProcess(MParList *pList) … … 233 342 } 234 343 235 //fDrive = (MReportDrive*)pList->FindObject(AddSerialNumber("MReportDrive"));344 fDrive = (MReportDrive*)pList->FindObject(AddSerialNumber("MReportDrive")); 236 345 237 346 if (!fDrive) 238 347 { 348 239 349 *fLog << warn << AddSerialNumber("MReportDrive") << " not found ... ignored." << endl; 350 240 351 } 241 352 else 242 353 { 243 // //Initialitation MAstroCamera 244 // // Name of a MC file having MGeomCam and MMcConfigRunHeader 245 // TString fname = "../data/Gamma_zbin9_90_7_1480to1489_w0.root"; 246 247 // // Time for which to get the picture 248 // // MTime time; 249 // // time.Set(2004, 2, 28, 01, 32, 15); 250 251 // // Current observatory 252 // MObservatory magic1; 253 254 // // Right Ascension [h] and declination [deg] of source 255 // // Currently 'perfect' pointing is assumed 256 // // const Double_t ra = MAstro::Hms2Rad(5, 34, 31.9); 257 // // const Double_t dec = MAstro::Dms2Rad(22, 0, 52.0); 258 259 // // -------------------------------------------------------------------------- 260 // // Create camera display from geometry 261 // MMcConfigRunHeader *config=0; 262 // MGeomCam *geom=0; 263 264 // TFile file(fname); 265 // TTree *tree = (TTree*)file.Get("RunHeaders"); 266 // tree->SetBranchAddress("MMcConfigRunHeader", &config); 267 // if (tree->GetBranch("MGeomCam")) 268 // tree->SetBranchAddress("MGeomCam", &geom); 269 // tree->GetEntry(0); 270 271 // fAstro.SetMirrors(*config->GetMirrors()); 272 // fAstro.SetGeom(*geom); 273 274 275 // fAstro.SetLimMag(6); 276 // fAstro.SetRadiusFOV(3); 277 // fAstro.ReadBSC("../data/bsc5.dat"); 278 279 // fAstro.SetObservatory(magic1); 280 // // Time for which to get the picture 281 // // MTime time; 282 // // time.Set(2004, 2, 28, 01, 32, 15); 283 // // fAstro.SetTime(time); 284 // fAstro.SetTime(*fTimeCurr); 285 // fAstro.SetGuiActive(); 286 287 // fAstro.SetStarList(fStars->GetList()); 288 354 355 MObservatory magic1; 356 357 MMcConfigRunHeader *config=0; 358 MGeomCam *geom=0; 359 360 TFile file(fGeometryFile); 361 TTree *tree = (TTree*)file.Get("RunHeaders"); 362 tree->SetBranchAddress("MMcConfigRunHeader", &config); 363 if (tree->GetBranch("MGeomCam")) tree->SetBranchAddress("MGeomCam", &geom); 364 tree->GetEntry(0); 365 366 fAstro.SetMirrors(*config->GetMirrors()); 367 fAstro.SetGeom(*geom); 368 fAstro.ReadBSC(fBSCFile); 369 370 fAstro.SetObservatory(magic1); 371 289 372 } 290 373 291 374 292 fStars = (MStarLocalCam*)pList->FindCreateObj(AddSerialNumber("MStarLocalCam") );375 fStars = (MStarLocalCam*)pList->FindCreateObj(AddSerialNumber("MStarLocalCam"),"MStarLocalCam"); 293 376 if (!fStars) 294 377 { … … 312 395 gMinuit->mnexcm("SET PRI", arglist ,1,ierflg); 313 396 397 // suppress warnings 398 Int_t errWarn; 399 Double_t tmpwar = 0; 400 gMinuit->mnexcm("SET NOW", &tmpwar, 0, errWarn); 401 402 314 403 // Set MParList object pointer to allow mimuit to access internally 315 404 gMinuit->SetObjectFit(pList); … … 317 406 return kTRUE; 318 407 } 408 409 //------------------------------------------------------------------------ 410 // 411 // Process : 412 // 413 // 414 // 415 // 319 416 320 417 Int_t MFindStars::Process() … … 325 422 origPixelsUsed.Set(numPixels); 326 423 327 if (fNumIntegratedEvents >= fMaxNumIntegratedEvents) 328 { 329 330 if (fDrive) 331 { 332 // Float_t ra = fDrive->GetRa(); 333 // Float_t dec = fDrive->GetDec(); 424 if (fNumIntegratedEvents >= fMaxNumIntegratedEvents) { 425 426 //Fist delete the previous stars in the list 427 fStars->GetList()->Delete(); 428 429 if (fDrive) { 430 431 //If drive information is provided we take RaDec info 432 //from the drive and let the star list fill by the astrocamera. 433 434 //FIXME: rwagner: Doesn't work as expected 435 //FIXME: rwagner: For the time being set manually. 436 //fAstro.SetRaDec(fDrive->GetRa(), fDrive->GetDec()); 437 438 fAstro.SetTime(*fTimeCurr); 439 fAstro.SetGuiActive(); 440 fAstro.FillStarList(fStars->GetList()); 441 442 cout << "Number of Stars added by astrocamera is " <<fStars->GetList()->GetSize() << endl; 443 444 MStarLocalPos* starpos; 445 TIter Next(fStars->GetList()); 446 while ((starpos=(MStarLocalPos*)Next())) { 447 starpos->SetCalcValues(40,40,starpos->GetXExp(),starpos->GetYExp(),fRingInterest/2,fRingInterest/2); 448 starpos->SetFitValues (40,40,starpos->GetXExp(),starpos->GetYExp(),fRingInterest/2,fRingInterest/2,0.,-1); 449 } 450 451 for (UInt_t pix=1; pix<numPixels; pix++) { 452 if (fDisplay.IsUsed(pix)) 453 origPixelsUsed[pix]=(Char_t)kTRUE; 454 else 455 origPixelsUsed[pix]=(Char_t)kFALSE; 456 } 457 458 DCPedestalCalc(); 459 460 } 461 else 462 { 463 464 cout << "No drive information available: Will not use a star catalog to identify stars."<< endl; 465 466 for (UInt_t pix=1; pix<numPixels; pix++) { 467 if (fDisplay.IsUsed(pix)) 468 origPixelsUsed[pix]=(Char_t)kTRUE; 469 else 470 origPixelsUsed[pix]=(Char_t)kFALSE; 471 } 334 472 335 // fAstro.SetRaDec(ra, dec); 336 // fAstro.SetGuiActive(); 337 338 // fAstro.FillStarList(); 339 } 473 if (DCPedestalCalc()) { 474 475 Float_t innermin = fStars->GetInnerPedestalDC()+fDCTailCut*fStars->GetInnerPedestalRMSDC(); 476 Float_t outermin = fStars->GetOuterPedestalDC()+fDCTailCut*fStars->GetOuterPedestalRMSDC(); 477 fMinDCForStars = innermin>outermin?innermin:outermin; 478 if (fMinuitPrintOutLevel>=0) *fLog << dbg << "fMinDCForStars = " << fMinDCForStars << endl; 479 480 // Find the star candidates searching the most brights pairs of pixels 481 Float_t maxPixelDC; 482 MGeomPix maxPixel; 483 484 while(FindPixelWithMaxDC(maxPixelDC, maxPixel)) { 485 486 MStarLocalPos *starpos = new MStarLocalPos; 487 starpos->SetExpValues(maxPixelDC,maxPixel.GetX(),maxPixel.GetY()); 488 starpos->SetCalcValues(maxPixelDC,maxPixelDC,maxPixel.GetX(),maxPixel.GetY(),fRingInterest/2,fRingInterest/2); 489 starpos->SetFitValues(maxPixelDC,maxPixelDC,maxPixel.GetX(),maxPixel.GetY(),fRingInterest/2,fRingInterest/2,0.,-1); 490 fStars->GetList()->Add(starpos); 491 492 ShadowStar(starpos); 493 } 494 fDisplay.SetUsed(origPixelsUsed); 495 } 496 } 497 498 //Show the stars found 499 //fStars->Print("namepossizechierr"); 500 501 //loop to extract position of stars on the camera 502 if (fStars->GetList()->GetSize() == 0) { 503 *fLog << err << GetName() << "No stars candidates in the camera." << endl; 504 return kCONTINUE; 505 } else 506 *fLog << inf << GetName() << " found " << fStars->GetList()->GetSize() 507 << " star candidates in the camera." << endl; 508 509 for (UInt_t pix=1; pix<numPixels; pix++) { 510 if (fDisplay.IsUsed(pix)) 511 origPixelsUsed[pix]=(Char_t)kTRUE; 340 512 else 341 { 342 //Fist delete the previus stars in the list 343 fStars->GetList()->Delete(); 344 // 345 346 for (UInt_t pix=1; pix<numPixels; pix++) 347 { 348 if (fDisplay.IsUsed(pix)) 349 origPixelsUsed[pix]=(Char_t)kTRUE; 350 else 351 origPixelsUsed[pix]=(Char_t)kFALSE; 352 } 353 354 if (DCPedestalCalc()) 355 { 356 357 Float_t innermin = fStars->GetInnerPedestalDC()+fDCTailCut*fStars->GetInnerPedestalRMSDC(); 358 Float_t outermin = fStars->GetOuterPedestalDC()+fDCTailCut*fStars->GetOuterPedestalRMSDC(); 359 fMinDCForStars = innermin>outermin?innermin:outermin; 360 if (fMinuitPrintOutLevel>=0) *fLog << dbg << "fMinDCForStars = " << fMinDCForStars << endl; 361 362 // Find the star candidats searching the most brights pairs of pixels 363 Float_t maxPixelDC; 364 MGeomPix maxPixel; 365 366 while(FindPixelWithMaxDC(maxPixelDC, maxPixel)) 367 { 368 369 MStarLocalPos *starpos = new MStarLocalPos; 370 starpos->SetExpValues(maxPixelDC,maxPixel.GetX(),maxPixel.GetY()); 371 starpos->SetCalcValues(maxPixelDC,maxPixelDC,maxPixel.GetX(),maxPixel.GetY(),fRingInterest/2,fRingInterest/2); 372 starpos->SetFitValues(maxPixelDC,maxPixelDC,maxPixel.GetX(),maxPixel.GetY(),fRingInterest/2,fRingInterest/2,0.,1); 373 fStars->GetList()->Add(starpos); 374 375 ShadowStar(starpos); 376 377 } 378 379 fDisplay.SetUsed(origPixelsUsed); 380 } 381 382 } 383 384 //loop to extract position of stars on the camera 385 if (fStars->GetList()->GetSize() == 0) 386 { 387 *fLog << err << GetName() << " No stars candidates in the camera." << endl; 388 return kCONTINUE; 389 } 390 else 391 *fLog << inf << GetName() << " Found " << fStars->GetList()->GetSize() << " stars candidates in the camera." << endl; 392 393 394 for (UInt_t pix=1; pix<numPixels; pix++) 395 { 396 if (fDisplay.IsUsed(pix)) 397 origPixelsUsed[pix]=(Char_t)kTRUE; 398 else 399 origPixelsUsed[pix]=(Char_t)kFALSE; 400 } 401 402 TIter Next(fStars->GetList()); 403 MStarLocalPos* star; 404 while ((star=(MStarLocalPos*)Next())) 405 { 406 FindStar(star); 407 ShadowStar(star); 408 } 409 410 //After finding stars reset all vairables 411 fDisplay.Reset(); 412 fStars->GetDisplay().Reset(); //FIXME: Put this display just in the container 413 fDisplay.SetUsed(origPixelsUsed); 414 fNumIntegratedEvents=0; 415 } 416 417 for (UInt_t pix=1; pix<numPixels; pix++) 418 { 419 if (fDisplay.IsUsed(pix)) 420 origPixelsUsed[pix]=(Char_t)kTRUE; 421 else 422 origPixelsUsed[pix]=(Char_t)kFALSE; 423 424 } 425 426 fDisplay.AddCamContent(*fCurr); 427 fNumIntegratedEvents++; 513 origPixelsUsed[pix]=(Char_t)kFALSE; 514 } 515 516 TIter Next(fStars->GetList()); 517 MStarLocalPos* star; 518 while ((star=(MStarLocalPos*)Next())) { 519 FindStar(star); 520 ShadowStar(star); 521 } 522 523 //Show the stars found: Here it is interesting to see what FindStars 524 //made out of the positions we gave to it. 525 if (fMinuitPrintOutLevel>=0) 526 fStars->Print("namepossizchierr"); 527 528 //After finding stars reset all variables 529 fDisplay.Reset(); 530 fStars->GetDisplay().Reset(); //FIXME: Put this display just in the container 428 531 fDisplay.SetUsed(origPixelsUsed); 532 fNumIntegratedEvents=0; 533 } 534 535 for (UInt_t pix=1; pix<numPixels; pix++) { 536 if (fDisplay.IsUsed(pix)) 537 origPixelsUsed[pix]=(Char_t)kTRUE; 538 else 539 origPixelsUsed[pix]=(Char_t)kFALSE; 429 540 430 541 } 542 543 fDisplay.AddCamContent(*fCurr); 544 fNumIntegratedEvents++; 545 fDisplay.SetUsed(origPixelsUsed); 546 431 547 return kTRUE; 432 548 } … … 449 565 fDisplay.SetUsed(fPixelsUsed); 450 566 } 567 568 //------------------------------------------------------------------------- 569 // 570 // DCPedestalCalc : 571 // 572 // 573 // 574 // 451 575 452 576 Bool_t MFindStars::DCPedestalCalc() … … 463 587 Float_t rms; 464 588 465 TH1F **dchist = new TH1F*[2]; 589 //TH1F **dchist = new TH1F*[2]; 590 TH1F *dchist[2]; 591 TString tit; 592 TString nam; 466 593 for (UInt_t i=0; i<2; i++) 467 dchist[i] = new TH1F("","",26,0.4*fMaxNumIntegratedEvents,3.*fMaxNumIntegratedEvents); 468 594 { 595 nam = i; 596 tit = "dchist["; 597 tit += i; 598 tit += "]"; 599 dchist[i] = new TH1F(nam, tit, 600 26,0.4*fMaxNumIntegratedEvents,3.*fMaxNumIntegratedEvents); 601 } 602 469 603 for (UInt_t pix=1; pix<=lastInnerPixel; pix++) 470 604 dchist[0]->Fill(fDisplay.GetBinContent(pix+1)); … … 474 608 // inner/outer pixels 475 609 for (UInt_t i=0; i<2; i++) 476 610 { 477 611 Float_t nummaxprobdc = dchist[i]->GetBinContent(dchist[i]->GetMaximumBin()); 478 612 Float_t maxprobdc = dchist[i]->GetBinCenter(dchist[i]->GetMaximumBin()); … … 517 651 { 518 652 *fLog << dbg << "dchist[i]->GetEntries()" << dchist[i]->GetEntries(); 653 // TCanvas *c1 = new TCanvas("c2","c2",500,800); 654 // dchist[i]->Draw(); 655 // c1->Print("dchist.ps"); 656 // delete c1; 657 // exit(1); 519 658 } 520 659 else if (TMath::Abs(ped-maxprobdc) > rmsguess || rms > rmsguess) … … 527 666 } 528 667 529 // TCanvas *c1 = new TCanvas("c2","c2",500,800);530 // dchist[i]->Draw();531 // c1->Print("dchist.ps");532 // getchar();533 // delete c1;534 // exit(1);535 536 668 if (i == 0) 537 669 { … … 544 676 fStars->SetOuterPedestalRMSDC(rms); 545 677 } 546 547 548 549 } 678 } 550 679 551 680 681 552 682 for (UInt_t i=0; i<2; i++) 683 { 553 684 delete dchist[i]; 554 delete [] dchist; 685 } 686 //delete [] dchist; 555 687 556 688 //================================================================= … … 632 764 } 633 765 766 767 //---------------------------------------------------------------------------- 768 // 769 // FindStar 770 // 771 // 772 // 773 634 774 Bool_t MFindStars::FindStar(MStarLocalPos* star) 635 775 { 636 637 776 UInt_t numPixels = fGeomCam->GetNumPixels(); 638 777 Float_t innerped = fStars->GetInnerPedestalDC(); … … 652 791 Float_t expX = star->GetXExp(); 653 792 Float_t expY = star->GetYExp(); 654 793 655 794 Float_t max=0; 656 795 UInt_t pixmax=0; … … 660 799 Float_t meanSqY=0; 661 800 Float_t sumCharge=0; 662 UInt_t usedInnerPx=0; 663 UInt_t usedOuterPx=0; 801 UInt_t usedInnerPx=0; 802 UInt_t usedOuterPx=0; 803 804 Float_t meanXold = 1.e10; 805 Float_t meanYold = 1.e10; 664 806 665 807 const Float_t meanPresition = 3.; //[mm] … … 667 809 UInt_t numIterations = 0; 668 810 669 do 670 { 671 // First define a area of interest around the expected position of the star 672 for (UInt_t pix=1; pix<numPixels; pix++) 673 { 674 675 Float_t pixXpos=(*fGeomCam)[pix].GetX(); 676 Float_t pixYpos=(*fGeomCam)[pix].GetY(); 677 Float_t dist = sqrt((pixXpos-expX)*(pixXpos-expX)+ 678 (pixYpos-expY)*(pixYpos-expY)); 679 680 if ((dist < fRingInterest) && fDisplay.IsUsed(pix)) 681 fPixelsUsed[pix]=(Char_t)kTRUE; 682 else 683 fPixelsUsed[pix]=(Char_t)kFALSE; 684 } 685 686 fDisplay.SetUsed(fPixelsUsed); 811 //-------------------- start of iteration loop ----------------------- 812 for (UInt_t it=0; it<maxNumIterations; it++) 813 { 814 //rwagner: Need to find px with highest dc and need to assume it is 815 // somewhere near the center of the star 816 //after that we need to REDEFINE our roi! because expected pos could be 817 // quite off that px! 818 819 // 1.) Initial roi around expected position 820 821 for (UInt_t pix=1; pix<numPixels; pix++) 822 { 823 824 Float_t pixXpos=(*fGeomCam)[pix].GetX(); 825 Float_t pixYpos=(*fGeomCam)[pix].GetY(); 826 Float_t dist = sqrt((pixXpos-expX)*(pixXpos-expX)+ 827 (pixYpos-expY)*(pixYpos-expY)); 828 829 if ((dist < fRingInterest) && fDisplay.IsUsed(pix)) 830 fPixelsUsed[pix]=(Char_t)kTRUE; 831 else 832 fPixelsUsed[pix]=(Char_t)kFALSE; 833 } 834 fDisplay.SetUsed(fPixelsUsed); 835 836 // 2.) Find px with highest dc in that region 837 838 max = 0.0; 839 pixmax = 0; 840 for(UInt_t pix=0; pix<numPixels; pix++) 841 if(fDisplay.IsUsed(pix)) 842 { 843 Float_t charge = fDisplay.GetBinContent(pix+1); 844 if (charge>max) 845 { 846 max=charge; 847 pixmax=pix; 848 } 849 } 850 851 // 3.) make it new center 852 853 expX = (*fGeomCam)[pixmax].GetX(); 854 expY = (*fGeomCam)[pixmax].GetY(); 855 856 for (UInt_t pix=1; pix<numPixels; pix++) 857 fPixelsUsed[pix]=(Char_t)kTRUE; 858 fDisplay.SetUsed(fPixelsUsed); 859 860 // First define a area of interest around the expected position of the star 861 for (UInt_t pix=1; pix<numPixels; pix++) 862 { 863 Float_t pixXpos=(*fGeomCam)[pix].GetX(); 864 Float_t pixYpos=(*fGeomCam)[pix].GetY(); 865 Float_t dist = sqrt((pixXpos-expX)*(pixXpos-expX)+ 866 (pixYpos-expY)*(pixYpos-expY)); 867 868 if ((dist < fRingInterest) && fDisplay.IsUsed(pix)) 869 fPixelsUsed[pix]=(Char_t)kTRUE; 870 else 871 fPixelsUsed[pix]=(Char_t)kFALSE; 872 } 873 874 fDisplay.SetUsed(fPixelsUsed); 687 875 688 // determine mean x and mean y 689 usedInnerPx=0; 690 usedOuterPx=0; 691 for(UInt_t pix=0; pix<numPixels; pix++) 692 { 693 if(fDisplay.IsUsed(pix)) 876 // determine mean x and mean y 877 max = 0.0; 878 pixmax = 0; 879 meanX = 0.0; 880 meanY = 0.0; 881 meanSqX = 0.0; 882 meanSqY = 0.0; 883 sumCharge = 0.0; 884 usedInnerPx = 0; 885 usedOuterPx = 0; 886 887 for(UInt_t pix=0; pix<numPixels; pix++) 694 888 { 695 pix>lastInnerPixel?usedOuterPx++:usedInnerPx++; 696 697 Float_t charge = fDisplay.GetBinContent(pix+1); 698 Float_t pixXpos = (*fGeomCam)[pix].GetX(); 699 Float_t pixYpos = (*fGeomCam)[pix].GetY(); 700 701 if (charge>max) 702 { 703 max=charge; 704 pixmax=pix; 705 } 706 707 meanX += charge*pixXpos; 708 meanY += charge*pixYpos; 709 meanSqX += charge*pixXpos*pixXpos; 710 meanSqY += charge*pixYpos*pixYpos; 711 sumCharge += charge; 712 } 713 } 714 715 if (fMinuitPrintOutLevel>=0) *fLog << dbg << " usedInnerPx " << usedInnerPx << " usedOuterPx " << usedOuterPx << endl; 716 717 meanX /= sumCharge; 718 meanY /= sumCharge; 719 meanSqX /= sumCharge; 720 meanSqY /= sumCharge; 721 722 expX = meanX; 723 expY = meanY; 724 725 if (++numIterations > maxNumIterations) 726 { 727 *fLog << warn << GetName() << "Mean calculation not converge after " << maxNumIterations << " iterations" << endl; 889 if(fDisplay.IsUsed(pix)) 890 { 891 pix>lastInnerPixel?usedOuterPx++:usedInnerPx++; 892 893 Float_t charge = fDisplay.GetBinContent(pix+1); 894 Float_t pixXpos = (*fGeomCam)[pix].GetX(); 895 Float_t pixYpos = (*fGeomCam)[pix].GetY(); 896 897 if (charge>max) 898 { 899 max=charge; 900 pixmax=pix; 901 } 902 903 meanX += charge*pixXpos; 904 meanY += charge*pixYpos; 905 meanSqX += charge*pixXpos*pixXpos; 906 meanSqY += charge*pixYpos*pixYpos; 907 sumCharge += charge; 908 } 909 } 910 911 if (fMinuitPrintOutLevel>=0) *fLog << dbg << " usedInnerPx " << usedInnerPx << " usedOuterPx " << usedOuterPx << endl; 912 913 meanX /= sumCharge; 914 meanY /= sumCharge; 915 meanSqX /= sumCharge; 916 meanSqY /= sumCharge; 917 918 // stop iteration when (meanX, meanY) becomes stable 919 if ( TMath::Abs(meanX-meanXold) < meanPresition && 920 TMath::Abs(meanY-meanYold) < meanPresition ) 728 921 break; 729 } 730 731 }while(TMath::Abs(meanX-expX) > meanPresition || TMath::Abs(meanY-expY) > meanPresition); 732 733 Float_t rmsX = (meanSqX - meanX*meanX) - fRingInterest*fRingInterest/12; 734 Float_t rmsY = (meanSqY - meanY*meanY) - fRingInterest*fRingInterest/12; 735 736 if ( rmsX > 0) 737 rmsX = TMath::Sqrt(rmsX); 738 else 739 { 740 *fLog << warn << " MFindStars::FindStar negative rmsX² " << rmsX << endl; 741 *fLog << warn << " meanSqX " << meanSqX << " meanX " << meanX << " fRingInterest " << fRingInterest << " sumCharge " << sumCharge << endl; 742 rmsX = 0.; 743 } 744 745 if ( rmsY > 0) 746 rmsY = TMath::Sqrt(rmsY); 747 else 748 { 749 *fLog << warn << " MFindStars::FindStar negative rmsY² " << rmsY << endl; 750 *fLog << warn << " meanSqY " << meanSqY << " meanY " << meanY << " fRingInterest " << fRingInterest << " sumCharge " << sumCharge<< endl; 751 rmsY = 0.; 752 } 753 754 // Substrack pedestal DC 755 sumCharge-= (usedInnerPx*innerped+usedOuterPx*outerped)/(usedInnerPx+usedOuterPx); 756 max-=pixmax>lastInnerPixel?outerped:innerped; 757 758 759 star->SetCalcValues(sumCharge,max,meanX,meanY,rmsX,rmsY); 760 761 if (rmsX <= 0. || rmsY <= 0.) 762 return kFALSE; 922 923 meanXold = meanX; 924 meanYold = meanY; 925 numIterations++; 926 } 927 // this statement was commented out because the condition 928 // was never fulfilled : 929 //while(TMath::Abs(meanX-expX) > meanPresition || 930 // TMath::Abs(meanY-expY) > meanPresition); 931 //-------------------- end of iteration loop ----------------------- 932 933 if (numIterations >= maxNumIterations) 934 { 935 *fLog << warn << GetName() << "Mean calculation not converged after " 936 << maxNumIterations << " iterations" << endl; 937 } 938 939 940 //Float_t rmsX = (meanSqX - meanX*meanX) - fRingInterest*fRingInterest/12; 941 //Float_t rmsY = (meanSqY - meanY*meanY) - fRingInterest*fRingInterest/12; 942 943 Float_t rmsX = (meanSqX - meanX*meanX); 944 Float_t rmsY = (meanSqY - meanY*meanY); 945 946 if ( rmsX > 0) 947 rmsX = TMath::Sqrt(rmsX); 948 else 949 { 950 *fLog << warn << " MFindStars::FindStar negative rmsX² " << rmsX << endl; 951 *fLog << warn << " meanSqX " << meanSqX << " meanX " << meanX << " fRingInterest " << fRingInterest << " sumCharge " << sumCharge << endl; 952 rmsX = 0.; 953 } 954 955 if ( rmsY > 0) 956 rmsY = TMath::Sqrt(rmsY); 957 else 958 { 959 *fLog << warn << " MFindStars::FindStar negative rmsY² " << rmsY << endl; 960 *fLog << warn << " meanSqY " << meanSqY << " meanY " << meanY << " fRingInterest " << fRingInterest << " sumCharge " << sumCharge<< endl; 961 rmsY = 0.; 962 } 963 964 // Substrack pedestal DC 965 sumCharge-= (usedInnerPx*innerped+usedOuterPx*outerped)/(usedInnerPx+usedOuterPx); 966 max-=pixmax>lastInnerPixel?outerped:innerped; 967 968 969 star->SetCalcValues( sumCharge, max, meanX, meanY, rmsX, rmsY); 970 971 if (rmsX <= 0. || rmsY <= 0.) 972 return kFALSE; 763 973 764 974 … … 772 982 if (fMinuitPrintOutLevel>=0) *fLog << dbg << "fMinDCForStars " << fMinDCForStars << " pixmax>lastInnerPixel?outerped:innerped " << (pixmax>lastInnerPixel?outerped:innerped) << " fMaxNumIntegratedEvents " << fMaxNumIntegratedEvents << endl; 773 983 774 //Initial ate variables for fit984 //Initialize variables for fit 775 985 fVinit[0] = max; 776 986 fLimlo[0] = fMinDCForStars-(pixmax>lastInnerPixel?outerped:innerped); … … 782 992 //Init steps 783 993 for(Int_t i=0; i<fNumVar; i++) 784 994 { 785 995 if (fVinit[i] != 0) 786 996 fStep[i] = TMath::Abs(fVinit[i]/sqrt2); 997 else 998 fStep[i] = 0.1; 999 787 1000 if (fMinuitPrintOutLevel>=0) *fLog << dbg << " fVinit[" << i << "] " << fVinit[i]; 788 1001 if (fMinuitPrintOutLevel>=0) *fLog << dbg << " fStep[" << i << "] " << fStep[i]; 789 1002 if (fMinuitPrintOutLevel>=0) *fLog << dbg << " fLimlo[" << i << "] " << fLimlo[i]; 790 1003 if (fMinuitPrintOutLevel>=0) *fLog << dbg << " fLimup[" << i << "] " << fLimup[i] << endl; 791 } 792 // 1004 } 1005 1006 // set the correlation fixed if requested 1007 if (fUseCorrelatedGauss && fFixCorrelation) 1008 { 1009 fStep[5] = 0.0; 1010 fFix[5] = 1; 1011 } 1012 793 1013 794 1014 // ------------------------------------------- … … 809 1029 gMinuit->mnexcm(fMethod, arglist ,2,ierflg); 810 1030 1031 // call fcn with iflag = 3 1032 //arglist[0] = 3; 1033 //Int_t ierflg3; 1034 //gMinuit->mnexcm("CALL", arglist, 1, ierflg3); 1035 811 1036 clock.Stop(); 812 1037 … … 817 1042 } 818 1043 819 Double_t integratedCharge; 820 Double_t maxFit, maxFitError; 821 Double_t meanXFit, meanXFitError; 822 Double_t sigmaMinorAxis, sigmaMinorAxisError; 823 Double_t meanYFit, meanYFitError; 824 Double_t sigmaMajorAxis, sigmaMajorAxisError; 825 Float_t chisquare = GetChisquare(); 826 Int_t dregrees = GetDegreesofFreedom()-fNumVar; 827 828 if (!ierflg) 1044 1045 //---------- for the uncorrelated Gauss fit (start) --------- 1046 if (!fUseCorrelatedGauss) 1047 { 1048 Double_t integratedCharge; 1049 Double_t maxFit, maxFitError; 1050 Double_t meanXFit, meanXFitError; 1051 Double_t sigmaX, sigmaXError; 1052 Double_t meanYFit, meanYFitError; 1053 Double_t sigmaY, sigmaYError; 1054 Float_t chisquare = GetChisquare(); 1055 Int_t dregrees = GetDegreesofFreedom()-fNumVar; 1056 1057 if (!ierflg) 829 1058 { 830 gMinuit->GetParameter(0, maxFit,maxFitError);831 gMinuit->GetParameter(1, meanXFit,meanXFitError);832 gMinuit->GetParameter(2, sigmaMinorAxis,sigmaMinorAxisError);833 gMinuit->GetParameter(3, meanYFit,meanYFitError);834 gMinuit->GetParameter(4, sigmaMajorAxis,sigmaMajorAxisError);1059 gMinuit->GetParameter(0, maxFit, maxFitError); 1060 gMinuit->GetParameter(1, meanXFit, meanXFitError); 1061 gMinuit->GetParameter(2, sigmaX, sigmaXError); 1062 gMinuit->GetParameter(3, meanYFit, meanYFitError); 1063 gMinuit->GetParameter(4, sigmaY, sigmaYError); 835 1064 836 1065 //FIXME: Do the integral properlly 837 1066 integratedCharge = 0.; 838 839 840 } 841 else 1067 } 1068 else 842 1069 { 843 1070 maxFit = 0.; 844 1071 meanXFit = 0.; 845 sigma MinorAxis= 0.;1072 sigmaX = 0.; 846 1073 meanYFit = 0.; 847 sigma MajorAxis= 0.;1074 sigmaY = 0.; 848 1075 integratedCharge = 0.; 849 1076 850 1077 *fLog << err << "TMinuit::Call error " << ierflg << endl; 851 1078 } 852 853 star->SetFitValues(integratedCharge,maxFit,meanXFit,meanYFit,sigmaMinorAxis,sigmaMajorAxis,chisquare,dregrees); 854 1079 1080 //rwagner: get error matrix 1081 Double_t matrix[5][5]; 1082 gMinuit->mnemat(&matrix[0][0],5); 1083 1084 star->SetFitValues(integratedCharge,maxFit, meanXFit, meanYFit, 1085 sigmaX, sigmaY, chisquare, dregrees, 1086 matrix[1][1], matrix[1][3], matrix[3][3]); 1087 1088 // set the results from the correlated Gauss fit to zero 1089 star->SetCGFitValues(100.0, 100.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1090 0.0, 0.0, 0.0, 0.0, -1); 1091 } 1092 //---------- for the uncorrelated Gauss fit (end) --------- 1093 1094 //---------- for the correlated Gauss fit (start) --------- 1095 if (fUseCorrelatedGauss) 1096 { 1097 TArrayD fValues(fNumVar); 1098 TArrayD fErrors(fNumVar); 1099 1100 const static Int_t fNdim = 6; 1101 Double_t matrix[fNdim][fNdim]; 1102 1103 Double_t fmin = 0.0; 1104 Double_t fedm = 0.0; 1105 Double_t errdef = 0.0; 1106 Int_t npari = 0; 1107 Int_t nparx = 0; 1108 Int_t istat = 0; 1109 gMinuit->mnstat(fmin, fedm, errdef, npari, nparx, istat); 1110 if (fMinuitPrintOutLevel>=0) 1111 { 1112 *fLog << dbg 1113 << "Status of Correlated Gauss fit to the DC currents : " << endl; 1114 } 1115 if (fMinuitPrintOutLevel>=0) 1116 { 1117 *fLog << dbg 1118 << " fmin, fedm, errdef, npari, nparx, istat = " 1119 << fmin << ", " << fedm << ", " << errdef << ", " << npari 1120 << ", " << nparx << ", " << istat << endl; 1121 } 1122 1123 if (!ierflg) 1124 { 1125 for (Int_t k=0; k<fNumVar; k++) 1126 gMinuit->GetParameter( k, fValues[k], fErrors[k] ); 1127 } 1128 else 1129 { 1130 *fLog << err << "Correlated Gauss fit failed : ierflg, istat = " 1131 << ierflg << ", " << istat << endl; 1132 } 1133 1134 Float_t charge = 0.0; 1135 Float_t chi2 = fmin; 1136 Int_t ndof = GetDegreesofFreedom()-fNumVar; 1137 1138 //get error matrix 1139 if (istat >= 1) 1140 { 1141 gMinuit->mnemat( &matrix[0][0], fNdim); 1142 1143 // copy covariance matrix into a matrix which includes also the fixed 1144 // parameters 1145 TString name; 1146 Double_t bnd1, bnd2, val, err; 1147 Int_t jvarbl; 1148 Int_t kvarbl; 1149 for (Int_t j=0; j<fNumVar; j++) 1150 { 1151 if (gMinuit) 1152 gMinuit->mnpout(j, name, val, err, bnd1, bnd2, jvarbl); 1153 1154 for (Int_t k=0; k<fNumVar; k++) 1155 { 1156 if (gMinuit) 1157 gMinuit->mnpout(k, name, val, err, bnd1, bnd2, kvarbl); 1158 1159 matrix[j][k] = jvarbl==0 || kvarbl==0 ? 0 : matrix[jvarbl-1][kvarbl-1]; 1160 } 1161 } 1162 } 1163 else 1164 { 1165 // error matrix was not calculated, construct it 1166 if (fMinuitPrintOutLevel>=0) 1167 { 1168 *fLog << warn 1169 << "error matrix is not defined, construct it" << endl; 1170 } 1171 for (Int_t j=0; j<fNumVar; j++) 1172 { 1173 for (Int_t k=0; k<fNumVar; k++) 1174 matrix[j][k] = 0; 1175 1176 matrix[j][j] = fErrors[j]*fErrors[j]; 1177 } 1178 } 1179 1180 if (fMinuitPrintOutLevel>=0) 1181 { 1182 *fLog << "Before calling SetCGFitValues : " << endl; 1183 *fLog << "fValues = " << fValues[0] << ", " << fValues[1] << ", " 1184 << fValues[2] << ", " << fValues[3] << ", " << fValues[4] 1185 << ", " << fValues[5] << endl; 1186 1187 *fLog << "fErrors = " << fErrors[0] << ", " << fErrors[1] << ", " 1188 << fErrors[2] << ", " << fErrors[3] << ", " << fErrors[4] 1189 << ", " << fErrors[5] << endl; 1190 1191 *fLog << "error matrix = " << matrix[0][0] << " " << matrix[0][1] 1192 << " " << matrix[0][2] << " " << matrix[0][3] 1193 << " " << matrix[0][4] << " " << matrix[0][5] 1194 << endl; 1195 *fLog << " " << matrix[1][0] << " " << matrix[1][1] 1196 << " " << matrix[1][2] << " " << matrix[1][3] 1197 << " " << matrix[1][4] << " " << matrix[1][5] 1198 << endl; 1199 *fLog << " " << matrix[2][0] << " " << matrix[2][1] 1200 << " " << matrix[2][2] << " " << matrix[2][3] 1201 << " " << matrix[2][4] << " " << matrix[2][5] 1202 << endl; 1203 *fLog << " " << matrix[3][0] << " " << matrix[3][1] 1204 << " " << matrix[3][2] << " " << matrix[3][3] 1205 << " " << matrix[3][4] << " " << matrix[3][5] 1206 << endl; 1207 *fLog << " " << matrix[4][0] << " " << matrix[4][1] 1208 << " " << matrix[4][2] << " " << matrix[4][3] 1209 << " " << matrix[4][4] << " " << matrix[4][5] 1210 << endl; 1211 *fLog << " " << matrix[5][0] << " " << matrix[5][1] 1212 << " " << matrix[5][2] << " " << matrix[5][3] 1213 << " " << matrix[5][4] << " " << matrix[5][5] 1214 << endl; 1215 } 1216 1217 star->SetCGFitValues(charge, fValues[0], fValues[1], fValues[3], 1218 fValues[2], fValues[4], fValues[5], 1219 matrix[1][1], matrix[1][3],matrix[3][3], 1220 chi2, ndof); 1221 // set the results from the uncorrelated Gauss fit to zero 1222 star->SetFitValues(100.0, 100.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1, 1223 0.0, 0.0, 0.0); 1224 } 1225 1226 //---------- for the correlated Gauss fit (end) --------- 1227 1228 855 1229 // reset the display to the starting values 856 1230 fDisplay.SetUsed(origPixelsUsed); … … 873 1247 Float_t starXpos = star->GetMeanX(); 874 1248 Float_t starYpos = star->GetMeanY(); 875 876 Float_t starSize = 3*star->GetSigmaMajorAxis(); 1249 1250 Float_t starSize = 3*star->GetSigmaMajorAxis(); 877 1251 878 1252 Float_t dist = sqrt((pixXpos-starXpos)*(pixXpos-starXpos)+ … … 899 1273 900 1274 1275 1276 1277 1278 1279 1280 1281 -
trunk/MagicSoft/Mars/mtemp/MFindStars.h
r4294 r4546 41 41 MStarLocalCam *fStars; 42 42 43 //MAstroCamera fAstro;43 MAstroCamera fAstro; 44 44 TArrayC fPixelsUsed; 45 45 MHCamera fDisplay; … … 54 54 55 55 //Fitting(Minuit) variables 56 constInt_t fNumVar;56 Int_t fNumVar; 57 57 Float_t fTempChisquare; 58 58 Int_t fTempDegreesofFreedom; 59 59 Int_t fMinuitPrintOutLevel; 60 60 61 Bool_t fUseCorrelatedGauss; 62 Bool_t fFixCorrelation; 63 61 64 TString *fVname; 62 65 TArrayD fVinit; … … 74 77 Bool_t ShadowStar(MStarLocalPos* star); 75 78 79 TString fGeometryFile; 80 TString fBSCFile; 81 76 82 public: 77 83 … … 82 88 Int_t PostProcess(); 83 89 90 void SetUseCorrelatedGauss(Bool_t usecorrgauss = kTRUE, 91 Bool_t fixcorr = kFALSE); 92 Bool_t GetUseCorrelatedGauss() {return fUseCorrelatedGauss;} 93 Bool_t GetFixCorrelation() {return fFixCorrelation;} 94 84 95 // setters 85 void SetNumIntegratedEvents(UInt_t max) {fMaxNumIntegratedEvents=max;}86 void SetRingInterest(Float_t ring) {fRingInterest=ring;}96 void SetNumIntegratedEvents(UInt_t max) {fMaxNumIntegratedEvents=max;} 97 void SetRingInterest(Float_t ring) {fRingInterest=ring;} 87 98 void SetBlindPixels(TArrayS blindpixels); 88 99 void SetMinuitPrintOutLevel(Int_t level) {fMinuitPrintOutLevel=level;} 89 void SetDCTailCut(Float_t cut) {fDCTailCut=cut;}100 void SetDCTailCut(Float_t cut) {fDCTailCut=cut;} 90 101 91 void SetChisquare(Float_t chi) {fTempChisquare=chi;} 92 void SetDegreesofFreedom(Int_t free) {fTempDegreesofFreedom=free;} 102 void SetChisquare(Float_t chi) {fTempChisquare=chi;} 103 void SetDegreesofFreedom(Int_t free) {fTempDegreesofFreedom=free;} 104 105 void SetGeometryFile(TString f) {fGeometryFile=f;} 106 void SetBSCFile(TString f) {fBSCFile=f;} 107 void SetRaDec(Double_t ra, Double_t dec) {fAstro.SetRaDec(ra,dec);} 108 void SetRaDec(TVector3 &v) { fAstro.SetRaDec(v); } 109 void SetLimMag(Double_t mag) { fAstro.SetLimMag(mag); } 110 void SetRadiusFOV(Double_t deg) { fAstro.SetRadiusFOV(deg); } 111 93 112 94 113 //Getters 95 MHCamera& GetDisplay() { return fDisplay; }114 MHCamera& GetDisplay() { return fDisplay; } 96 115 97 Float_t GetChisquare() {return fTempChisquare;}98 Int_t GetDegreesofFreedom(){return fTempDegreesofFreedom;}99 UInt_t GetNumIntegratedEvents() {return fMaxNumIntegratedEvents;}100 Float_t GetRingInterest() {return fRingInterest;}116 Float_t GetChisquare() {return fTempChisquare;} 117 Int_t GetDegreesofFreedom() {return fTempDegreesofFreedom;} 118 UInt_t GetNumIntegratedEvents() {return fMaxNumIntegratedEvents;} 119 Float_t GetRingInterest() {return fRingInterest;} 101 120 102 121 ClassDef(MFindStars, 0) // Tool to find stars from DC Currents … … 104 123 105 124 #endif 125 126
Note:
See TracChangeset
for help on using the changeset viewer.