- Timestamp:
- 12/18/03 18:03:21 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCalibrationCam.cc
r2715 r2719 206 206 } 207 207 208 // --------------------------------------------------------------------------209 //210 // Return TRUE if:211 //212 // 1) Pixel is inside the range of the TClonesArray213 // 2) Pixel has a fitted charge greater than 3*PedRMS214 // 3) Pixel has a charge sigma bigger than its Pedestal RMS215 // 4) Pixel has a fit error greater than 0.216 // 5) Pixel has a fit Probability greater than 0.0001217 // 6) If FitTimes is used,218 // the mean arrival time is at least 1.5 slices from the edge219 //220 Bool_t MCalibrationCam::IsPixelFitValid(Int_t idx) const221 {222 223 if (!CheckBounds(idx))224 return kFALSE;225 226 return (*this)[idx].IsFitValid();227 }228 208 229 209 // -------------------------------------- … … 397 377 } 398 378 379 380 399 381 Bool_t MCalibrationCam::CalcNumPhotInsidePlexiglass() 400 382 { … … 442 424 { 443 425 if((pix->GetCharge() > 0.) && (fMeanPhotInsidePlexiglass > 0.)) 444 pix->SetConversionBlindPixelMethod(fMeanPhotInsidePlexiglass/pix->GetCharge(), 0., 0.); 426 { 427 428 Float_t conversion = fMeanPhotInsidePlexiglass/pix->GetCharge(); 429 Float_t conversionerr = 0.; 430 Float_t conversionsigma = 0.; 431 pix->SetConversionBlindPixelMethod(conversion, conversionerr, conversionsigma); 432 433 if (conversionerr/conversion < 0.1) 434 pix->SetBlindPixelMethodValid(); 435 } 445 436 } 446 437 return kTRUE; -
trunk/MagicSoft/Mars/manalysis/MCalibrationPix.cc
r2716 r2719 72 72 fConversionSigmaBlindPixelMethod(-1.), 73 73 fConversionSigmaPINDiodeMethod(-1.), 74 fHiGainSaturation(kFALSE) 74 fHiGainSaturation(kFALSE), 75 fFitValid(kFALSE), 76 fFitted(kFALSE), 77 fBlindPixelMethodValid(kFALSE), 78 fFFactorMethodValid(kFALSE), 79 fPINDiodeMethodValid(kFALSE) 75 80 { 76 81 … … 106 111 } 107 112 108 109 Bool_t MCalibrationPix::IsFitted()110 {111 return (fCharge > 0.) && (fErrCharge > 0.) ;112 }113 114 // --------------------------------------------------------------------------115 //116 // Return TRUE if:117 //118 // 1) Pixel has a fitted charge greater than 3*PedRMS119 // 2) Pixel has a fit error greater than 0.120 // 3) Pixel has a fit Probability greater than 0.0001121 // 4) Pixel has a charge sigma bigger than its Pedestal RMS122 // 5) If FitTimes is used,123 // the mean arrival time is at least 1.5 slices from the edge124 //125 Bool_t MCalibrationPix::IsFitValid()126 {127 128 if (fCharge < 3.*GetPedRms())129 return kFALSE;130 131 if (fErrCharge <= 0.)132 return kFALSE;133 134 if (!fHist->IsFitOK())135 return kFALSE;136 137 if (fSigmaCharge <= fPedRms)138 return kFALSE;139 140 if (fHist->GetTimeLowerFitRange() < fTime < fHist->GetTimeLowerFitRange()+1.)141 return kFALSE;142 143 if (fHist->GetTimeUpperFitRange()-1. < fTime < fHist->GetTimeUpperFitRange())144 return kFALSE;145 146 return kTRUE;147 148 }149 150 // --------------------------------------------------------------------------151 //152 // Return TRUE if:153 //154 // 1) Pixel is FitValid155 // 2) Conversion Factor is bigger than 0.156 // 3) The error of the conversion factor is smaller than 10%157 //158 Bool_t MCalibrationPix::IsBlindPixelMethodValid()159 {160 161 if (!IsFitValid())162 return kFALSE;163 164 if (fConversionBlindPixelMethod <= 0.)165 return kFALSE;166 167 if (fConversionErrorBlindPixelMethod/fConversionBlindPixelMethod > 0.1)168 return kFALSE;169 170 return kTRUE;171 }172 173 // --------------------------------------------------------------------------174 //175 // Return TRUE if:176 //177 // 1) Pixel is FitValid178 // 2) Conversion Factor is bigger than 0.179 // 3) The error of the conversion factor is smaller than 10%180 //181 Bool_t MCalibrationPix::IsFFactorMethodValid()182 {183 184 if (!IsFitValid())185 return kFALSE;186 187 if (fConversionFFactorMethod <= 0.)188 return kFALSE;189 190 if (fConversionErrorFFactorMethod/fConversionFFactorMethod > 0.1)191 return kFALSE;192 193 return kTRUE;194 }195 196 // --------------------------------------------------------------------------197 //198 // Return TRUE if:199 //200 // 1) Pixel is FitValid201 // 2) Conversion Factor is bigger than 0.202 // 3) The error of the conversion factor is smaller than 10%203 //204 Bool_t MCalibrationPix::IsPINDiodeMethodValid()205 {206 207 if (!IsFitValid())208 return kFALSE;209 210 if (fConversionPINDiodeMethod <= 0.)211 return kFALSE;212 213 if (fConversionErrorPINDiodeMethod/fConversionPINDiodeMethod > 0.1)214 return kFALSE;215 216 return kTRUE;217 }218 113 219 114 // -------------------------------------------------------------------------- … … 229 124 // 8) Calculate the errors of the F-Factor method 230 125 // 126 // The fit is declared as valid, if: 127 // 128 // 1) Pixel has a fitted charge greater than 3*PedRMS 129 // 2) Pixel has a fit error greater than 0. 130 // 3) Pixel has a fit Probability greater than 0.0001 131 // 4) Pixel has a charge sigma bigger than its Pedestal RMS 132 // 5) If FitTimes is used, 133 // the mean arrival time is at least 1.5 slices from the edge 134 // 135 // The F-Factor method is declared as valid, if: 136 // 137 // 1) Pixel is FitValid 138 // 2) Conversion Factor is bigger than 0. 139 // 3) The error of the conversion factor is smaller than 10% 140 // 231 141 Bool_t MCalibrationPix::FitCharge() 232 142 { … … 273 183 return kFALSE; 274 184 } 275 185 186 if (fErrCharge > 0.) 187 fFitted = kTRUE; 188 189 if ( (fCharge > 3.*GetPedRms()) && 190 (fErrCharge > 0.) && 191 (fHist->IsFitOK()) && 192 (fSigmaCharge > fPedRms) && 193 (fTime > fHist->GetTimeLowerFitRange()+1.) && 194 (fTime < fHist->GetTimeUpperFitRange()-1.) ) 195 fFitValid = kTRUE; 276 196 277 197 // … … 326 246 Float_t logainrmssquare = nsbsquare/conversionsquare + elecrmssquare; 327 247 Float_t logainrmssquareerrsquare = nsbsquareerrsquare/conversionsquare/conversionsquare 328 + elecrmssquareerr * elecrmssquareerr ; 248 + elecrmssquareerr * elecrmssquareerr 249 + conversionsquareerr*conversionsquareerr 250 / (conversionsquare*conversionsquare) 251 / (conversionsquare*conversionsquare); 329 252 // 330 253 // Calculate the reduced sigma with the new "Pedestal RMS" … … 377 300 fPheFFactorMethodError = TMath::Sqrt(pheffactorrelerrsquare) * fPheFFactorMethod; 378 301 302 if ( IsFitValid() && 303 (fConversionFFactorMethod > 0.) && 304 (fConversionErrorFFactorMethod/fConversionFFactorMethod < 0.1) ) 305 fFFactorMethodValid = kTRUE; 306 307 379 308 } /* if ((fPed > 0.) && (fPedRms > 0.)) */ 380 309 -
trunk/MagicSoft/Mars/manalysis/MCalibrationPix.h
r2716 r2719 48 48 Float_t fConversionSigmaPINDiodeMethod; // The conversion factor to Phd's calculated after the PIN Diode method 49 49 50 Bool_t fHiGainSaturation; // Is Lo-Gain used at all?50 Bool_t fHiGainSaturation; // Is Lo-Gain used at all? 51 51 52 Bool_t fFitValid; 53 Bool_t fFitted; 54 Bool_t fBlindPixelMethodValid; 55 Bool_t fFFactorMethodValid; 56 Bool_t fPINDiodeMethodValid; 57 52 58 MHCalibrationPixel *fHist; //! Pointer to the histograms performing the fits, etc. 53 59 … … 122 128 Bool_t FillRChargevsTimeLoGain(Float_t rq, Int_t t) { return fHist->FillChargevsNLoGain(rq,t); } 123 129 124 Bool_t IsFitValid(); 125 Bool_t IsFitted(); 126 Bool_t IsBlindPixelMethodValid(); 127 Bool_t IsFFactorMethodValid(); 128 Bool_t IsPINDiodeMethodValid(); 130 Bool_t IsFitValid() { return fFitValid; } 131 Bool_t IsFitted() { return fFitted; } 132 Bool_t IsBlindPixelMethodValid() { return fBlindPixelMethodValid; } 133 Bool_t IsFFactorMethodValid() { return fFFactorMethodValid; } 134 Bool_t IsPINDiodeMethodValid() { return fPINDiodeMethodValid; } 135 136 void SetFitValid() { fFitValid = kTRUE; } 137 void SetFitted() { fFitted = kTRUE; } 138 void SetBlindPixelMethodValid() { fBlindPixelMethodValid = kTRUE; } 139 void SetFFactorMethodValid() { fFFactorMethodValid = kTRUE; } 140 void SetPINDiodeMethodValid() { fPINDiodeMethodValid = kTRUE; } 129 141 130 142 Int_t GetPixId() const { return fPixId; }
Note:
See TracChangeset
for help on using the changeset viewer.