- Timestamp:
- 01/13/04 17:36:02 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2792 r2793 25 25 - Time fit accepted if ChiSquare less than 30. (instead of 20.) 26 26 27 * mcalib/MCalibrationPix.[h.cc] 28 - F-Factor corrected and added error 29 - Histograms not fitted if they are empty 30 - rejection criteria of fitted charges now > 5 PedRMS (instead 3) 27 31 28 32 2004/01/13: Abelardo Moralejo -
trunk/MagicSoft/Mars/mcalib/MCalibrationFits.h
r2734 r2793 8 8 #define GIMMEABREAK 10000000000.0 9 9 10 inline Double_t gfKto4(Double_t *x, Double_t *par) 11 { 12 13 Double_t lambda = par[0]; 14 15 Double_t sum = 0.; 16 Double_t arg = 0.; 17 18 Double_t mu0 = par[1]; 19 Double_t mu1 = par[2]; 20 21 if (mu1 < mu0) 22 return GIMMEABREAK; 23 24 Double_t sigma0 = par[3]; 25 Double_t sigma1 = par[4]; 26 27 if (sigma1 < sigma0) 28 return GIMMEABREAK; 29 30 31 Double_t mu2 = (2.*mu1)-mu0; 32 Double_t mu3 = (3.*mu1)-(2.*mu0); 33 Double_t mu4 = (4.*mu1)-(3.*mu0); 34 35 Double_t sigma2 = TMath::Sqrt((2.*sigma1*sigma1) - (sigma0*sigma0)); 36 Double_t sigma3 = TMath::Sqrt((3.*sigma1*sigma1) - (2.*sigma0*sigma0)); 37 Double_t sigma4 = TMath::Sqrt((4.*sigma1*sigma1) - (3.*sigma0*sigma0)); 38 39 Double_t lambda2 = lambda*lambda; 40 Double_t lambda3 = lambda2*lambda; 41 Double_t lambda4 = lambda3*lambda; 42 43 // k=0: 44 arg = (x[0] - mu0)/sigma0; 45 sum = TMath::Exp(-0.5*arg*arg)/sigma0; 46 47 // k=1: 48 arg = (x[0] - mu1)/sigma1; 49 sum += lambda*TMath::Exp(-0.5*arg*arg)/sigma1; 50 51 // k=2: 52 arg = (x[0] - mu2)/sigma2; 53 sum += 0.5*lambda2*TMath::Exp(-0.5*arg*arg)/sigma2; 54 55 // k=3: 56 arg = (x[0] - mu3)/sigma3; 57 sum += 0.1666666667*lambda3*TMath::Exp(-0.5*arg*arg)/sigma3; 58 59 // k=4: 60 arg = (x[0] - mu4)/sigma4; 61 sum += 0.041666666666667*lambda4*TMath::Exp(-0.5*arg*arg)/sigma4; 62 63 return TMath::Exp(-1.*lambda)*par[5]*sum; 64 65 }; 66 10 67 inline Double_t gfKto5(Double_t *x, Double_t *par) 11 68 { … … 68 125 sum += 0.008333333333333*lambda5*TMath::Exp(-0.5*arg*arg)/sigma5; 69 126 70 return par[5]*sum; 71 72 }; 127 return TMath::Exp(-1.*lambda)*par[5]*sum; 128 129 }; 130 73 131 74 132 inline Double_t gfKto6(Double_t *x, Double_t *par) … … 139 197 sum += 0.001388888888889*lambda6*TMath::Exp(-0.5*arg*arg)/sigma6; 140 198 141 return par[5]*sum;199 return TMath::Exp(-1.*lambda)*par[5]*sum; 142 200 143 201 }; … … 217 275 sum += 0.000198412698413*lambda7*TMath::Exp(-0.5*arg*arg)/sigma7; 218 276 219 return par[5]*sum;277 return TMath::Exp(-1.*lambda)*par[5]*sum; 220 278 221 279 }; … … 303 361 sum += 0.000024801587315*lambda8*TMath::Exp(-0.5*arg*arg)/sigma7; 304 362 305 return par[5]*sum;363 return TMath::Exp(-1.*lambda)*par[5]*sum; 306 364 307 365 }; -
trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc
r2765 r2793 43 43 // -------------------------------------------------------------------------- 44 44 // 45 // Default Constructor. 45 // Default Constructor: 46 // 47 // The following values are initialized to meaningful values: 48 // 49 // - The Electronic Rms to 1.5 per FADC slice 50 // - The uncertainty about the Electronic RMS to 0.3 per slice 51 // - The F-Factor is assumed to have been measured in Munich to 1.13 - 1.17. 52 // We use here the Square of the Munich definition, thus: 53 // Mean F-Factor = 1.15*1.15 = 1.32 54 // Error F-Factor = 2.*0.02 = 0.04 46 55 // 47 56 MCalibrationPix::MCalibrationPix(const char *name, const char *title) … … 61 70 fSigmaTime(-1.), 62 71 fTimeChiSquare(-1.), 63 fFactor(1.3), 72 fFactor(1.32), 73 fFactorError(0.04), 64 74 fPheFFactorMethod(-1.), 75 fPheFFactorMethodError(-1.), 65 76 fConversionFFactorMethod(-1.), 66 77 fConversionBlindPixelMethod(-1.), … … 122 133 // 123 134 // 1) Return if the charge distribution is already succesfully fitted 135 // or if the histogram is empty 124 136 // 2) Set a lower Fit range according to 1.5 Pedestal RMS in order to avoid 125 137 // possible remaining cosmics to spoil the fit. … … 133 145 // The fits are declared valid (fFitValid = kTRUE), if: 134 146 // 135 // 1) Pixel has a fitted charge greater than 3*PedRMS147 // 1) Pixel has a fitted charge greater than 5*PedRMS 136 148 // 2) Pixel has a fit error greater than 0. 137 149 // 3) Pixel has a fit Probability greater than 0.0001 … … 141 153 // (this stage is only performed in the times fit) 142 154 // 155 // If the histogram is empty, all values are set to -1. 156 // 143 157 // The conversion factor after the F-Factor method is declared valid, if: 144 158 // … … 152 166 // 153 167 // 1) Return if the charge distribution is already succesfully fitted 154 // 155 if (fHist->IsFitOK()) 168 // or if the histogram is empty 169 // 170 if (fHist->IsFitOK() || fHist->IsEmpty()) 156 171 return kTRUE; 157 172 … … 301 316 302 317 const Float_t rSigmaSquareRelErrSquare = (sigmaSquareErrSquare + pedRmsSquareErrSquare) 303 / (fRSigmaSquare * fRSigmaSquare) ;318 / (fRSigmaSquare * fRSigmaSquare) ; 304 319 305 320 // … … 342 357 // The check return kTRUE if: 343 358 // 344 // 1) Pixel has a fitted charge greater than 3*PedRMS359 // 1) Pixel has a fitted charge greater than 5*PedRMS 345 360 // 2) Pixel has a fit error greater than 0. 346 361 // 3) Pixel has a fit Probability greater than 0.0001 … … 355 370 equivpedestal /= fConversionHiLo; 356 371 357 if (fCharge < 3.*equivpedestal)358 { 359 *fLog << warn << "WARNING: Fitted Charge is smaller than 3Pedestal RMS in Pixel " << fPixId << endl;372 if (fCharge < 5.*equivpedestal) 373 { 374 *fLog << warn << "WARNING: Fitted Charge is smaller than 5 Pedestal RMS in Pixel " << fPixId << endl; 360 375 return kFALSE; 361 376 }
Note:
See TracChangeset
for help on using the changeset viewer.