Changeset 4776


Ignore:
Timestamp:
08/27/04 20:00:21 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
2 edited

Legend:

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

    r4603 r4776  
    4040// -  fLoGainPedRmsSquare and fLoGainPedRmsSquareVar (see CalcLoGainPedestal())
    4141// -  fRSigmaSquare and fRSigmaSquareVar             (see CalcReducedSigma()  )
    42 // -  fPheFFactorMethod and fPheFFactorMethodVar     (see CalcFFactorMethod() )
     42// -  fPheFFactorMethod and fPheFFactorMethodVar     (see CalcFFactor()       )
     43// -  fMeanConvFADC2Phe and fMeanConvFADC2PheVar     (see CalcConvFFactor()  )
    4344//
    4445// The following variables are set by MHCalibrationChargeCam:
     
    746747//
    747748// If fRSigmaSquare is smaller than 0 (i.e. has not yet been set),
    748 // set kFFactorMethodValid to kFALSE and return kFALSE
     749// return kFALSE
    749750//
    750751// Calculate the number of photo-electrons with the F-Factor method:
     
    768769// - If fPheFFactorMethod is less than fPheFFactorMethodLimit,
    769770//   set kFFactorMethodValid to kFALSE and return kFALSE
    770 //   else: Set kFFactorMethodValid to kTRUE and return kTRUE
    771 //
    772 Bool_t MCalibrationChargePix::CalcFFactorMethod()
    773 {
    774 
     771//
     772Bool_t MCalibrationChargePix::CalcFFactor()
     773{
    775774
    776775  if (fRSigmaSquare < 0.)
     
    810809  //
    811810  const Float_t pheRelVar = ffactorsquareRelVar + meanSquareRelVar + rsigmaSquareRelVar;
    812   fPheFFactorMethodVar = pheRelVar * fPheFFactorMethod * fPheFFactorMethod;
     811  fPheFFactorMethodVar    = pheRelVar * fPheFFactorMethod * fPheFFactorMethod;
    813812
    814813  if (IsDebug())
     
    825824    return kFALSE;
    826825 
     826}
     827
     828// ------------------------------------------------------------------
     829//
     830// If fPheFFactorMethod is smaller than 0 (i.e. has not yet been set),
     831// return kFALSE
     832//
     833// If GetCovertedMean() is smaller than 0 (i.e. has not yet been set),
     834// return kFALSE
     835//
     836// Calculate fMeanConvFADC2Phe with the following formula:
     837//
     838//      fMeanConvFADC2Phe    =  fPheFFactorMethod / GetConvMean();
     839//
     840// Calculate the rel. variance of fMeanConvFADC2Phe, taking into account that
     841// in the calculation of the number of phe's one mean square has already been used.
     842// Now, dividing by another mean, one mean calcels out, one cannot directly propagate
     843// the errors, but instead havs to take into account this cancellation:
     844//
     845//     convrelvar = ffactorsquareRelVar + GetMeanRelVar() + rsigmaSquareRelVar;
     846//
     847// If confrelvar is smaller than 0. or greater than fConvFFactorRelVarLimit,
     848// return kFALSE
     849//
     850// Calculate the variance of fMeanConvFADC2Phe with the formula:
     851//
     852//    fMeanConvFADC2PheVar =  convrelvar * fMeanConvFADC2Phe * fMeanConvFADC2Phe;
     853//
     854// Set kFFactorMethodValid to kTRUE and
     855// return kTRUE
     856//
     857Bool_t MCalibrationChargePix::CalcConvFFactor()
     858{
     859 
     860  if (fPheFFactorMethod <= 0.)
     861    return kFALSE;
     862
    827863  const Float_t convmean = GetConvertedMean();
    828  
    829 
    830   if (convmean > 0.)
    831     fMeanConvFADC2Phe    =  fPheFFactorMethod / GetConvertedMean();
    832   else
    833     fMeanConvFADC2Phe    =  -1.;
     864
     865  if (convmean <= 0.)
     866    return kFALSE;
     867 
     868  fMeanConvFADC2Phe    =  fPheFFactorMethod / convmean;
    834869
    835870  if (IsDebug())
     
    841876    }
    842877
    843   if (fMeanConvFADC2Phe < 0. )
    844     return kFALSE;
    845  
     878  const Float_t ffactorsquareRelVar = 4.* GetFFactorRelVar();
     879  const Float_t rsigmaSquareRelVar  =     fRSigmaSquareVar / fRSigmaSquare / fRSigmaSquare;
    846880  //
    847881  // In the calculation of the number of phe's one mean square has already been used.
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.h

    r4333 r4776  
    110110  void   CalcLoGainPedestal       ( const Float_t logainsamples, const Int_t aidx );
    111111  Bool_t CalcReducedSigma  (  );
    112   Bool_t CalcFFactorMethod ();
     112  Bool_t CalcFFactor       (  );
     113  Bool_t CalcConvFFactor   (  ); 
    113114  Bool_t CalcMeanFFactor   ( const Float_t nphotons, const Float_t nphotonsrelvar );
    114115 
Note: See TracChangeset for help on using the changeset viewer.