Ignore:
Timestamp:
12/18/03 18:03:21 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MCalibrationCam.cc

    r2715 r2719  
    206206}
    207207
    208 // --------------------------------------------------------------------------
    209 //
    210 // Return TRUE if:
    211 //
    212 // 1) Pixel is inside the range of the TClonesArray
    213 // 2) Pixel has a fitted charge greater than 3*PedRMS
    214 // 3) Pixel has a charge sigma bigger than its Pedestal RMS
    215 // 4) Pixel has a fit error greater than 0.
    216 // 5) Pixel has a fit Probability greater than 0.0001
    217 // 6) If FitTimes is used,
    218 //    the mean arrival time is at least 1.5 slices from the edge
    219 //
    220 Bool_t MCalibrationCam::IsPixelFitValid(Int_t idx) const
    221 {
    222 
    223   if (!CheckBounds(idx))
    224     return kFALSE;
    225 
    226   return (*this)[idx].IsFitValid();
    227 }
    228208
    229209// --------------------------------------
     
    397377}
    398378
     379
     380
    399381Bool_t MCalibrationCam::CalcNumPhotInsidePlexiglass()
    400382{
     
    442424    {
    443425      if((pix->GetCharge() > 0.) && (fMeanPhotInsidePlexiglass > 0.))
    444         pix->SetConversionBlindPixelMethod(fMeanPhotInsidePlexiglass/pix->GetCharge(), 0., 0.);
     426        {
     427
     428          Float_t conversion      = fMeanPhotInsidePlexiglass/pix->GetCharge();
     429          Float_t conversionerr   = 0.;
     430          Float_t conversionsigma = 0.;
     431          pix->SetConversionBlindPixelMethod(conversion, conversionerr, conversionsigma);
     432
     433          if (conversionerr/conversion < 0.1)
     434            pix->SetBlindPixelMethodValid();
     435        }
    445436    }
    446437  return kTRUE;
  • trunk/MagicSoft/Mars/manalysis/MCalibrationPix.cc

    r2716 r2719  
    7272      fConversionSigmaBlindPixelMethod(-1.),
    7373      fConversionSigmaPINDiodeMethod(-1.),
    74       fHiGainSaturation(kFALSE)
     74      fHiGainSaturation(kFALSE),
     75      fFitValid(kFALSE),       
     76      fFitted(kFALSE),
     77      fBlindPixelMethodValid(kFALSE),
     78      fFFactorMethodValid(kFALSE),
     79      fPINDiodeMethodValid(kFALSE)
    7580{
    7681
     
    106111}
    107112
    108 
    109 Bool_t MCalibrationPix::IsFitted()
    110 {
    111   return (fCharge > 0.) && (fErrCharge > 0.) ;
    112 }
    113 
    114 // --------------------------------------------------------------------------
    115 //
    116 // Return TRUE if:
    117 //
    118 // 1) Pixel has a fitted charge greater than 3*PedRMS
    119 // 2) Pixel has a fit error greater than 0.
    120 // 3) Pixel has a fit Probability greater than 0.0001
    121 // 4) Pixel has a charge sigma bigger than its Pedestal RMS
    122 // 5) If FitTimes is used,
    123 //    the mean arrival time is at least 1.5 slices from the edge
    124 //
    125 Bool_t MCalibrationPix::IsFitValid()
    126 {
    127    
    128   if (fCharge < 3.*GetPedRms())
    129     return kFALSE;
    130  
    131   if (fErrCharge <= 0.)
    132     return kFALSE;
    133  
    134   if (!fHist->IsFitOK())
    135     return kFALSE;
    136  
    137   if (fSigmaCharge <= fPedRms)
    138     return kFALSE;
    139 
    140   if (fHist->GetTimeLowerFitRange() < fTime < fHist->GetTimeLowerFitRange()+1.)
    141     return kFALSE;
    142 
    143   if (fHist->GetTimeUpperFitRange()-1. < fTime < fHist->GetTimeUpperFitRange())
    144     return kFALSE;
    145 
    146   return kTRUE;
    147  
    148 }
    149 
    150 // --------------------------------------------------------------------------
    151 //
    152 // Return TRUE if:
    153 //
    154 // 1) Pixel is FitValid
    155 // 2) Conversion Factor is bigger than 0.
    156 // 3) The error of the conversion factor is smaller than 10%
    157 //
    158 Bool_t MCalibrationPix::IsBlindPixelMethodValid()
    159 {
    160  
    161   if (!IsFitValid())
    162     return kFALSE;
    163 
    164   if (fConversionBlindPixelMethod <= 0.)
    165     return kFALSE;
    166  
    167   if (fConversionErrorBlindPixelMethod/fConversionBlindPixelMethod > 0.1)
    168     return kFALSE;
    169  
    170   return kTRUE;
    171 }
    172 
    173 // --------------------------------------------------------------------------
    174 //
    175 // Return TRUE if:
    176 //
    177 // 1) Pixel is FitValid
    178 // 2) Conversion Factor is bigger than 0.
    179 // 3) The error of the conversion factor is smaller than 10%
    180 //
    181 Bool_t MCalibrationPix::IsFFactorMethodValid()
    182 {
    183  
    184   if (!IsFitValid())
    185     return kFALSE;
    186 
    187   if (fConversionFFactorMethod <= 0.)
    188     return kFALSE;
    189  
    190   if (fConversionErrorFFactorMethod/fConversionFFactorMethod > 0.1)
    191     return kFALSE;
    192 
    193   return kTRUE;
    194 }
    195 
    196 // --------------------------------------------------------------------------
    197 //
    198 // Return TRUE if:
    199 //
    200 // 1) Pixel is FitValid
    201 // 2) Conversion Factor is bigger than 0.
    202 // 3) The error of the conversion factor is smaller than 10%
    203 //
    204 Bool_t MCalibrationPix::IsPINDiodeMethodValid()
    205 {
    206  
    207   if (!IsFitValid())
    208     return kFALSE;
    209 
    210   if (fConversionPINDiodeMethod <= 0.)
    211     return kFALSE;
    212  
    213   if (fConversionErrorPINDiodeMethod/fConversionPINDiodeMethod > 0.1)
    214     return kFALSE;
    215 
    216   return kTRUE;
    217 }
    218113
    219114// --------------------------------------------------------------------------
     
    229124// 8) Calculate the errors of the F-Factor method
    230125//
     126// The fit is declared as valid, if:
     127//
     128// 1) Pixel has a fitted charge greater than 3*PedRMS
     129// 2) Pixel has a fit error greater than 0.
     130// 3) Pixel has a fit Probability greater than 0.0001
     131// 4) Pixel has a charge sigma bigger than its Pedestal RMS
     132// 5) If FitTimes is used,
     133//    the mean arrival time is at least 1.5 slices from the edge
     134//
     135// The F-Factor method is declared as valid, if:
     136//
     137// 1) Pixel is FitValid
     138// 2) Conversion Factor is bigger than 0.
     139// 3) The error of the conversion factor is smaller than 10%
     140//
    231141Bool_t MCalibrationPix::FitCharge()
    232142{
     
    273183      return kFALSE;
    274184    }
    275  
     185
     186  if (fErrCharge > 0.)
     187    fFitted = kTRUE;
     188
     189  if ( (fCharge > 3.*GetPedRms()) &&
     190       (fErrCharge  > 0.)        &&
     191       (fHist->IsFitOK())        &&
     192       (fSigmaCharge > fPedRms)  &&
     193       (fTime > fHist->GetTimeLowerFitRange()+1.) &&
     194       (fTime < fHist->GetTimeUpperFitRange()-1.) )
     195    fFitValid =  kTRUE;
    276196
    277197  //
     
    326246          Float_t logainrmssquare          = nsbsquare/conversionsquare + elecrmssquare;
    327247          Float_t logainrmssquareerrsquare = nsbsquareerrsquare/conversionsquare/conversionsquare
    328                                            + elecrmssquareerr * elecrmssquareerr ;
     248                                           + elecrmssquareerr * elecrmssquareerr
     249                                           + conversionsquareerr*conversionsquareerr
     250                                             / (conversionsquare*conversionsquare)
     251                                             / (conversionsquare*conversionsquare);
    329252          //
    330253          // Calculate the reduced sigma with the new "Pedestal RMS"
     
    377300      fPheFFactorMethodError        =  TMath::Sqrt(pheffactorrelerrsquare) * fPheFFactorMethod;
    378301
     302      if ( IsFitValid()                    &&
     303          (fConversionFFactorMethod > 0.) &&
     304           (fConversionErrorFFactorMethod/fConversionFFactorMethod < 0.1) )
     305        fFFactorMethodValid = kTRUE;
     306     
     307
    379308    } /*   if ((fPed > 0.)  && (fPedRms > 0.)) */
    380309
  • trunk/MagicSoft/Mars/manalysis/MCalibrationPix.h

    r2716 r2719  
    4848  Float_t fConversionSigmaPINDiodeMethod;   // The conversion factor to Phd's calculated after the PIN Diode method
    4949
    50   Bool_t fHiGainSaturation;     // Is Lo-Gain used at all?
     50  Bool_t  fHiGainSaturation;     // Is Lo-Gain used at all?
    5151
     52  Bool_t  fFitValid;       
     53  Bool_t  fFitted;
     54  Bool_t  fBlindPixelMethodValid;
     55  Bool_t  fFFactorMethodValid;
     56  Bool_t  fPINDiodeMethodValid;
     57 
    5258  MHCalibrationPixel *fHist;    //! Pointer to the histograms performing the fits, etc. 
    5359 
     
    122128  Bool_t FillRChargevsTimeLoGain(Float_t rq, Int_t t)  { return fHist->FillChargevsNLoGain(rq,t); }   
    123129 
    124   Bool_t IsFitValid();       
    125   Bool_t IsFitted();
    126   Bool_t IsBlindPixelMethodValid();
    127   Bool_t IsFFactorMethodValid();
    128   Bool_t IsPINDiodeMethodValid();
     130  Bool_t IsFitValid()                                  { return fFitValid;  }
     131  Bool_t IsFitted()                                    { return fFitted;  }
     132  Bool_t IsBlindPixelMethodValid()                     { return fBlindPixelMethodValid;  }
     133  Bool_t IsFFactorMethodValid()                        { return fFFactorMethodValid;  }
     134  Bool_t IsPINDiodeMethodValid()                       { return fPINDiodeMethodValid;  }
     135 
     136  void   SetFitValid()                                     { fFitValid = kTRUE;  }
     137  void   SetFitted()                                      { fFitted = kTRUE;  }
     138  void   SetBlindPixelMethodValid()                             { fBlindPixelMethodValid = kTRUE;  }
     139  void   SetFFactorMethodValid()                               { fFFactorMethodValid = kTRUE;  }
     140  void   SetPINDiodeMethodValid()                              { fPINDiodeMethodValid = kTRUE;  }
    129141 
    130142  Int_t  GetPixId()                              const  { return fPixId;   }
Note: See TracChangeset for help on using the changeset viewer.