- Timestamp:
- 04/06/04 16:54:53 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3670 r3671 154 154 - updated and enlarged documentation 155 155 156 * mcalib/MCalibrationPix. h156 * mcalib/MCalibrationPix.[h,cc] 157 157 * mcalib/MHCalibrationChargePINDiode.cc 158 158 * mcalib/MHCalibrationChargeCam.[h,cc] 159 159 - rename Setter for fMeanVar from SetMeanErr() to SetMeanVar() 160 160 - rename arrays of fAverageSigmaErr to AverageSigmaVar 161 - add Getters to the relative variance 162 161 163 162 164 2004/04/05: Nadia Tonello -
trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc
r3648 r3671 127 127 // -------------------------------------------------------------------------- 128 128 // 129 // Get the Relative Variance of either High Gain or Low Gain Mean 130 // depending on IsHighGainSaturation() 131 // 132 // If variance is smaller than 0. return -1. 133 // 134 Float_t MCalibrationPix::GetMeanRelVar() const 135 { 136 137 if (IsHiGainSaturation()) 138 if (fLoGainMeanVar < 0.) 139 return -1.; 140 else 141 return fLoGainMeanVar / (fLoGainMean * fLoGainMean); 142 else 143 if (fHiGainMeanVar < 0.) 144 return -1.; 145 else 146 return fHiGainMeanVar / (fHiGainMean * fHiGainMean); 147 } 148 149 // -------------------------------------------------------------------------- 150 // 151 // Get the Relative Variance of either High Gain or Low Gain Sigma 152 // depending on IsHighGainSaturation() 153 // 154 // If variance is smaller than 0. return -1. 155 // 156 Float_t MCalibrationPix::GetSigmaRelVar() const 157 { 158 159 if (IsHiGainSaturation()) 160 if (fLoGainSigmaVar < 0.) 161 return -1.; 162 else 163 return fLoGainSigmaVar / (fLoGainSigma * fLoGainSigma); 164 else 165 if (fHiGainSigmaVar < 0.) 166 return -1.; 167 else 168 return fHiGainSigmaVar / (fHiGainSigma * fHiGainSigma); 169 } 170 171 // -------------------------------------------------------------------------- 172 // 129 173 // Get the High Gain Mean Error: Takes square root of fHiGainMeanVar 130 174 // 131 175 Float_t MCalibrationPix::GetHiGainMeanErr() const 132 176 { 133 return TMath::Sqrt(fHiGainMeanVar); 134 } 177 if (fLoGainMeanVar < 0.) 178 return -1.; 179 180 return TMath::Sqrt(fLoGainMeanVar); 181 } 182 135 183 136 184 // -------------------------------------------------------------------------- … … 140 188 Float_t MCalibrationPix::GetHiGainSigmaErr() const 141 189 { 190 if (fHiGainSigmaVar < 0.) 191 return -1.; 192 142 193 return TMath::Sqrt(fHiGainSigmaVar); 143 194 } … … 145 196 // -------------------------------------------------------------------------- 146 197 // 147 // Get the Low Gain Mean Error: Takes square root of f HiGainMeanVar198 // Get the Low Gain Mean Error: Takes square root of fLoGainMeanVar 148 199 // 149 200 Float_t MCalibrationPix::GetLoGainMeanErr() const 150 201 { 202 if (fLoGainMeanVar < 0.) 203 return -1.; 204 151 205 return TMath::Sqrt(fLoGainMeanVar); 152 206 } 153 207 154 155 208 // -------------------------------------------------------------------------- 156 209 // … … 159 212 Float_t MCalibrationPix::GetLoGainSigmaErr() const 160 213 { 214 if (fLoGainSigmaVar < 0.) 215 return -1.; 216 161 217 return TMath::Sqrt(fLoGainSigmaVar); 162 218 } … … 168 224 Bool_t MCalibrationPix::IsHiGainSaturation() const 169 225 { 170 226 return TESTBIT(fFlags,kHiGainSaturation); 171 227 } 172 228 -
trunk/MagicSoft/Mars/mcalib/MCalibrationPix.h
r3647 r3671 41 41 42 42 void SetHiGainMean ( const Float_t f ) { fHiGainMean = f; } 43 void SetHiGainMean Err ( const Float_t f ) { fHiGainMeanVar = f*f; }43 void SetHiGainMeanVar ( const Float_t f ) { fHiGainMeanVar = f; } 44 44 void SetHiGainProb ( const Float_t f ) { fHiGainProb = f; } 45 45 void SetHiGainSigma ( const Float_t f ) { fHiGainSigma = f; } 46 void SetHiGainSigma Err ( const Float_t f ) { fHiGainSigmaVar = f*f; }46 void SetHiGainSigmaVar ( const Float_t f ) { fHiGainSigmaVar = f; } 47 47 void SetHiGainNumPickup ( const Float_t f ) { fHiGainNumPickup = f; } 48 48 49 49 void SetLoGainMean ( const Float_t f ) { fLoGainMean = f; } 50 void SetLoGainMean Err ( const Float_t f ) { fLoGainMeanVar = f*f; }50 void SetLoGainMeanVar ( const Float_t f ) { fLoGainMeanVar = f; } 51 51 void SetLoGainProb ( const Float_t f ) { fLoGainProb = f; } 52 52 void SetLoGainSigma ( const Float_t f ) { fLoGainSigma = f; } 53 void SetLoGainSigma Err ( const Float_t f ) { fLoGainSigmaVar = f*f; }53 void SetLoGainSigmaVar ( const Float_t f ) { fLoGainSigmaVar = f; } 54 54 void SetLoGainNumPickup ( const Float_t f ) { fLoGainNumPickup = f; } 55 55 56 56 void SetMean ( const Float_t f ) { IsHiGainSaturation() ? fLoGainMean = f : fHiGainMean = f ; } 57 void SetMean Err ( const Float_t f ) { IsHiGainSaturation() ? fLoGainMeanVar = f*f : fHiGainMeanVar = f*f ;}57 void SetMeanVar ( const Float_t f ) { IsHiGainSaturation() ? fLoGainMeanVar = f : fHiGainMeanVar = f ; } 58 58 void SetProb ( const Float_t f ) { IsHiGainSaturation() ? fLoGainProb = f : fHiGainProb = f ; } 59 59 void SetSigma ( const Float_t f ) { IsHiGainSaturation() ? fLoGainSigma = f : fHiGainSigma = f ; } 60 void SetSigma Err ( const Float_t f ) { IsHiGainSaturation() ? fLoGainSigmaVar = f*f : fHiGainSigmaVar = f*f; }60 void SetSigmaVar ( const Float_t f ) { IsHiGainSaturation() ? fLoGainSigmaVar = f : fHiGainSigmaVar = f ; } 61 61 void SetNumPickup ( const Float_t f ) { IsHiGainSaturation() ? fLoGainNumPickup = f : fHiGainNumPickup = f ; } 62 62 … … 82 82 Float_t GetMean () const { return IsHiGainSaturation() ? GetLoGainMean() : GetHiGainMean() ; } 83 83 Float_t GetMeanErr () const { return IsHiGainSaturation() ? GetLoGainMeanErr() : GetHiGainMeanErr() ; } 84 Float_t GetMeanRelVar () const; 84 85 Float_t GetProb () const { return IsHiGainSaturation() ? GetLoGainProb() : GetHiGainProb() ; } 85 86 Float_t GetSigma () const { return IsHiGainSaturation() ? GetLoGainSigma() : GetHiGainSigma() ; } 86 87 Float_t GetSigmaErr () const { return IsHiGainSaturation() ? GetLoGainSigmaErr() : GetHiGainSigmaErr() ; } 88 Float_t GetSigmaRelVar() const; 87 89 Float_t GetNumPickup () const { return IsHiGainSaturation() ? GetLoGainNumPickup() : GetHiGainNumPickup(); } 88 90 -
trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.cc
r3667 r3671 309 309 cam->fAverageAreaSat = fAverageAreaSat; 310 310 cam->fAverageAreaSigma = fAverageAreaSigma; 311 cam->fAverageAreaSigma Err = fAverageAreaSigmaErr;311 cam->fAverageAreaSigmaVar = fAverageAreaSigmaVar; 312 312 cam->fAverageAreaRelSigma = fAverageAreaRelSigma; 313 cam->fAverageAreaRelSigma Err = fAverageAreaRelSigmaErr;313 cam->fAverageAreaRelSigmaVar = fAverageAreaRelSigmaVar; 314 314 cam->fAverageSectorNum = fAverageSectorNum; 315 315 … … 408 408 fAverageAreaSat. Set(nareas); 409 409 fAverageAreaSigma. Set(nareas); 410 fAverageAreaSigma Err. Set(nareas);410 fAverageAreaSigmaVar. Set(nareas); 411 411 fAverageAreaRelSigma. Set(nareas); 412 fAverageAreaRelSigma Err.Set(nareas);412 fAverageAreaRelSigmaVar.Set(nareas); 413 413 fAverageSectorNum. Set(nsectors); 414 414 … … 644 644 MCalibrationPix &pix = (*fCam).GetAverageArea(j); 645 645 646 fAverageAreaSigma[j] = pix.GetSigma () * TMath::Sqrt((Float_t)fAverageAreaNum[j]); 647 fAverageAreaSigmaErr[j] = pix.GetSigmaErr () * TMath::Sqrt((Float_t)fAverageAreaNum[j]); 646 const Float_t numsqr = TMath::Sqrt((Float_t)fAverageAreaNum[j]); 647 fAverageAreaSigma[j] = pix.GetSigma () * numsqr; 648 fAverageAreaSigmaVar[j] = pix.GetSigmaErr () * pix.GetSigmaErr() * numsqr; 648 649 649 650 pix.SetSigma (fAverageAreaSigma[j]); 650 pix.SetSigmaErr(fAverageAreaSigmaErr[j]); 651 652 fAverageAreaRelSigma[j] = fAverageAreaSigma[j] / pix.GetMean(); 653 654 Float_t relsigmaerr = fAverageAreaSigmaErr[j]*fAverageAreaSigmaErr[j] 655 / (fAverageAreaSigma[j] *fAverageAreaSigma[j] ); 656 relsigmaerr += pix.GetMeanErr()*pix.GetMeanErr() 657 / (pix.GetMean() *pix.GetMean() ); 658 relsigmaerr *= fAverageAreaRelSigma[j]; 659 fAverageAreaRelSigmaErr[j] = TMath::Sqrt(relsigmaerr); 651 pix.SetSigmaVar(fAverageAreaSigmaVar[j]); 652 653 fAverageAreaRelSigma [j] = fAverageAreaSigma[j] / pix.GetMean(); 654 fAverageAreaRelSigmaVar[j] = fAverageAreaSigmaVar[j] / (fAverageAreaSigma[j]*fAverageAreaSigma[j]); 655 fAverageAreaRelSigmaVar[j] += pix.GetMeanRelVar(); 656 fAverageAreaRelSigmaVar[j] *= fAverageAreaRelSigma[j]; 660 657 } 661 658 } … … 717 714 // 718 715 pix.SetHiGainMean ( hist.GetMean() ); 719 pix.SetHiGainMean Err (hist.GetMeanErr() );716 pix.SetHiGainMeanVar ( hist.GetMeanErr() * hist.GetMeanErr() ); 720 717 pix.SetHiGainSigma ( hist.GetSigma() ); 721 pix.SetHiGainSigma Err (hist.GetSigmaErr() );718 pix.SetHiGainSigmaVar ( hist.GetSigmaErr()* hist.GetSigmaErr() ); 722 719 pix.SetHiGainProb ( hist.GetProb() ); 723 720 pix.SetHiGainNumPickup ( hist.GetPickup() ); … … 780 777 // 781 778 pix.SetLoGainMean ( hist.GetMean() ); 782 pix.SetLoGainMean Err (hist.GetMeanErr() );779 pix.SetLoGainMeanVar ( hist.GetMeanErr() * hist.GetMeanErr() ); 783 780 pix.SetLoGainSigma ( hist.GetSigma() ); 784 pix.SetLoGainSigma Err (hist.GetSigmaErr() );781 pix.SetLoGainSigmaVar ( hist.GetSigmaErr() * hist.GetSigmaErr() ); 785 782 pix.SetLoGainProb ( hist.GetProb() ); 786 783 pix.SetLoGainNumPickup ( hist.GetPickup() ); … … 835 832 if (!fAverageAreaSat[i]) 836 833 DrawAverageSigma(fAverageAreaSat[i], i, 837 fAverageAreaSigma[i], fAverageAreaSigma Err[i],838 fAverageAreaRelSigma[i], fAverageAreaRelSigma Err[i]);834 fAverageAreaSigma[i], fAverageAreaSigmaVar[i], 835 fAverageAreaRelSigma[i], fAverageAreaRelSigmaVar[i]); 839 836 840 837 pad->cd(2*(i+1)); … … 843 840 if (fAverageAreaSat[i]) 844 841 DrawAverageSigma(fAverageAreaSat[i], i, 845 fAverageAreaSigma[i], fAverageAreaSigma Err[i],846 fAverageAreaRelSigma[i], fAverageAreaRelSigma Err[i]);842 fAverageAreaSigma[i], fAverageAreaSigmaVar[i], 843 fAverageAreaRelSigma[i], fAverageAreaRelSigmaVar[i]); 847 844 } 848 845 } … … 855 852 // 856 853 void MHCalibrationCam::DrawAverageSigma(Bool_t sat, Bool_t inner, 857 Float_t sigma, Float_t sigma err,858 Float_t relsigma, Float_t relsigma err) const859 { 860 861 if (sigma != 0 )854 Float_t sigma, Float_t sigmavar, 855 Float_t relsigma, Float_t relsigmavar) const 856 { 857 858 if (sigma != 0 && sigmavar >= 0 && relsigmavar >= 0.) 862 859 { 863 860 … … 872 869 " Pixels ", sat ? "Low Gain" : "High Gain"); 873 870 TText *txt1 = text->AddText(line1.Data()); 874 const TString line2 = Form("#sigma per pix: %2.2f #pm %2.2f",sigma, sigmaerr);871 const TString line2 = Form("#sigma per pix: %2.2f #pm %2.2f",sigma,TMath::Sqrt(sigmavar)); 875 872 TText *txt2 = text->AddText(line2.Data()); 876 const TString line3 = Form("Rel. #sigma per pix: %2.2f #pm %2.2f",relsigma, relsigmaerr);873 const TString line3 = Form("Rel. #sigma per pix: %2.2f #pm %2.2f",relsigma,TMath::Sqrt(relsigmavar)); 877 874 TText *txt3 = text->AddText(line3.Data()); 878 875 text->Draw("");
Note:
See TracChangeset
for help on using the changeset viewer.