Ignore:
Timestamp:
03/07/04 17:12:28 (21 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

    r3422 r3427  
    154154  SetHiGainFitted           ( kFALSE );
    155155  SetLoGainFitted           ( kFALSE );
    156   SetHiGainOscillating      ( kFALSE );
    157   SetLoGainOscillating      ( kFALSE );
    158156  SetExcluded               ( kFALSE );
    159   SetChargeValid            ( kFALSE );
    160157  SetBlindPixelMethodValid  ( kFALSE );
    161158  SetFFactorMethodValid     ( kFALSE );
    162159  SetPINDiodeMethodValid    ( kFALSE );
    163160  SetCombinedMethodValid    ( kFALSE );
    164 
    165   SetMeanTimeInFirstBin     ( kFALSE );
    166   SetMeanTimeInLastBin      ( kFALSE );
    167161
    168162  fHiGainMeanCharge                 =  -1.;
     
    357351// --------------------------------------------------------------------------
    358352//
    359 // Set the Excluded Bit from outside
    360 //
    361 void MCalibrationChargePix::SetChargeValid(Bool_t b )   
    362 {
    363   b ?  SETBIT(fFlags, kChargeValid) : CLRBIT(fFlags, kChargeValid);
    364 }
    365 
    366 // --------------------------------------------------------------------------
    367 //
    368353// Set the Fitted Bit from outside
    369354//
     
    380365{
    381366  b ?  SETBIT(fFlags, kLoGainFitted) : CLRBIT(fFlags, kLoGainFitted);
    382 }
    383    
    384 // --------------------------------------------------------------------------
    385 //
    386 // Set the Ocillating Bit from outside
    387 //
    388 void MCalibrationChargePix::SetHiGainOscillating(const Bool_t b )
    389 {
    390   b ?  SETBIT(fFlags, kHiGainOscillating) : CLRBIT(fFlags, kHiGainOscillating);
    391 }
    392    
    393 // --------------------------------------------------------------------------
    394 //
    395 // Set the Ocillating Bit from outside
    396 //
    397 void MCalibrationChargePix::SetLoGainOscillating(const Bool_t b )
    398 {
    399   b ?  SETBIT(fFlags, kLoGainOscillating) : CLRBIT(fFlags, kLoGainOscillating);
    400367}
    401368   
     
    452419}
    453420
    454 void MCalibrationChargePix::SetMeanTimeInFirstBin(const Bool_t b)
    455 {
    456   b ? SETBIT(fFlags,kMeanTimeInFirstBin) : CLRBIT(fFlags,kMeanTimeInFirstBin);
    457 }
    458 
    459 void MCalibrationChargePix::SetMeanTimeInLastBin(const Bool_t b)
    460 {
    461   b ? SETBIT(fFlags,kMeanTimeInLastBin) : CLRBIT(fFlags,kMeanTimeInLastBin);
    462 }
    463 
    464421Float_t  MCalibrationChargePix::GetMeanCharge()   const
    465422{
     
    492449}
    493450
    494 Bool_t  MCalibrationChargePix::IsOscillating()  const
    495 {
    496   return  IsHiGainSaturation() ? IsLoGainOscillating() :  IsHiGainOscillating();
    497 }
    498 
    499 Bool_t MCalibrationChargePix::IsMeanTimeInFirstBin() const
    500 {
    501   return TESTBIT(fFlags,kMeanTimeInFirstBin);
    502 }
    503 
    504 Bool_t MCalibrationChargePix::IsMeanTimeInLastBin() const
    505 {
    506   return TESTBIT(fFlags,kMeanTimeInLastBin);
    507 }
    508 
    509 
    510451
    511452Bool_t MCalibrationChargePix::IsExcluded()     const
     
    524465}
    525466
    526 Bool_t MCalibrationChargePix::IsChargeValid()         const
    527 {
    528   return TESTBIT(fFlags, kChargeValid); 
    529 }
    530 
    531467Bool_t MCalibrationChargePix::IsHiGainFitted()        const
    532468{
     
    537473{
    538474  return TESTBIT(fFlags, kLoGainFitted);   
    539 }
    540 
    541 Bool_t MCalibrationChargePix::IsHiGainOscillating()    const
    542 {
    543   return TESTBIT(fFlags, kHiGainOscillating);
    544 }
    545 
    546 Bool_t MCalibrationChargePix::IsLoGainOscillating()    const
    547 {
    548   return TESTBIT(fFlags, kLoGainOscillating);
    549475}
    550476
     
    578504// 4) Pixel has a charge sigma bigger than its Pedestal RMS
    579505//
    580 void MCalibrationChargePix::CheckChargeValidity(MBadPixelsPix *bad)
     506Bool_t MCalibrationChargePix::CheckChargeValidity(MBadPixelsPix *bad)
    581507{
    582508 
     
    588514      *fLog << warn << "WARNING: Fitted Charge is smaller than "
    589515            << fChargeLimit << " Pedestal RMS in Pixel  " << fPixId << endl;
    590       bad->SetCalcChargePedestal();
     516      if (bad)
     517        bad->SetCalcChargePedestal();
     518      else
     519        return kFALSE;
    591520    }
    592521  else
    593     bad->SetNoCalcChargePedestal();
     522    if (bad)
     523      bad->SetNoCalcChargePedestal();
    594524     
    595525 
     
    598528      *fLog << warn << "WARNING: Error of Fitted Charge is smaller than "
    599529            << fChargeErrLimit << " in Pixel  " << fPixId << endl;
    600       bad->SetNoCalcChargeErrValid();
     530      if (bad)
     531        bad->SetNoCalcChargeErrValid();
     532      else
     533        return kFALSE;
    601534    }
    602535  else
    603     bad->SetCalcChargeErrValid();
     536      if (bad)
     537        bad->SetCalcChargeErrValid();
    604538     
    605539   if (GetMeanCharge() < fChargeRelErrLimit*GetMeanChargeErr())
     
    607541      *fLog << warn << "WARNING: Fitted Charge is smaller than "
    608542            << fChargeRelErrLimit << "* its error in Pixel  " << fPixId << endl;
    609       bad->SetNoCalcChargeRelErrValid();
     543      if (bad)
     544        bad->SetNoCalcChargeRelErrValid();
     545      else
     546        return kFALSE;
    610547    }
    611548   else
    612       bad->SetCalcChargeRelErrValid();     
     549      if (bad)
     550        bad->SetCalcChargeRelErrValid();     
    613551
    614552  if (GetSigmaCharge() < GetPedRms())
    615553    {
    616         *fLog << warn << "WARNING: Sigma of Fitted Charge smaller than Pedestal RMS in Pixel  " << fPixId << endl;
    617         bad->SetNoCalcChargeSigmaValid();
     554        *fLog << warn << "WARNING: Sigma of Fitted Charge smaller than Pedestal RMS in Pixel  "
     555              << fPixId << endl;
     556        if (bad)
     557          bad->SetNoCalcChargeSigmaValid();
     558        else
     559          return kFALSE;
    618560    }
    619561  else
    620     bad->SetCalcChargeSigmaValid();
    621  
     562    if (bad)
     563        bad->SetCalcChargeSigmaValid();
     564
     565  return kTRUE;
    622566}
    623567
     
    627571// The mean arrival time is at least 1.0 slices from the used edge slices
    628572//
    629 void MCalibrationChargePix::CheckTimeValidity(MBadPixelsPix *bad)
    630 {
    631 
    632     const Float_t loweredge     = IsHiGainSaturation() ? fTimeFirstHiGain   : fTimeFirstLoGain;
    633     const Float_t upperedge     = IsHiGainSaturation() ? fTimeLastHiGain    : fTimeLastLoGain;
    634 
    635     if ( fAbsTimeMean < loweredge+1.)
     573Bool_t MCalibrationChargePix::CheckTimeValidity(MBadPixelsPix *bad)
     574{
     575 
     576  const Float_t loweredge     = IsHiGainSaturation() ? fTimeFirstHiGain   : fTimeFirstLoGain;
     577  const Float_t upperedge     = IsHiGainSaturation() ? fTimeLastHiGain    : fTimeLastLoGain;
     578 
     579  if ( fAbsTimeMean < loweredge+1.)
    636580    {
    637         *fLog << warn << "WARNING: Mean ArrivalTime in first extraction bin of the Pixel " << fPixId << endl;
     581      *fLog << warn << "WARNING: Mean ArrivalTime in first extraction bin of the Pixel " << fPixId << endl;
     582      if (bad)
    638583        bad->SetMeanTimeInFirstBin();
     584      else
     585        return kFALSE;
    639586    }
    640     else
    641       bad->SetNoMeanTimeInFirstBin();
    642    
    643     if ( fAbsTimeMean > upperedge-1.)
     587  else
     588    bad->SetNoMeanTimeInFirstBin();
     589 
     590  if ( fAbsTimeMean > upperedge-1.)
    644591    {
    645         *fLog << warn << "WARNING: Mean ArrivalTime in last extraction bin of the Pixel " << fPixId << endl;
     592      *fLog << warn << "WARNING: Mean ArrivalTime in last extraction bin of the Pixel " << fPixId << endl;
     593      if (bad)
    646594        bad->SetMeanTimeInLastBin();
     595      else
     596        return kFALSE;
    647597    }
    648     else
    649       bad->SetNoMeanTimeInLastBin();
    650 
     598  else
     599    bad->SetNoMeanTimeInLastBin();
     600 
     601  return kTRUE;
    651602}
    652603
     
    743694{
    744695
    745   if (!IsChargeValid())
    746       return kFALSE;
    747 
    748696  if (fRSigmaCharge < 0.)
    749697      return kFALSE;
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.h

    r3362 r3427  
    1515class MRawEvtData;
    1616class MGeomCam;
     17class MBadPixelsCam;
    1718class MCalibrationChargeCam;
    1819class MCalibrationChargePix;
     
    3940  MRawEvtData            *fRawEvt;                   //!  Raw event data (time slices)
    4041  MGeomCam               *fGeom;                     //!  MAGIC geometry
     42  MBadPixelsCam          *fBadPixels;                //!  Bad Pixels
    4143
    4244  Int_t fNumInnerPixels;
    4345  Int_t fNumOuterPixels;
     46  Int_t fNumExcluded;
    4447
    4548  void FinalizeHiGainHists(MHCalibrationChargeHiGainPix &hist, MCalibrationChargePix &pix);
Note: See TracChangeset for help on using the changeset viewer.