Changeset 3697 for trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
- Timestamp:
- 04/09/04 17:05:05 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r3694 r3697 28 28 // 29 29 // Task to calculate the calibration conversion factors and quantum efficiencies 30 // from the FADC time slices. The integrated time slices have to be delivered by an 31 // MExtractedSignalCam, pedestals by an MPedestalCam. 32 // 33 // The output container MCalibrationCam holds one entry of type MCalibrationChargePix 34 // for every pixel. It is filled in the following way: 35 // 36 // PreProcess(): Initialize MCalibrationCam 30 // from the fit results to the summed FADC slice distributions delivered by 31 // MCalibrationChargeCam, MCalibrationChargePix, MCalibrationChargeBlindPix and 32 // MCalibrationChargePINDiode, calculated and filled by MHCalibrationChargeCam, 33 // MHCalibrationChargePix, MHCalibrationChargeBlindPix and MHCalibrationChargePINDiode. 34 // 35 // PreProcess(): Initialize pointers to MCalibrationChargeCam, MCalibrationChargeBlindPix 36 // MCalibrationChargePINDiode and MCalibrationQECam 37 // 37 38 // Initialize pulser light wavelength 38 39 // … … 231 232 const Float_t MCalibrationChargeCalc::fgLambdaCheckLimit = 0.2; 232 233 const Float_t MCalibrationChargeCalc::fgPheErrLimit = 5.; 233 const Float_t MCalibrationChargeCalc::fgTimeLowerLimit = 1.;234 const Float_t MCalibrationChargeCalc::fgTimeUpperLimit = 2.;235 234 // -------------------------------------------------------------------------- 236 235 // … … 251 250 // - fLambdaCheckLimit to fgLambdaCheckLimit 252 251 // - fLambdaErrLimit to fgLambdaErrLimit 253 // - fTimeLowerLimit to fgTimeLowerLimit254 // - fTimeUpperLimit to fgTimeUpperLimit255 252 // - fPheErrLimit to fgPheErrLimit 256 253 // - fPulserColor to MCalibrationCam::kCT1 … … 261 258 MCalibrationChargeCalc::MCalibrationChargeCalc(const char *name, const char *title) 262 259 : fBadPixels(NULL), fCam(NULL), fBlindPixel(NULL), fPINDiode(NULL), 263 fQECam(NULL), fSignals(NULL), fSigBlind(NULL), fSigPIN(NULL), 264 fGeom(NULL), fPedestals(NULL), fEvtTime(NULL) 260 fQECam(NULL), fGeom(NULL), fPedestals(NULL), fEvtTime(NULL) 265 261 { 266 262 … … 280 276 SetPheErrLimit(); 281 277 SetPulserColor(MCalibrationCam::kCT1); 282 SetTimeLowerLimit();283 SetTimeUpperLimit();284 278 285 279 Clear(); … … 302 296 // The following container are searched for and execution aborted if not in MParList: 303 297 // - MPedestalCam 304 // - MExtractedSignalCam305 // - MCalibrationChargeCam306 298 // 307 299 // The following containers are searched and created if they were not found: … … 313 305 // cannot be found, the corresponding calibration part is only skipped. 314 306 // 315 // - M ExtractedSignalBlindPixel and MCalibrationChargeBlindPix316 // - M ExtractedSignalPINDiode and MCalibrationChargePINDiode307 // - MCalibrationChargeBlindPix 308 // - MCalibrationChargePINDiode 317 309 // - MTime 318 310 // … … 336 328 } 337 329 338 fSignals = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam");339 if (!fSignals)340 {341 *fLog << err << "MExtractedSignalCam not found... aborting" << endl;342 return kFALSE;343 }344 345 fCam = (MCalibrationChargeCam*)pList->FindObject("MCalibrationChargeCam");346 if (!fCam)347 {348 *fLog << err << "Cannot find MCalibrationChargeCam... aborting" << endl;349 *fLog << err << "Maybe you forget to call an MFillH for the MHCalibrationChargeCam before..." << endl;350 return kFALSE;351 }352 353 330 // 354 331 // Containers that are created in case that they are not there. … … 368 345 } 369 346 370 //371 // Optional Containers372 //373 fSigBlind = (MExtractedSignalBlindPixel*)pList->FindObject("MExtractedSignalBlindPixel");374 if (!fSigBlind)375 *fLog << warn << "MExtractedSignalBlindPixel not found... no blind pixel method! " << endl;376 else377 {378 fBlindPixel = (MCalibrationChargeBlindPix*)pList->FindCreateObj("MCalibrationChargeBlindPix");379 if (!fBlindPixel)380 {381 *fLog << err << "Cannot find nor create MCalibrationChargeBlindPix... aborting" << endl;382 return kFALSE;383 }384 }385 386 fSigPIN = (MExtractedSignalPINDiode*)pList->FindObject("MExtractedSignalPINDiode");387 if (!fSigPIN)388 *fLog << warn << "MExtractedSignalPINDiode not found... no PIN Diode method! " << endl;389 else390 {391 fPINDiode = (MCalibrationChargePINDiode*)pList->FindCreateObj("MCalibrationChargePINDiode");392 if (!fPINDiode)393 {394 *fLog << err << "Cannot find nor create MCalibrationChargePINDiode... aborting" << endl;395 return kFALSE;396 }397 }398 347 399 348 fEvtTime = (MTime*)pList->FindObject("MTime"); … … 418 367 // The ReInit searches for the following input containers: 419 368 // - MGeomCam 420 // 421 // It retrieves the following variables from MExtractedSignalCam: 369 // - MCalibrationChargeCam 370 // 371 // It retrieves the following variables from MCalibrationChargeCam: 422 372 // 423 373 // - fNumHiGainSamples … … 446 396 } 447 397 448 fNumHiGainSamples = fSignals->GetNumUsedHiGainFADCSlices(); 449 fNumLoGainSamples = fSignals->GetNumUsedLoGainFADCSlices(); 398 fCam = (MCalibrationChargeCam*)pList->FindObject("MCalibrationChargeCam"); 399 if (!fCam) 400 { 401 *fLog << err << "Cannot find MCalibrationChargeCam... aborting" << endl; 402 *fLog << err << "Maybe you forget to call an MFillH for the MHCalibrationChargeCam before..." << endl; 403 return kFALSE; 404 } 405 406 // 407 // Optional Containers 408 // 409 fBlindPixel = (MCalibrationChargeBlindPix*)pList->FindObject("MCalibrationChargeBlindPix"); 410 if (!fBlindPixel) 411 { 412 *fLog << warn << GetDescriptor() 413 << ": MCalibrationChargeBlindPix not found... no blind pixel method! " << endl; 414 return kFALSE; 415 } 416 417 fPINDiode = (MCalibrationChargePINDiode*)pList->FindCreateObj("MCalibrationChargePINDiode"); 418 if (!fPINDiode) 419 { 420 *fLog << warn << GetDescriptor() 421 << "MCalibrationChargePINDiode not found... no PIN Diode method! " << endl; 422 return kFALSE; 423 } 424 425 fNumHiGainSamples = fCam->GetNumHiGainFADCSlices(); 426 fNumLoGainSamples = fCam->GetNumLoGainFADCSlices(); 450 427 fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples); 451 428 fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples); … … 565 542 // Finalize charges per pixel: 566 543 // - Check chage validity 567 // - Check absolute time validity568 544 // - Calculate the reduced sigma 569 545 // - Calculate the number of photo-electrons … … 609 585 } 610 586 611 //612 // The check returns kTRUE if:613 //614 // The mean arrival time is at least fTimeLowerLimit slices from the lower edge615 // and fUpperLimit slices from the upper edge616 //617 const Byte_t loweredge = cal.IsHiGainSaturation() ? fSignals->GetFirstUsedSliceLoGain()618 : fSignals->GetFirstUsedSliceHiGain();619 const Byte_t upperedge = cal.IsHiGainSaturation() ? fSignals->GetLastUsedSliceLoGain()620 : fSignals->GetLastUsedSliceHiGain();621 622 const Float_t lowerlimit = (Float_t)loweredge + fTimeLowerLimit;623 const Float_t upperlimit = (Float_t)upperedge + fTimeUpperLimit;624 625 if ( cal.GetAbsTimeMean() < lowerlimit)626 {627 *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in first " << fTimeLowerLimit628 << " extraction bin of the Pixel " << cal.GetPixId() << endl;629 *fLog << cal.GetAbsTimeMean() << " " << lowerlimit << endl;630 bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInFirstBin );631 }632 633 if ( cal.GetAbsTimeMean() > upperlimit )634 {635 *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in last " << fTimeUpperLimit636 << " two extraction bins of the Pixel " << cal.GetPixId() << endl;637 *fLog << cal.GetAbsTimeMean() << " " << upperlimit << endl;638 bad.SetUncalibrated( MBadPixelsPix::kMeanTimeInLast2Bins );639 }640 641 587 if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 642 588 return kFALSE; … … 671 617 // 3) PINDiode has a fitted charge smaller its fChargeRelErrLimit times its charge error 672 618 // 4) PINDiode has a charge sigma smaller than its Pedestal RMS 673 // 5) The mean arrival time is in fTimeLowerLimit slices from the lower edge674 // and fUpperLimit slices from the upper edge675 619 // 676 620 // Calls: … … 680 624 { 681 625 682 if (!fSigPIN)683 return kFALSE;684 685 626 if (!fPINDiode) 686 627 return kFALSE; … … 709 650 if (fPINDiode->GetSigma() < fPINDiode->GetPedRms()) 710 651 { 711 *fLog << warn << GetDescriptor() << ": Sigma of Fitted Charge smaller than Pedestal RMS in PINDiode " << endl; 712 } 713 return kFALSE; 714 715 const Byte_t loweredge = fSigPIN->GetFirstUsedSlice(); 716 const Byte_t upperedge = fSigPIN->GetLastUsedSlice(); 717 const Float_t lowerlimit = (Float_t)loweredge + fTimeLowerLimit; 718 const Float_t upperlimit = (Float_t)upperedge + fTimeUpperLimit; 719 720 if (fPINDiode->GetAbsTimeMean() < lowerlimit) 721 { 722 *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in first " << fTimeLowerLimit 723 << " extraction bin in PIN Diode " << endl; 724 *fLog << fPINDiode->GetAbsTimeMean() << " " << lowerlimit << endl; 725 return kFALSE; 726 } 727 728 if ( fPINDiode->GetAbsTimeMean() > upperlimit ) 729 { 730 *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in last " << fTimeUpperLimit 731 << " two extraction bins in PIN Diode " << endl; 732 *fLog << fPINDiode->GetAbsTimeMean() << " " << upperlimit << endl; 733 return kFALSE; 734 } 652 *fLog << warn << GetDescriptor() 653 << ": Sigma of Fitted Charge smaller than Pedestal RMS in PINDiode " << endl; 654 return kFALSE; 655 } 656 735 657 736 658 if (!fPINDiode->CalcFluxOutsidePlexiglass()) … … 760 682 { 761 683 762 if (!fSigBlind)763 return kFALSE;764 765 684 if (!fBlindPixel) 766 685 return kFALSE; … … 1340 1259 "Pixels with Low Gain Saturation: "); 1341 1260 PrintUncalibrated(MBadPixelsPix::kMeanTimeInFirstBin, 1342 Form("%s%2.1f%s","Mean Abs. Arr. Time in First ", fTimeLowerLimit," Bin(s): "));1261 Form("%s%2.1f%s","Mean Abs. Arr. Time in First ",1," Bin(s): ")); 1343 1262 PrintUncalibrated(MBadPixelsPix::kMeanTimeInLast2Bins, 1344 Form("%s%2.1f%s","Mean Abs. Arr. Time in Last ", fTimeUpperLimit," Bin(s): "));1263 Form("%s%2.1f%s","Mean Abs. Arr. Time in Last ",2," Bin(s): ")); 1345 1264 PrintUncalibrated(MBadPixelsPix::kHiGainOscillating, 1346 1265 "Pixels with changing Hi Gain signal over time: ");
Note:
See TracChangeset
for help on using the changeset viewer.