Changeset 2488 for trunk/MagicSoft/Mars/mimage
- Timestamp:
- 11/07/03 19:03:41 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mimage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
r2470 r2488 266 266 #include "MParList.h" 267 267 #include "MSigmabar.h" 268 #include "MCameraData.h" 268 269 269 270 #include "MGeomPix.h" … … 312 313 // -------------------------------------------------------------------------- 313 314 // 314 // NT 28/04/2003: now the option to use the standard method or the 315 // The first step of cleaning defines the CORE pixels. All the other pixels 316 // are set as UNUSED and belong to RING 0. 317 // After this point, only the CORE pixels are set as USED, with RING 318 // number 1. 319 // 320 // NT 28/04/2003: now the option to use the standard method or the 315 321 // democratic method is implemented: 316 322 // 317 // KStandard: This method looks for all pixels with an entry (photons) 318 // that is three times bigger than the noise of the pixel 319 // (default: 3 sigma, clean level 1) 320 // 321 // -------------------------------------------------------------------------- 322 // 323 // Returns the maximum Pixel Id (used for ispixused in CleanStep2) 324 // 325 void MImgCleanStd::CleanStep1Std() 323 // kStandard: This method looks for all pixels with an entry (photons) 324 // that is three times bigger than the noise of the pixel 325 // (default: 3 sigma, clean level 1) 326 // 327 // kDemocratic: this method looks for all pixels with an entry (photons) 328 // that is n times bigger than the noise of the mean of the 329 // inner pixels (default: 3 sigmabar, clean level 1) 330 // 331 // 332 void MImgCleanStd::CleanStep1() 326 333 { 327 334 const Int_t entries = fEvt->GetNumPixels(); 328 329 // 330 // check the number of all pixels against the noise level and 331 // set them to 'unused' state if necessary 332 // 333 334 for (Int_t i=0; i<entries; i++ ) 335 { 336 MCerPhotPix &pix = (*fEvt)[i]; 337 338 const Int_t idx = pix.GetPixId(); 339 340 const Float_t entry = pix.GetNumPhotons(); 341 const Float_t noise = (*fPed)[idx].GetPedestalRms(); 342 343 // 344 // We calculate a correction factor which accounts for the 345 // fact that pixels have different size (see TDAS 02-14). 346 // 347 const Double_t factor = fCam->GetPixRatioSqrt(idx); 348 349 // COBB: '<=' to skip entry=noise=0 350 if (entry * factor <= fCleanLvl1 * noise) 351 pix.SetPixelUnused(); 352 } 353 } 354 355 // -------------------------------------------------------------------------- 356 // 357 // NT 28/04/2003: now the option to use the standard method or the 358 // democratic method is implemented: 359 // 360 // "KDemocratic": this method looks for all pixels with an entry (photons) 361 // that is n times bigger than the noise of the mean of the 362 // inner pixels (default: 3 sigmabar, clean level 1) 363 // 364 // Returns the maximum Pixel Id (used for ispixused in CleanStep2) 365 // 366 void MImgCleanStd::CleanStep1Dem() 367 { 368 const Int_t entries = fEvt->GetNumPixels(); 335 const TArrayD &data = fData->GetData(); 369 336 370 337 // … … 376 343 MCerPhotPix &pix = (*fEvt)[i]; 377 344 378 const Int_t idx = pix.GetPixId(); 379 380 const Float_t entry = pix.GetNumPhotons(); 381 const Double_t ratio = fCam->GetPixRatio(idx); 382 383 // COBB: '<=' to skip entry=noise=0 384 if (entry * ratio <= fCleanLvl1 * fInnerNoise) 345 if (data[pix.GetPixId()] <= fCleanLvl1) 385 346 pix.SetPixelUnused(); 386 }387 }388 389 // --------------------------------------------------------------------------390 // The first step of cleaning defines the CORE pixels. All the other pixels391 // are set as UNUSED and belong to RING 0.392 // After this point, only the CORE pixels are set as USED, with RING393 // number 1.394 // Returns the maximum Pixel Id (used for ispixused in CleanStep2)395 //396 void MImgCleanStd::CleanStep1()397 {398 switch (fCleaningMethod)399 {400 case kStandard:401 CleanStep1Std();402 return;403 case kDemocratic:404 CleanStep1Dem();405 return;406 347 } 407 348 } … … 487 428 } 488 429 489 490 // --------------------------------------------------------------------------491 //492 // Look for the boundary pixels around the core pixels493 // if a pixel has more than 2.5 (clean level 2.5) sigma, and494 // a core neigbor it is declared as used.495 //496 Bool_t MImgCleanStd::CleanStep3Std(const MCerPhotPix &pix)497 {498 //499 // get pixel id of this entry500 //501 const Int_t idx = pix.GetPixId();502 503 //504 // check the num of photons against the noise level505 //506 const Float_t entry = pix.GetNumPhotons();507 const Float_t noise = (*fPed)[idx].GetPedestalRms();508 509 //510 // We calculate a correction factor which accounts for the511 // fact that pixels have different size (see TDAS 02-14).512 //513 const Double_t factor = fCam->GetPixRatioSqrt(idx);514 515 return (entry * factor <= fCleanLvl2 * noise);516 }517 518 // --------------------------------------------------------------------------519 //520 // Look for the boundary pixels around the core pixels521 // if a pixel has more than 2.5 (clean level 2.5) sigmabar and522 // a core neighbor, it is declared as used.523 //524 Bool_t MImgCleanStd::CleanStep3Dem(const MCerPhotPix &pix)525 {526 //527 // get pixel id of this entry528 //529 const Int_t idx = pix.GetPixId();530 531 //532 // check the num of photons against the noise level533 //534 const Float_t entry = pix.GetNumPhotons();535 const Double_t ratio = fCam->GetPixRatio(idx);536 537 return (entry * ratio <= fCleanLvl2 * fInnerNoise);538 }539 540 430 void MImgCleanStd::CleanStep3b(MCerPhotPix &pix) 541 431 { … … 598 488 // -------------------------------------------------------------------------- 599 489 // 600 // 601 // 602 // 490 // Look for the boundary pixels around the core pixels 491 // if a pixel has more than 2.5 (clean level 2.5) sigma, and 492 // a core neigbor, it is declared as used. 603 493 // 604 494 void MImgCleanStd::CleanStep3() 605 495 { 606 496 const Int_t entries = fEvt->GetNumPixels(); 497 const TArrayD &data = fData->GetData(); 607 498 608 499 for (UShort_t r=1; r<fCleanRings+1; r++) … … 621 512 continue; 622 513 623 switch (fCleaningMethod) 624 { 625 case kStandard: 626 if (CleanStep3Std(pix)) 627 continue; 628 break; 629 case kDemocratic: 630 if (CleanStep3Dem(pix)) 631 continue; 632 break; 633 } 514 if (data[pix.GetPixId()] <= fCleanLvl2) 515 continue; 634 516 635 517 if (r==1) … … 681 563 } 682 564 565 fData = (MCameraData*)pList->FindCreateObj(AddSerialNumber("MCameraData")); 566 if (!fData) 567 return kFALSE; 568 683 569 return kTRUE; 684 570 } … … 691 577 { 692 578 if (fSgb) 693 fInnerNoise = fSgb->GetSigmabarInner(); 579 fData->Calc(*fEvt, *fSgb, *fCam); 580 else 581 fData->Calc(*fEvt, *fPed, *fCam); 582 694 583 #ifdef DEBUG 695 584 *fLog << all << "CleanStep 1" << endl; -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.h
r2237 r2488 11 11 class MCerPhotEvt; 12 12 class MPedestalCam; 13 class MCameraData; 13 14 14 15 class MGGroupFrame; … … 27 28 MSigmabar *fSgb; //! 28 29 MPedestalCam *fPed; //! 30 MCameraData *fData; //! 29 31 30 32 CleaningMethod_t fCleaningMethod; … … 40 42 void StreamPrimitive(ofstream &out) const; 41 43 42 void CleanStep1Dem();43 void CleanStep1Std();44 Bool_t CleanStep3Dem(const MCerPhotPix &pix);45 Bool_t CleanStep3Std(const MCerPhotPix &pix);46 44 void CleanStep3b(MCerPhotPix &pix); 47 45 void CleanStep4(UShort_t r, MCerPhotPix &pix);
Note:
See TracChangeset
for help on using the changeset viewer.