Ignore:
Timestamp:
05/13/05 15:28:58 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
3 edited

Legend:

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

    r7023 r7028  
    179179// 
    180180// 
    181 // 
     181//  ClassVersion 2:
     182//   - 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)
     185//
    182186//////////////////////////////////////////////////////////////////////////////
    183187#include "MCalibrationChargeCalc.h"
     
    236240const Float_t MCalibrationChargeCalc::fgLambdaErrLimit         = 0.2;
    237241const Float_t MCalibrationChargeCalc::fgLambdaCheckLimit       = 0.5;
    238 const Float_t MCalibrationChargeCalc::fgPheErrLimit            = 4.5;
     242const Float_t MCalibrationChargeCalc::fgPheErrLowerLimit       = 9.0;
     243const Float_t MCalibrationChargeCalc::fgPheErrUpperLimit       = 5.5;
    239244const Float_t MCalibrationChargeCalc::fgFFactorErrLimit        = 4.5;
    240245const Float_t MCalibrationChargeCalc::fgArrTimeRmsLimit        = 3.5;
     
    262267// - fLambdaErrLimit    to fgLambdaErrLimit
    263268// - fNamePedestalCam   to fgNamePedestalCam
    264 // - fPheErrLimit       to fgPheErrLimit 
     269// - fPheErrLowerLimit  to fgPheErrLowerLimit
     270// - fPheErrUpperLimit  to fgPheErrUpperLimit
    265271// - fPulserColor       to MCalibrationCam::kCT1
    266272// - fOutputPath        to "."
     
    289295  SetChargeErrLimit    (); 
    290296  SetChargeRelErrLimit ();
     297  SetDebug       ( kFALSE );
    291298  SetFFactorErrLimit   ();
    292299  SetLambdaCheckLimit  ();
    293300  SetLambdaErrLimit    ();
    294301  SetNamePedestalCam   ();
    295   SetPheErrLimit       ();
    296302  SetOutputPath        ();
    297303  SetOutputFile        ();
    298   SetDebug       ( kFALSE );
     304  SetPheErrLowerLimit  ();
     305  SetPheErrUpperLimit  ();
    299306
    300307  SetCheckArrivalTimes     ();
     
    867874  PrintUncalibrated(MBadPixelsPix::kDeadPedestalRms,
    868875                    "Presumably dead from Pedestal Rms:                ");
     876  PrintUncalibrated(MBadPixelsPix::kDeviatingNumPhes,
     877                    "Deviating number of phes:                         ");
    869878  PrintUncalibrated(MBadPixelsPix::kPreviouslyExcluded,
    870879                    "Previously excluded:                              ");
     
    883892  PrintUncalibrated(MBadPixelsPix::kLoGainNotFitted,     
    884893                    "Unsuccesful Gauss fit to the Lo Gain:   ");
    885   PrintUncalibrated(MBadPixelsPix::kDeviatingNumPhes,   
    886                     "Deviating number of phes:               ");
    887894  PrintUncalibrated(MBadPixelsPix::kDeviatingFFactor,   
    888895                    "Deviating F-Factor:                     ");
     
    11001107        {
    11011108          if (bad.IsUncalibrated( MBadPixelsPix::kDeviatingNumPhes ))
    1102             bad.SetUnsuitable(   MBadPixelsPix::kUnreliableRun    );
     1109            bad.SetUnsuitable(   MBadPixelsPix::kUnsuitableRun    );
    11031110        }
    11041111     
     
    12351242        }
    12361243     
    1237       lowlim  [i] = areaphes[i] - fPheErrLimit*TMath::Sqrt(areavars[i]);
    1238       upplim  [i] = areaphes[i] + fPheErrLimit*TMath::Sqrt(areavars[i]);
     1244      lowlim[i] = areaphes[i] - fPheErrLowerLimit*TMath::Sqrt(areavars[i]);
     1245      upplim[i] = areaphes[i] + fPheErrUpperLimit*TMath::Sqrt(areavars[i]);
     1246 
    12391247
    12401248      TH1D *hist = camphes.ProjectionS(TArrayI(),TArrayI(1,&i),"_py",100);
     
    12471255        hist->DrawClone();
    12481256
    1249       if (ndf < 2)
     1257      if (ndf < 5)
    12501258        {
    12511259          *fLog << warn << GetDescriptor() << ": Cannot use a Gauss fit to the number of photo-electrons "
    12521260                << "in the camera with area index: " << i << endl;
    1253           *fLog << warn << GetDescriptor() << ": Number of dof.: " << ndf << " is smaller than 2 " << endl;
     1261          *fLog << warn << GetDescriptor() << ": Number of dof.: " << ndf << " is smaller than 5 " << endl;
    12541262          *fLog << warn << GetDescriptor() << ": Will use the simple mean and rms " << endl;
    12551263          delete hist;
     
    12821290            << Form("%7.2f+-%6.2f",mean,sigma) << endl;
    12831291
    1284       lowlim  [i] = mean  - fPheErrLimit*sigma;
    1285       upplim  [i] = mean  + fPheErrLimit*sigma;
     1292      lowlim[i] = mean - fPheErrLowerLimit*sigma;
     1293      upplim[i] = mean + fPheErrUpperLimit*sigma;
    12861294
    12871295      delete hist;
     
    13261334        {
    13271335          *fLog << warn << "Number of phes: "
    1328                 << Form("%7.2f out of %3.1f sigma limit: ",nphe,fPheErrLimit)
     1336                << Form("%7.2f out of +%3.1f-%3.1f sigma limit: ",nphe,fPheErrUpperLimit,fPheErrLowerLimit)
    13291337                << Form("[%7.2f,%7.2f] pixel%4i",lowlim[aidx],upplim[aidx],i) << endl;
    13301338          bad.SetUncalibrated( MBadPixelsPix::kDeviatingNumPhes );
     1339
    13311340          if (IsCheckDeviatingBehavior())
    1332             {
    1333               bad.SetUnsuitable  ( MBadPixelsPix::kUnreliableRun    );
    1334               //              pix.SetFFactorMethodValid(kFALSE);
    1335             }
     1341                bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun);
    13361342          continue;
    13371343        }
     
    15111517      if (2.*(lambdacheck-lambda)/(lambdacheck+lambda) > fLambdaCheckLimit)
    15121518        {
    1513           *fLog << warn << GetDescriptor()
    1514                 << Form("%s%4.2f%s%4.2f%s%4.2f%s%2i",": Lambda: ",lambda," and Lambda-Check: ",
    1515                     lambdacheck," differ by more than ",fLambdaCheckLimit," in the Blind Pixel Nr.",i)
    1516                 << endl;
     1519          *fLog << warn << GetDescriptor() << ": Lambda="
     1520                << Form("%4.2f", lambda) << " and Lambda-Check="
     1521                << Form("%4.2f", lambdacheck) << " differ by more than "
     1522                << Form("%4.2f", fLambdaCheckLimit) << " in the Blind Pixel Nr."
     1523                << Form("%2i", i) << endl;
    15171524          blindpix.SetValid(kFALSE);
    15181525          continue;
     
    15211528      if (lambdaerr > fLambdaErrLimit)
    15221529        {
    1523           *fLog << warn << GetDescriptor()
    1524                 << Form("%s%4.2f%s%4.2f%s%2i",": Error of Fitted Lambda: ",lambdaerr," is greater than ",
    1525                         fLambdaErrLimit," in Blind Pixel Nr.",i) << endl;
     1530            *fLog << warn << GetDescriptor() << ": Error of Fitted Lambda="
     1531                << Form("%4.2f", lambdaerr) << " is greater than "
     1532                << Form("%4.2f", fLambdaErrLimit)
     1533                << " in Blind Pixel Nr." << Form("%2d", i) << endl;
    15261534          blindpix.SetValid(kFALSE);
    15271535          continue;
     
    22482256      rc = kTRUE;
    22492257    }
    2250   if (IsEnvDefined(env, prefix, "PheErrLimit", print))
    2251     {
    2252       SetPheErrLimit(GetEnvValue(env, prefix, "PheErrLimit", fPheErrLimit));
    2253       rc = kTRUE;
    2254     }
    22552258  if (IsEnvDefined(env, prefix, "CheckDeadPixels", print))
    22562259    {
     
    22832286      rc = kTRUE;
    22842287    }
     2288  if (IsEnvDefined(env, prefix, "PheErrLowerLimit", print))
     2289    {
     2290      SetPheErrLowerLimit(GetEnvValue(env, prefix, "PheErrLowerLimit", fPheErrLowerLimit));
     2291      rc = kTRUE;
     2292    }
     2293  if (IsEnvDefined(env, prefix, "PheErrUpperLimit", print))
     2294    {
     2295      SetPheErrUpperLimit(GetEnvValue(env, prefix, "PheErrUpperLimit", fPheErrUpperLimit));
     2296      rc = kTRUE;
     2297    }
    22852298
    22862299  return rc;
    22872300}
    22882301
     2302
     2303 
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h

    r7013 r7028  
    5454  static const Float_t fgLambdaCheckLimit;     //! Default for fLambdaCheckLimit   (now set to: 0.2)
    5555  static const Float_t fgLambdaErrLimit;       //! Default for fLabmdaErrLimit     (now set to: 0.5)
    56   static const Float_t fgPheErrLimit;          //! Default for fPheErrLimit        (now set to: 4.5)
     56  static const Float_t fgPheErrLowerLimit;     //! Default for fPheErrLowerLimit   (now set to: 9.0)
     57  static const Float_t fgPheErrUpperLimit;     //! Default for fPheErrUpperLimit   (now set to: 4.5)
    5758  static const Float_t fgFFactorErrLimit;      //! Default for fFFactorErrLimit    (now set to: 4.5)
    5859  static const Float_t fgArrTimeRmsLimit;      //! Default for fArrTimeRmsLimit    (now set to: 3.5)
     
    6869  Float_t fNumHiGainSamples;                   // Number High-Gain FADC slices used by extractor
    6970  Float_t fNumLoGainSamples;                   // Number Low -Gain FADC slices used by extractor
    70   Float_t fPheErrLimit;                        // Limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
    71   Float_t fFFactorErrLimit;                    // Limit acceptance F-Factor w.r.t. area idx mean
     71  Float_t fPheErrLowerLimit;                   // Lower limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
     72  Float_t fPheErrUpperLimit;                   // Upper limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
     73  Float_t fFFactorErrLimit;                    // Limit acceptance F-Factor w.r.t. area idx mean
    7274  Float_t fArrTimeRmsLimit;                    // Limit acceptance RMS of absolute arrival times
    7375  Float_t fSqrtHiGainSamples;                  // Square root nr. High-Gain FADC slices used by extractor
     
    218220  void SetOutputPath        ( TString path="."                   );
    219221  void SetOutputFile        ( TString file="ChargeCalibStat.txt" );
    220   void SetPheErrLimit       ( const Float_t f=fgPheErrLimit            ) { fPheErrLimit       = f;     } 
     222  void SetPheErrLowerLimit  ( const Float_t f=fgPheErrLowerLimit       ) { fPheErrLowerLimit  = f;     }
     223  void SetPheErrUpperLimit  ( const Float_t f=fgPheErrUpperLimit       ) { fPheErrUpperLimit  = f;     }
    221224  void SetPulserColor       ( const MCalibrationCam::PulserColor_t col ) { fPulserColor       = col;   }
    222225
    223   ClassDef(MCalibrationChargeCalc, 1)   // Task calculating Calibration Containers and Quantum Efficiencies
     226  ClassDef(MCalibrationChargeCalc, 2)   // Task calculating Calibration Containers and Quantum Efficiencies
    224227};
    225228
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc

    r7013 r7028  
    523523      break;
    524524    case 9:
    525       if (!pix.IsFFactorMethodValid())
     525      //      if (!pix.IsFFactorMethodValid())
     526      //        return kFALSE;
     527      if (pix.IsExcluded())
    526528        return kFALSE;
    527529      val = pix.GetPheFFactorMethod();
    528530      break;
    529531    case 10:
    530       if (!pix.IsFFactorMethodValid())
     532      //      if (!pix.IsFFactorMethodValid())
     533      //        return kFALSE;
     534      if (pix.IsExcluded())
    531535        return kFALSE;
    532536      val = pix.GetPheFFactorMethodErr();
     537      if (val < 0.)
     538        val = 0.00001;
    533539      break;
    534540    case 11:
    535       if (!pix.IsFFactorMethodValid())
     541      //      if (!pix.IsFFactorMethodValid())
     542      //        return kFALSE;
     543      if (pix.IsExcluded())
    536544        return kFALSE;
    537545      val = pix.GetMeanConvFADC2Phe();
    538546      break;
    539547    case 12:
    540       if (!pix.IsFFactorMethodValid())
     548      //      if (!pix.IsFFactorMethodValid())
     549      //        return kFALSE;
     550      if (pix.IsExcluded())
    541551        return kFALSE;
    542552      val = pix.GetMeanConvFADC2PheErr();
     553      if (val < 0.)
     554        val = 0.00001;
    543555      break;
    544556    case 13:
    545       if (!pix.IsFFactorMethodValid())
     557      //      if (!pix.IsFFactorMethodValid())
     558      //        return kFALSE;
     559      if (pix.IsExcluded())
    546560        return kFALSE;
    547561      val = pix.GetMeanFFactorFADC2Phot();
    548562      break;
    549563    case 14:
    550       if (!pix.IsFFactorMethodValid())
     564      //      if (!pix.IsFFactorMethodValid())
     565      //        return kFALSE;
     566      if (pix.IsExcluded())
    551567        return kFALSE;
    552568      val = pix.GetMeanFFactorFADC2PhotErr();
     569      if (val < 0.)
     570        val = 0.00001;
    553571      break;
    554572    case 15:
Note: See TracChangeset for help on using the changeset viewer.