Changeset 5609 for trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc
- Timestamp:
- 12/16/04 17:32:32 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc
r5371 r5609 413 413 MBadPixelsCam *badcam = fIntensBad ? fIntensBad->GetCam() : fBadPixels; 414 414 415 const Int_t nareas = fAverageHiGainAreas->GetSize(); 416 const Int_t nsectors = fAverageHiGainSectors->GetSize(); 417 418 TArrayI satarea(nareas); 419 TArrayI satsect(nsectors); 420 fNumareahi .Reset(); 421 fNumsectorhi.Reset(); 422 415 423 for (Int_t i=0; i<fHiGainArray->GetSize(); i++) 416 424 { 417 425 418 426 MHCalibrationPix &histhi = (*this)[i]; 419 427 420 428 if (histhi.IsExcluded()) 421 429 continue; 422 430 431 const Int_t aidx = (*fGeom)[i].GetAidx(); 432 const Int_t sector = (*fGeom)[i].GetSector(); 433 423 434 MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*relcam)[i] ; 424 435 436 fNumareahi[aidx]++; 437 fNumsectorhi[sector]++; 438 // 439 // Check saturation 440 // 425 441 if (histhi.GetSaturated() > fNumHiGainSaturationLimit*histhi.GetHGausHist()->GetEntries()) 442 { 443 pix.SetHiGainSaturation(); 444 histhi.SetExcluded(); 445 satarea[aidx]++; 446 satsect[sector]++; 447 } 448 else 449 if (IsLoGain()) 450 (*this)(i).SetExcluded(); 451 452 // 453 // Check histogram overflow 454 // 455 CheckOverflow(histhi); 456 if (IsLoGain()) 457 CheckOverflow((*this)(i)); 458 459 } 460 461 for (Int_t j=0; j<nareas; j++) 462 { 463 464 MHCalibrationPix &histhi = GetAverageHiGainArea(j); 465 MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)relcam->GetAverageArea(j); 466 467 if (satarea[j] > 0.5*fNumareahi[j]) 426 468 { 427 469 pix.SetHiGainSaturation(); … … 430 472 else 431 473 if (IsLoGain()) 432 (*this)(i).SetExcluded();433 434 Stat_t overflow = histhi.GetHGausHist()->GetBinContent(histhi.GetHGausHist()->GetNbinsX()+1);435 if (overflow > 0.1)436 {437 *fLog << warn << "HiGain Hist-overflow occurred " << overflow438 << " times in pix: " << i << " (w/o saturation!) " << endl;439 // bad.SetUncalibrated( MBadPixelsPix::kHiGainOverFlow );440 }441 442 overflow = histhi.GetHGausHist()->GetBinContent(0);443 if (overflow > 0.1)444 {445 *fLog << warn << "HiGain Hist-underflow occurred " << overflow446 << " times in pix: " << i << " (w/o saturation!) " << endl;447 // bad.SetUncalibrated( MBadPixelsPix::kHiGainOverFlow );448 }449 }450 451 for (Int_t j=0; j<fAverageHiGainAreas->GetSize(); j++)452 {453 454 MHCalibrationPix &histhi = GetAverageHiGainArea(j);455 456 if (histhi.GetSaturated() > fNumHiGainSaturationLimit*histhi.GetHGausHist()->GetEntries())457 {458 MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)relcam->GetAverageArea(j);459 pix.SetHiGainSaturation();460 histhi.SetExcluded();461 }462 else463 if (IsLoGain())464 474 GetAverageLoGainArea(j).SetExcluded(); 465 475 476 // 477 // Check histogram overflow 478 // 479 CheckOverflow(histhi); 480 if (IsLoGain()) 481 CheckOverflow(GetAverageLoGainArea(j)); 466 482 } 467 483 … … 472 488 MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)relcam->GetAverageSector(j) ; 473 489 474 if ( histhi.GetSaturated() > fNumHiGainSaturationLimit*histhi.GetHGausHist()->GetEntries())490 if (satsect[j] > 0.5*fNumsectorhi[j]) 475 491 { 476 492 pix.SetHiGainSaturation(); … … 480 496 if (IsLoGain()) 481 497 GetAverageLoGainSector(j).SetExcluded(); 498 499 // 500 // Check histogram overflow 501 // 502 CheckOverflow(histhi); 503 if (IsLoGain()) 504 CheckOverflow(GetAverageLoGainSector(j)); 482 505 } 483 506 … … 632 655 // Ask for Hi-Gain saturation 633 656 // 634 if (hipix. GetSaturated() > fNumHiGainSaturationLimit*hipix.GetHGausHist()->GetEntries() && IsLoGain())635 657 if (hipix.IsExcluded() && IsLoGain()) 658 { 636 659 MHCalibrationPix &lopix = GetAverageLoGainArea(i); 637 660 DrawDataCheckPixel(lopix,0.); … … 641 664 } 642 665 } 666 667 void MHCalibrationRelTimeCam::CheckOverflow( MHCalibrationPix &pix ) 668 { 669 670 if (pix.IsExcluded()) 671 return; 672 673 TH1F *hist = pix.GetHGausHist(); 674 675 Stat_t overflow = hist->GetBinContent(hist->GetNbinsX()+1); 676 if (overflow > 0.0005*hist->GetEntries()) 677 { 678 *fLog << warn << "HiGain Hist-overflow occurred " << overflow 679 << " times in " << pix.GetName() << " (w/o saturation!) " << endl; 680 } 681 682 overflow = hist->GetBinContent(0); 683 if (overflow > 0.0005*hist->GetEntries()) 684 { 685 *fLog << warn << "HiGain Hist-underflow occurred " << overflow 686 << " times in " << pix.GetName() << " (w/o saturation!) " << endl; 687 } 688 } 689 643 690 644 691 // -----------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.