Changeset 4452 for trunk/MagicSoft/Mars/mimage
- Timestamp:
- 08/04/04 11:19:34 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mimage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
r3415 r4452 128 128 // the terms commonly used in the class. 129 129 // 130 // 130 131 // STANDARD CLEANING: 131 132 // ================= … … 165 166 // // add the image cleaning to the main task list 166 167 // 168 // 167 169 // DEMOCRATIC CLEANING: 168 170 // =================== 169 171 // You use this cleaning method when you want to compare the number of 170 // photo-electons of each pixel with the average pedestal RMS 171 // (fInnerNoise = fSgb->GetSigmabarInner()) of the inner pixels (for the 172 // MAGIC camera they are the smaller ones): 172 // photo-electons of each pixel with the average pedestal RMS of the 173 // inner pixels (for the MAGIC camera they are the smaller ones): 173 174 //Begin_Html 174 175 // <img src="images/MImgCleanStd-f2.png"> … … 178 179 // have a different area) are compared to the same pedestal RMS, coming 179 180 // from the inner pixels. 180 // To calculate the average pedestal RMS of the inner pixels, you have to 181 // add to the main task list an object of type MSigmabarCalc before the 182 // MImgCleanStd object. To know how the calculation of fInnerNoise is done 183 // look at the MSigmabarCalc Class. 184 // 185 // Example: 186 // 187 // MSigmabarCalc sbcalc; 188 // //creates an object that calcutates the average pedestal RMS 189 // MImgCleanStd clean; 190 // ... 191 // tlist.AddToList(&sbcalc); 192 // tlist.AddToList(&clean); 181 // 182 // Make sure that you used a class calculating the MPedPhotCam which also 183 // updated the contents of the mean values (Recalc) correctly. 184 // 193 185 // 194 186 // Member Function: SetMethod() … … 206 198 // clean.SetMethod(MImgCleanStd::kDemocratic); 207 199 // //now the method of cleaning is changed to Democratic 200 // 208 201 // 209 202 // FIRST AND SECOND CLEANING LEVEL … … 245 238 // Input Containers: 246 239 // MGeomCam 240 // MPedPhotCam 247 241 // MCerPhotEvt 248 // [MSigmabar]249 242 // 250 243 // Output Containers: … … 265 258 266 259 #include "MParList.h" 267 #include "MSigmabar.h"268 260 #include "MCameraData.h" 269 261 … … 298 290 MImgCleanStd::MImgCleanStd(const Float_t lvl1, const Float_t lvl2, 299 291 const char *name, const char *title) 300 : f Sgb(NULL), fCleaningMethod(kStandard), fCleanLvl1(lvl1),292 : fCleaningMethod(kStandard), fCleanLvl1(lvl1), 301 293 fCleanLvl2(lvl2), fCleanRings(1) 302 294 … … 358 350 359 351 while ((pix=static_cast<MCerPhotPix*>(Next()))) 360 352 { 361 353 // get pixel id of this entry 362 354 const Int_t idx = pix->GetPixId(); … … 391 383 Next.Reset(); 392 384 while ((pix=static_cast<MCerPhotPix*>(Next()))) 393 { 394 if ( pix->IsPixelUsed()) 395 pix->SetPixelCore();} 385 { 386 if (pix->IsPixelUsed()) 387 pix->SetPixelCore(); 388 } 396 389 } 397 390 … … 434 427 // 435 428 if (pix.GetRing() != 0) 436 { 437 return; 438 } 429 return; 439 430 440 431 // … … 480 471 MCerPhotEvtIter NextAll(fEvt, kFALSE); 481 472 while ((pix=static_cast<MCerPhotPix*>(NextAll()))) 482 473 { 483 474 // 484 475 // if pixel is a core pixel or unmapped, go to the next pixel 485 476 // 486 if (pix->IsPixelCore()) 487 { 488 continue;} 489 if (pix->IsPixelUnmapped()) 490 { 491 continue;} 492 493 if (data[pix->GetPixId()] <= fCleanLvl2) 494 { 495 continue;} 496 497 if (r==1) 498 { 499 CleanStep3b(*pix);} 500 else 501 { 502 CleanStep4(r, *pix);} 503 477 if (pix->IsPixelCore() || pix->IsPixelUnmapped()) 478 continue; 479 480 if (data[pix->GetPixId()] <= fCleanLvl2) 481 continue; 482 483 if (r==1) 484 CleanStep3b(*pix); 485 else 486 CleanStep4(r, *pix); 504 487 } 505 488 } … … 527 510 } 528 511 529 if (fCleaningMethod == kDemocratic) 530 { 531 fSgb = (MSigmabar*)pList->FindObject(AddSerialNumber("MSigmabar")); 532 if (!fSgb) 533 { 534 *fLog << dbginf << "MSigmabar not found... aborting." << endl; 535 return kFALSE; 536 } 537 } 538 else 539 { 540 fPed = (MPedPhotCam*)pList->FindObject(AddSerialNumber("MPedPhotCam")); 541 if (!fPed) 542 { 543 *fLog << dbginf << "MPedPhotCam not found... aborting." << endl; 544 return kFALSE; 545 } 512 fPed = (MPedPhotCam*)pList->FindObject(AddSerialNumber("MPedPhotCam")); 513 if (!fPed) 514 { 515 *fLog << dbginf << "MPedPhotCam not found... aborting." << endl; 516 return kFALSE; 546 517 } 547 518 … … 559 530 Int_t MImgCleanStd::Process() 560 531 { 561 if (fSgb)562 fData->CalcCleaningLevel(*fEvt, *fSgb, *fCam);563 else532 switch (fCleaningMethod) 533 { 534 case kStandard: 564 535 fData->CalcCleaningLevel(*fEvt, *fPed, *fCam); 536 break; 537 case kScaled: 538 fData->CalcCleaningLevel2(*fEvt, *fPed, *fCam); 539 break; 540 case kDemocratic: 541 fData->CalcCleaningLevelDemocratic(*fEvt, *fPed, *fCam); 542 break; 543 } 565 544 566 545 #ifdef DEBUG … … 568 547 #endif 569 548 CleanStep1(); 549 550 // For speed reasons skip the rest of the cleaning if no 551 // action will be taken! 552 if (fCleanLvl1>=fCleanLvl2) 553 return kTRUE; 570 554 571 555 #ifdef DEBUG … … 599 583 *fLog << "standard"; 600 584 break; 585 case kScaled: 586 *fLog << "scaled"; 587 break; 601 588 } 602 589 *fLog << " cleaning initialized with noise level " << fCleanLvl1 << " and " << fCleanLvl2; … … 611 598 void MImgCleanStd::CreateGuiElements(MGGroupFrame *f) 612 599 { 613 // 614 // Create a frame for line 3 and 4 to be able 615 // to align entry field and label in one line 616 // 617 TGHorizontalFrame *f1 = new TGHorizontalFrame(f, 0, 0); 618 TGHorizontalFrame *f2 = new TGHorizontalFrame(f, 0, 0); 600 // 601 // Create a frame for line 3 and 4 to be able 602 // to align entry field and label in one line 603 // 604 TGHorizontalFrame *f1 = new TGHorizontalFrame(f, 0, 0); 605 TGHorizontalFrame *f2 = new TGHorizontalFrame(f, 0, 0); 606 607 /* 608 * --> use with root >=3.02 <-- 609 * 610 611 TGNumberEntry *fNumEntry1 = new TGNumberEntry(frame, 3.0, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative); 612 TGNumberEntry *fNumEntry2 = new TGNumberEntry(frame, 2.5, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative); 619 613 620 /* 621 * --> use with root >=3.02 <-- 622 * 623 624 TGNumberEntry *fNumEntry1 = new TGNumberEntry(frame, 3.0, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative); 625 TGNumberEntry *fNumEntry2 = new TGNumberEntry(frame, 2.5, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative); 626 627 */ 628 TGTextEntry *entry1 = new TGTextEntry(f1, "****", kImgCleanLvl1); 629 TGTextEntry *entry2 = new TGTextEntry(f2, "****", kImgCleanLvl2); 630 631 // --- doesn't work like expected (until root 3.02?) --- fNumEntry1->SetAlignment(kTextRight); 632 // --- doesn't work like expected (until root 3.02?) --- fNumEntry2->SetAlignment(kTextRight); 633 634 entry1->SetText("3.0"); 635 entry2->SetText("2.5"); 636 637 entry1->Associate(f); 638 entry2->Associate(f); 639 640 TGLabel *l1 = new TGLabel(f1, "Cleaning Level 1"); 641 TGLabel *l2 = new TGLabel(f2, "Cleaning Level 2"); 642 643 l1->SetTextJustify(kTextLeft); 644 l2->SetTextJustify(kTextLeft); 645 646 // 647 // Align the text of the label centered, left in the row 648 // with a left padding of 10 649 // 650 TGLayoutHints *laylabel = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 10); 651 TGLayoutHints *layframe = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 5, 0, 10); 652 653 // 654 // Add one entry field and the corresponding label to each line 655 // 656 f1->AddFrame(entry1); 657 f2->AddFrame(entry2); 658 659 f1->AddFrame(l1, laylabel); 660 f2->AddFrame(l2, laylabel); 661 662 f->AddFrame(f1, layframe); 663 f->AddFrame(f2, layframe); 664 665 f->AddToList(entry1); 666 f->AddToList(entry2); 667 f->AddToList(l1); 668 f->AddToList(l2); 669 f->AddToList(laylabel); 670 f->AddToList(layframe); 614 */ 615 TGTextEntry *entry1 = new TGTextEntry(f1, "****", kImgCleanLvl1); 616 TGTextEntry *entry2 = new TGTextEntry(f2, "****", kImgCleanLvl2); 617 618 // --- doesn't work like expected (until root 3.02?) --- fNumEntry1->SetAlignment(kTextRight); 619 // --- doesn't work like expected (until root 3.02?) --- fNumEntry2->SetAlignment(kTextRight); 620 621 entry1->SetText("3.0"); 622 entry2->SetText("2.5"); 623 624 entry1->Associate(f); 625 entry2->Associate(f); 626 627 TGLabel *l1 = new TGLabel(f1, "Cleaning Level 1"); 628 TGLabel *l2 = new TGLabel(f2, "Cleaning Level 2"); 629 630 l1->SetTextJustify(kTextLeft); 631 l2->SetTextJustify(kTextLeft); 632 633 // 634 // Align the text of the label centered, left in the row 635 // with a left padding of 10 636 // 637 TGLayoutHints *laylabel = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 10); 638 TGLayoutHints *layframe = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 5, 0, 10); 639 640 // 641 // Add one entry field and the corresponding label to each line 642 // 643 f1->AddFrame(entry1); 644 f2->AddFrame(entry2); 645 646 f1->AddFrame(l1, laylabel); 647 f2->AddFrame(l2, laylabel); 648 649 f->AddFrame(f1, layframe); 650 f->AddFrame(f2, layframe); 651 652 f->AddToList(entry1); 653 f->AddToList(entry2); 654 f->AddToList(l1); 655 f->AddToList(l2); 656 f->AddToList(laylabel); 657 f->AddToList(layframe); 671 658 } 672 659 -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.h
r2781 r4452 20 20 typedef enum { 21 21 kStandard, 22 kScaled, 22 23 kDemocratic 23 24 } CleaningMethod_t; … … 26 27 const MGeomCam *fCam; //! 27 28 MCerPhotEvt *fEvt; //! 28 MSigmabar *fSgb; //!29 29 MPedPhotCam *fPed; //! 30 30 MCameraData *fData; //!
Note:
See TracChangeset
for help on using the changeset viewer.