Changeset 4159
- Timestamp:
- 05/24/04 19:37:02 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r4158 r4159 529 529 // Call FinalizeBlindPixelQECam() (fifth loop over pixels and areas) 530 530 // Call FinalizePINDiodeQECam() (sixth loop over pixels and areas) 531 // 532 // Call FinalizeUnsuitablePixels() 531 533 // 532 534 // Call MParContainer::SetReadyToSave() for fCam, fQECam, fBadPixels and … … 609 611 610 612 const MPedestalPix &ped = fPedestals->GetAverageSector(sector); 613 611 614 MCalibrationChargePix &pix = (MCalibrationChargePix&)fCam->GetAverageSector(sector); 612 615 FinalizePedestals(ped,pix, 0); … … 928 931 } 929 932 930 // 933 // if (bad.IsUnsuitable(MBadPixelsPix::kUnreliableRun)) 931 934 // continue; 932 935 … … 970 973 971 974 // 972 // Second loop: Get weightedmean number of photo-electrons and its RMS excluding975 // Second loop: Get mean number of photo-electrons and its RMS excluding 973 976 // pixels deviating by more than fPheErrLimit sigma. 974 977 // Set the conversion factor FADC counts to photo-electrons … … 1007 1010 } 1008 1011 1009 const Float_t weight = 1./nvar; 1010 1011 areaweights [aidx] += weight; 1012 areaphes [aidx] += weight*nphe; 1012 // const Float_t weight = 1./nvar; 1013 // areaweights [aidx] += weight; 1014 // areaphes [aidx] += weight*nphe; 1015 areaweights [aidx] += nphe*nphe; 1016 areaphes [aidx] += nphe; 1013 1017 numareavalid [aidx] ++; 1014 sectorweights [sector] += weight; 1015 sectorphes [sector] += weight*nphe; 1018 // sectorweights [sector] += weight; 1019 // sectorphes [sector] += weight*nphe; 1020 sectorweights [sector] += nphe*nphe; 1021 sectorphes [sector] += nphe; 1016 1022 numsectorvalid[sector] ++; 1017 1023 } … … 1022 1028 MCalibrationChargePix &apix = (MCalibrationChargePix&)fCam->GetAverageArea(aidx); 1023 1029 1030 areaweights[aidx] -= areaphes[aidx]*areaphes[aidx]/numareavalid[aidx]; 1031 areaphes[aidx] /= numareavalid[aidx]; 1032 areaweights[aidx] /= numareavalid[aidx]-1.; 1033 1024 1034 if (areaweights[aidx] <= 0. || areaphes[aidx] <= 0.) 1025 1035 { 1026 1036 *fLog << warn << " Mean number of phe's from area index " << aidx << " cannot be calculated: " 1027 << " Sum of weights: " << areaweights[aidx]1028 << " Sum of weighted phes: " << areaphes[aidx] << endl;1037 << " Mean number of phes: " << areaphes[aidx] 1038 << " Variance: " << areaweights[aidx] << endl; 1029 1039 apix.SetFFactorMethodValid(kFALSE); 1030 1040 continue; 1031 1041 } 1032 1042 1033 1043 *fLog << inf << "Replacing number photo-electrons of average area idx " << aidx << ": " 1034 1044 << Form("%5.3f%s%5.3f",apix.GetPheFFactorMethod()," +- ",apix.GetPheFFactorMethodErr()) << endl; 1035 1045 *fLog << inf << " by average number of photo-electrons from area idx " << aidx << ": " 1036 << Form("%5.3f%s%5.3f",areaphes[aidx] / areaweights[aidx]," +- ", 1037 TMath::Sqrt(1./areaweights[aidx])) << endl; 1038 1039 apix.SetPheFFactorMethod ( areaphes[aidx]/ areaweights[aidx] ); 1040 apix.SetPheFFactorMethodVar( 1. / areaweights[aidx] ); 1046 << Form("%5.3f%s%5.3f",areaphes[aidx]," +- ",TMath::Sqrt(areaweights[aidx])) << endl; 1047 1048 // apix.SetPheFFactorMethod ( areaphes[aidx]/ areaweights[aidx] ); 1049 // apix.SetPheFFactorMethodVar( 1. / areaweights[aidx] ); 1050 apix.SetPheFFactorMethod ( areaphes[aidx] ); 1051 apix.SetPheFFactorMethodVar( areaweights[aidx] / numareavalid[aidx] ); 1041 1052 apix.SetFFactorMethodValid ( kTRUE ); 1042 1053 … … 1046 1057 { 1047 1058 1059 sectorweights[sector] -= sectorphes[sector]*sectorphes[sector]/numsectorvalid[sector]; 1060 sectorphes[sector] /= numsectorvalid[sector]; 1061 sectorweights[sector] /= numsectorvalid[sector]-1.; 1062 1048 1063 MCalibrationChargePix &spix = (MCalibrationChargePix&)fCam->GetAverageSector(sector); 1049 1064 … … 1051 1066 { 1052 1067 *fLog << warn << " Mean number of phe's from sector " << sector << " cannot be calculated: " 1053 << " Sum of weights: " << sectorweights[sector]1054 << " Sum of weighted phes: " << sectorphes[sector] << endl;1068 << " Mean number of phes: " << sectorphes[sector] 1069 << " Variance: " << sectorweights[sector] << endl; 1055 1070 spix.SetFFactorMethodValid(kFALSE); 1056 1071 continue; … … 1060 1075 << Form("%5.3f%s%5.3f",spix.GetPheFFactorMethod()," +- ",spix.GetPheFFactorMethodErr()) << endl; 1061 1076 *fLog << inf << " by average number photo-electrons from sector " << sector << ": " 1062 << Form("%5.3f%s%5.3f",sectorphes[sector]/ sectorweights[sector]," +- ", 1063 TMath::Sqrt(1./sectorweights[sector])) << endl; 1064 1065 spix.SetPheFFactorMethod ( sectorphes[sector]/ sectorweights[sector] ); 1066 spix.SetPheFFactorMethodVar( 1. / sectorweights[sector] ); 1077 << Form("%5.3f%s%5.3f",sectorphes[sector]," +- ",TMath::Sqrt(sectorweights[sector])) << endl; 1078 1079 // spix.SetPheFFactorMethod ( sectorphes[sector]/ sectorweights[sector] ); 1080 // spix.SetPheFFactorMethodVar( 1. / sectorweights[sector] ); 1081 spix.SetPheFFactorMethod ( sectorphes[sector] ); 1082 spix.SetPheFFactorMethodVar( sectorweights[sector] / numsectorvalid[sector]); 1067 1083 spix.SetFFactorMethodValid ( kTRUE ); 1068 1084
Note:
See TracChangeset
for help on using the changeset viewer.