Changeset 3654 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 04/05/04 18:06:54 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc
r3650 r3654 38 38 // 39 39 // The following variables are calculated inside this class: 40 // - fLoGainPedRmsSquare and LoGainPedRmsSquareVar (see CalcLoGainPedestal())41 // - fRSigmaSquare and fRSigmaSquareVar (see CalcReducedSigma())42 // - fPheFFactorMethod and fPheFFactorMethodVar see CalcFFactorMethod() )40 // - fLoGainPedRmsSquare and fLoGainPedRmsSquareVar (see CalcLoGainPedestal()) 41 // - fRSigmaSquare and fRSigmaSquareVar (see CalcReducedSigma() ) 42 // - fPheFFactorMethod and fPheFFactorMethodVar (see CalcFFactorMethod() ) 43 43 // 44 44 // The following variables are set by MHCalibrationChargeCam: … … 52 52 // - fConversionFFactorMethodVar, fConversionBlindPixelMethodVar 53 53 // fConversionPINDiodeMethodVar and fConversionCombinedMethodVar 54 // - fSigmaConversionFFactorMethod m, fSigmaConversionBlindPixelMethod54 // - fSigmaConversionFFactorMethod, fSigmaConversionBlindPixelMethod 55 55 // fSigmaConversionPINDiodeMethod and fSigmaConversionCombinedMethod 56 56 // - fTotalFFactorFFactorMethod, fTotalFFactorBlindPixelMethod … … 95 95 // - fCalibFlags to 0 96 96 // - fConversionHiLo to fgConversionHiLo 97 // - fConversionHiLo Err tofgConversionHiLoErr98 // - PheFFactorMethodLimit to fgPheFFactorMethodLimit97 // - fConversionHiLoVar to square of fgConversionHiLoErr 98 // - fPheFFactorMethodLimit to fgPheFFactorMethodLimit 99 99 // 100 100 // Calls: … … 180 180 // -------------------------------------------------------------------------- 181 181 // 182 // Set theconversion factors Blind Pixel Method from outside (only for MC)182 // Set conversion factors Blind Pixel Method from outside (only for MC) 183 183 // 184 184 void MCalibrationChargePix::SetConversionBlindPixelMethod(Float_t c, Float_t err, Float_t sig) … … 192 192 // -------------------------------------------------------------------------- 193 193 // 194 // Set theconversion factors Combined Method from outside (only for MC)194 // Set conversion factors Combined Method from outside (only for MC) 195 195 // 196 196 void MCalibrationChargePix::SetConversionCombinedMethod(Float_t c, Float_t err, Float_t sig) … … 204 204 // -------------------------------------------------------------------------- 205 205 // 206 // Set theconversion factors F-Factor Method from outside (only for MC)206 // Set conversion factors F-Factor Method from outside (only for MC) 207 207 // 208 208 void MCalibrationChargePix::SetConversionFFactorMethod(Float_t c, Float_t err, Float_t sig) … … 215 215 // -------------------------------------------------------------------------- 216 216 // 217 // Set theconversion factors PIN Diode Method from outside (only for MC)217 // Set conversion factors PIN Diode Method from outside (only for MC) 218 218 // 219 219 void MCalibrationChargePix::SetConversionPINDiodeMethod(Float_t c, Float_t err, Float_t sig) … … 226 226 // -------------------------------------------------------------------------- 227 227 // 228 // Set the BlindPixelMethod Validity Bit from outside228 // Set Blind Pixel Method Validity Bit from outside 229 229 // 230 230 void MCalibrationChargePix::SetBlindPixelMethodValid(const Bool_t b ) … … 235 235 // -------------------------------------------------------------------------- 236 236 // 237 // Set the CombinedMethod Validity Bit from outside237 // Set Combined Method Validity Bit from outside 238 238 // 239 239 void MCalibrationChargePix::SetCombinedMethodValid(const Bool_t b ) … … 244 244 // -------------------------------------------------------------------------- 245 245 // 246 // Set the FFactorMethod Validity Bit from outside246 // Set F-Factor Method Validity Bit from outside 247 247 // 248 248 void MCalibrationChargePix::SetFFactorMethodValid(const Bool_t b ) … … 253 253 // -------------------------------------------------------------------------- 254 254 // 255 // Set the PINDiodeMethod Validity Bit from outside255 // Set PIN Diode Method Validity Bit from outside 256 256 // 257 257 void MCalibrationChargePix::SetPINDiodeMethodValid(const Bool_t b ) … … 262 262 // -------------------------------------------------------------------------- 263 263 // 264 // Set the pedestals from outside264 // Set pedestals from outside (done by MCalibrationChargeCalc) 265 265 // 266 266 void MCalibrationChargePix::SetPedestal(const Float_t ped, const Float_t pedrms, const Float_t pederr) … … 306 306 // Get the Error of the pedestals RMS: 307 307 // - Test bit kHiGainSaturation: 308 // If yes, return kLoGainPedRms, else fPedRms 308 // If yes, return square root of (0.25*fLoGainPedRmsSquareVar/ fLoGainPedRmsSquare) (if greater than 0, otherwise -1.) 309 // If no , return square root of (fPedVar) (if greater than 0, otherwise -1.), divided by 2. 309 310 // 310 311 Float_t MCalibrationChargePix::GetPedRmsErr() const … … 336 337 // 337 338 // Get the Error of the Low Gain Mean: 338 // Returns the quadratic sum of the relative low Gain Mean error and the 339 // the relative conversion High-to-Low error, mulitplied with GetLoGainMean() 339 // 340 // Returns -1 if the variable fLoGainMean or fLoGainMeanVar are smaller than 0. 341 // 342 // Returns the square root of the quadratic sum of the relative variances of 343 // the fLoGainMean and fConversionHiLo, mulitplied with GetLoGainMean() 340 344 // 341 345 Float_t MCalibrationChargePix::GetLoGainMeanErr() const 342 346 { 347 348 if (fLoGainMeanVar < 0.) 349 return -1.; 350 351 if (fLoGainMean < 0.) 352 return -1.; 343 353 344 354 const Float_t chargeRelVar = fLoGainMeanVar … … 361 371 // 362 372 // Get the Error of the Low Gain Sigma: 363 // Returns the quadratic sum of the relative low Gain Sigma error and the 364 // the relative conversion High-to-Low error, mulitplied with GetLoGainSigma() 373 // 374 // Returns -1 if the variable fLoGainSigma or fLoGainSigmaVar are smaller than 0. 375 // 376 // Returns the square root of the quadratic sum of the relative variances of 377 // the fLoGainSigma and fConversionHiLo, mulitplied with GetLoGainSigma() 365 378 // 366 379 Float_t MCalibrationChargePix::GetLoGainSigmaErr() const 367 380 { 381 382 if (fLoGainSigmaVar < 0.) 383 return -1.; 384 385 if (fLoGainSigma < 0.) 386 return -1.; 368 387 369 388 const Float_t sigmaRelVar = fLoGainSigmaVar … … 396 415 // - If fRSigmaSquareVar is smaller than 0 (i.e. has not yet been set), return -1. 397 416 // - Calculate the absolute variance of the reduced sigma with the formula: 398 // sigma variance = 0.25 * fRSigmaSquareVar / fRSigmaSquare417 // reduced sigma variance = 0.25 * fRSigmaSquareVar / fRSigmaSquare 399 418 // - Test bit kHiGainSaturation: 400 // If yes, returns the quadratic sum of the relative reduced Sigma error andthe401 // the relative conversion High-to-Low error, mulitplied with GetRSigma()419 // If yes, returns the square root of the quadratic sum of the relative variances of the 420 // reduced sigma and fConversionHiLo, mulitplied with GetRSigma() 402 421 // Else returns the square root of rel. (0.25*fRSigmaSquareVar / fRSigmaSquare) 403 422 // … … 593 612 // - If fPedRms is smaller than 0 (i.e. has not yet been set), return kFALSE 594 613 // 595 // Calculate the reduced sigma :614 // Calculate the reduced sigma of the low-Gain FADC slices: 596 615 // - Test bit IsHiGainSaturation() for the Sigma: 597 616 // If yes, take fLoGainSigma and fLoGainSigmaVar … … 600 619 // - Test bit IsHiGainSaturation() for the pedRMS: 601 620 // If yes, take fLoGainPedRmsSquare and fLoGainPedRmsSquareVar 602 // If no , take fPedRms and fPed RmsVar621 // If no , take fPedRms and fPedVar 603 622 // 604 623 // - Calculate the reduced sigma with the formula: 605 624 // fRSigmaSquare = Sigma*Sigma - pedRMS*pedRMS 606 625 // 626 // - If fRSigmaSquare is smaller than 0, give a warning and return kFALSE 627 // 607 628 // - Calculate the variance of the reduced sigma with the formula: 608 629 // fRSigmaSquareVar = 4.* (sigmaVar*Sigma*Sigma + pedRmsVar*pedRMS*pedRMS) 609 630 // 631 // A back-transformation to the corr. amplification factor of the High-Gain is done 632 // in GetRSigma() and GetRSigmaErr() 633 // 610 634 Bool_t MCalibrationChargePix::CalcReducedSigma() 611 635 { … … 617 641 return kFALSE; 618 642 619 const Float_t sigma = IsHiGainSaturation() ? fLoGainSigma: fHiGainSigma ;620 const Float_t sigmavar = IsHiGainSaturation() ? fLoGainSigmaVar: fHiGainSigmaVar;643 const Float_t sigma = IsHiGainSaturation() ? fLoGainSigma : fHiGainSigma ; 644 const Float_t sigmavar = IsHiGainSaturation() ? fLoGainSigmaVar : fHiGainSigmaVar; 621 645 const Float_t pedRmsSquare = IsHiGainSaturation() ? fLoGainPedRmsSquare : fPedRms*fPedRms; 622 646 const Float_t pedRmsSquareVar = IsHiGainSaturation() ? fLoGainPedRmsSquareVar : 0.25*fPedVar*pedRmsSquare; … … 654 678 // - Test bit IsHiGainSaturation() for the pedRMS: 655 679 // If yes, take fLoGainPedRmsSquare and fLoGainPedRmsSquareVar 656 // If no , take fPedRms and fPed RmsVar680 // If no , take fPedRms and fPedVar 657 681 // 658 682 // - Calculate the number of photo-electrons with the formula: 659 // fPheFFactorMethod = gkFFactor*gkFFactor * mean * mean / fRSigmaSquare683 // fPheFFactorMethod = gkFFactor*gkFFactor * Mean * Mean / fRSigmaSquare 660 684 // 661 685 // - Calculate the Variance on the photo-electrons with the formula: 662 686 // fPheFFactorMethodVar = ( 4. * gkFFactorErr * gkFFactorErr / ( gkFFactor * gkFFactor ) 663 // + 4. * fMeanVar / ( mean * mean ) 664 // + 4. * fRSigmaVar / ( fRSigma * fRSigma ) 665 // ) * fPheFFactor * fPheFFactor 666 // - if fPheFFactorMethod is less than fPheFFactorMethodLimit, 667 // Set kFFactorMethodValid to kFALSE and return kFALSE 687 // + 4. * Mean Var. / ( Mean * Mean ) 688 // + fRSigmaSquareVar / fRSigmaSquare 689 // ) * fPheFFactorMethod * fPheFFactorMethod 690 // 691 // - If fPheFFactorMethod is less than fPheFFactorMethodLimit, 692 // set kFFactorMethodValid to kFALSE and return kFALSE 668 693 // else: Set kFFactorMethodValid to kTRUE and return kTRUE 669 694 // … … 722 747 // - elec. pedestal = gkElectronicPedRms * sqrt(logainsamples) 723 748 // 724 // Calculate the LONS ped. RMS contributionin the high-gain749 // Calculate the night sky background ped. RMS contribution ("NSB") in the high-gain 725 750 // from the high gain Pedestal RMS with the formula: 726 751 // - HiGain NSB square = fPedRms * fPedRms - elec.ped.* elec.ped. 727 752 // - Var(HiGain NSB square) = fPedVar * fPedRms * fPedRms + 4.*elecPedRmsVar * elec.ped.* elec.ped. 728 753 // 729 // If PedRMS (LONS,lowgain)square is smaller than 0., set it to zero. (but not the error!)730 // 731 // Convert the LONSped. RMS contribution to the low-gain with the formula:754 // If HiGain NSB square is smaller than 0., set it to zero. (but not the error!) 755 // 756 // Convert the NSB ped. RMS contribution to the low-gain with the formula: 732 757 // - LoGain NSB square = - HiGain NSB square / (fConversionHiLo*fConversionHiLo) 733 758 // - Var(LoGain NSB square) = ( Var(HiGain NSB square) / (HiGain NSB square * HiGain NSB square) 734 // + GetConversionHiLoRelVar() )735 // * LoGain NSB square * LoGain NSB square759 // + GetConversionHiLoRelVar() 760 // ) * LoGain NSB square * LoGain NSB square 736 761 // 737 762 // - Low Gain Ped RMS Square = LoGain NSB square + elec.ped. square … … 784 809 } 785 810 811 // -------------------------------------------------------------------------- 812 // 813 // Get the relative variance of the conversion factor between higain and logain: 814 // - If fConversionHiLo is smaller than 0, return -1. 815 // - Else returns: fConversionHiLoVar / (fConversionHiLo * fConversionHiLo) 816 // 786 817 const Float_t MCalibrationChargePix::GetConversionHiLoRelVar() const 787 818 {
Note:
See TracChangeset
for help on using the changeset viewer.