Changeset 3429
- Timestamp:
- 03/07/04 17:56:39 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3428 r3429 26 26 * mcalib/MHCalibrationChargeCam.[h,cc] 27 27 - include MBadPixelsCam 28 - include one additional MBadPixelsPix for the average inner and 29 outer pixel, respectively 28 30 29 31 * mcalib/MHCalibrationChargePix.[h,cc] -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsPix.cc
r3068 r3429 112 112 MCalibrationCalc - valid for the result of a calibration run: 113 113 114 <- 1 Pedestals not available115 <- 2 FADC samples not available116 117 114 3 Hi-Gain saturated, no LoGain available 118 115 … … 122 119 6 Cannot be fitted - calibrated using Histogram Mean and RMS 123 120 124 7 Mean Charge smaller than PedRMS125 8 Mean Charge smaller than Mean charge in camera minus 5 sigma126 9 Mean Charge bigger than Mean charge in camera plus 5 sigma127 128 10 Sigma Charge smaller than PedRMS129 130 11 Result of F-Factor method invalid131 12 Result of Blind Pixel method invalid132 13 Result of PIN-Diode method invalid133 14 Methods inconsistency134 135 15 Gains oscillate136 137 <- 16 Arrival Time not calculated138 <- 17 Arrival Time not valid139 140 18 Sigma Arrival Time bigger than FADC window141 19 Mean Arrival Time at edge of FADC window142 121 */ 143 122 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r3423 r3429 330 330 return kFALSE; 331 331 } 332 332 333 333 fCam->SetGeomCam(fGeom); 334 fCam->SetBadPixelsCam(fBadPixels); 334 335 335 336 fNumHiGainSamples = fSignals->GetNumUsedHiGainFADCSlices(); … … 438 439 pix.CheckTimeValidity(&bad); 439 440 440 if (!bad.IsCalibration OK())441 if (!bad.IsCalibrationResultOK()) 441 442 continue; 442 443 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc
r3426 r3429 167 167 fAverageInnerPix = new MCalibrationChargePix("AverageInnerPix","Container of the fit results of the camera average inner pixels"); 168 168 fAverageOuterPix = new MCalibrationChargePix("AverageOuterPix","Container of the fit results of the camera average outer pixels"); 169 fAverageInnerBadPix = new MBadPixelsPix("AverageInnerBadPix","Bad Pixel Container of the camera average inner pixels"); 170 fAverageOuterBadPix = new MBadPixelsPix("AverageOuterBadPix","Bad Pixel Container of the camera average outer pixels"); 169 171 170 172 Clear(); … … 188 190 delete fAverageOuterPix; 189 191 192 delete fAverageInnerBadPix; 193 delete fAverageOuterBadPix; 194 190 195 if (fOffsets) 191 196 delete fOffsets; … … 252 257 fAverageInnerPix->Clear(); 253 258 fAverageOuterPix->Clear(); 259 260 fAverageInnerBadPix->Clear(); 261 fAverageOuterBadPix->Clear(); 254 262 255 263 fNumExcludedPixels = 0; -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.h
r3426 r3429 16 16 class MCalibrationChargePINDiode; 17 17 class MCalibrationChargePix; 18 class MBadPixelsPix; 18 19 class MBadPixelsCam; 19 20 class MCalibrationChargeCam : public MParContainer, public MCamEvent … … 25 26 MCalibrationChargePix *fAverageInnerPix; //-> Average Pixel of all events 26 27 MCalibrationChargePix *fAverageOuterPix; //-> Average Pixel of all events 28 29 MBadPixelsPix *fAverageInnerBadPix; //-> Average Pixel of all events 30 MBadPixelsPix *fAverageOuterBadPix; //-> Average Pixel of all events 27 31 28 32 const MCalibrationChargeBlindPix *fBlindPixel; //! Pointer to the Blind Pixel with fit results … … 85 89 const MCalibrationChargePix *GetAverageOuterPix() const { return fAverageOuterPix; } 86 90 91 MBadPixelsPix *GetAverageInnerBadPix() { return fAverageInnerBadPix; } 92 const MBadPixelsPix *GetAverageInnerBadPix() const { return fAverageInnerBadPix; } 93 94 MBadPixelsPix *GetAverageOuterBadPix() { return fAverageOuterBadPix; } 95 const MBadPixelsPix *GetAverageOuterBadPix() const { return fAverageOuterBadPix; } 96 87 97 // Prints 88 98 void Print(Option_t *o="") const; -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc
r3362 r3429 81 81 #include "MGeomPix.h" 82 82 83 #include "MBadPixelsCam.h" 84 #include "MBadPixelsPix.h" 85 83 86 #include "MRawEvtData.h" 84 87 #include "MRawEvtPixelIter.h" … … 97 100 // 98 101 MHCalibrationChargeCam::MHCalibrationChargeCam(const char *name, const char *title) 102 : fRawEvt(NULL), fGeom(NULL), fBadPixels(NULL) 99 103 { 100 104 fName = name ? name : "MHCalibrationChargeCam"; … … 128 132 fAverageLoGainOuterPix->GetHAbsTime()->SetTitle("Absolute Arrival Time average Outer pixels LoGain"); 129 133 130 fAverageHiGainInnerPix->SetChargeLast(1000.); 131 fAverageLoGainInnerPix->SetChargeLast(100.); 132 fAverageHiGainOuterPix->SetChargeLast(1000.); 133 fAverageLoGainOuterPix->SetChargeLast(100.); 134 fAverageHiGainInnerPix->SetChargeFirst(-1000.); 135 fAverageHiGainOuterPix->SetChargeFirst(-1000.); 136 137 fAverageHiGainInnerPix->SetChargeLast(4000.); 138 fAverageLoGainInnerPix->SetChargeLast(4000.); 139 fAverageHiGainOuterPix->SetChargeLast(4000.); 140 fAverageLoGainOuterPix->SetChargeLast(4000.); 134 141 135 142 fAverageHiGainInnerPix->SetChargeNbins(4000); … … 143 150 fNumInnerPixels = 0; 144 151 fNumOuterPixels = 0; 152 fNumExcluded = 0; 145 153 } 146 154 … … 295 303 Bool_t MHCalibrationChargeCam::ReInit(MParList *pList) 296 304 { 305 306 fBadPixels = (MBadPixelsCam*)pList->FindCreateObj("MBadPixelsCam"); 307 if (!fBadPixels) 308 { 309 gLog << err << GetDescriptor() << ": ERROR: Could not find MBadPixelsCam ... aborting " << endl; 310 return kFALSE; 311 } 297 312 298 313 fCam = (MCalibrationChargeCam*)pList->FindCreateObj("MCalibrationChargeCam"); … … 318 333 for (Int_t i=0; i<n; i++) 319 334 { 335 // 336 // Oscillating pixels 337 // 320 338 (*fHiGainArray)[i] = new MHCalibrationChargeHiGainPix; 339 340 if ((*fBadPixels)[i].IsBad()) 341 { 342 fNumExcluded++; 343 (*this)[i].SetExcluded(); 344 } 321 345 (*this)[i].Init(); 322 346 (*this)[i].ChangeHistId(i); 323 324 347 } 325 348 } … … 332 355 { 333 356 (*fLoGainArray)[i] = new MHCalibrationChargeLoGainPix; 357 // 358 // Pixels with non-valid behavior 359 // 360 if ((*fBadPixels)[i].IsBad()) 361 (*this)(i).SetExcluded(); 362 334 363 (*this)(i).Init(); 335 364 (*this)(i).ChangeHistId(i); 336 365 } 337 366 } 367 368 369 370 371 *fLog << inf << GetDescriptor() << ": " << fNumExcluded << " excluded Pixels " << endl; 338 372 339 373 return kTRUE; … … 382 416 for (int i=0; i<n; i++) 383 417 { 418 419 if ((*this)[i].IsExcluded()) 420 continue; 384 421 385 422 const MExtractedSignalPix &pix = (*signal)[i]; … … 430 467 // 431 468 sumhiinnertot = sumloinnertot = sumhioutertot = sumlooutertot = 0.; 469 fNumInnerPixels = fNumOuterPixels = 0; 470 432 471 MRawEvtPixelIter pixel(fRawEvt); 433 472 while (pixel.Next()) … … 435 474 436 475 const UInt_t pixid = pixel.GetPixelId(); 437 438 const Float_t timehi = (Float_t)pixel.GetIdxMaxHiGainSample(); 476 477 if ((*this)[pixid].IsExcluded()) 478 continue; 479 480 const Int_t timehi = (Int_t)pixel.GetIdxMaxHiGainSample(); 439 481 const Float_t timelo = (Float_t)pixel.GetIdxMaxLoGainSample() + 15.; 440 482 … … 446 488 sumhiinnertot += timehi; 447 489 sumloinnertot += timelo; 490 fNumInnerPixels++; 448 491 } 449 492 else … … 451 494 sumhioutertot += timehi; 452 495 sumlooutertot += timelo; 496 fNumOuterPixels++; 453 497 } 454 498 } … … 478 522 { 479 523 524 MCalibrationChargePix &pix = (*fCam)[i]; 480 525 MHCalibrationChargeHiGainPix &histhi = (*this)[i]; 481 MCalibrationChargePix &pix = (*fCam)[i]; 482 483 FinalizeHiGainHists(histhi,pix); 526 MBadPixelsPix &bad = (*fBadPixels)[i]; 527 528 FinalizeHiGainHists(histhi,pix,bad); 529 484 530 } 485 531 … … 487 533 { 488 534 535 if ((*this)(i).IsExcluded()) 536 continue; 537 489 538 MHCalibrationChargeLoGainPix &histlo = (*this)(i); 490 539 MCalibrationChargePix &pix = (*fCam)[i]; 491 492 FinalizeLoGainHists(histlo,pix); 493 } 494 495 FinalizeHiGainHists(*fAverageHiGainInnerPix,*fCam->GetAverageInnerPix()); 496 FinalizeLoGainHists(*fAverageLoGainInnerPix,*fCam->GetAverageInnerPix()); 497 FinalizeHiGainHists(*fAverageHiGainOuterPix,*fCam->GetAverageOuterPix()); 498 FinalizeLoGainHists(*fAverageLoGainOuterPix,*fCam->GetAverageOuterPix()); 540 MBadPixelsPix &bad = (*fBadPixels)[i]; 541 542 FinalizeLoGainHists(histlo,pix,bad); 543 544 } 545 546 FinalizeHiGainHists(*fAverageHiGainInnerPix,*fCam->GetAverageInnerPix(),*fCam->GetAverageInnerBadPix()); 547 FinalizeLoGainHists(*fAverageLoGainInnerPix,*fCam->GetAverageInnerPix(),*fCam->GetAverageInnerBadPix()); 548 FinalizeHiGainHists(*fAverageHiGainOuterPix,*fCam->GetAverageOuterPix(),*fCam->GetAverageOuterBadPix()); 549 FinalizeLoGainHists(*fAverageLoGainOuterPix,*fCam->GetAverageOuterPix(),*fCam->GetAverageOuterBadPix()); 499 550 500 551 fCam->GetAverageInnerPix()->SetSigmaCharge (fCam->GetAverageInnerPix()->GetSigmaCharge() *TMath::Sqrt((Float_t)fNumInnerPixels)); … … 502 553 fCam->GetAverageInnerPix()->SetSigmaChargeErr(fCam->GetAverageInnerPix()->GetSigmaChargeErr()*TMath::Sqrt((Float_t)fNumInnerPixels)); 503 554 fCam->GetAverageOuterPix()->SetSigmaChargeErr(fCam->GetAverageOuterPix()->GetSigmaChargeErr()*TMath::Sqrt((Float_t)fNumOuterPixels)); 555 556 *fLog << err << TMath::Sqrt((Float_t)fNumInnerPixels) << endl; 557 *fLog << err << TMath::Sqrt((Float_t)fNumOuterPixels) << endl; 504 558 505 559 return kTRUE; 506 560 } 507 561 508 void MHCalibrationChargeCam::FinalizeHiGainHists(MHCalibrationChargeHiGainPix &hist, MCalibrationChargePix &pix) 562 void MHCalibrationChargeCam::FinalizeHiGainHists(MHCalibrationChargeHiGainPix &hist, 563 MCalibrationChargePix &pix, 564 MBadPixelsPix &bad) 509 565 { 510 566 511 567 if (hist.IsEmpty()) 512 568 return; 513 569 514 570 if (hist.GetSaturated() > fNumHiGainSaturationLimit*hist.GetHGausHist()->GetEntries()) 515 571 { 516 572 pix.SetHiGainSaturation(); 573 bad.SetHiGainSaturation(); 517 574 return; 518 575 } … … 522 579 // 523 580 if (hist.FitGaus()) 524 pix.SetHiGainFitted();525 // 526 // 3) In case of failure set the bit kFitted to false and take histogram means and RMS581 bad.SetHiGainFitted(); 582 // 583 // 3) In case of failure set the bit Fitted to false and take histogram means and RMS 527 584 // 528 585 else if (hist.RepeatFit()) 529 pix.SetHiGainFitted();586 bad.SetHiGainFitted(); 530 587 else 588 { 531 589 hist.BypassFit(); 532 590 bad.SetNoHiGainFitted(); 591 } 592 533 593 // 534 594 // 4) Check for pickup … … 553 613 pix.SetAbsTimeRms ( hist.GetAbsTimeRms() ); 554 614 555 pix.SetHiGainOscillating ( !hist.IsFourierSpectrumOK() );556 615 pix.SetHiGainNumPickup ( hist.GetPickup() ); 557 616 558 } 559 560 561 void MHCalibrationChargeCam::FinalizeLoGainHists(MHCalibrationChargeLoGainPix &hist, MCalibrationChargePix &pix) 617 if (!hist.IsFourierSpectrumOK()) 618 bad.SetHiGainOscillating(); 619 } 620 621 622 void MHCalibrationChargeCam::FinalizeLoGainHists(MHCalibrationChargeLoGainPix &hist, 623 MCalibrationChargePix &pix, 624 MBadPixelsPix &bad) 562 625 { 563 626 … … 569 632 { 570 633 pix.SetLoGainSaturation(); 634 bad.SetLoGainSaturation(); 571 635 return; 572 636 } … … 575 639 // 576 640 if (hist.FitGaus()) 577 pix.SetLoGainFitted();641 bad.SetLoGainFitted(); 578 642 // 579 643 // 3) In case of failure set the bit kFitted to false and take histogram means and RMS 580 644 // 581 645 else if (hist.RepeatFit()) 582 pix.SetLoGainFitted();646 bad.SetLoGainFitted(); 583 647 else 648 { 584 649 hist.BypassFit(); 585 650 bad.SetNoLoGainFitted(); 651 } 652 586 653 // 587 654 // 4) Check for pickup … … 609 676 } 610 677 611 pix.SetLoGainOscillating ( !hist.IsFourierSpectrumOK() );612 678 pix.SetLoGainNumPickup ( hist.GetPickup() ); 613 679 680 if (!hist.IsFourierSpectrumOK()) 681 bad.SetLoGainOscillating(); 614 682 } 615 683 -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.h
r3427 r3429 16 16 class MGeomCam; 17 17 class MBadPixelsCam; 18 class MBadPixelsPix; 18 19 class MCalibrationChargeCam; 19 20 class MCalibrationChargePix; … … 46 47 Int_t fNumExcluded; 47 48 48 void FinalizeHiGainHists(MHCalibrationChargeHiGainPix &hist, MCalibrationChargePix &pix );49 void FinalizeLoGainHists(MHCalibrationChargeLoGainPix &hist, MCalibrationChargePix &pix );49 void FinalizeHiGainHists(MHCalibrationChargeHiGainPix &hist, MCalibrationChargePix &pix, MBadPixelsPix &bad); 50 void FinalizeLoGainHists(MHCalibrationChargeLoGainPix &hist, MCalibrationChargePix &pix, MBadPixelsPix &bad); 50 51 51 52 public:
Note:
See TracChangeset
for help on using the changeset viewer.