Ignore:
Timestamp:
05/27/05 16:33:19 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r7069 r7099  
    181181//  ClassVersion 2:
    182182//   - Float_t fPheErrLimit;
    183 //   + Float_t fPheErrLowerLimit;                   // Lower limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
    184 //   + Float_t fPheErrUpperLimit;                   // Upper limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
     183//   + Float_t fPheErrLowerLimit; // Lower limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
     184//   + Float_t fPheErrUpperLimit; // Upper limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
     185//
     186//  ClassVersion 3:
     187//   + Bool_t  fUseExtractorRes;  // Include extractor resolution in F-Factor method
    185188//
    186189//////////////////////////////////////////////////////////////////////////////
     
    280283//
    281284MCalibrationChargeCalc::MCalibrationChargeCalc(const char *name, const char *title)
    282     : fGeom(NULL), fSignal(NULL), fCalibPattern(NULL)
     285    : fUseExtractorRes(kFALSE),
     286    fGeom(NULL), fSignal(NULL), fCalibPattern(NULL), fExtractor(NULL)
    283287{
    284288       
     
    661665      return kTRUE;
    662666  }
    663  
     667
    664668  if (fNumProcessed == 0)
    665669    return kTRUE;
     
    10171021            << endl;
    10181022      bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes);
     1023      bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun);
     1024      return kFALSE;
     1025    }
     1026
     1027  if (cal.GetPheFFactorMethod() < 0.)
     1028    {
     1029      bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes);
     1030      bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun);
     1031      cal.SetFFactorMethodValid(kFALSE);
     1032      return kFALSE;
     1033    }
     1034
     1035  if (!cal.CalcConvFFactor())
     1036    {
     1037      *fLog << warn << "Could not calculate the Conv. FADC counts to Phes in ";
     1038      *fLog << what << ":           " << Form("%4i", cal.GetPixId()) << endl;
     1039      bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes);
     1040      return kFALSE;
     1041    }
     1042
     1043  if (!fUseExtractorRes)
     1044    return kTRUE;
     1045
     1046  if (!fExtractor)
     1047    {
     1048      *fLog << err << "Extractor resolution has been chosen, but not extractor is set. Cannot calibrate" << endl;
     1049      return kFALSE;
     1050    }
     1051
     1052  const Float_t resinphes = cal.IsHiGainSaturation()
     1053    ? cal.GetPheFFactorMethod()*fExtractor->GetResolutionPerPheLoGain()
     1054    : cal.GetPheFFactorMethod()*fExtractor->GetResolutionPerPheHiGain();
     1055
     1056  Float_t resinfadc = cal.IsHiGainSaturation()
     1057    ? resinphes/cal.GetMeanConvFADC2Phe()/cal.GetConversionHiLo()
     1058    : resinphes/cal.GetMeanConvFADC2Phe();
     1059
     1060  if (resinfadc > 1.5*cal.GetPedRms() )
     1061    {
     1062      *fLog << warn << " Extractor Resolution: " << resinfadc << " bigger than Pedestal RMS " << cal.GetPedRms() << endl;
     1063      resinfadc = cal.GetPedRms();
     1064    }
     1065
     1066  if (!cal.CalcReducedSigma(resinfadc))
     1067    {
     1068        *fLog << warn << "Could not calculate the reduced sigma in " << what;
     1069        *fLog << ":                        " << Form("%4i",cal.GetPixId()) << endl;
     1070        bad.SetUncalibrated( MBadPixelsPix::kChargeSigmaNotValid );
     1071        return kFALSE;
     1072    }
     1073
     1074  if (!cal.CalcFFactor())
     1075    {
     1076        *fLog << warn << "Could not calculate the F-Factor in " << what;
     1077        *fLog << ":                             " << Form("%4i",cal.GetPixId()) << endl;
     1078      bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes);
     1079      bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun);
    10191080      return kFALSE;
    10201081    }
     
    22992360      rc = kTRUE;
    23002361    }
     2362  if (IsEnvDefined(env, prefix, "UseExtractorRes", print))
     2363    {
     2364      SetUseExtractorRes(GetEnvValue(env, prefix, "UseExtractorRes", fUseExtractorRes));
     2365      rc = kTRUE;
     2366    }
    23012367
    23022368  return rc;
Note: See TracChangeset for help on using the changeset viewer.