Changeset 2793 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
01/13/04 17:36:02 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2792 r2793  
    2525     - Time fit accepted if ChiSquare less than 30. (instead of 20.)
    2626
     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)
    2731
    2832 2004/01/13: Abelardo Moralejo
  • trunk/MagicSoft/Mars/mcalib/MCalibrationFits.h

    r2734 r2793  
    88#define GIMMEABREAK     10000000000.0
    99
     10inline 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
    1067inline Double_t gfKto5(Double_t *x, Double_t *par)
    1168{
     
    68125  sum += 0.008333333333333*lambda5*TMath::Exp(-0.5*arg*arg)/sigma5;
    69126
    70   return par[5]*sum;
    71 
    72 };
     127  return TMath::Exp(-1.*lambda)*par[5]*sum;
     128
     129};
     130
    73131
    74132inline Double_t gfKto6(Double_t *x, Double_t *par)
     
    139197  sum += 0.001388888888889*lambda6*TMath::Exp(-0.5*arg*arg)/sigma6;
    140198 
    141   return par[5]*sum;
     199  return TMath::Exp(-1.*lambda)*par[5]*sum;
    142200
    143201};
     
    217275  sum += 0.000198412698413*lambda7*TMath::Exp(-0.5*arg*arg)/sigma7;
    218276 
    219   return par[5]*sum;
     277  return TMath::Exp(-1.*lambda)*par[5]*sum;
    220278
    221279};
     
    303361  sum += 0.000024801587315*lambda8*TMath::Exp(-0.5*arg*arg)/sigma7;
    304362 
    305   return par[5]*sum;
     363  return TMath::Exp(-1.*lambda)*par[5]*sum;
    306364
    307365};
  • trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc

    r2765 r2793  
    4343// --------------------------------------------------------------------------
    4444//
    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
    4655//
    4756MCalibrationPix::MCalibrationPix(const char *name, const char *title)
     
    6170      fSigmaTime(-1.),
    6271      fTimeChiSquare(-1.),
    63       fFactor(1.3),
     72      fFactor(1.32),
     73      fFactorError(0.04),
    6474      fPheFFactorMethod(-1.),
     75      fPheFFactorMethodError(-1.),
    6576      fConversionFFactorMethod(-1.),
    6677      fConversionBlindPixelMethod(-1.),
     
    122133//
    123134// 1) Return if the charge distribution is already succesfully fitted 
     135//    or if the histogram is empty
    124136// 2) Set a lower Fit range according to 1.5 Pedestal RMS in order to avoid
    125137//    possible remaining cosmics to spoil the fit.
     
    133145// The fits are declared valid (fFitValid = kTRUE), if:
    134146//
    135 // 1) Pixel has a fitted charge greater than 3*PedRMS
     147// 1) Pixel has a fitted charge greater than 5*PedRMS
    136148// 2) Pixel has a fit error greater than 0.
    137149// 3) Pixel has a fit Probability greater than 0.0001
     
    141153// (this stage is only performed in the times fit)
    142154//
     155// If the histogram is empty, all values are set to -1.
     156//
    143157// The conversion factor after the F-Factor method is declared valid, if:
    144158//
     
    152166  //
    153167  // 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())
    156171    return kTRUE;
    157172
     
    301316
    302317      const Float_t rSigmaSquareRelErrSquare = (sigmaSquareErrSquare + pedRmsSquareErrSquare)
    303         / (fRSigmaSquare * fRSigmaSquare) ;
     318                                               / (fRSigmaSquare * fRSigmaSquare) ;
    304319 
    305320      //
     
    342357// The check return kTRUE if:
    343358//
    344 // 1) Pixel has a fitted charge greater than 3*PedRMS
     359// 1) Pixel has a fitted charge greater than 5*PedRMS
    345360// 2) Pixel has a fit error greater than 0.
    346361// 3) Pixel has a fit Probability greater than 0.0001
     
    355370    equivpedestal /= fConversionHiLo;
    356371     
    357   if (fCharge < 3.*equivpedestal)
    358     {
    359       *fLog << warn << "WARNING: Fitted Charge is smaller than 3 Pedestal 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;
    360375      return kFALSE;
    361376    }
Note: See TracChangeset for help on using the changeset viewer.