Changeset 3664 for trunk/MagicSoft/Mars
- Timestamp:
- 04/06/04 12:16:14 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3663 r3664 25 25 GetConvertedLoGain*() for better clarity 26 26 27 * mcalib/MCalibrationChargeCam.[h,cc] 28 - updated and enlarged documentation 27 29 28 30 2004/04/05: Markus Gaug -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r3662 r3664 851 851 // F-Factor calibration 852 852 // 853 if (fCam->Calc MeanFluxPhotonsFFactorMethod(*fGeom, *fBadPixels))853 if (fCam->CalcFluxPhotonsFFactorMethod(*fGeom, *fBadPixels)) 854 854 { 855 855 fCam->ApplyFFactorCalibration(*fGeom,*fBadPixels); -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc
r3662 r3664 155 155 fAverageSectors = new TClonesArray("MCalibrationChargePix",1); 156 156 157 f MeanFluxPhesInnerPixel = 0.;158 f MeanFluxPhesInnerPixelVar = 0.;159 f MeanFluxPhesOuterPixel = 0.;160 f MeanFluxPhesOuterPixelVar = 0.;157 fFluxPhesInnerPixel = 0.; 158 fFluxPhesInnerPixelVar = 0.; 159 fFluxPhesOuterPixel = 0.; 160 fFluxPhesOuterPixelVar = 0.; 161 161 162 162 CLRBIT(fFlags,kBlindPixelMethodValid); … … 195 195 { 196 196 197 f MeanFluxPhesInnerPixel = 0.;198 f MeanFluxPhesInnerPixelVar = 0.;199 f MeanFluxPhesOuterPixel = 0.;200 f MeanFluxPhesOuterPixelVar = 0.;197 fFluxPhesInnerPixel = 0.; 198 fFluxPhesInnerPixelVar = 0.; 199 fFluxPhesOuterPixel = 0.; 200 fFluxPhesOuterPixelVar = 0.; 201 201 202 202 CLRBIT(fFlags,kBlindPixelMethodValid); … … 224 224 } 225 225 226 Float_t MCalibrationChargeCam::Get MeanFluxPhesInnerPixelErr() const227 { 228 if (f MeanFluxPhesInnerPixelVar <= 0.)226 Float_t MCalibrationChargeCam::GetFluxPhesInnerPixelErr() const 227 { 228 if (fFluxPhesInnerPixelVar <= 0.) 229 229 return -1.; 230 return TMath::Sqrt(f MeanFluxPhesInnerPixelVar);231 } 232 233 Float_t MCalibrationChargeCam::Get MeanFluxPhesOuterPixelErr() const234 { 235 if (f MeanFluxPhesOuterPixelVar <= 0.)230 return TMath::Sqrt(fFluxPhesInnerPixelVar); 231 } 232 233 Float_t MCalibrationChargeCam::GetFluxPhesOuterPixelErr() const 234 { 235 if (fFluxPhesOuterPixelVar <= 0.) 236 236 return -1.; 237 return TMath::Sqrt(f MeanFluxPhesOuterPixelVar);238 } 239 240 Float_t MCalibrationChargeCam::Get MeanFluxPhotonsInnerPixelErr() const241 { 242 if (f MeanFluxPhotonsInnerPixelVar <= 0.)237 return TMath::Sqrt(fFluxPhesOuterPixelVar); 238 } 239 240 Float_t MCalibrationChargeCam::GetFluxPhotonsInnerPixelErr() const 241 { 242 if (fFluxPhotonsInnerPixelVar <= 0.) 243 243 return -1.; 244 return TMath::Sqrt(f MeanFluxPhotonsInnerPixelVar);245 } 246 247 Float_t MCalibrationChargeCam::Get MeanFluxPhotonsOuterPixelErr() const248 { 249 if (f MeanFluxPhotonsOuterPixelVar <= 0.)244 return TMath::Sqrt(fFluxPhotonsInnerPixelVar); 245 } 246 247 Float_t MCalibrationChargeCam::GetFluxPhotonsOuterPixelErr() const 248 { 249 if (fFluxPhotonsOuterPixelVar <= 0.) 250 250 return -1.; 251 return TMath::Sqrt(f MeanFluxPhotonsOuterPixelVar);251 return TMath::Sqrt(fFluxPhotonsOuterPixelVar); 252 252 } 253 253 … … 675 675 // which are fPheFFactorRelLimit sigmas from the mean. 676 676 // 677 Bool_t MCalibrationChargeCam::Calc MeanFluxPhotonsFFactorMethod(const MGeomCam &geom, MBadPixelsCam &bad)677 Bool_t MCalibrationChargeCam::CalcFluxPhotonsFFactorMethod(const MGeomCam &geom, MBadPixelsCam &bad) 678 678 { 679 679 … … 737 737 else 738 738 { 739 f MeanFluxPhesInnerPixel = sumphesinner/sumweightsinner;740 f MeanFluxPhesInnerPixelVar = (1./sumweightsinner)*fMeanFluxPhesInnerPixel*fMeanFluxPhesInnerPixel;739 fFluxPhesInnerPixel = sumphesinner/sumweightsinner; 740 fFluxPhesInnerPixelVar = (1./sumweightsinner)*fFluxPhesInnerPixel*fFluxPhesInnerPixel; 741 741 } 742 742 … … 748 748 else 749 749 { 750 f MeanFluxPhesOuterPixel = sumphesouter/sumweightsouter;751 f MeanFluxPhesOuterPixelVar = (1./sumweightsouter)*fMeanFluxPhesOuterPixel*fMeanFluxPhesOuterPixel;752 } 753 754 Float_t meanFluxPhotonsRelVar = f MeanFluxPhesInnerPixelVar755 / (f MeanFluxPhesInnerPixel * fMeanFluxPhesInnerPixel);756 757 f MeanFluxPhotonsInnerPixel = fMeanFluxPhesInnerPixel/fAverageQE;758 f MeanFluxPhotonsInnerPixelVar = (meanFluxPhotonsRelVar + avQERelVar)759 * f MeanFluxPhotonsInnerPixel * fMeanFluxPhotonsInnerPixel;760 761 f MeanFluxPhotonsOuterPixel = 4. *fMeanFluxPhotonsInnerPixel;762 f MeanFluxPhotonsOuterPixelVar = 16.*fMeanFluxPhotonsInnerPixelVar;750 fFluxPhesOuterPixel = sumphesouter/sumweightsouter; 751 fFluxPhesOuterPixelVar = (1./sumweightsouter)*fFluxPhesOuterPixel*fFluxPhesOuterPixel; 752 } 753 754 Float_t meanFluxPhotonsRelVar = fFluxPhesInnerPixelVar 755 / (fFluxPhesInnerPixel * fFluxPhesInnerPixel); 756 757 fFluxPhotonsInnerPixel = fFluxPhesInnerPixel/fAverageQE; 758 fFluxPhotonsInnerPixelVar = (meanFluxPhotonsRelVar + avQERelVar) 759 * fFluxPhotonsInnerPixel * fFluxPhotonsInnerPixel; 760 761 fFluxPhotonsOuterPixel = 4. *fFluxPhotonsInnerPixel; 762 fFluxPhotonsOuterPixelVar = 16.*fFluxPhotonsInnerPixelVar; 763 763 764 764 *fLog << inf << " Mean number of photo-electrons from inner pixels (F-Factor Method): " 765 << f MeanFluxPhesInnerPixel << " +- " << GetMeanFluxPhesInnerPixelErr() << endl;765 << fFluxPhesInnerPixel << " +- " << GetFluxPhesInnerPixelErr() << endl; 766 766 767 767 *fLog << inf << " Mean number of photons from inner pixels (F-Factor Method): " 768 << f MeanFluxPhotonsInnerPixel << " +- " << GetMeanFluxPhotonsInnerPixelErr() << endl;768 << fFluxPhotonsInnerPixel << " +- " << GetFluxPhotonsInnerPixelErr() << endl; 769 769 770 770 // 771 771 // Here starts the second loop discarting pixels out of the range: 772 772 // 773 const Float_t innervar = (Float_t)validinner*fPheFFactorRelVarLimit*f MeanFluxPhesInnerPixelVar;774 const Float_t outervar = (Float_t)validouter*fPheFFactorRelVarLimit*f MeanFluxPhesOuterPixelVar;773 const Float_t innervar = (Float_t)validinner*fPheFFactorRelVarLimit*fFluxPhesInnerPixelVar; 774 const Float_t outervar = (Float_t)validouter*fPheFFactorRelVarLimit*fFluxPhesOuterPixelVar; 775 775 776 776 Float_t innererr; … … 797 797 } 798 798 799 const Float_t lowerpheinnerlimit = f MeanFluxPhesInnerPixel - innererr;800 const Float_t upperpheinnerlimit = f MeanFluxPhesInnerPixel + innererr;801 802 const Float_t lowerpheouterlimit = f MeanFluxPhesOuterPixel - outererr;803 const Float_t upperpheouterlimit = f MeanFluxPhesOuterPixel + outererr;799 const Float_t lowerpheinnerlimit = fFluxPhesInnerPixel - innererr; 800 const Float_t upperpheinnerlimit = fFluxPhesInnerPixel + innererr; 801 802 const Float_t lowerpheouterlimit = fFluxPhesOuterPixel - outererr; 803 const Float_t upperpheouterlimit = fFluxPhesOuterPixel + outererr; 804 804 805 805 sumweightsinner = 0.; … … 871 871 else 872 872 { 873 f MeanFluxPhesInnerPixel = sumphesinner/sumweightsinner;874 f MeanFluxPhesInnerPixelVar = (1./sumweightsinner)*fMeanFluxPhesInnerPixel*fMeanFluxPhesInnerPixel;873 fFluxPhesInnerPixel = sumphesinner/sumweightsinner; 874 fFluxPhesInnerPixelVar = (1./sumweightsinner)*fFluxPhesInnerPixel*fFluxPhesInnerPixel; 875 875 876 876 } … … 883 883 else 884 884 { 885 f MeanFluxPhesOuterPixel = sumphesouter/sumweightsouter;886 f MeanFluxPhesOuterPixelVar = (1./sumweightsouter)*fMeanFluxPhesOuterPixel*fMeanFluxPhesOuterPixel;887 } 888 889 meanFluxPhotonsRelVar = f MeanFluxPhesInnerPixelVar890 / (f MeanFluxPhesInnerPixel * fMeanFluxPhesInnerPixel);891 892 f MeanFluxPhotonsInnerPixel = fMeanFluxPhesInnerPixel/fAverageQE;893 f MeanFluxPhotonsInnerPixelVar = (meanFluxPhotonsRelVar + avQERelVar)894 * f MeanFluxPhotonsInnerPixel * fMeanFluxPhotonsInnerPixel;895 896 f MeanFluxPhotonsOuterPixel = 4. *fMeanFluxPhotonsInnerPixel;897 f MeanFluxPhotonsOuterPixelVar = 16.*fMeanFluxPhotonsInnerPixelVar;885 fFluxPhesOuterPixel = sumphesouter/sumweightsouter; 886 fFluxPhesOuterPixelVar = (1./sumweightsouter)*fFluxPhesOuterPixel*fFluxPhesOuterPixel; 887 } 888 889 meanFluxPhotonsRelVar = fFluxPhesInnerPixelVar 890 / (fFluxPhesInnerPixel * fFluxPhesInnerPixel); 891 892 fFluxPhotonsInnerPixel = fFluxPhesInnerPixel/fAverageQE; 893 fFluxPhotonsInnerPixelVar = (meanFluxPhotonsRelVar + avQERelVar) 894 * fFluxPhotonsInnerPixel * fFluxPhotonsInnerPixel; 895 896 fFluxPhotonsOuterPixel = 4. *fFluxPhotonsInnerPixel; 897 fFluxPhotonsOuterPixelVar = 16.*fFluxPhotonsInnerPixelVar; 898 898 899 899 *fLog << inf << " Mean number of photo-electrons from inner pixels (F-Factor Method): " 900 << f MeanFluxPhesInnerPixel << " +- " << GetMeanFluxPhesInnerPixelErr() << endl;900 << fFluxPhesInnerPixel << " +- " << GetFluxPhesInnerPixelErr() << endl; 901 901 902 902 *fLog << inf << " Mean number of photons from inner pixels (F-Factor Method): " 903 << f MeanFluxPhotonsInnerPixel << " +- " << GetMeanFluxPhotonsInnerPixelErr() << endl;903 << fFluxPhotonsInnerPixel << " +- " << GetFluxPhotonsInnerPixelErr() << endl; 904 904 905 905 return kTRUE; … … 909 909 { 910 910 911 const Float_t meanphotRelVar = f MeanFluxPhotonsInnerPixelVar912 /( f MeanFluxPhotonsInnerPixel * fMeanFluxPhotonsInnerPixel );911 const Float_t meanphotRelVar = fFluxPhotonsInnerPixelVar 912 /( fFluxPhotonsInnerPixel * fFluxPhotonsInnerPixel ); 913 913 914 914 TIter Next(fPixels); … … 938 938 939 939 if (ratio == 1.) 940 conv = f MeanFluxPhotonsInnerPixel / pix->GetMean();940 conv = fFluxPhotonsInnerPixel / pix->GetMean(); 941 941 else 942 conv = f MeanFluxPhotonsOuterPixel / pix->GetMean();942 conv = fFluxPhotonsOuterPixel / pix->GetMean(); 943 943 944 944 if (conv <= 0.) … … 968 968 // 969 969 const Float_t totalFFactor = (pix->GetRSigma()/pix->GetMean()) 970 *TMath::Sqrt(f MeanFluxPhotonsInnerPixel);970 *TMath::Sqrt(fFluxPhotonsInnerPixel); 971 971 972 972 // -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.h
r3651 r3664 16 16 private: 17 17 18 static const Float_t fgAverageQE; // The default for fAverageQE(now set to: 0.18)19 static const Float_t fgAverageQEErr; // The default for fAverageQEErr(now set to: 0.02)20 static const Float_t fgConvFFactorRelErrLimit; // The default for fConvFFactorRelErrLimit (now set to: 0.35)21 static const Float_t fgPheFFactorRelErrLimit; // The default for fPheFFactorRelErrLimit (now set to: 5.)18 static const Float_t fgAverageQE; //! Default for fAverageQE (now set to: 0.18) 19 static const Float_t fgAverageQEErr; //! Default for fAverageQEErr (now set to: 0.02) 20 static const Float_t fgConvFFactorRelErrLimit; //! Default for fConvFFactorRelErrLimit (now set to: 0.35) 21 static const Float_t fgPheFFactorRelErrLimit; //! Default for fPheFFactorRelErrLimit (now set to: 5.) 22 22 23 Float_t fAverageQE; // The average quantum efficieny (see Class description)24 Float_t fAverageQEVar; // The error of the average quantum efficieny(see Class description)25 Float_t fConvFFactorRelVarLimit; // Acceptance limit for rel. error of conversion factor (FFactor method)26 Float_t fPheFFactorRelVarLimit; // Acceptance limit for number of phe's w.r.t mean number(in variances)23 Float_t fAverageQE; // Average quantum efficieny (see Class description) 24 Float_t fAverageQEVar; // Error av. quantum eff. (see Class description) 25 Float_t fConvFFactorRelVarLimit; // Acceptance limit rel. error conv. factor (F-Factor method) 26 Float_t fPheFFactorRelVarLimit; // Acceptance limit number phe's w.r.t its mean (in variances) 27 27 28 TH1D* fOffsets; //! 29 TH1D* fSlopes; //! 30 31 TH2D* fOffvsSlope; //! 28 TH1D* fOffsets; //! Histogram with Higain-vs-LoGain fit result Offsets 29 TH1D* fSlopes; //! Histogram with Higain-vs-LoGain fit result Slopes 30 TH2D* fOffvsSlope; //! Histogram with Higain-vs-LoGain fit result Offsets vs. Slopes 32 31 33 32 enum { kFFactorMethodValid, kBlindPixelMethodValid, kPINDiodeMethodValid, kCombinedMethodValid }; 34 33 35 Float_t fMeanFluxPhesInnerPixel; // The mean number of photo-electrons in an INNER PIXEL 36 Float_t fMeanFluxPhesInnerPixelVar; // The variance of the number of photo-electrons INNER PIXEL 37 Float_t fMeanFluxPhesOuterPixel; // The mean number of photo-electrons in an INNER PIXEL 38 Float_t fMeanFluxPhesOuterPixelVar; // The variance of the number of photo-electrons INNER PIXEL 39 40 Float_t fMeanFluxPhotonsInnerPixel; // The mean number of photo-electrons in an INNER PIXEL 41 Float_t fMeanFluxPhotonsInnerPixelVar; // The variance of the number of photo-electrons INNER PIXEL 42 Float_t fMeanFluxPhotonsOuterPixel; // The mean number of photo-electrons in an INNER PIXEL 43 Float_t fMeanFluxPhotonsOuterPixelVar; // The variance of the number of photo-electrons INNER PIXEL 44 45 Byte_t fFlags; // Byte to hold the flags 34 Float_t fFluxPhesInnerPixel; // Mean nr. photo-electrons in INNER PIXEL 35 Float_t fFluxPhesInnerPixelVar; // Variance nr. photo-electrons INNER PIXEL 36 Float_t fFluxPhesOuterPixel; // Mean nr. photo-electrons in an OUTER PIXEL 37 Float_t fFluxPhesOuterPixelVar; // Variance nr, photo-electrons OUTER PIXEL 38 Float_t fFluxPhotonsInnerPixel; // Mean nr. photo-electrons in INNER PIXEL 39 Float_t fFluxPhotonsInnerPixelVar; // Variance nr. photo-electrons INNER PIXEL 40 Float_t fFluxPhotonsOuterPixel; // Mean nr. photo-electrons in OUTER PIXEL 41 Float_t fFluxPhotonsOuterPixelVar; // Variance nr. photo-electrons OUTER PIXEL 42 Byte_t fFlags; // Bit-fieldto hold the flags 46 43 47 44 public: … … 53 50 54 51 // Setters 55 void SetAverageQE ( const Float_t qe=fgAverageQE,56 const Float_t err=fgAverageQEErr) { fAverageQE = qe;57 fAverageQEVar = err*err; } 52 void SetAverageQE ( const Float_t q=fgAverageQE, 53 const Float_t e=fgAverageQEErr) { fAverageQE = q; fAverageQEVar = e*e; } 54 void SetBlindPixelMethodValid ( const Bool_t b=kTRUE ); 58 55 void SetConvFFactorRelErrLimit( const Float_t f=fgConvFFactorRelErrLimit ) { fConvFFactorRelVarLimit = f*f; } 59 void SetPheFFactorRelErrLimit ( const Float_t f=fgPheFFactorRelErrLimit ) { fPheFFactorRelVarLimit = f*f; } 60 61 void SetFFactorMethodValid( const Bool_t b = kTRUE ); 62 void SetBlindPixelMethodValid( const Bool_t b = kTRUE ); 63 void SetPINDiodeMethodValid( const Bool_t b = kTRUE ); 56 void SetFFactorMethodValid ( const Bool_t b=kTRUE ); 57 void SetPheFFactorRelErrLimit ( const Float_t f=fgPheFFactorRelErrLimit ) { fPheFFactorRelVarLimit = f*f; } 58 void SetPINDiodeMethodValid ( const Bool_t b=kTRUE ); 64 59 65 60 // Getters 66 Bool_t GetConversionFactorFFactor (Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma );67 Bool_t GetConversionFactorBlindPixel ( Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma );68 Bool_t GetConversionFactorPINDiode (Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma );69 Bool_t GetConversionFactorCombined (Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma );61 Bool_t GetConversionFactorFFactor ( Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma ); 62 Bool_t GetConversionFactorBlindPixel ( Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma ); 63 Bool_t GetConversionFactorPINDiode ( Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma ); 64 Bool_t GetConversionFactorCombined ( Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma ); 70 65 71 Float_t GetMeanFluxPhesInnerPixel() const { return fMeanFluxPhesInnerPixel; } 72 Float_t GetMeanFluxPhesInnerPixelErr() const; 73 Float_t GetMeanFluxPhesOuterPixel() const { return fMeanFluxPhesOuterPixel; } 74 Float_t GetMeanFluxPhesOuterPixelErr() const; 66 Float_t GetFluxPhesInnerPixel() const { return fFluxPhesInnerPixel; } 67 Float_t GetFluxPhesInnerPixelErr() const; 68 Float_t GetFluxPhesOuterPixel() const { return fFluxPhesOuterPixel; } 69 Float_t GetFluxPhesOuterPixelErr() const; 70 Float_t GetFluxPhotonsInnerPixel() const { return fFluxPhotonsInnerPixel; } 71 Float_t GetFluxPhotonsInnerPixelErr() const; 72 Float_t GetFluxPhotonsOuterPixel() const { return fFluxPhotonsOuterPixel; } 73 Float_t GetFluxPhotonsOuterPixelErr() const; 75 74 76 Float_t GetMeanFluxPhotonsInnerPixel() const { return fMeanFluxPhotonsInnerPixel; } 77 Float_t GetMeanFluxPhotonsInnerPixelErr() const; 78 Float_t GetMeanFluxPhotonsOuterPixel() const { return fMeanFluxPhotonsOuterPixel; } 79 Float_t GetMeanFluxPhotonsOuterPixelErr() const; 80 81 Bool_t IsBlindPixelMethodValid() const; 82 Bool_t IsPINDiodeMethodValid() const; 75 Bool_t IsBlindPixelMethodValid() const; 76 Bool_t IsPINDiodeMethodValid() const; 83 77 84 78 // Prints 85 void Print(Option_t *o="") const;79 void Print(Option_t *o="") const; 86 80 87 81 // Draws 88 void DrawPixelContent(Int_t num) const;82 void DrawPixelContent(Int_t num) const; 89 83 // void DrawHiLoFits(); 90 84 … … 92 86 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 93 87 94 Bool_t Calc MeanFluxPhotonsFFactorMethod(const MGeomCam &geom, MBadPixelsCam &bad);88 Bool_t CalcFluxPhotonsFFactorMethod(const MGeomCam &geom, MBadPixelsCam &bad); 95 89 96 void ApplyPINDiodeCalibration(const MGeomCam &geom, 97 const MBadPixelsCam &bad, 98 const MCalibrationChargePINDiode &pindiode); 99 void ApplyBlindPixelCalibration(const MGeomCam &geom, 100 const MBadPixelsCam &bad, 101 const MCalibrationChargeBlindPix &blindpix); 102 void ApplyFFactorCalibration(const MGeomCam &geom, const MBadPixelsCam &bad); 90 void ApplyPINDiodeCalibration ( const MGeomCam &geom, 91 const MBadPixelsCam &bad, 92 const MCalibrationChargePINDiode &pindiode ); 93 void ApplyBlindPixelCalibration ( const MGeomCam &geom, 94 const MBadPixelsCam &bad, 95 const MCalibrationChargeBlindPix &blindpix ); 96 void ApplyFFactorCalibration ( const MGeomCam &geom, 97 const MBadPixelsCam &bad ); 103 98 104 ClassDef(MCalibrationChargeCam, 1) // Container for calibration of the camera99 ClassDef(MCalibrationChargeCam, 1) // Container Charge Calibration Results Camera 105 100 }; 106 101
Note:
See TracChangeset
for help on using the changeset viewer.