Changeset 5485


Ignore:
Timestamp:
11/27/04 15:11:29 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 edited

Legend:

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

    r5479 r5485  
    133133      break;
    134134    case 5:
    135       val = (*this)[idx].GetLoGainMean() > 1. ? 0. : (*this)[idx].GetLoGainMean();
     135      val = (*this)[idx].GetLoGainMean();
    136136      break;
    137137    case 6:
  • trunk/MagicSoft/Mars/mhcalib/MHPedestalCam.cc

    r5482 r5485  
    485485      //
    486486      pix.SetLoGainMean    ( fSum[i] / fNumEvents  );
    487       pix.SetLoGainSigma   ( TMath::Sqrt( (fSum2[i] - fSum[i]*fSum[i]/fNumEvents) / (fNumEvents-1) ));
     487      const Double_t diff = fSum2[i] - fSum[i]*fSum[i]/fNumEvents;
     488      pix.SetLoGainSigma   ( diff > 0. ? TMath::Sqrt( diff / (fNumEvents-1) ) : 0.);
    488489      pix.SetLoGainMeanVar ( pix.GetLoGainSigma() * pix.GetLoGainSigma() / fNumEvents  );
    489490      pix.SetLoGainSigmaVar( pix.GetLoGainMeanVar() / 4. );
     
    532533      if (aevts <= 1)
    533534        continue;
     535
    534536      pix.SetLoGainMean ( fAreaSum[j] / aevts  );
    535       pix.SetLoGainSigma( TMath::Sqrt( (fAreaSum2[j] - fAreaSum[j]*fAreaSum[j]/aevts) / (aevts-1) ));
     537      const Double_t diff = fAreaSum2[j] - fAreaSum[j]*fAreaSum[j]/aevts ;
     538      pix.SetLoGainSigma( diff > 0. ? TMath::Sqrt( diff / (aevts-1) ) : 0.);
    536539    }
    537540 
     
    574577      if (sevts <= 1)
    575578        continue;
    576       pix.SetLoGainMean ( fAreaSum[j] / sevts  );
    577       pix.SetLoGainSigma( TMath::Sqrt( (fAreaSum2[j] - fAreaSum[j]*fAreaSum[j]/sevts) / (sevts-1) ));
     579
     580      pix.SetLoGainMean ( fSectorSum[j] / sevts  );
     581      const Double_t diff = fSectorSum2[j] - fSectorSum[j]*fSectorSum[j]/sevts ;
     582      pix.SetLoGainSigma( diff > 0. ? TMath::Sqrt( diff / (sevts-1) ) : 0.);
    578583    }
    579584}
Note: See TracChangeset for help on using the changeset viewer.