Changeset 3555 for trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc
- Timestamp:
- 03/19/04 19:37:51 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.cc
r3554 r3555 177 177 fLoGainNumPickup = -1; 178 178 179 fNumLoGainSamples = -1.;180 181 179 fPed = -1.; 182 180 fPedRms = -1.; … … 708 706 } 709 707 710 void MCalibrationChargePix::CalcLoGainPed()711 {712 713 Float_t pedRmsSquare = fPedRms * fPedRms;714 Float_t pedRmsSquareVar = fPedVar * pedRmsSquare; // fPedRmsErr = fPedErr/2.715 716 //717 // We do not know the Lo Gain Pedestal RMS, so we have to retrieve it718 // from the HI GAIN (all calculation per slice up to now):719 //720 // We extract the pure NSB contribution:721 //722 const Float_t elecRmsSquare = fElectronicPedRms * fElectronicPedRms;723 const Float_t elecRmsSquareVar = 4.*fElectronicPedRmsVar * elecRmsSquare;724 725 Float_t nsbSquare = pedRmsSquare - elecRmsSquare;726 Float_t nsbSquareRelVar = (pedRmsSquareVar + elecRmsSquareVar)727 / (nsbSquare * nsbSquare) ;728 729 if (nsbSquare < 0.)730 nsbSquare = 0.;731 732 //733 // Now, we divide the NSB by the conversion factor and734 // add it quadratically to the electronic noise735 //736 const Float_t conversionSquare = fConversionHiLo * fConversionHiLo;737 const Float_t convertedNsbSquare = nsbSquare / conversionSquare;738 const Float_t convertedNsbSquareVar = nsbSquareRelVar739 * convertedNsbSquare * convertedNsbSquare;740 741 pedRmsSquare = convertedNsbSquare + elecRmsSquare;742 pedRmsSquareVar = convertedNsbSquareVar + elecRmsSquareVar;743 744 fLoGainPedRms = TMath::Sqrt(pedRmsSquare);745 fLoGainPedRmsVar = 0.25 * pedRmsSquareVar / pedRmsSquare;746 747 }748 708 749 709 // … … 844 804 845 805 846 void MCalibrationChargePix::ApplyLoGainConversion() 847 { 848 849 fElectronicPedRms = gkElectronicPedRms * TMath::Sqrt(fNumLoGainSamples); 850 fElectronicPedRmsVar = gkElectronicPedRmsErr * gkElectronicPedRmsErr * fNumLoGainSamples; 851 852 CalcLoGainPed(); 853 } 854 855 806 void MCalibrationChargePix::CalcLoGainPedestal(Float_t logainsamples) 807 { 808 809 fElectronicPedRms = gkElectronicPedRms * TMath::Sqrt(logainsamples); 810 fElectronicPedRmsVar = gkElectronicPedRmsErr * gkElectronicPedRmsErr * logainsamples; 811 812 Float_t pedRmsSquare = fPedRms * fPedRms; 813 Float_t pedRmsSquareVar = fPedVar * pedRmsSquare; // fPedRmsErr = fPedErr/2. 814 815 // 816 // We do not know the Lo Gain Pedestal RMS, so we have to retrieve it 817 // from the HI GAIN (all calculation per slice up to now): 818 // 819 // We extract the pure NSB contribution: 820 // 821 const Float_t elecRmsSquare = fElectronicPedRms * fElectronicPedRms; 822 const Float_t elecRmsSquareVar = 4.*fElectronicPedRmsVar * elecRmsSquare; 823 824 Float_t nsbSquare = pedRmsSquare - elecRmsSquare; 825 Float_t nsbSquareRelVar = (pedRmsSquareVar + elecRmsSquareVar) 826 / (nsbSquare * nsbSquare) ; 827 828 if (nsbSquare < 0.) 829 nsbSquare = 0.; 830 831 // 832 // Now, we divide the NSB by the conversion factor and 833 // add it quadratically to the electronic noise 834 // 835 const Float_t conversionSquare = fConversionHiLo * fConversionHiLo; 836 const Float_t convertedNsbSquare = nsbSquare / conversionSquare; 837 const Float_t convertedNsbSquareVar = nsbSquareRelVar 838 * convertedNsbSquare * convertedNsbSquare; 839 840 pedRmsSquare = convertedNsbSquare + elecRmsSquare; 841 pedRmsSquareVar = convertedNsbSquareVar + elecRmsSquareVar; 842 843 fLoGainPedRms = TMath::Sqrt(pedRmsSquare); 844 fLoGainPedRmsVar = 0.25 * pedRmsSquareVar / pedRmsSquare; 845 846 } 847 848 849
Note:
See TracChangeset
for help on using the changeset viewer.