Changeset 3242


Ignore:
Timestamp:
02/19/04 21:33:45 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3240 r3242  
    44
    55                                                 -*-*- END OF LINE -*-*-
     6 2004/01/19: Markus Gaug
     7   * mcalib/MCalibrationPix.[h,cc]
     8   * mcalib/MCalibrationCam.cc
     9   * mcalib/MCalibrate.cc
     10   * mcalib/MCalibrateDate.cc
     11   * manalysis/MMcCalibrationUpdate.cc
     12     - standardized naming of variables containing "Error", this also affected
     13       the calling functions MCalibrate, MMcCalibrationUpdate and MCalibrateData
     14
     15
    616 2004/01/19: Abelardo Moralejo
    717
  • trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc

    r3065 r3242  
    225225
    226226        calpix.SetConversionHiLo(fConversionHiLo);
    227         calpix.SetConversionHiLoError(0.);         // FIXME ?
     227        calpix.SetConversionHiLoErr(0.);         // FIXME ?
    228228
    229229        //
  • trunk/MagicSoft/Mars/mcalib/MCalibrate.cc

    r3183 r3242  
    185185  UInt_t npix = fSignals->GetSize();
    186186
    187   Float_t hiloconv   = 1.;
    188   Float_t hiloconverr= 0.;
    189   Float_t calibrationConversionFactor = 1.;
    190   Float_t calibrationConversionFactorError = 0.;
     187  Float_t hiloconv      = 1.;
     188  Float_t hiloconverr   = 0.;
     189  Float_t calibrationConversionFactor    = 1.;
     190  Float_t calibrationConversionFactorErr = 0.;
    191191 
    192192  for (UInt_t pixidx=0; pixidx<npix; pixidx++)
     
    200200         
    201201          hiloconv   = pix.GetConversionHiLo();
    202           hiloconverr= pix.GetConversionHiLoError();
     202          hiloconverr= pix.GetConversionHiLoErr();
    203203         
    204204          switch(fCalibrationMode)
     
    206206            case kBlindPixel:
    207207              calibrationConversionFactor      = pix.GetMeanConversionBlindPixelMethod();
    208               calibrationConversionFactorError = pix.GetErrorConversionBlindPixelMethod();
     208              calibrationConversionFactorErr   = pix.GetConversionBlindPixelMethodErr();
    209209              break;
    210210            case kPinDiode:
    211211              calibrationConversionFactor      = pix.GetMeanConversionPINDiodeMethod();
    212               calibrationConversionFactorError = pix.GetErrorConversionPINDiodeMethod();
     212              calibrationConversionFactorErr   = pix.GetConversionPINDiodeMethodErr();
    213213              break;
    214214            case kFfactor:
    215215              calibrationConversionFactor      = pix.GetMeanConversionFFactorMethod();
    216               calibrationConversionFactorError = pix.GetErrorConversionFFactorMethod();
     216              calibrationConversionFactorErr   = pix.GetConversionFFactorMethodErr();
    217217              break;
    218218            case kCombined:
    219219              calibrationConversionFactor      = pix.GetMeanConversionCombinedMethod();
    220               calibrationConversionFactorError = pix.GetErrorConversionCombinedMethod();
     220              calibrationConversionFactorErr   = pix.GetConversionCombinedMethodErr();
    221221              break;
    222222            case kDummy:
    223223              calibrationConversionFactor      = 1.;
    224               calibrationConversionFactorError = 0.;
     224              calibrationConversionFactorErr  = 0.;
    225225              break;
    226226            }
     
    250250     
    251251      nphot    = signal*calibrationConversionFactor;
    252       nphotErr = signal*calibrationConversionFactorError
    253         *signal*calibrationConversionFactorError
    254         +signalErr*calibrationConversionFactor
    255         *signalErr*calibrationConversionFactor;
     252      nphotErr = signal*calibrationConversionFactorErr
     253                *signal*calibrationConversionFactorErr
     254               + signalErr*calibrationConversionFactor
     255                *signalErr*calibrationConversionFactor;
    256256     
    257257      nphotErr  = TMath::Sqrt(nphotErr);
  • trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc

    r3183 r3242  
    193193    Float_t hiloconverr;
    194194    Float_t calibrationConversionFactor;
    195     Float_t calibrationConversionFactorError;
     195    Float_t calibrationConversionFactorErr;
    196196
    197197    if ( !GetConversionFactor(pixid, hiloconv, hiloconverr,
    198           calibrationConversionFactor, calibrationConversionFactorError) )
     198                              calibrationConversionFactor, calibrationConversionFactorErr ))
    199199      continue;
    200200
     
    226226Bool_t MCalibrateData::GetConversionFactor(UInt_t pixidx,
    227227 Float_t &hiloconv, Float_t &hiloconverr,
    228  Float_t &calibrationConversionFactor, Float_t &calibrationConversionFactorError)
     228 Float_t &calibrationConversionFactor, Float_t &calibrationConversionFactorErr)
    229229{
    230230  hiloconv    = 1.;
    231231  hiloconverr = 0.;
    232232  calibrationConversionFactor      = 1.;
    233   calibrationConversionFactorError = 0.;
     233  calibrationConversionFactorErr  = 0.;
    234234
    235235  if(fCalibrationMode!=kNone)
     
    241241         
    242242    hiloconv   = pix.GetConversionHiLo();
    243     hiloconverr= pix.GetConversionHiLoError();
     243    hiloconverr= pix.GetConversionHiLoErr();
    244244         
    245245    switch(fCalibrationMode)
     
    247247      case kBlindPixel:
    248248      calibrationConversionFactor      = pix.GetMeanConversionBlindPixelMethod();
    249       calibrationConversionFactorError = pix.GetErrorConversionBlindPixelMethod();
     249      calibrationConversionFactorErr   = pix.GetConversionBlindPixelMethodErr();
    250250      break;
    251251      case kFfactor:
    252252      calibrationConversionFactor      = pix.GetMeanConversionFFactorMethod();
    253       calibrationConversionFactorError = pix.GetErrorConversionFFactorMethod();
     253      calibrationConversionFactorErr   = pix.GetConversionFFactorMethodErr();
    254254      break;
    255255      default:
     
    286286  Float_t hiloconverr;
    287287  Float_t calibrationConversionFactor;
    288   Float_t calibrationConversionFactorError;
     288  Float_t calibrationConversionFactorErr;
    289289 
    290290  for (UInt_t pixidx=0; pixidx<npix; pixidx++)
    291291    {
    292292      if ( !GetConversionFactor(pixidx, hiloconv, hiloconverr,
    293             calibrationConversionFactor, calibrationConversionFactorError) )
     293            calibrationConversionFactor, calibrationConversionFactorErr) )
    294294        continue;
    295295     
     
    317317     
    318318      nphot    = signal*calibrationConversionFactor;
    319       nphotErr = signal*calibrationConversionFactorError
    320         *signal*calibrationConversionFactorError
     319      nphotErr = signal*calibrationConversionFactorErr
     320        *signal*calibrationConversionFactorErr
    321321        +signalErr*calibrationConversionFactor
    322322        *signalErr*calibrationConversionFactor;
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc

    r3080 r3242  
    556556      if ((*this)[idx].IsExcluded())
    557557        return kFALSE;
    558       val = (*this)[idx].GetErrCharge();
     558      val = (*this)[idx].GetChargeErr();
    559559      break;
    560560    case 2:
     
    566566      if ((*this)[idx].IsExcluded())
    567567        return kFALSE;
    568       val = (*this)[idx].GetErrSigmaCharge();
     568      val = (*this)[idx].GetSigmaChargeErr();
    569569      break;
    570570    case 4:
     
    581581      if ((*this)[idx].IsExcluded())
    582582        return kFALSE;
    583       val = (*this)[idx].GetErrRSigmaCharge();
     583      val = (*this)[idx].GetRSigmaChargeErr();
    584584      break;
    585585    case 7:
     
    592592        return kFALSE;
    593593      // relative error RsigmaCharge square
    594       val =    (*this)[idx].GetErrRSigmaCharge()* (*this)[idx].GetErrRSigmaCharge()
     594      val =    (*this)[idx].GetRSigmaChargeErr()* (*this)[idx].GetRSigmaChargeErr()
    595595            / ((*this)[idx].GetRSigmaCharge()   * (*this)[idx].GetRSigmaCharge()   );
    596596      // relative error Charge square
    597       val +=   (*this)[idx].GetErrCharge() * (*this)[idx].GetErrCharge()
     597      val +=   (*this)[idx].GetChargeErr() * (*this)[idx].GetChargeErr()
    598598            / ((*this)[idx].GetCharge()    * (*this)[idx].GetCharge()   );
    599599      // calculate relative error out of squares
     
    610610      if ((*this)[idx].IsExcluded())
    611611        return kFALSE;
    612       val = (*this)[idx].GetPheFFactorMethodError();
     612      val = (*this)[idx].GetPheFFactorMethodErr();
    613613      break;
    614614    case 11:
     
    620620      if ((*this)[idx].IsExcluded())
    621621        return kFALSE;
    622       val = (*this)[idx].GetErrorConversionFFactorMethod();
     622      val = (*this)[idx].GetConversionFFactorMethodErr();
    623623      break;
    624624    case 13:
     
    630630      if ((*this)[idx].IsExcluded())
    631631        return kFALSE;
    632       val = (*this)[idx].GetTotalFFactorErrorFFactorMethod();
     632      val = (*this)[idx].GetTotalFFactorErrFFactorMethod();
    633633      break;
    634634    case 15:
     
    650650      if ((*this)[idx].IsExcluded())
    651651        return kFALSE;
    652       val = (*this)[idx].GetErrorConversionBlindPixelMethod();
     652      val = (*this)[idx].GetConversionBlindPixelMethodErr();
    653653      break;
    654654    case 19:
     
    660660      if ((*this)[idx].IsExcluded())
    661661        return kFALSE;
    662       val = (*this)[idx].GetTotalFFactorErrorBlindPixelMethod();
     662      val = (*this)[idx].GetTotalFFactorErrBlindPixelMethod();
    663663      break;
    664664    case 21:
     
    680680      if ((*this)[idx].IsExcluded())
    681681        return kFALSE;
    682       val = (*this)[idx].GetErrorConversionPINDiodeMethod();
     682      val = (*this)[idx].GetConversionPINDiodeMethodErr();
    683683      break;
    684684    case 25:
     
    690690      if ((*this)[idx].IsExcluded())
    691691        return kFALSE;
    692       val = (*this)[idx].GetTotalFFactorErrorBlindPixelMethod();
     692      val = (*this)[idx].GetTotalFFactorErrBlindPixelMethod();
    693693      break;
    694694    case 27:
     
    914914          const Float_t charge    = pix->GetCharge();
    915915          const Float_t area      = (*fGeomCam)[idx].GetA();
    916           const Float_t chargeerr = pix->GetErrCharge();         
     916          const Float_t chargeerr = pix->GetChargeErr();         
    917917
    918918          const Float_t nphot      = fMeanFluxInsidePlexiglass*area;
     
    10251025          const Float_t charge    = pix->GetCharge();
    10261026          const Float_t area      = (*fGeomCam)[idx].GetA();
    1027           const Float_t chargeerr = pix->GetErrCharge();         
     1027          const Float_t chargeerr = pix->GetChargeErr();         
    10281028
    10291029          const Float_t nphot      = fMeanFluxOutsidePlexiglass*area;
     
    10661066
    10671067  mean  = (*this)[ipx].GetMeanConversionBlindPixelMethod();
    1068   err   = (*this)[ipx].GetErrorConversionBlindPixelMethod();
     1068  err   = (*this)[ipx].GetConversionBlindPixelMethodErr();
    10691069  sigma = (*this)[ipx].GetSigmaConversionBlindPixelMethod();
    10701070
     
    10851085
    10861086  mean  = conv;
    1087   err   = (*this)[ipx].GetErrorConversionFFactorMethod();
     1087  err   = (*this)[ipx].GetConversionFFactorMethodErr();
    10881088  sigma = (*this)[ipx].GetSigmaConversionFFactorMethod();
    10891089
     
    11111111
    11121112  mean  = (*this)[ipx].GetMeanConversionPINDiodeMethod();
    1113   err   = (*this)[ipx].GetErrorConversionPINDiodeMethod();
     1113  err   = (*this)[ipx].GetConversionPINDiodeMethodErr();
    11141114  sigma = (*this)[ipx].GetSigmaConversionPINDiodeMethod();
    11151115
  • trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc

    r3206 r3242  
    9696
    9797const Float_t MCalibrationPix::gkElectronicPedRms         = 1.5;
    98 const Float_t MCalibrationPix::gkErrElectronicPedRms      = 0.3;
     98const Float_t MCalibrationPix::gkElectronicPedRmsErr      = 0.3;
    9999const Float_t MCalibrationPix::gkFFactor                  = 1.15;
    100 const Float_t MCalibrationPix::gkFFactorError             = 0.02;
     100const Float_t MCalibrationPix::gkFFactorErr               = 0.02;
    101101const Float_t MCalibrationPix::gkChargeLimit              = 3.;
    102102const Float_t MCalibrationPix::gkChargeErrLimit           = 0.;
     
    104104const Float_t MCalibrationPix::gkTimeLimit                = 1.5;
    105105const Float_t MCalibrationPix::gkTimeErrLimit             = 3.;
    106 const Float_t MCalibrationPix::gkConvFFactorRelErrorLimit = 0.1;
     106const Float_t MCalibrationPix::gkConvFFactorRelErrLimit  = 0.1;
    107107
    108108const Float_t MCalibrationPix::gkAverageQE                = 0.18;     
    109109const Float_t MCalibrationPix::gkAverageQEErr             = 0.02; 
    110110const Float_t MCalibrationPix::gkConversionHiLo           = 10.;
    111 const Float_t MCalibrationPix::gkConversionHiLoError      = 2.5;
     111const Float_t MCalibrationPix::gkConversionHiLoErr        = 2.5;
    112112// --------------------------------------------------------------------------
    113113//
     
    122122  fTitle = title ? title : "Container of the MHCalibrationPixels and the fit results";
    123123
     124  fHist = new MHCalibrationPixel("MHCalibrationPixel","Calibration Histograms Pixel ");
     125
     126  if (!fHist)
     127    *fLog << warn << dbginf << " Could not create MHCalibrationPixel " << endl;
     128
     129  Clear();
     130
    124131  //
    125132  // At the moment, we don't have a database, yet,
    126133  // so we get it from the configuration file
    127134  //
    128   fConversionHiLo      = gkConversionHiLo;
    129   fConversionHiLoError = gkConversionHiLoError; 
    130 
    131   fHist = new MHCalibrationPixel("MHCalibrationPixel","Calibration Histograms Pixel ");
    132 
    133   if (!fHist)
    134     *fLog << warn << dbginf << " Could not create MHCalibrationPixel " << endl;
    135 
    136   Clear();
     135  SetConversionHiLo();
     136  SetConversionHiLoErr();
    137137
    138138  SetAverageQE();
    139 
    140139}
    141140
     
    167166
    168167  fCharge                           =  -1.;
    169   fErrCharge                        =  -1.;
     168  fChargeErr                        =  -1.;
    170169  fSigmaCharge                      =  -1.;
    171   fErrSigmaCharge                   =  -1.;
     170  fSigmaChargeErr                   =  -1.;
    172171  fRSigmaCharge                     =  -1.;
    173   fErrRSigmaCharge                  =  -1.;
     172  fRSigmaChargeErr                  =  -1.;
    174173
    175174  fChargeProb                       =  -1.;
    176175  fPed                              =  -1.;
    177176  fPedRms                           =  -1.;
    178   fErrPedRms                        =   0.;
     177  fPedRmsErr                        =  -1.;
    179178
    180179  fNumHiGainSamples                 =  -1.;
     
    190189
    191190  fPheFFactorMethod                 =  -1.;
    192   fPheFFactorMethodError            =  -1.;
     191  fPheFFactorMethodErr              =  -1.;
    193192
    194193  fMeanConversionFFactorMethod      =  -1.;
     
    197196  fMeanConversionCombinedMethod     =  -1.;
    198197
    199   fErrorConversionFFactorMethod     =  -1.;
    200   fErrorConversionBlindPixelMethod  =  -1.;
    201   fErrorConversionPINDiodeMethod    =  -1.;
    202   fErrorConversionCombinedMethod    =  -1.;
     198  fConversionFFactorMethodErr       =  -1.;
     199  fConversionBlindPixelMethodErr    =  -1.;
     200  fConversionPINDiodeMethodErr      =  -1.;
     201  fConversionCombinedMethodErr      =  -1.;
    203202
    204203  fSigmaConversionFFactorMethod     =  -1.;
     
    207206  fSigmaConversionCombinedMethod    =  -1.;
    208207
    209   fFactorCalculated = kFALSE;
     208  fTotalFFactorFFactorMethod        =  -1.;
     209  fTotalFFactorBlindPixelMethod     =  -1.;
     210  fTotalFFactorPINDiodeMethod       =  -1.;
     211  fTotalFFactorCombinedMethod       =  -1.;
    210212
    211213}
     
    226228//
    227229void MCalibrationPix::SetPedestal(const Float_t ped, const Float_t pedrms,
    228                                   const Float_t higainsamp, const Float_t logainsamp )
     230                                  const Float_t higainsamp, const Float_t logainsamp ) 
    229231{
    230232
     
    243245void MCalibrationPix::SetConversionFFactorMethod(Float_t c, Float_t err, Float_t sig)
    244246{
    245   fMeanConversionFFactorMethod = c;
    246   fErrorConversionFFactorMethod = err;
     247  fMeanConversionFFactorMethod  = c;
     248  fConversionFFactorMethodErr  = err;
    247249  fSigmaConversionFFactorMethod = sig;
    248250}
     
    254256void MCalibrationPix::SetConversionCombinedMethod(Float_t c, Float_t err, Float_t sig)
    255257{
    256   fMeanConversionCombinedMethod = c;
    257   fErrorConversionCombinedMethod = err;
     258  fMeanConversionCombinedMethod  = c;
     259  fConversionCombinedMethodErr  = err;
    258260  fSigmaConversionCombinedMethod = sig;
    259261}
     
    267269{
    268270  fMeanConversionBlindPixelMethod  = c;
    269   fErrorConversionBlindPixelMethod = err;
     271  fConversionBlindPixelMethodErr  = err;
    270272  fSigmaConversionBlindPixelMethod = sig;
    271273}
     
    277279void MCalibrationPix::SetConversionPINDiodeMethod(Float_t c, Float_t err, Float_t sig)
    278280{
    279   fMeanConversionPINDiodeMethod = c ;
    280   fErrorConversionPINDiodeMethod = err;
     281  fMeanConversionPINDiodeMethod  = c ;
     282  fConversionPINDiodeMethodErr  = err;
    281283  fSigmaConversionPINDiodeMethod = sig;
    282284}
     
    390392}
    391393
    392 Float_t MCalibrationPix::GetPheFFactorMethod()
    393 {
    394  
    395   if (!fFactorCalculated)
    396     CalcFFactorMethod();
    397  
    398   return fPheFFactorMethod;
    399  
    400 }
    401 
    402 Float_t MCalibrationPix::GetPheFFactorMethodError()
    403 {
    404  
    405   if (!fFactorCalculated)
    406     CalcFFactorMethod();
    407  
    408   return fPheFFactorMethodError;
    409  
    410 }
    411 
    412 
    413 Float_t MCalibrationPix::GetTotalFFactorFFactorMethod()
    414 {
    415   if (!fFactorCalculated)
    416     CalcFFactorMethod();
    417  
    418   if (fPheFFactorMethod > 0)
    419     return (fRSigmaCharge/fCharge)*TMath::Sqrt(fPheFFactorMethod);
    420   else
    421     return -1.;
    422 }
    423 
    424 Float_t MCalibrationPix::GetTotalFFactorErrorFFactorMethod()
    425 {
    426 
    427   if (!fFactorCalculated)
    428    CalcFFactorMethod();
    429 
    430   const Float_t rsigmaChargeRelErrSquare = fErrRSigmaCharge * fErrRSigmaCharge
    431                                            / (fRSigmaCharge * fRSigmaCharge) ;
    432   const Float_t rChargeRelErrSquare      = fErrCharge * fErrCharge
    433                                            / (fCharge * fCharge) ;
    434   const Float_t rPheRelErrSquare         = fPheFFactorMethodError * fPheFFactorMethodError
    435                                            / (fPheFFactorMethod * fPheFFactorMethod) ;
    436 
    437   return TMath::Sqrt(rsigmaChargeRelErrSquare+rChargeRelErrSquare+rPheRelErrSquare);
    438 }
    439 
    440 
    441 Float_t MCalibrationPix::GetTotalFFactorBlindPixelMethod()
    442 {
    443   return 1.;
    444 }
    445 
    446 Float_t MCalibrationPix::GetTotalFFactorErrorBlindPixelMethod()
    447 {
    448 
    449   return 1.;
    450 }
    451 
    452 Float_t MCalibrationPix::GetTotalFFactorPINDiodeMethod()
    453 {
    454   return 1.;
    455 }
    456 
    457 Float_t MCalibrationPix::GetTotalFFactorErrorPINDiodeMethod()
    458 {
    459 
    460   return 1.;
    461 }
    462 
    463 Float_t MCalibrationPix::GetTotalFFactorCombinedMethod()
    464 {
    465   return 1.;
    466 }
    467 
    468 Float_t MCalibrationPix::GetTotalFFactorErrorCombinedMethod()
    469 {
    470 
    471   return 1.;
    472 }
    473 
    474 //
    475 // FIXME: This is a preliminary solution, the qe shall be
    476 // calibrated itself!
    477 //
    478 Float_t MCalibrationPix::GetMeanConversionFFactorMethod()
    479 {
    480 
    481   if (!fFactorCalculated)
    482     CalcFFactorMethod();
    483 
    484   return fMeanConversionFFactorMethod/fAverageQE;
    485  
    486 }
    487 
    488 Float_t MCalibrationPix::GetErrorConversionFFactorMethod()
    489 {
    490 
    491   if (!fFactorCalculated)
    492     CalcFFactorMethod();
    493  
    494   Float_t var = fErrorConversionFFactorMethod*fErrorConversionFFactorMethod
    495              / (fMeanConversionFFactorMethod * fMeanConversionFFactorMethod);
    496 
    497   var += fAverageQEErr * fAverageQEErr
    498        / (fAverageQE * fAverageQE);
    499 
    500   if (var > 0)
    501     return -1.;
    502 
    503   var = TMath::Sqrt(var);
    504 
    505   return var*GetMeanConversionFFactorMethod();
    506  
    507 }
    508 
    509 Float_t MCalibrationPix::GetSigmaConversionFFactorMethod()
    510 {
    511 
    512   if (!fFactorCalculated)
    513     CalcFFactorMethod();
    514  
    515   return fSigmaConversionFFactorMethod;
    516  
    517 }
    518 
    519 
    520 Bool_t MCalibrationPix::IsExcluded() const
    521  {
     394Bool_t MCalibrationPix::IsExcluded()            const
     395{
    522396   return TESTBIT(fFlags,kExcluded); 
    523  }
     397}
    524398
    525399Bool_t MCalibrationPix::IsExcludeQualityCheck() const
    526  {
    527    return TESTBIT(fFlags,kExcludeQualityCheck); 
    528  }
    529 
    530 Bool_t MCalibrationPix::IsHiGainSaturation() const
    531  {
     400{
     401    return TESTBIT(fFlags,kExcludeQualityCheck); 
     402}
     403
     404Bool_t MCalibrationPix::IsHiGainSaturation()    const
     405{
    532406   return TESTBIT(fFlags,kHiGainSaturation); 
    533  }
    534 
    535 Bool_t MCalibrationPix::IsChargeValid() const
     407}
     408
     409Bool_t MCalibrationPix::IsChargeValid()         const
    536410{
    537411  return TESTBIT(fFlags, kChargeValid); 
    538412}
    539413
    540 Bool_t MCalibrationPix::IsFitted() const
     414Bool_t MCalibrationPix::IsFitted()              const
    541415{
    542416  return TESTBIT(fFlags, kFitted);   
    543417}
    544418
    545 Bool_t MCalibrationPix::IsOscillating()
    546 {
    547 
    548   if (TESTBIT(fFlags, kOscillating))
    549     return kTRUE;
    550 
    551   if (fHist->CheckOscillations())
    552     {
    553       SETBIT(fFlags,kOscillating);
    554       return kTRUE;
    555     }
    556  
    557   return kFALSE;
     419Bool_t MCalibrationPix::IsOscillating()         const
     420{
     421  return TESTBIT(fFlags, kOscillating);
    558422}
    559423
     
    563427}
    564428
    565 Bool_t MCalibrationPix::IsFFactorMethodValid()
    566 {
    567 
    568   if (!fFactorCalculated)
    569     CalcFFactorMethod();
    570 
     429Bool_t MCalibrationPix::IsFFactorMethodValid()   const
     430{
    571431  return TESTBIT(fFlags, kFFactorMethodValid);     
    572432}
    573433
    574 Bool_t MCalibrationPix::IsPINDiodeMethodValid() const
     434Bool_t MCalibrationPix::IsPINDiodeMethodValid()  const
    575435{
    576436  return TESTBIT(fFlags, kPINDiodeMethodValid);   
    577437}
    578438
    579 Bool_t MCalibrationPix::IsCombinedMethodValid()
     439Bool_t MCalibrationPix::IsCombinedMethodValid()  const
    580440{
    581441  return TESTBIT(fFlags, kCombinedMethodValid);   
     
    655515  //
    656516  // 6) Retrieve the results and store them in this class
    657   //    If fFitted is false, we get the means and RMS of the histogram!!
     517  //    If fFitted is false, we get the eans and RMS of the histogram!!
    658518  //
    659519  fCharge         = fHist->GetChargeMean();
    660   fErrCharge      = fHist->GetChargeMeanErr();
     520  fChargeErr      = fHist->GetChargeMeanErr();
    661521  fSigmaCharge    = fHist->GetChargeSigma();
    662   fErrSigmaCharge = fHist->GetChargeSigmaErr();
     522  fSigmaChargeErr = fHist->GetChargeSigmaErr();
    663523  fChargeProb     = fHist->GetChargeProb();
    664524
     
    674534
    675535  //
    676   // Calculate the conversion factors
     536  //Calculate the conversion factors
    677537  //
    678538  if (IsHiGainSaturation())
     
    699559
    700560  if ( (fCharge    == -1.)
    701    || (fErrCharge   < 0.)
     561   || (fChargeErr   < 0.)
    702562   || (fSigmaCharge < 0.)
    703563   || (fPedRms      < 0.) )
     
    714574  // First the relative error squares
    715575  //
    716   const Float_t chargeSquare              =       fCharge*   fCharge;
    717   const Float_t chargeSquareRelErrSquare  = 4.*fErrCharge*fErrCharge / chargeSquare;
    718  
    719   const Float_t ffactorsquare             =    gkFFactor      * gkFFactor;
    720   const Float_t ffactorsquareRelErrSquare = 4.*gkFFactorError * gkFFactorError / ffactorsquare;
     576  const Float_t chargeSquare              =     fCharge    * fCharge;
     577  const Float_t chargeSquareRelErrSquare  = 4.* fChargeErr * fChargeErr / chargeSquare;
     578
     579  const Float_t chargeRelErrSquare        =     fChargeErr * fChargeErr
     580                                             / (fCharge    * fCharge);
     581 
     582  const Float_t ffactorsquare             =    gkFFactor    * gkFFactor;
     583  const Float_t ffactorsquareRelErrSquare = 4.*gkFFactorErr * gkFFactorErr / ffactorsquare;
     584
     585  const Float_t avQERelErrSquare          =    fAverageQEErr * fAverageQEErr / fAverageQE / fAverageQE;
     586
     587  const Float_t avQEFFactor               = TMath::Sqrt( ( 1. - fAverageQE ) / fAverageQE  );
     588  const Float_t avQEFFactorErr            = 1./ ( 2. * avQEFFactor ) * fAverageQEErr
     589                                            / ( fAverageQE * fAverageQE );
     590  const Float_t avQEFFactorRelErrSquare  = avQEFFactorErr  * avQEFFactorErr
     591                                           / ( avQEFFactor * avQEFFactor) ;
    721592  //
    722593  // Now the absolute error squares
    723594  //
    724   const Float_t sigmaSquare               =       fSigmaCharge*fSigmaCharge;
    725   const Float_t sigmaSquareErrSquare      = 4.*fErrSigmaCharge*fErrSigmaCharge * sigmaSquare;
    726  
    727   Float_t pedRmsSquare                    =       fPedRms fPedRms;
    728   Float_t pedRmsSquareErrSquare           = 4.*fErrPedRms*fErrPedRms * pedRmsSquare;
     595  const Float_t sigmaSquare               =    fSigmaCharge   * fSigmaCharge;
     596  const Float_t sigmaSquareErrSquare      = 4.*fSigmaChargeErr* fSigmaChargeErr * sigmaSquare;
     597 
     598  Float_t pedRmsSquare                    =       fPedRms * fPedRms;
     599  Float_t pedRmsSquareErrSquare           = 4.*fPedRmsErr * fPedRmsErr * pedRmsSquare;
    729600 
    730601  if (!IsHiGainSaturation())
     
    743614      // We extract the pure NSB contribution:
    744615      //
    745       const Float_t elecRmsSquare          =    gkElectronicPedRms   *gkElectronicPedRms;
    746       const Float_t elecRmsSquareErrSquare = 4.*gkErrElectronicPedRms*gkErrElectronicPedRms * elecRmsSquare;
     616      const Float_t elecRmsSquare          =    gkElectronicPedRms    * gkElectronicPedRms;
     617      const Float_t elecRmsSquareErrSquare = 4.*gkElectronicPedRmsErr * gkElectronicPedRmsErr * elecRmsSquare;
    747618 
    748619      Float_t nsbSquare             =  pedRmsSquare          - elecRmsSquare;
     
    757628      // add it quadratically to the electronic noise
    758629      //
    759       const Float_t conversionSquare             =    fConversionHiLo     *fConversionHiLo;
    760       const Float_t conversionSquareRelErrSquare = 4.*fConversionHiLoError*fConversionHiLoError/conversionSquare;
     630      const Float_t conversionSquare             =    fConversionHiLo    * fConversionHiLo;
     631      const Float_t conversionSquareRelErrSquare = 4.*fConversionHiLoErr * fConversionHiLoErr / conversionSquare;
    761632     
    762633      const Float_t convertedNsbSquare          =  nsbSquare             / conversionSquare;
     
    790661            << fPixId << endl;
    791662      CLRBIT(fFlags,kFFactorMethodValid);
    792       fFactorCalculated = kTRUE;
    793663      return kFALSE;
    794664    }
     
    798668 
    799669  fRSigmaCharge    = TMath::Sqrt(rsigmachargesquare);
    800   fErrRSigmaCharge = TMath::Sqrt(sigmaSquareErrSquare + pedRmsSquareErrSquare);
     670  fRSigmaChargeErr = TMath::Sqrt(sigmaSquareErrSquare + pedRmsSquareErrSquare);
    801671
    802672
     
    806676  //
    807677  fPheFFactorMethod = ffactorsquare * chargeSquare / rsigmachargesquare;
     678  //
     679  // Calculate the number of photons from the F-Factor method
     680  // FIXME: This is a preliminary solution, the qe shall be
     681  // calibrated itself!
     682  //
     683  fPheFFactorMethod /= fAverageQE;
    808684
    809685  const Float_t pheFFactorRelErrSquare =  ffactorsquareRelErrSquare
    810                                        + chargeSquareRelErrSquare
    811                                        + rSigmaSquareRelErrSquare ;
    812  
    813   fPheFFactorMethodError        =  TMath::Sqrt(pheFFactorRelErrSquare) * fPheFFactorMethod;
    814  
    815   const Float_t chargeRelErrSquare = fErrCharge*fErrCharge / (fCharge * fCharge);
    816  
    817   fMeanConversionFFactorMethod     =  fPheFFactorMethod / fCharge ;
    818   fErrorConversionFFactorMethod    =  ( pheFFactorRelErrSquare + chargeRelErrSquare )
    819                                    * fMeanConversionFFactorMethod * fMeanConversionFFactorMethod;
    820 
    821   const Float_t convrelerror = fErrorConversionFFactorMethod/fMeanConversionFFactorMethod;
    822  
    823   if ( (fMeanConversionFFactorMethod > 0.) && (convrelerror < gkConvFFactorRelErrorLimit))
     686                                        + chargeSquareRelErrSquare
     687                                        + rSigmaSquareRelErrSquare
     688                                        + avQERelErrSquare;
     689 
     690  fPheFFactorMethodErr                 =  TMath::Sqrt(pheFFactorRelErrSquare) * fPheFFactorMethod;
     691 
     692  fMeanConversionFFactorMethod         =  fPheFFactorMethod / fCharge ;
     693  fConversionFFactorMethodErr          =  ( pheFFactorRelErrSquare + chargeRelErrSquare )
     694                                        * fMeanConversionFFactorMethod * fMeanConversionFFactorMethod;
     695
     696  const Float_t convrelerror           =   fConversionFFactorMethodErr
     697                                         / fMeanConversionFFactorMethod;
     698 
     699  if ( (fMeanConversionFFactorMethod > 0.) && (convrelerror < gkConvFFactorRelErrLimit))
    824700    SETBIT(fFlags,kFFactorMethodValid);
    825701
    826   fFactorCalculated = kTRUE;
    827 
    828702  fSigmaConversionFFactorMethod = GetTotalFFactorFFactorMethod()*TMath::Sqrt(fMeanConversionFFactorMethod);
     703 
     704  //
     705  // Calculate the Total F-Factor of the camera ( in photons )
     706  //
     707  if (fPheFFactorMethod > 0)
     708  {     
     709      fTotalFFactorFFactorMethod =  (fRSigmaCharge/fCharge)*TMath::Sqrt(fPheFFactorMethod);
     710      fTotalFFactorFFactorMethod *=  avQEFFactor;
     711  }
     712
     713  //
     714  // Calculate the error of the Total F-Factor of the camera ( in photons )
     715  //
     716  const Float_t rSigmaChargeRelErrSquare =    fRSigmaChargeErr * fRSigmaChargeErr
     717                                           / (fRSigmaCharge    * fRSigmaCharge) ;
     718
     719  fTotalFFactorErrFFactorMethod = TMath::Sqrt(  rSigmaChargeRelErrSquare
     720                                                + chargeRelErrSquare
     721                                                + pheFFactorRelErrSquare
     722                                                + avQEFFactorRelErrSquare  );
     723
     724  fTotalFFactorErrFFactorMethod *= fTotalFFactorFFactorMethod;
    829725
    830726  return kTRUE;
     
    870766    }
    871767 
    872   if (fErrCharge < gkChargeErrLimit)
    873     {
    874       *fLog << warn << "WARNING: Error of Fitted Charge is smaller than "
     768  if (fChargeErr < gkChargeErrLimit)
     769    {
     770      *fLog << warn << "WARNING: Err of Fitted Charge is smaller than "
    875771            << gkChargeErrLimit << " in Pixel " << fPixId << endl;
    876772      return kFALSE;
    877773    }
    878774     
    879   if (fCharge < gkChargeRelErrLimit*fErrCharge)
     775  if (fCharge < gkChargeRelErrLimit*fChargeErr)
    880776    {
    881777      *fLog << warn << "WARNING: Fitted Charge is smaller than "
     
    975871{
    976872 
    977   const Float_t chargeRelErrSquare     =   fErrCharge*fErrCharge
    978                                          /(   fCharge *  fCharge);
    979   const Float_t sigmaRelErrSquare      =   fErrSigmaCharge*fErrSigmaCharge
    980                                          /(   fSigmaCharge *  fSigmaCharge);
    981   const Float_t conversionRelErrSquare =   fConversionHiLoError*fConversionHiLoError
    982                                          /(fConversionHiLo    * fConversionHiLo);
     873  const Float_t chargeRelErrSquare     =    fChargeErr * fChargeErr
     874                                         /( fCharge    * fCharge  );
     875  const Float_t sigmaRelErrSquare      =    fSigmaChargeErr * fSigmaChargeErr
     876                                         /( fSigmaCharge    * fSigmaCharge );
     877  const Float_t conversionRelErrSquare =    fConversionHiLoErr * fConversionHiLoErr
     878                                         /( fConversionHiLo    * fConversionHiLo  );
    983879 
    984880  fCharge         *= fConversionHiLo;
    985   fErrCharge       = TMath::Sqrt(chargeRelErrSquare + conversionRelErrSquare) * fCharge;
     881  fChargeErr       = TMath::Sqrt(chargeRelErrSquare + conversionRelErrSquare) * fCharge;
    986882 
    987883  fSigmaCharge    *= fConversionHiLo;
    988   fErrSigmaCharge =  TMath::Sqrt(sigmaRelErrSquare + conversionRelErrSquare) * fSigmaCharge;
    989  
    990 }
     884  fSigmaChargeErr =  TMath::Sqrt(sigmaRelErrSquare + conversionRelErrSquare) * fSigmaCharge;
     885 
     886}
  • trunk/MagicSoft/Mars/mcalib/MCalibrationPix.h

    r3236 r3242  
    1212private:
    1313
    14   static const Float_t gkAverageQE;           // The average quantum efficieny agreed on for the first analysis
    15   static const Float_t gkAverageQEErr;        // The error of average quantum efficieny
    16  
    17   static const Float_t gkConversionHiLo;      // The default conversion factor HI gain - Lo Gain
    18   static const Float_t gkConversionHiLoError; // The error of the default conversion factor
    19  
    20   static const Float_t gkElectronicPedRms;    // The pure electronic component of the RMS
    21   static const Float_t gkErrElectronicPedRms; // The error of the pure electronic component of the RMS
    22   static const Float_t gkFFactor;             // The laboratory F-factor of the PMTs
    23   static const Float_t gkFFactorError;        // The laboratory F-factor Error of the PMTs
    24   static const Float_t gkChargeLimit;         // The limit (in units of PedRMS) for acceptance of the fitted mean charge
    25   static const Float_t gkChargeErrLimit;      // The limit (in units of PedRMS) for acceptance of the fitted charge sigma
    26   static const Float_t gkChargeRelErrLimit;   // The limit (in units of Error of fitted charge) for acceptance of the fitted mean 
    27   static const Float_t gkTimeLimit;           // The limit (in units of FADC slices) for acceptance of the fitted time
    28   static const Float_t gkTimeErrLimit;        // The limit (in units of FADC slices) for acceptance of the fitted time sigma
    29   static const Float_t gkConvFFactorRelErrorLimit; // The limit (in units of [1]) for acceptance of the rel. error of the conversion factor with the FFactor method
    30 
    31   Int_t   fPixId;               // the pixel Id
    32 
    33   UInt_t  fFlags;               // Flag for the set Bits
    34  
    35   Float_t fAverageQE;
    36   Float_t fAverageQEErr; 
    37  
    38   Float_t fCharge;              // The mean reduced charge after the fit
    39   Float_t fErrCharge;           // The error of reduced mean charge after the fit
    40   Float_t fSigmaCharge;         // The sigma of the mean charge after the fit
    41   Float_t fErrSigmaCharge;      // The error of the sigma of the mean charge after the fit
    42   Float_t fRSigmaCharge;        // The reduced squares of sigmas after the fit
    43   Float_t fErrRSigmaCharge;     // The reduced squares of sigmas after the fit 
    44   Float_t fChargeProb;          // The probability of the fit function
    45 
    46   Float_t fPed;                 // The mean pedestal (from MPedestalPix)
    47   Float_t fPedRms;              // The pedestal  RMS (from MPedestalPix)
    48   Float_t fErrPedRms;           // The error of the pedestal  RMS (from MPedestalPix) 
    49 
    50   Float_t fAbsTimeMean;
    51   Float_t fAbsTimeMeanErr; 
    52   Float_t fAbsTimeRms;
    53  
    54   Byte_t  fTimeFirstHiGain;           // The first used FADC slice
    55   Byte_t  fTimeLastHiGain;            // The last used FADC slice
    56  
    57   Byte_t  fTimeFirstLoGain;           // The first used FADC slice
    58   Byte_t  fTimeLastLoGain;            // The last used FADC slice
    59  
    60   Float_t fPheFFactorMethod;                // The number of Phe's calculated (F-factor method)
    61   Float_t fPheFFactorMethodError;           // The error on the number of Phe's calculated (F-factor method)
    62 
    63   Float_t fMeanConversionFFactorMethod;     // The conversion factor to Phe's (F-factor method)
    64   Float_t fMeanConversionBlindPixelMethod;  // The conversion factor to Ph's (Blind Pixel method)
    65   Float_t fMeanConversionPINDiodeMethod;    // The conversion factor to Ph's (PIN Diode method)
    66   Float_t fMeanConversionCombinedMethod;    // The conversion factor to Ph's (all methods combined)
    67 
    68   Float_t fErrorConversionFFactorMethod;    // The error of the conversion factor to Phe's (F-factor method)
    69   Float_t fErrorConversionBlindPixelMethod; // The error of the conversion factor to Ph's (Blind Pixel method)
    70   Float_t fErrorConversionPINDiodeMethod;   // The error of the conversion factor to Ph's (PIN Diode method)
    71   Float_t fErrorConversionCombinedMethod;   // The error of the conversion factor to Ph's (all methods combined)
    72 
    73   Float_t fSigmaConversionFFactorMethod;    // The sigma of conversion factor to Phe's (F-factor method)
    74   Float_t fSigmaConversionBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method)
    75   Float_t fSigmaConversionPINDiodeMethod;   // The conversion factor to Ph's (PIN Diode method)
    76   Float_t fSigmaConversionCombinedMethod;   // The conversion factor to Ph's (all methods combined)
    77 
    78   Float_t fTotalFFactor;                    // The F-Factor of the total readout system (Sigma(out)/mean(out)*Mean(in)/sigma(in)
    79   Float_t fTotalFFactorError;               // The error on the F-Factor of the total readout system
    80  
    81   Float_t fConversionHiLo;                  // The conversion factor between Hi Gain and Lo Gain 
    82   Float_t fConversionHiLoError;             // The error of the conversion factor between Hi Gain and Lo Gain 
    83 
    84   Float_t fNumHiGainSamples;
    85   Float_t fNumLoGainSamples;
    86  
    87   Bool_t fFactorCalculated;
     14  static const Float_t gkAverageQE;              // The average quantum efficieny agreed on for the first analysis
     15  static const Float_t gkAverageQEErr;           // The error of average quantum efficieny
     16 
     17  static const Float_t gkConversionHiLo;         // The default conversion factor HI gain - Lo Gain
     18  static const Float_t gkConversionHiLoErr;      // The error of the default conversion factor
     19 
     20  static const Float_t gkElectronicPedRms;       // The pure electronic component of the RMS
     21  static const Float_t gkElectronicPedRmsErr;    // The error of the pure electronic component of the RMS
     22  static const Float_t gkFFactor;                // The laboratory F-factor of the PMTs
     23  static const Float_t gkFFactorErr;             // The laboratory F-factor Error of the PMTs
     24  static const Float_t gkChargeLimit;            // The limit (in units of PedRMS) for acceptance of the fitted mean charge
     25  static const Float_t gkChargeErrLimit;         // The limit (in units of PedRMS) for acceptance of the fitted charge sigma
     26  static const Float_t gkChargeRelErrLimit;      // The limit (in units of Error of fitted charge) for acceptance of the fitted mean 
     27  static const Float_t gkTimeLimit;              // The limit (in units of FADC slices) for acceptance of the fitted time
     28  static const Float_t gkTimeErrLimit;           // The limit (in units of FADC slices) for acceptance of the fitted time sigma
     29  static const Float_t gkConvFFactorRelErrLimit; // The limit for acceptance of the rel. error of the conversion factor with the FFactor method
     30
     31  Int_t   fPixId;                                // the pixel Id
     32
     33  UInt_t  fFlags;                                // Flag for the set bits
     34 
     35  Float_t fAverageQE;                            // The average quantum efficieny (see Class description)
     36  Float_t fAverageQEErr;                         // The error of the average quantum efficieny (see Class description)
     37 
     38  Float_t fCharge;                               // The mean reduced charge after the fit
     39  Float_t fChargeErr;                            // The error of reduced mean charge after the fit
     40  Float_t fSigmaCharge;                          // The sigma of the mean charge after the fit
     41  Float_t fSigmaChargeErr;                       // The error of the sigma of the mean charge after the fit
     42  Float_t fRSigmaCharge;                         // The reduced squares of sigmas after the fit
     43  Float_t fRSigmaChargeErr;                      // The reduced squares of sigmas after the fit 
     44  Float_t fChargeProb;                           // The probability of the fit function
     45
     46  Float_t fPed;                                  // The mean pedestal (from MPedestalPix)
     47  Float_t fPedRms;                               // The pedestal  RMS (from MPedestalPix)
     48  Float_t fPedRmsErr;                            // The error of the pedestal  RMS (from MPedestalPix) 
     49
     50  Float_t fAbsTimeMean;                          // The mean absolute arrival time
     51  Float_t fAbsTimeMeanErr;                       // The error of the absolute mean arrival time
     52  Float_t fAbsTimeRms;                           // The rms of the mean absolute arrival time
     53 
     54  Byte_t  fTimeFirstHiGain;                      // The first used FADC slice
     55  Byte_t  fTimeLastHiGain;                       // The last used FADC slice
     56 
     57  Byte_t  fTimeFirstLoGain;                      // The first used FADC slice
     58  Byte_t  fTimeLastLoGain;                       // The last used FADC slice
     59 
     60  Float_t fPheFFactorMethod;                     // The number of Phe's calculated (F-factor method)
     61  Float_t fPheFFactorMethodErr;                  // The error on the number of Phe's calculated (F-factor method)
     62
     63  Float_t fMeanConversionFFactorMethod;          // The conversion factor to Phe's (F-factor method)
     64  Float_t fMeanConversionBlindPixelMethod;       // The conversion factor to Ph's (Blind Pixel method)
     65  Float_t fMeanConversionPINDiodeMethod;         // The conversion factor to Ph's (PIN Diode method)
     66  Float_t fMeanConversionCombinedMethod;         // The conversion factor to Ph's (all methods combined)
     67
     68  Float_t fConversionFFactorMethodErr;           // The error of the conversion factor to Phe's (F-factor method)
     69  Float_t fConversionBlindPixelMethodErr;        // The error of the conversion factor to Ph's (Blind Pixel method)
     70  Float_t fConversionPINDiodeMethodErr;          // The error of the conversion factor to Ph's (PIN Diode method)
     71  Float_t fConversionCombinedMethodErr;          // The error of the conversion factor to Ph's (all methods combined)
     72
     73  Float_t fSigmaConversionFFactorMethod;         // The sigma of conversion factor to Phe's (F-factor method)
     74  Float_t fSigmaConversionBlindPixelMethod;      // The conversion factor to Ph's (Blind Pixel method)
     75  Float_t fSigmaConversionPINDiodeMethod;        // The conversion factor to Ph's (PIN Diode method)
     76  Float_t fSigmaConversionCombinedMethod;        // The conversion factor to Ph's (all methods combined)
     77 
     78  Float_t fTotalFFactorFFactorMethod;            // The total F-Factor to Ph's (F-factor method)
     79  Float_t fTotalFFactorBlindPixelMethod;         // The total F-Factor to Ph's (Blind Pixel method)
     80  Float_t fTotalFFactorPINDiodeMethod;           // The total F-Factor to Ph's (PIN Diode method)
     81  Float_t fTotalFFactorCombinedMethod;           // The total F-Factor to Ph's (all methods combined)
     82 
     83  Float_t fTotalFFactorErrFFactorMethod;         // The error of the total F-Factor to Ph's (F-factor method)
     84  Float_t fTotalFFactorErrBlindPixelMethod;      // The error of the total F-Factor to Ph's (Blind Pixel method)
     85  Float_t fTotalFFactorErrPINDiodeMethod;        // The error of the total F-Factor to Ph's (PIN Diode method)
     86  Float_t fTotalFFactorErrCombinedMethod;        // The error of the total F-Factor to Ph's (all methods combined)
     87 
     88  Float_t fTotalFFactor;                         // The F-Factor of the total readout system (Sigma(out)/mean(out)*Mean(in)/sigma(in)
     89  Float_t fTotalFFactorErr;                      // The error on the F-Factor of the total readout system
     90 
     91  Float_t fConversionHiLo;                       // The conversion factor between Hi Gain and Lo Gain 
     92  Float_t fConversionHiLoErr;                    // The error of the conversion factor between Hi Gain and Lo Gain 
     93
     94  Float_t fNumHiGainSamples;                     // The number of hi-gain samples used for the signal extraction
     95  Float_t fNumLoGainSamples;                     // The number of hi-gain samples used for the signal extraction
    8896 
    8997  enum  { kHiGainSaturation,
     
    9199          kChargeValid, kTimeFitValid,
    92100          kFitted, kOscillating,
    93           kBlindPixelMethodValid, kFFactorMethodValid, kPINDiodeMethodValid, kCombinedMethodValid };
    94  
    95   MHCalibrationPixel *fHist;                // Pointer to the histograms performing the fits, etc. 
     101          kBlindPixelMethodValid, kFFactorMethodValid,
     102          kPINDiodeMethodValid, kCombinedMethodValid };
     103 
     104  MHCalibrationPixel *fHist;                     // Pointer to the histograms performing the fits, etc. 
    96105
    97106  Bool_t CheckChargeValidity();
     
    111120  void SetPedestal(const Float_t ped, const Float_t pedrms,
    112121                   const Float_t higainsamp, const Float_t logainsamp);
    113   void SetConversionHiLo(     const Float_t c=gkConversionHiLo)       { fConversionHiLo      = c;    }
    114   void SetConversionHiLoError(const Float_t e=gkConversionHiLoError)  { fConversionHiLoError = e;    }
    115   void SetAverageQE(const Float_t qe=gkAverageQE, const Float_t err=gkAverageQEErr)
    116                                     { fAverageQE = qe;               fAverageQEErr = err;  }
    117  
     122  void SetConversionHiLo(     const Float_t c = gkConversionHiLo)       { fConversionHiLo      = c;    }
     123  void SetConversionHiLoErr(  const Float_t e = gkConversionHiLoErr)    { fConversionHiLoErr   = e;    }
     124  void SetAverageQE(          const Float_t qe= gkAverageQE,
     125                              const Float_t err=gkAverageQEErr)         { fAverageQE    = qe;           
     126                                                                          fAverageQEErr = err;         }
     127
    118128  // Setters for MC
    119   void SetConversionFFactorMethod(Float_t c, Float_t err, Float_t sig);
    120   void SetConversionBlindPixelMethod(Float_t c, Float_t err, Float_t sig);
    121   void SetConversionPINDiodeMethod(Float_t c, Float_t err, Float_t sig);
    122   void SetConversionCombinedMethod(Float_t c, Float_t err, Float_t sig);
     129  void SetConversionFFactorMethod(    Float_t c, Float_t err, Float_t sig );
     130  void SetConversionBlindPixelMethod( Float_t c, Float_t err, Float_t sig );
     131  void SetConversionPINDiodeMethod(   Float_t c, Float_t err, Float_t sig );
     132  void SetConversionCombinedMethod(   Float_t c, Float_t err, Float_t sig );
    123133
    124134  // Bit Setters
    125   void SetHiGainSaturation(Bool_t b = kTRUE);
    126   void SetExcluded(Bool_t b = kTRUE);
    127   void SetExcludeQualityCheck(Bool_t b = kTRUE);
    128   void SetChargeValid(Bool_t b = kTRUE);
    129   void SetFitted(Bool_t b = kTRUE);
    130   void SetOscillating(Bool_t b = kTRUE);
    131   void SetBlindPixelMethodValid(Bool_t b = kTRUE);
    132   void SetFFactorMethodValid(Bool_t b = kTRUE);
    133   void SetPINDiodeMethodValid(Bool_t b = kTRUE);
    134   void SetAbsTimeBordersHiGain(Byte_t f, Byte_t l);
    135   void SetAbsTimeBordersLoGain(Byte_t f, Byte_t l);
     135  void SetHiGainSaturation(      Bool_t b = kTRUE );
     136  void SetExcluded(              Bool_t b = kTRUE );
     137  void SetExcludeQualityCheck(   Bool_t b = kTRUE );
     138  void SetChargeValid(           Bool_t b = kTRUE );
     139  void SetFitted(                Bool_t b = kTRUE );
     140  void SetOscillating(           Bool_t b = kTRUE );
     141  void SetBlindPixelMethodValid( Bool_t b = kTRUE );
     142  void SetFFactorMethodValid(    Bool_t b = kTRUE );
     143  void SetPINDiodeMethodValid(   Bool_t b = kTRUE );
     144
     145  void SetAbsTimeBordersHiGain( Byte_t f, Byte_t l );
     146  void SetAbsTimeBordersLoGain( Byte_t f, Byte_t l );
    136147 
    137148  // Charges
    138149  Float_t GetCharge()              const { return fCharge;          }
    139   Float_t GetErrCharge()           const { return fErrCharge;       }
     150  Float_t GetChargeErr()           const { return fChargeErr;       }
    140151  Float_t GetChargeProb()          const { return fChargeProb;      }   
    141152  Float_t GetSigmaCharge()         const { return fSigmaCharge;     }
    142   Float_t GetErrSigmaCharge()      const { return fErrSigmaCharge;  }
     153  Float_t GetSigmaChargeErr()      const { return fSigmaChargeErr;  }
    143154  Float_t GetRSigmaCharge()        const { return fRSigmaCharge;    }
    144   Float_t GetErrRSigmaCharge()     const { return fErrRSigmaCharge; } 
    145 
    146 
    147   Float_t GetAbsTimeMean()         const { return fAbsTimeMean;    }
    148   Float_t GetAbsTimeMeanErr()      const { return fAbsTimeMeanErr; }
    149   Float_t GetAbsTimeRms()          const { return fAbsTimeRms;     }
     155  Float_t GetRSigmaChargeErr()     const { return fRSigmaChargeErr; } 
     156
     157
     158  Float_t GetAbsTimeMean()         const { return fAbsTimeMean;     }
     159  Float_t GetAbsTimeMeanErr()      const { return fAbsTimeMeanErr;  }
     160  Float_t GetAbsTimeRms()          const { return fAbsTimeRms;      }
    150161 
    151162  // Conversion Factors
    152   Float_t GetConversionHiLo()                 const  { return fConversionHiLo;        }
    153   Float_t GetConversionHiLoError()            const  { return fConversionHiLoError;  }
     163  Float_t GetConversionHiLo()      const  { return fConversionHiLo;    }
     164  Float_t GetConversionHiLoErr()   const  { return fConversionHiLoErr; }
    154165
    155166  Float_t GetMeanConversionBlindPixelMethod()  const { return fMeanConversionBlindPixelMethod  ; }
    156   Float_t GetErrorConversionBlindPixelMethod() const { return fErrorConversionBlindPixelMethod ; }
     167  Float_t GetConversionBlindPixelMethodErr()   const { return fConversionBlindPixelMethodErr ;  }
    157168  Float_t GetSigmaConversionBlindPixelMethod() const { return fSigmaConversionBlindPixelMethod ; }
    158169
    159   Float_t GetMeanConversionFFactorMethod();
    160   Float_t GetErrorConversionFFactorMethod();
    161   Float_t GetSigmaConversionFFactorMethod();
    162 
    163   Float_t GetMeanConversionPINDiodeMethod()    const { return fMeanConversionPINDiodeMethod ;  }
    164   Float_t GetErrorConversionPINDiodeMethod()   const { return fErrorConversionPINDiodeMethod ; }
    165   Float_t GetSigmaConversionPINDiodeMethod()   const { return fSigmaConversionPINDiodeMethod ; }
    166 
    167   Float_t GetMeanConversionCombinedMethod()    const { return fMeanConversionCombinedMethod ;  }
    168   Float_t GetErrorConversionCombinedMethod()   const { return fErrorConversionCombinedMethod ; }
    169   Float_t GetSigmaConversionCombinedMethod()   const { return fSigmaConversionCombinedMethod ; }
    170 
    171   Float_t GetPheFFactorMethod();   
    172   Float_t GetPheFFactorMethodError();
    173 
    174   Int_t   GetPixId()                           const  { return fPixId;   }
    175 
    176   Float_t GetPed()                             const { return fPed;    }
    177   Float_t GetPedRms()                          const { return fPedRms; }
    178 
    179   Float_t GetTotalFFactorFFactorMethod();
    180   Float_t GetTotalFFactorErrorFFactorMethod();
    181  
    182   Float_t GetTotalFFactorBlindPixelMethod();
    183   Float_t GetTotalFFactorErrorBlindPixelMethod();
    184  
    185   Float_t GetTotalFFactorPINDiodeMethod();
    186   Float_t GetTotalFFactorErrorPINDiodeMethod();
    187 
    188   Float_t GetTotalFFactorCombinedMethod();
    189   Float_t GetTotalFFactorErrorCombinedMethod();
    190  
    191   Bool_t IsExcluded()              const;
    192   Bool_t IsExcludeQualityCheck()   const;
    193   Bool_t IsHiGainSaturation()      const;
    194   Bool_t IsChargeValid()        const;
    195   Bool_t IsFitted()                const;
    196   Bool_t IsOscillating();
    197   Bool_t IsBlindPixelMethodValid() const;
    198   Bool_t IsPINDiodeMethodValid()   const;
    199   Bool_t IsFFactorMethodValid();
    200   Bool_t IsCombinedMethodValid();
     170  Float_t GetMeanConversionFFactorMethod()     const { return fMeanConversionFFactorMethod;      }
     171  Float_t GetConversionFFactorMethodErr()      const { return fConversionFFactorMethodErr;       }
     172  Float_t GetSigmaConversionFFactorMethod()    const { return fSigmaConversionFFactorMethod;     }
     173
     174  Float_t GetMeanConversionPINDiodeMethod()    const { return fMeanConversionPINDiodeMethod ;    }
     175  Float_t GetConversionPINDiodeMethodErr()     const { return fConversionPINDiodeMethodErr ;    }
     176  Float_t GetSigmaConversionPINDiodeMethod()   const { return fSigmaConversionPINDiodeMethod ;   }
     177
     178  Float_t GetMeanConversionCombinedMethod()    const { return fMeanConversionCombinedMethod ;    }
     179  Float_t GetConversionCombinedMethodErr()     const { return fConversionCombinedMethodErr ;    }
     180  Float_t GetSigmaConversionCombinedMethod()   const { return fSigmaConversionCombinedMethod ;   }
     181
     182  Float_t GetPheFFactorMethod()                const { return fPheFFactorMethod;                 }   
     183  Float_t GetPheFFactorMethodErr()             const { return fPheFFactorMethodErr;              }
     184
     185  Int_t   GetPixId()                           const { return fPixId;                            }
     186
     187  Float_t GetPed()                             const { return fPed;                              }
     188  Float_t GetPedRms()                          const { return fPedRms;                           }
     189
     190  Float_t GetTotalFFactorFFactorMethod()       const { return fTotalFFactorFFactorMethod;        }
     191  Float_t GetTotalFFactorErrFFactorMethod()    const { return fTotalFFactorErrFFactorMethod;     }
     192 
     193  Float_t GetTotalFFactorBlindPixelMethod()    const { return fTotalFFactorBlindPixelMethod;     }
     194  Float_t GetTotalFFactorErrBlindPixelMethod() const { return fTotalFFactorErrBlindPixelMethod;  }
     195 
     196  Float_t GetTotalFFactorPINDiodeMethod()      const { return fTotalFFactorPINDiodeMethod;       }
     197  Float_t GetTotalFFactorErrPINDiodeMethod()   const { return fTotalFFactorErrPINDiodeMethod;    }
     198
     199  Float_t GetTotalFFactorCombinedMethod()      const { return fTotalFFactorCombinedMethod;       }
     200  Float_t GetTotalFFactorErrCombinedMethod()   const { return fTotalFFactorErrCombinedMethod;    }
     201 
     202  Bool_t IsExcluded()                          const;
     203  Bool_t IsExcludeQualityCheck()               const;
     204  Bool_t IsHiGainSaturation()                  const;
     205  Bool_t IsChargeValid()                       const;
     206  Bool_t IsFitted()                            const;
     207  Bool_t IsOscillating()                       const;
     208  Bool_t IsBlindPixelMethodValid()             const;
     209  Bool_t IsPINDiodeMethodValid()               const;
     210  Bool_t IsFFactorMethodValid()                const;
     211  Bool_t IsCombinedMethodValid()               const;
    201212
    202213  // Fill histos
Note: See TracChangeset for help on using the changeset viewer.