Ignore:
Timestamp:
05/11/05 19:06:48 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r6928 r7013  
    231231using namespace std;
    232232
    233 const Float_t MCalibrationChargeCalc::fgChargeLimit            = 2.5;
     233const Float_t MCalibrationChargeCalc::fgChargeLimit            = 4.5;
    234234const Float_t MCalibrationChargeCalc::fgChargeErrLimit         = 0.;
    235235const Float_t MCalibrationChargeCalc::fgChargeRelErrLimit      = 1.;
     
    238238const Float_t MCalibrationChargeCalc::fgPheErrLimit            = 4.5;
    239239const Float_t MCalibrationChargeCalc::fgFFactorErrLimit        = 4.5;
     240const Float_t MCalibrationChargeCalc::fgArrTimeRmsLimit        = 3.5;
    240241const TString MCalibrationChargeCalc::fgNamePedestalCam = "MPedestalCam";
     242
    241243// --------------------------------------------------------------------------
    242244//
     
    252254//
    253255// Initializes:
     256// - fArrTimeRmsLimit   to fgArrTimeRmsLimit
    254257// - fChargeLimit       to fgChargeLimit
    255258// - fChargeErrLimit    to fgChargeErrLimit   
     
    282285  AddToBranchList("MRawEvtData.fLoGainFadcSamples");
    283286 
     287  SetArrTimeRmsLimit   ();
    284288  SetChargeLimit       ();
    285289  SetChargeErrLimit    (); 
     
    294298  SetDebug       ( kFALSE );
    295299
     300  SetCheckArrivalTimes     ();
    296301  SetCheckDeadPixels       ();
    297302  SetCheckDeviatingBehavior();
     
    732737      if (FinalizeCharges(pix,bad,"pixel  "))
    733738        nvalid++;
     739
     740      FinalizeArrivalTimes(pix,bad,"pixel  ");
    734741    }
    735742
     
    760767      FinalizePedestals(ped,pix,aidx);
    761768      FinalizeCharges(pix, chargecam->GetAverageBadArea(aidx),"area id");
     769      FinalizeArrivalTimes(pix, chargecam->GetAverageBadArea(aidx), "area id");
    762770    }
    763771 
     
    855863  PrintUncalibrated(MBadPixelsPix::kLoGainOverFlow,   
    856864                    "Pixels with Low Gain Overflow :                   ");
     865  PrintUncalibrated(MBadPixelsPix::kFluctuatingArrivalTimes,
     866                    "Fluctuating Pulse Arrival Times:                  ");
     867  PrintUncalibrated(MBadPixelsPix::kDeadPedestalRms,
     868                    "Presumably dead from Pedestal Rms:                ");
     869  PrintUncalibrated(MBadPixelsPix::kPreviouslyExcluded,
     870                    "Previously excluded:                              ");
    857871
    858872  *fLog << inf << endl;
     
    10181032}
    10191033
    1020 
     1034// -----------------------------------------------------------------------------------
     1035//
     1036// Test the arrival Times RMS of the pixel and set the bit
     1037// - MBadPixelsPix::kFluctuatingArrivalTimes
     1038//
     1039void MCalibrationChargeCalc::FinalizeArrivalTimes(MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what)
     1040{
     1041    if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun))
     1042        return;
     1043
     1044    if (cal.GetAbsTimeRms() > fArrTimeRmsLimit)
     1045    {
     1046        *fLog << warn;
     1047        *fLog << "RMS of pulse arrival times: " << Form("%2.1f", cal.GetAbsTimeRms());
     1048        *fLog << " FADC sl. < " << Form("%2.1", fArrTimeRmsLimit);
     1049        *fLog << "   in " << what << Form("%3i", cal.GetPixId()) << endl;
     1050        bad.SetUncalibrated( MBadPixelsPix::kFluctuatingArrivalTimes);
     1051    }
     1052}
    10211053
    10221054// -----------------------------------------------------------------------------------
     
    10391071{
    10401072 
    1041   MBadPixelsCam         *badcam    = fIntensBad
    1042     ? (MBadPixelsCam*)        fIntensBad->GetCam()  : fBadPixels;
    1043   MCalibrationChargeCam *chargecam = fIntensCam
    1044     ? (MCalibrationChargeCam*)fIntensCam->GetCam()  : fCam;
     1073  MBadPixelsCam *badcam = fIntensBad ? (MBadPixelsCam*)fIntensBad->GetCam() : fBadPixels;
    10451074
    10461075  for (Int_t i=0; i<badcam->GetSize(); i++)
    10471076    {
    10481077     
    1049       MBadPixelsPix    &bad    = (*badcam)   [i];
    1050       MCalibrationPix  &pix    = (*chargecam)[i];
     1078      MBadPixelsPix &bad = (*badcam)[i];
    10511079
    10521080      if (IsCheckDeadPixels())
     
    10861114        }
    10871115     
    1088       if (bad.IsUnsuitable(   MBadPixelsPix::kUnsuitableRun    ))
    1089         pix.SetExcluded();
     1116      if (IsCheckArrivalTimes())
     1117        {
     1118          if (bad.IsUncalibrated( MBadPixelsPix::kFluctuatingArrivalTimes ))
     1119            bad.SetUnsuitable(   MBadPixelsPix::kUnsuitableRun    );
     1120        }
    10901121
    10911122      if (bad.IsUncalibrated( MBadPixelsPix::kChargeSigmaNotValid ))
     
    18121843          qepix.SetFFactorMethodValid(kFALSE,fPulserColor);
    18131844          pix.SetFFactorMethodValid(kFALSE);
    1814           pix.SetExcluded();
    18151845          continue;
    18161846        }
     
    22002230      rc = kTRUE;
    22012231    }
     2232  if (IsEnvDefined(env, prefix, "ArrTimeRmsLimit", print))
     2233    {
     2234      SetArrTimeRmsLimit(GetEnvValue(env, prefix, "ArrTimeRmsLimit", fArrTimeRmsLimit));
     2235      rc = kTRUE;
     2236    }
    22022237  if (IsEnvDefined(env, prefix, "FFactorErrLimit", print))
    22032238    {
     
    22452280      rc = kTRUE;
    22462281    }
    2247  
     2282  if (IsEnvDefined(env, prefix, "CheckArrivalTimes", print))
     2283    {
     2284      SetCheckArrivalTimes(GetEnvValue(env, prefix, "CheckArrivalTimes", IsCheckArrivalTimes()));
     2285      rc = kTRUE;
     2286    }
     2287
    22482288  return rc;
    22492289}
Note: See TracChangeset for help on using the changeset viewer.