Ignore:
Timestamp:
05/24/04 17:16:02 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r4133 r4150  
    228228const Float_t MCalibrationChargeCalc::fgLambdaErrLimit         = 0.2;
    229229const Float_t MCalibrationChargeCalc::fgLambdaCheckLimit       = 0.2;
    230 const Float_t MCalibrationChargeCalc::fgPheErrLimit            = 8.;
     230const Float_t MCalibrationChargeCalc::fgPheErrLimit            = 3.;
    231231const Float_t MCalibrationChargeCalc::fgFFactorErrLimit        = 3.;
    232232// --------------------------------------------------------------------------
     
    932932     
    933933      const Float_t nphe  = pix.GetPheFFactorMethod();
    934       const Float_t nvar  = pix.GetPheFFactorMethodVar();
     934      const Float_t nvar  = pix.GetPheFFactorMethod()*pix.GetPheFFactorMethod();
    935935      const Int_t   aidx  = (*fGeom)[i].GetAidx();
    936936
    937       if (nvar > 0.)
    938         {
    939           areaphes    [aidx] += nphe;
    940           areavars    [aidx] += nvar;
    941           numareavalid[aidx] ++;
    942         }
     937      areaphes    [aidx] += nphe;
     938      areavars    [aidx] += nvar;
     939      numareavalid[aidx] ++;
    943940    }
    944941
     
    953950
    954951      areaphes[i] = areaphes[i] / numareavalid[i];
    955       areavars[i] = areavars[i] / numareavalid[i];
     952      areavars[i] = (areavars[i] - areaphes[i]*areaphes[i]/numareavalid[i]) / (numareavalid[i]-1.);
     953
     954      if (areavars[i] > 0.)
     955        areavars[i] = TMath::Sqrt(areavars[i]);
     956      else
     957        {
     958          *fLog << warn << GetDescriptor() << ": No pixels with valid variance of photo-electrons found "
     959                << "in area index: " << i << endl;
     960          continue;
     961        }
     962     
    956963      lowlim  [i] = areaphes[i] - fPheErrLimit*TMath::Sqrt(areavars[i]);
    957964      upplim  [i] = areaphes[i] + fPheErrLimit*TMath::Sqrt(areavars[i]);
     
    12161223  const UInt_t nareas   = fGeom->GetNumAreas();
    12171224
     1225  //
     1226  // Set the results in the MCalibrationChargeCam
     1227  //
     1228  fCam->SetNumPhotonsFFactorMethod   (avphotons);
     1229  if (avphotrelvar > 0.)
     1230    fCam->SetNumPhotonsFFactorMethodErr(TMath::Sqrt( avphotrelvar * avphotons * avphotons)); 
     1231
    12181232  Float_t lowlim           [nareas];
    12191233  Float_t upplim           [nareas];
Note: See TracChangeset for help on using the changeset viewer.