Changeset 3065
- Timestamp:
- 02/09/04 10:36:04 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3064 r3065 4 4 5 5 -*-*- END OF LINE -*-*- 6 2004/02/09: Markus Gaug 7 8 * MMcCalibrationUpdate.cc 9 * MCalibrate.cc 10 * MCalibrationPix.cc 11 * MCalibrationPix.h 12 - replace MCalibrationPix->IsChargeFitValid() by IsChargeValid() 13 because we can calibrate with the histogram mean and RMS even 14 if the fit is not OK. Thus, there is a question: IsFitted() and 15 IsChargeValid(), i.e. does the charge make any sense? 16 17 * MCalibrationCam.cc 18 MCalibrationConfig.h 19 MCalibrationCalc.cc 20 - found serious bug in calculation of conversion factors for the 21 outer pixels: 22 GetMeanConversionBlindPixelMethod and 23 GetMeanConversionPINDiodeMethod 24 did not correct for the area of the outer pixel, this did only 25 MCalibrationCam::GetPixelContent which is not used by MCalibrate 26 27 6 28 2004/02/06: Markus Gaug 7 29 -
trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc
r3060 r3065 222 222 223 223 calpix.SetBlindPixelMethodValid(); 224 calpix.SetCharge FitValid();224 calpix.SetChargeValid(); 225 225 226 226 calpix.SetConversionHiLo(fConversionHiLo); -
trunk/MagicSoft/Mars/mcalib/MCalibrate.cc
r3031 r3065 169 169 MCalibrationPix &pix = (*fCalibrations)[pixidx]; 170 170 171 if (!pix.IsCharge FitValid())171 if (!pix.IsChargeValid()) 172 172 continue; 173 173 -
trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc
r3061 r3065 279 279 return kFALSE; 280 280 } 281 282 283 fCalibrations->SetGeomCam(cam); 281 284 282 285 fNumHiGainSamples = fSignals->GetNumUsedHiGainFADCSlices(); -
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc
r3063 r3065 262 262 { 263 263 264 if (pix->IsCharge FitValid() && !pix->IsExcluded())264 if (pix->IsChargeValid() && !pix->IsExcluded()) 265 265 { 266 266 … … 284 284 { 285 285 286 if (!pix->IsCharge FitValid() && !pix->IsExcluded())286 if (!pix->IsChargeValid() && !pix->IsExcluded()) 287 287 { 288 288 … … 383 383 Float_t arearatio = cam.GetPixRatio(idx); 384 384 385 385 if (arearatio == 0) 386 386 return kFALSE; 387 387 … … 587 587 if (!(*this)[idx].IsFitted()) 588 588 return kFALSE; 589 if (!(*this)[idx].IsCharge FitValid())589 if (!(*this)[idx].IsChargeValid()) 590 590 val = 1; 591 591 else … … 702 702 const Float_t mean = fBlindPixel->GetLambda(); 703 703 const Float_t merr = fBlindPixel->GetErrLambda(); 704 705 // 706 // Start calculation of number of photons 707 // 708 // The blind pixel has exactly one cm^2 area (with negligible error), 709 // thus we omi division by 1. 710 // 711 fMeanPhotInsidePlexiglass = mean * gkCalibrationInnerPixelArea; 712 713 // Start calculation of number of photons relative Variance (!!) 714 fMeanPhotErrInsidePlexiglass = merr*merr/mean/mean; 715 fMeanPhotErrInsidePlexiglass += gkCalibrationInnerPixelAreaError*gkCalibrationInnerPixelAreaError 716 / gkCalibrationInnerPixelArea/gkCalibrationInnerPixelArea; 704 717 705 718 switch (fColor) 706 719 { 707 720 case kECGreen: 708 fMeanPhotInsidePlexiglass = (mean / gkCalibrationBlindPixelQEGreen) // real photons 709 *TMath::Power(10,gkCalibrationBlindPixelAttGreen) // correct for absorption 710 * gkCalibrationInnerPixelArea; // correct for area 711 712 721 fMeanPhotInsidePlexiglass /= gkCalibrationBlindPixelQEGreen; 722 fMeanPhotErrInsidePlexiglass += gkCalibrationBlindPixelQEGreenError*gkCalibrationBlindPixelQEGreenError 723 / gkCalibrationBlindPixelQEGreen / gkCalibrationBlindPixelQEGreen; 724 725 fMeanPhotInsidePlexiglass *= TMath::Power(10,gkCalibrationBlindPixelAttGreen); // correct for absorption 726 // attenuation has negligible error 713 727 break; 714 728 case kECBlue: 715 fMeanPhotInsidePlexiglass = (mean / gkCalibrationBlindPixelQEBlue ) 716 *TMath::Power(10,gkCalibrationBlindPixelAttBlue) 717 * gkCalibrationInnerPixelArea; 729 fMeanPhotInsidePlexiglass /= gkCalibrationBlindPixelQEBlue; 730 fMeanPhotErrInsidePlexiglass += gkCalibrationBlindPixelQEBlueError*gkCalibrationBlindPixelQEBlueError 731 / gkCalibrationBlindPixelQEBlue / gkCalibrationBlindPixelQEBlue; 732 733 fMeanPhotInsidePlexiglass *= TMath::Power(10,gkCalibrationBlindPixelAttBlue); // correct for absorption 734 // attenuation has negligible error 718 735 break; 719 736 case kECUV: 720 fMeanPhotInsidePlexiglass = (mean / gkCalibrationBlindPixelQEUV ) 721 *TMath::Power(10,gkCalibrationBlindPixelAttUV) 722 * gkCalibrationInnerPixelArea; 737 fMeanPhotInsidePlexiglass /= gkCalibrationBlindPixelQEUV; 738 fMeanPhotErrInsidePlexiglass += gkCalibrationBlindPixelQEUVError*gkCalibrationBlindPixelQEUVError 739 / gkCalibrationBlindPixelQEUV / gkCalibrationBlindPixelQEUV; 740 741 fMeanPhotInsidePlexiglass *= TMath::Power(10,gkCalibrationBlindPixelAttUV); // correct for absorption 742 // attenuation has negligible error 723 743 break; 724 744 case kECCT1: 725 745 default: 726 fMeanPhotInsidePlexiglass = (mean / gkCalibrationBlindPixelQECT1 ) 727 *TMath::Power(10,gkCalibrationBlindPixelAttCT1) 728 * gkCalibrationInnerPixelArea; 729 break; 730 } 731 732 SETBIT(fFlags,kNumPhotInsidePlexiglassAvailable); 746 fMeanPhotInsidePlexiglass /= gkCalibrationBlindPixelQECT1; 747 fMeanPhotErrInsidePlexiglass += gkCalibrationBlindPixelQECT1Error*gkCalibrationBlindPixelQECT1Error 748 / gkCalibrationBlindPixelQECT1 / gkCalibrationBlindPixelQECT1; 749 750 fMeanPhotInsidePlexiglass *= TMath::Power(10,gkCalibrationBlindPixelAttCT1); // correct for absorption 751 // attenuation has negligible error 752 break; 753 } 733 754 734 755 *fLog << inf << endl; 735 *fLog << inf << " Mean number of Photons for an Inner Pixel (inside Plexiglass): "756 *fLog << inf << " Mean number of Photons for an Inner Pixel (inside Plexiglass): " 736 757 << fMeanPhotInsidePlexiglass << endl; 758 759 if (fMeanPhotInsidePlexiglass > 0.) 760 SETBIT(fFlags,kNumPhotInsidePlexiglassAvailable); 761 else 762 { 763 CLRBIT(fFlags,kNumPhotInsidePlexiglassAvailable); 764 return kFALSE; 765 } 766 767 if (fMeanPhotErrInsidePlexiglass < 0.) 768 { 769 *fLog << warn << " Relative Variance on number of Photons for an Inner Pixel (inside Plexiglass): " 770 << fMeanPhotErrInsidePlexiglass << endl; 771 CLRBIT(fFlags,kNumPhotInsidePlexiglassAvailable); 772 return kFALSE; 773 } 774 775 // Finish calculation of errors -> convert from relative variance to absolute error 776 fMeanPhotErrInsidePlexiglass = TMath::Sqrt(fMeanPhotErrInsidePlexiglass); 777 fMeanPhotErrInsidePlexiglass *= fMeanPhotInsidePlexiglass; 778 779 *fLog << inf << " Error on number of Photons for an Inner Pixel (inside Plexiglass): " 780 << fMeanPhotErrInsidePlexiglass << endl; 781 *fLog << inf << endl; 782 783 737 784 738 785 TIter Next(fPixels); … … 740 787 while ((pix=(MCalibrationPix*)Next())) 741 788 { 742 if((pix->GetCharge() > 0.) && (fMeanPhotInsidePlexiglass > 0.)) 789 790 if(pix->IsChargeValid()) 743 791 { 744 792 745 Float_t conversion = fMeanPhotInsidePlexiglass/pix->GetCharge(); 746 Float_t conversionerr = 0.; 747 Float_t conversionsigma = 0.; 793 const Float_t charge = pix->GetCharge(); 794 const Float_t ratio = fGeomCam->GetPixRatio(pix->GetPixId()); 795 const Float_t chargeerr = pix->GetErrCharge(); 796 797 Float_t nphot; 798 Float_t nphoterr; 799 800 if (ratio == 1.) 801 { 802 nphot = fMeanPhotInsidePlexiglass; 803 nphoterr = fMeanPhotErrInsidePlexiglass; 804 } 805 else 806 { 807 nphot = fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelArea; 808 nphoterr = fMeanPhotErrInsidePlexiglass*gkCalibrationOutervsInnerPixelArea 809 *fMeanPhotErrInsidePlexiglass*gkCalibrationOutervsInnerPixelArea; 810 nphoterr += fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelAreaError 811 *fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelAreaError; 812 nphoterr = TMath::Sqrt(nphoterr); 813 } 814 815 816 817 const Float_t conversion = nphot/charge; 818 Float_t conversionerr; 819 820 conversionerr = nphoterr/charge 821 * nphoterr/charge ; 822 conversionerr += chargeerr/charge 823 * chargeerr/charge 824 * conversion*conversion; 825 conversionerr = TMath::Sqrt(conversionerr); 826 827 const Float_t conversionsigma = 0.; 828 748 829 pix->SetConversionBlindPixelMethod(conversion, conversionerr, conversionsigma); 749 830 … … 764 845 const Float_t mean = fPINDiode->GetCharge(); 765 846 const Float_t merr = fPINDiode->GetErrCharge(); 847 848 // Start calculation of number of photons 849 fMeanPhotOutsidePlexiglass = mean * gkCalibrationInnerPixelvsPINDiodeArea; 850 851 // Start calculation of number of photons relative Variance (!!) 852 fMeanPhotErrOutsidePlexiglass = merr*merr/mean/mean; 853 fMeanPhotErrOutsidePlexiglass += gkCalibrationInnerPixelvsPINDiodeAreaError*gkCalibrationInnerPixelvsPINDiodeAreaError 854 / gkCalibrationInnerPixelvsPINDiodeArea/gkCalibrationInnerPixelvsPINDiodeArea; 766 855 767 856 switch (fColor) 768 857 { 769 858 case kECGreen: 770 fMeanPhotOutsidePlexiglass = (mean / gkCalibrationPINDiodeQEGreen) // real photons 771 * gkCalibrationInnerPixelvsPINDiodeArea; // correct for area 859 fMeanPhotOutsidePlexiglass /= gkCalibrationPINDiodeQEGreen; 860 fMeanPhotErrOutsidePlexiglass += gkCalibrationPINDiodeQEGreenError*gkCalibrationPINDiodeQEGreenError 861 / gkCalibrationPINDiodeQEGreen/gkCalibrationPINDiodeQEGreen; 772 862 break; 773 863 case kECBlue: 774 fMeanPhotOutsidePlexiglass = (mean / gkCalibrationPINDiodeQEBlue ) 775 * gkCalibrationInnerPixelvsPINDiodeArea; 776 break; 864 fMeanPhotOutsidePlexiglass /= gkCalibrationPINDiodeQEBlue; 865 fMeanPhotErrOutsidePlexiglass += gkCalibrationPINDiodeQEBlueError*gkCalibrationPINDiodeQEBlueError 866 / gkCalibrationPINDiodeQEBlue/gkCalibrationPINDiodeQEBlue; 867 break; 777 868 case kECUV: 778 fMeanPhotOutsidePlexiglass = (mean / gkCalibrationPINDiodeQEUV ) 779 * gkCalibrationInnerPixelvsPINDiodeArea; 869 fMeanPhotOutsidePlexiglass /= gkCalibrationPINDiodeQEUV; 870 fMeanPhotErrOutsidePlexiglass += gkCalibrationPINDiodeQEUVError*gkCalibrationPINDiodeQEUVError 871 / gkCalibrationPINDiodeQEUV/gkCalibrationPINDiodeQEUV; 780 872 break; 781 873 case kECCT1: 782 874 default: 783 fMeanPhotOutsidePlexiglass = (mean / gkCalibrationPINDiodeQECT1 )784 * gkCalibrationInnerPixelvsPINDiodeArea;785 break;786 }787 788 SETBIT(fFlags,kNumPhotOutsidePlexiglassAvailable); 875 fMeanPhotOutsidePlexiglass /= gkCalibrationPINDiodeQECT1; 876 fMeanPhotErrOutsidePlexiglass += gkCalibrationPINDiodeQECT1Error*gkCalibrationPINDiodeQECT1Error 877 / gkCalibrationPINDiodeQECT1/gkCalibrationPINDiodeQECT1; 878 break; 879 } 880 789 881 790 882 *fLog << inf << endl; 791 *fLog << inf << mean <<" Mean number of Photons for an Inner Pixel (outside Plexiglass): "883 *fLog << inf << " Mean number of Photons for an Inner Pixel (outside Plexiglass): " 792 884 << fMeanPhotOutsidePlexiglass << endl; 885 886 if (fMeanPhotOutsidePlexiglass > 0.) 887 SETBIT(fFlags,kNumPhotOutsidePlexiglassAvailable); 888 else 889 { 890 CLRBIT(fFlags,kNumPhotOutsidePlexiglassAvailable); 891 return kFALSE; 892 } 893 894 if (fMeanPhotErrOutsidePlexiglass < 0.) 895 { 896 *fLog << warn << "Relative Variance on number of Photons for an Inner Pixel (outside Plexiglass): " 897 << fMeanPhotErrOutsidePlexiglass << endl; 898 CLRBIT(fFlags,kNumPhotOutsidePlexiglassAvailable); 899 return kFALSE; 900 } 901 902 // Finish calculation of errors -> convert from relative variance to absolute error 903 fMeanPhotErrOutsidePlexiglass = TMath::Sqrt(fMeanPhotErrOutsidePlexiglass); 904 fMeanPhotErrOutsidePlexiglass *= fMeanPhotOutsidePlexiglass; 905 906 *fLog << inf << " Error on number of Photons for an Inner Pixel (outside Plexiglass): " 907 << fMeanPhotErrOutsidePlexiglass << endl; 793 908 *fLog << inf << endl; 794 909 … … 797 912 while ((pix=(MCalibrationPix*)Next())) 798 913 { 799 800 if((pix->GetCharge() > 0.) && (fMeanPhotInsidePlexiglass > 0.)) 801 pix->SetConversionPINDiodeMethod(fMeanPhotOutsidePlexiglass/pix->GetCharge(), 0., 0.); 914 915 if (pix->IsChargeValid()) 916 { 917 918 const Float_t charge = pix->GetCharge(); 919 const Float_t ratio = fGeomCam->GetPixRatio(pix->GetPixId()); 920 const Float_t chargeerr = pix->GetErrCharge(); 921 922 Float_t nphot; 923 Float_t nphoterr; 924 925 if (ratio == 1.) 926 { 927 nphot = fMeanPhotInsidePlexiglass; 928 nphoterr = fMeanPhotErrInsidePlexiglass; 929 } 930 else 931 { 932 nphot = fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelArea; 933 nphoterr = fMeanPhotErrInsidePlexiglass*gkCalibrationOutervsInnerPixelArea 934 *fMeanPhotErrInsidePlexiglass*gkCalibrationOutervsInnerPixelArea; 935 nphoterr += fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelAreaError 936 *fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelAreaError; 937 nphoterr = TMath::Sqrt(nphoterr); 938 } 939 940 const Float_t conversion = nphot/charge; 941 Float_t conversionerr; 942 943 conversionerr = nphoterr/charge 944 * nphoterr/charge ; 945 conversionerr += chargeerr/charge 946 * chargeerr/charge 947 * conversion*conversion; 948 if (conversionerr > 0.) 949 conversionerr = TMath::Sqrt(conversionerr); 950 951 const Float_t conversionsigma = 0.; 952 953 pix->SetConversionBlindPixelMethod(conversion, conversionerr, conversionsigma); 954 955 if (conversionerr/conversion < 0.1) 956 pix->SetBlindPixelMethodValid(); 957 958 } 802 959 } 803 960 return kTRUE; -
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.h
r3062 r3065 30 30 MCalibrationPINDiode *fPINDiode; //-> Pointer to the PIN Diode with fit results 31 31 32 MGeomCam *fGeomCam; //! Need geom cam to know which pixel in inner or outer 33 32 34 TH1D* fOffsets; //! 33 35 TH1D* fSlopes; //! … … 69 71 void SetBlindPixelMethodValid(const Bool_t b = kTRUE); 70 72 void SetPINDiodeMethodValid(const Bool_t b = kTRUE); 73 74 void SetGeomCam(MGeomCam *geom) { fGeomCam = geom; } 71 75 72 76 // Getters -
trunk/MagicSoft/Mars/mcalib/MCalibrationConfig.h
r2957 r3065 23 23 const Float_t gkCalibrationBlindPixelQEUV = 0.247; 24 24 const Float_t gkCalibrationBlindPixelQECT1 = 0.247; 25 26 // Average QE Error of Blind Pixel (three colours) 27 const Float_t gkCalibrationBlindPixelQEGreenError = 0.015; 28 const Float_t gkCalibrationBlindPixelQEBlueError = 0.02; 29 const Float_t gkCalibrationBlindPixelQEUVError = 0.02; 30 const Float_t gkCalibrationBlindPixelQECT1Error = 0.02; 25 31 26 32 // Attenuation factor Blind Pixel (three colours) … … 82 88 const Float_t gkCalibrationPINDiodeQECT1 = -1.0; 83 89 90 // 91 // Average QE of the PIN Diode 92 // 93 const Float_t gkCalibrationPINDiodeQEGreenError = -1.0; 94 const Float_t gkCalibrationPINDiodeQEBlueError = -1.0; 95 const Float_t gkCalibrationPINDiodeQEUVError = -1.0; 96 const Float_t gkCalibrationPINDiodeQECT1Error = -1.0; 84 97 85 98 #endif /* MARS_MCalibrationConfig */ -
trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc
r3061 r3065 107 107 CLRBIT(fFlags, kExcluded); 108 108 CLRBIT(fFlags, kExcludeQualityCheck); 109 CLRBIT(fFlags, kCharge FitValid);109 CLRBIT(fFlags, kChargeValid); 110 110 CLRBIT(fFlags, kFitted); 111 111 CLRBIT(fFlags, kOscillating); … … 258 258 // Set the Excluded Bit from outside 259 259 // 260 void MCalibrationPix::SetCharge FitValid(Bool_t b )261 { 262 b ? SETBIT(fFlags, kCharge FitValid) : CLRBIT(fFlags, kChargeFitValid);260 void MCalibrationPix::SetChargeValid(Bool_t b ) 261 { 262 b ? SETBIT(fFlags, kChargeValid) : CLRBIT(fFlags, kChargeValid); 263 263 } 264 264 … … 443 443 } 444 444 445 Bool_t MCalibrationPix::IsCharge FitValid() const446 { 447 return TESTBIT(fFlags, kCharge FitValid);445 Bool_t MCalibrationPix::IsChargeValid() const 446 { 447 return TESTBIT(fFlags, kChargeValid); 448 448 } 449 449 … … 584 584 ApplyLoGainConversion(); 585 585 586 if (CheckCharge FitValidity())587 SETBIT(fFlags,kCharge FitValid);586 if (CheckChargeValidity()) 587 SETBIT(fFlags,kChargeValid); 588 588 else 589 589 { 590 CLRBIT(fFlags,kCharge FitValid);590 CLRBIT(fFlags,kChargeValid); 591 591 return kFALSE; 592 592 } … … 751 751 // 5) Pixel has a charge sigma bigger than its Pedestal RMS 752 752 // 753 Bool_t MCalibrationPix::CheckCharge FitValidity()753 Bool_t MCalibrationPix::CheckChargeValidity() 754 754 { 755 755 -
trunk/MagicSoft/Mars/mcalib/MCalibrationPix.h
r3062 r3065 78 78 enum { kHiGainSaturation, 79 79 kExcluded, kExcludeQualityCheck, 80 kCharge FitValid, kTimeFitValid,80 kChargeValid, kTimeFitValid, 81 81 kFitted, kOscillating, 82 82 kBlindPixelMethodValid, kFFactorMethodValid, kPINDiodeMethodValid }; … … 84 84 MHCalibrationPixel *fHist; // Pointer to the histograms performing the fits, etc. 85 85 86 Bool_t CheckCharge FitValidity();86 Bool_t CheckChargeValidity(); 87 87 Bool_t CheckTimeFitValidity(); 88 88 Bool_t CalcFFactorMethod(); … … 148 148 Bool_t IsExcludeQualityCheck() const; 149 149 Bool_t IsHiGainSaturation() const; 150 Bool_t IsCharge FitValid() const;150 Bool_t IsChargeValid() const; 151 151 Bool_t IsFitted() const; 152 152 Bool_t IsOscillating(); … … 169 169 void SetExcluded(Bool_t b = kTRUE); 170 170 void SetExcludeQualityCheck(Bool_t b = kTRUE); 171 void SetCharge FitValid(Bool_t b = kTRUE);171 void SetChargeValid(Bool_t b = kTRUE); 172 172 void SetFitted(Bool_t b = kTRUE); 173 173 void SetOscillating(Bool_t b = kTRUE);
Note:
See TracChangeset
for help on using the changeset viewer.