Changeset 3057 for trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc
- Timestamp:
- 02/08/04 20:54:22 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc
r3029 r3057 29 29 // Task to calculate the calibration conversion factors from the FADC 30 30 // time slices. The integrated time slices have to be delivered by an 31 // MExtractedSignalCam. The pedestals by an MPedestalCam and possibly 32 // arrival times from MArrivalTime 31 // MExtractedSignalCam. The pedestals by an MPedestalCam. 33 32 // 34 33 // The output container MCalibrationCam holds one entry of type MCalibrationPix … … 37 36 // ProProcess: Search for MPedestalCam, MExtractedSignalCam 38 37 // Initialize MCalibrationCam 39 // Initialize MArrivalTime if exists40 38 // Initialize pulser light wavelength 41 39 // … … 62 60 // 63 61 // Fits can be excluded via the commands: 64 // MalibrationCam::SkipTimeFits() (skip all time fits)65 62 // MalibrationCam::SkipBlindPixelFits() (skip all blind 66 63 // pixel fits) … … 112 109 #include "MCalibrationPINDiode.h" 113 110 114 #include "MArrivalTime.h"115 116 111 ClassImp(MCalibrationCalc); 117 112 118 113 using namespace std; 119 114 120 const Int_t MCalibrationCalc::fBlindPixelId = 559;121 const Int_t MCalibrationCalc::fPINDiodeId = 9999;115 const UInt_t MCalibrationCalc::fBlindPixelId = 559; 116 const UInt_t MCalibrationCalc::fPINDiodeId = 9999; 122 117 const Byte_t MCalibrationCalc::fgSaturationLimit = 254; 123 118 const Byte_t MCalibrationCalc::fgBlindPixelFirst = 3; … … 130 125 MCalibrationCalc::MCalibrationCalc(const char *name, const char *title) 131 126 : fPedestals(NULL), fCalibrations(NULL), fSignals(NULL), 132 fRawEvt(NULL), fRunHeader(NULL), f ArrivalTime(NULL), fEvtTime(NULL)127 fRawEvt(NULL), fRunHeader(NULL), fEvtTime(NULL) 133 128 { 134 129 … … 147 142 { 148 143 149 SETBIT(fFlags, kUseTimes);150 144 SETBIT(fFlags, kUseBlindPixelFit); 151 145 SETBIT(fFlags, kUseCosmicsRejection); … … 153 147 SETBIT(fFlags, kHiLoGainCalibration); 154 148 155 CLRBIT(fFlags, kBlindPixelOverFlow);156 CLRBIT(fFlags, kPINDiodeOverFlow);157 149 CLRBIT(fFlags, kHiGainOverFlow); 158 150 CLRBIT(fFlags, kLoGainOverFlow); … … 198 190 // The following output containers are only searched, but not created 199 191 // 200 // - MArrivaltime201 192 // - MTime 202 193 // … … 226 217 return kFALSE; 227 218 } 228 229 fArrivalTime = (MArrivalTime*)pList->FindObject("MArrivalTime");230 219 231 220 fEvtTime = (MTime*)pList->FindObject("MTime"); … … 310 299 if (!TESTBIT(fFlags,kUseQualityChecks)) 311 300 pix.SetExcludeQualityCheck(); 301 302 // Exclude the blind pixel and the PIN Diode from normal pixel calibration: 303 if (i == fBlindPixelId) 304 pix.SetExcluded(); 305 306 if (i == fPINDiodeId) 307 pix.SetExcluded(); 312 308 313 309 } … … 450 446 // Create a (second) loop to do fill the calibration histograms 451 447 // Search for: a signal in MExtractedSignalCam 452 // a time in MArrivalTime.453 448 // Fill histograms with: 454 449 // charge … … 463 458 MCalibrationPix &pix = (*fCalibrations)[pixid]; 464 459 465 if (pix.IsExcluded())466 continue;467 468 460 MExtractedSignalPix &sig = (*fSignals)[pixid]; 469 461 … … 474 466 Float_t reltime = 0.; 475 467 468 #if 0 476 469 if (TESTBIT(fFlags,kUseTimes)) 477 470 { … … 492 485 if (pixid == 1) 493 486 referencetime = (Float_t)pixel.GetIdxMaxHiGainSample(); 494 487 #endif 495 488 if (sig.IsLoGainUsed()) 496 489 { 497 490 abstime = (Float_t)pixel.GetIdxMaxLoGainSample(); 498 reltime = abstime - referencetime;491 // reltime = abstime - referencetime; 499 492 } 500 493 else 501 494 { 502 495 abstime = (Float_t)pixel.GetIdxMaxHiGainSample(); 503 reltime = abstime - referencetime;496 // reltime = abstime - referencetime; 504 497 } 505 }506 } /* if Use Times */507 498 // } 499 // } /* if Use Times */ 500 508 501 switch(pixid) 509 502 { … … 526 519 "Overflow or Underflow occurred filling Blind Pixel sum = " << blindpixelsum << endl; 527 520 528 if (TESTBIT(fFlags,kUseTimes)) 529 { 530 if (!blindpixel.FillTime(reltime)) 531 *fLog << warn << 532 "Overflow or Underflow occurred filling Blind Pixel time = " << reltime << endl; 533 } 534 535 if (!TESTBIT(fFlags,kBlindPixelOverFlow)) 536 if (!blindpixel.FillRChargevsTime(blindpixelsum,fEvents)) 537 { 538 *fLog << warn << 539 "Overflow or Underflow occurred filling Blind Pixel eventnr = " << fEvents << endl; 540 SETBIT(fFlags,kBlindPixelOverFlow); 541 } 521 // if (!blindpixel.FillRChargevsTime(blindpixelsum,fEvents)) 522 // *fLog << warn << 523 // "Overflow or Underflow occurred filling Blind Pixel eventnr = " << fEvents << endl; 542 524 } /* if use blind pixel */ 543 525 … … 550 532 551 533 if (!pindiode.FillCharge(sumhi)) 552 *fLog << warn << 553 "Overflow or Underflow occurred filling PINDiode: sum = " << sumhi << endl; 534 *fLog << warn 535 << "Overflow or Underflow occurred filling PINDiode: sum = " 536 << sumhi << endl; 554 537 555 if (TESTBIT(fFlags,kUseTimes)) 556 { 557 if (!pindiode.FillAbsTime(abstime)) 558 *fLog << warn << 559 "Overflow or Underflow occurred filling PINDiode abs. time = " << abstime << endl; 560 if (!pindiode.FillRelTime(reltime)) 561 *fLog << warn << 562 "Overflow or Underflow occurred filling PINDiode rel. time = " << reltime << endl; 563 } 564 565 if (!TESTBIT(fFlags,kPINDiodeOverFlow)) 566 if (!pindiode.FillRChargevsTime(sumhi,fEvents)) 567 { 568 *fLog << warn 569 << "Overflow or Underflow occurred filling PINDiode: eventnr = " 570 << fEvents << endl; 571 SETBIT(fFlags,kPINDiodeOverFlow); 572 } 538 if (!pindiode.FillAbsTime(abstime)) 539 *fLog << warn 540 << "Overflow or Underflow occurred filling PINDiode abs. time = " 541 << abstime << endl; 542 543 if (!pindiode.FillGraphs(sumhi,sumlo)) 544 *fLog << warn 545 << "Overflow or Underflow occurred filling PINDiode: eventnr = " 546 << fEvents << endl; 573 547 574 548 } /* if use PIN Diode */ … … 578 552 default: 579 553 580 if (!TESTBIT(fFlags,kLoGainOverFlow)) 581 if (!pix.FillRChargevsTimeLoGain(sumlo,fEvents)) 582 { 583 *fLog << warn 584 << "Overflow filling Histogram ChargevsNLoGain eventnr = " 585 << fEvents << endl; 586 SETBIT(fFlags,kLoGainOverFlow); 587 SkipHiLoGainCalibration(); 588 } 589 590 if (!TESTBIT(fFlags,kHiGainOverFlow)) 591 if (!pix.FillRChargevsTimeHiGain(sumhi,fEvents)) 592 { 593 *fLog << warn 594 << "Overflow filling Histogram ChargevsNHiGain eventnr = " 595 << fEvents << endl; 596 SETBIT(fFlags,kHiGainOverFlow); 597 SkipHiLoGainCalibration(); 598 } 599 600 601 if (TESTBIT(fFlags,kHiLoGainCalibration)) 602 pix.FillChargesInGraph(sumhi,sumlo); 554 if (pix.IsExcluded()) 555 continue; 556 557 pix.FillGraphs(sumhi,sumlo); 603 558 604 559 if (sig.IsLoGainUsed()) … … 608 563 *fLog << warn << "Could not fill Lo Gain Charge of pixel: " << pixid 609 564 << " signal = " << sumlo << endl; 610 611 if (TESTBIT(fFlags,kUseTimes)) 612 { 613 if (!pix.FillAbsTimeLoGain(abstime)) 614 *fLog << warn << "Could not fill Lo Gain Abs. Time of pixel: " 615 << pixid << " time = " << abstime << endl; 616 if (!pix.FillRelTimeLoGain(reltime)) 617 *fLog << warn << "Could not fill Lo Gain Rel. Time of pixel: " 618 << pixid << " time = " << reltime << endl; 619 } 565 566 if (!pix.FillAbsTimeLoGain(abstime)) 567 *fLog << warn << "Could not fill Lo Gain Abs. Time of pixel: " 568 << pixid << " time = " << abstime << endl; 569 /* 570 if (!pix.FillRelTimeLoGain(reltime)) 571 *fLog << warn << "Could not fill Lo Gain Rel. Time of pixel: " 572 << pixid << " time = " << reltime << endl; 573 */ 620 574 } /* if (sig.IsLoGainUsed()) */ 621 575 else … … 625 579 << " signal = " << sumhi << endl; 626 580 627 if (TESTBIT(fFlags,kUseTimes)) 628 { 629 if (!pix.FillAbsTimeHiGain(abstime)) 630 *fLog << warn << "Could not fill Hi Gain Abs. Time of pixel: " 631 << pixid << " time = " << abstime << endl; 632 if (!pix.FillRelTimeHiGain(reltime)) 581 if (!pix.FillAbsTimeHiGain(abstime)) 582 *fLog << warn << "Could not fill Hi Gain Abs. Time of pixel: " 583 << pixid << " time = " << abstime << endl; 584 /* 585 if (!pix.FillRelTimeHiGain(reltime)) 633 586 *fLog << warn << "Could not fill Hi Gain Rel. Time of pixel: " 634 587 << pixid << " time = " << reltime << endl; 635 }588 */ 636 589 } /* else (sig.IsLoGainUsed()) */ 637 590 break; … … 771 724 772 725 // 773 // Perform the Gauss fits to the arrival times 774 // 775 if (TESTBIT(fFlags,kUseTimes)) 776 pix.FitTime(); 726 // check also for oscillations 727 // 728 pix.CheckOscillations(); 777 729 778 730 }
Note:
See TracChangeset
for help on using the changeset viewer.