Changeset 6855 for trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
- Timestamp:
- 03/18/05 17:21:58 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
r6489 r6855 61 61 // 62 62 // When an event is read, before the image cleaning, all the pixels that 63 // are in M CerPhotEvtare set as USED and NOT CORE. All the pixels belong63 // are in MSignalCam are set as USED and NOT CORE. All the pixels belong 64 64 // to RING number 1 (like USED pixels). 65 // Look at M CerPhotPix.h to see how these informations of the pixel are65 // Look at MSignalPix.h to see how these informations of the pixel are 66 66 // stored. 67 67 // The default cleaning METHOD is the STANDARD one and the number of the … … 84 84 // This avoids problems of deformations of the shower images. 85 85 // The signal S_i and the pedestal RMS Prms_i of the pixel are called from 86 // the object M CerPhotPix.86 // the object MSignalPix. 87 87 // If (default method = kStandard) 88 88 //Begin_Html … … 281 281 // MGeomCam 282 282 // MPedPhotCam 283 // M CerPhotEvt283 // MSignalCam 284 284 // 285 285 // Output Containers: 286 // M CerPhotEvt286 // MSignalCam 287 287 // 288 288 ///////////////////////////////////////////////////////////////////////////// … … 307 307 #include "MGeomCam.h" 308 308 309 #include "M CerPhotPix.h"310 #include "M CerPhotEvt.h"309 #include "MSignalPix.h" 310 #include "MSignalCam.h" 311 311 312 312 #include "MGGroupFrame.h" // MGGroupFrame … … 325 325 326 326 const TString MImgCleanStd::gsNamePedPhotCam="MPedPhotCam"; // default name of the 'MPedPhotCam' container 327 const TString MImgCleanStd::gsName CerPhotEvt="MCerPhotEvt"; // default name of the 'MCerPhotEvt' container327 const TString MImgCleanStd::gsNameSignalCam ="MSignalCam"; // default name of the 'MSignalCam' container 328 328 const TString MImgCleanStd::gsNameGeomCam ="MGeomCam"; // default name of the 'MGeomCam' container 329 329 … … 341 341 fCleanLvl2(lvl2), fCleanRings(1), fKeepSinglePixels(kFALSE), 342 342 fNamePedPhotCam(gsNamePedPhotCam), fNameGeomCam(gsNameGeomCam), 343 fName CerPhotEvt(gsNameCerPhotEvt)343 fNameSignalCam(gsNameSignalCam) 344 344 { 345 345 fName = name ? name : gsDefName.Data(); … … 374 374 // set them to 'unused' state if necessary 375 375 // 376 MCerPhotPix *pix; 377 378 // Loop over all pixels 379 MCerPhotEvtIter Next(fEvt, kFALSE); 380 while ((pix=static_cast<MCerPhotPix*>(Next()))) 381 if (!pix->IsPixelUnmapped() && data[pix->GetPixId()] <= fCleanLvl1) 382 pix->SetPixelUnused(); 376 const UInt_t npixevt = fEvt->GetNumPixels(); 377 for (UInt_t idx=0; idx<npixevt; idx++) 378 { 379 if (data[idx]>fCleanLvl1) 380 continue; 381 382 MSignalPix &pix = (*fEvt)[idx]; 383 if (!pix.IsPixelUnmapped()) 384 pix.SetPixelUnused(); 385 } 383 386 } 384 387 … … 395 398 size = 0; 396 399 397 MCerPhotPix *pix; 398 399 // Loop over used pixels only 400 TIter Next(*fEvt); 401 402 while ((pix=static_cast<MCerPhotPix*>(Next()))) 403 { 404 // get pixel id of this entry 405 const Int_t idx = pix->GetPixId(); 400 const UInt_t npixevt = fEvt->GetNumPixels(); 401 for (UInt_t idx=0; idx<npixevt; idx++) 402 { 403 MSignalPix &pix = (*fEvt)[idx]; 404 if (!pix.IsPixelUsed()) 405 continue; 406 406 407 407 // check for 'used' neighbors of this pixel … … 427 427 { 428 428 if (!fKeepSinglePixels) 429 pix ->SetPixelUnused();430 size += pix ->GetNumPhotons();429 pix.SetPixelUnused(); 430 size += pix.GetNumPhotons(); 431 431 n++; 432 432 } 433 433 } 434 434 435 Next.Reset();436 while ((pix=static_cast<MCerPhotPix*>(Next())))437 {438 if (pix ->IsPixelUsed())439 pix ->SetPixelCore();435 for (UInt_t idx=0; idx<npixevt; idx++) 436 { 437 MSignalPix &pix = (*fEvt)[idx]; 438 if (pix.IsPixelUsed()) 439 pix.SetPixelCore(); 440 440 } 441 441 … … 443 443 } 444 444 445 void MImgCleanStd::CleanStep3b( MCerPhotPix &pix)446 { 447 const Int_t idx = pix.GetPixId();445 void MImgCleanStd::CleanStep3b(Int_t idx) 446 { 447 MSignalPix &pix = (*fEvt)[idx]; 448 448 449 449 // … … 475 475 // If a value<2 for fCleanRings is used, no CleanStep4 is done. 476 476 // 477 void MImgCleanStd::CleanStep4(UShort_t r, MCerPhotPix &pix) 478 { 477 void MImgCleanStd::CleanStep4(UShort_t r, Int_t idx/*MSignalPix &pix*/) 478 { 479 MSignalPix &pix = (*fEvt)[idx]; 480 479 481 // 480 482 // Skip events that have already a defined status; … … 488 490 // and tell to which ring it belongs to. 489 491 // 490 const Int_t idx = pix.GetPixId();491 492 492 MGeomPix &gpix = (*fCam)[idx]; 493 493 … … 498 498 const Int_t idx2 = gpix.GetNeighbor(j); 499 499 500 M CerPhotPix *npix = fEvt->GetPixById(idx2);500 MSignalPix *npix = fEvt->GetPixById(idx2); 501 501 if (!npix || !npix->IsPixelUsed() || npix->GetRing()>r-1 ) 502 502 continue; … … 519 519 for (UShort_t r=1; r<fCleanRings+1; r++) 520 520 { 521 MCerPhotPix *pix;522 523 521 // Loop over all pixels 524 525 MCerPhotEvtIter NextAll(fEvt, kFALSE); 526 while ((pix=static_cast<MCerPhotPix*>(NextAll()))) 522 const UInt_t npixevt = fEvt->GetNumPixels(); 523 for (UInt_t idx=0; idx<npixevt; idx++) 527 524 { 525 MSignalPix &pix = (*fEvt)[idx]; 526 528 527 // 529 528 // if pixel is a core pixel or unmapped, go to the next pixel 530 529 // 531 if (pix ->IsPixelCore() || pix->IsPixelUnmapped())530 if (pix.IsPixelCore() || pix.IsPixelUnmapped()) 532 531 continue; 533 532 534 if (data[ pix->GetPixId()] <= fCleanLvl2)533 if (data[idx] <= fCleanLvl2) 535 534 continue; 536 535 537 536 if (r==1) 538 CleanStep3b( *pix);537 CleanStep3b(idx); 539 538 else 540 CleanStep4(r, *pix);539 CleanStep4(r, idx); 541 540 } 542 541 } … … 557 556 } 558 557 559 fEvt = (M CerPhotEvt*)pList->FindObject(AddSerialNumber(fNameCerPhotEvt), "MCerPhotEvt");558 fEvt = (MSignalCam*)pList->FindObject(AddSerialNumber(fNameSignalCam), "MSignalCam"); 560 559 if (!fEvt) 561 560 { 562 *fLog << err << fName CerPhotEvt << " [MCerPhotEvt] not found... aborting." << endl;561 *fLog << err << fNameSignalCam << " [MSignalCam] not found... aborting." << endl; 563 562 return kFALSE; 564 563 } … … 570 569 return kFALSE; 571 570 } 572 573 fTime = (MArrivalTime*)pList->FindObject(AddSerialNumber("MArrivalTime"));574 if (!fTime && fCleaningMethod==kProbability)575 *fLog << warn << "MArrivalTime not found... probability cleaning done with signal only!" << endl;576 571 577 572 fData = (MCameraData*)pList->FindCreateObj(AddSerialNumber("MCameraData")); … … 602 597 break; 603 598 case kProbability: 604 fData->CalcCleaningProbability(*fEvt, *fPed, *fCam , fTime);599 fData->CalcCleaningProbability(*fEvt, *fPed, *fCam); 605 600 break; 606 601 case kAbsolute: … … 819 814 if (gsNameGeomCam!=fNameGeomCam) 820 815 out << " " << GetUniqueName() << ".SetNameGeomCam(\"" << fNameGeomCam << "\");" << endl; 821 if (gsName CerPhotEvt!=fNameCerPhotEvt)822 out << " " << GetUniqueName() << ".SetName CerPhotEvt(\"" << fNameCerPhotEvt<< "\");" << endl;816 if (gsNameSignalCam!=fNameSignalCam) 817 out << " " << GetUniqueName() << ".SetNameSignalCam(\"" << fNameSignalCam << "\");" << endl; 823 818 if (fKeepSinglePixels) 824 819 out << " " << GetUniqueName() << ".SetKeepSinglePixels();" << endl;
Note:
See TracChangeset
for help on using the changeset viewer.