Changeset 2725


Ignore:
Timestamp:
12/19/03 15:41:03 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2723 r2725  
    44
    55                                                 -*-*- END OF LINE -*-*-
     6
     7 2003/12/19: Markus Gaug, Michele Doro
     8
     9   * manalysis/MExtractSignal.[h,cc]
     10   * manalysis/MCalibrate.[h,cc]
     11   * manalysis/MCalibrationCalc.[h,cc]
     12   * manalysis/MCalibrationPix.[h,cc]
     13
     14     - Treatment of the conversion factors between HI Gain and Lo Gain
     15       is now done in the MCalibrationPix.
     16
     17       MExtractSignal does not convert anymore, but MCalibrate searches
     18       the conversion factor from MCalibrationPix.
     19       This allows for different conversion factors for every pixel.
    620
    721 2003/12/18: Abelardo Moralejo
  • trunk/MagicSoft/Mars/manalysis/MCalibrate.cc

    r2720 r2725  
    4444
    4545#include "MCalibrate.h"
     46#include "MCalibrationConfig.h"
    4647
    4748#include "MLog.h"
     
    137138        MCalibrationPix &pix = (*fCalibrations)[pixid];
    138139
     140
    139141        if (pix.IsBlindPixelMethodValid())
    140142        {
    141143            MExtractedSignalPix &sig =  (*fSignals)[pixid];
    142144
    143             Bool_t logain = sig.IsLoGainUsed();
    144        
    145145            Float_t signal;
    146             if (logain)
    147                 signal = sig.GetExtractedSignalLoGain();
     146            Float_t signalErr = 0.;
     147
     148            if (sig.IsLoGainUsed())
     149              {
     150                signal    = sig.GetExtractedSignalLoGain()*pix.GetConversionHiLo();
     151                signalErr = signal*pix.GetConversionHiLoError();
     152              }
    148153            else
    149                 signal = sig.GetExtractedSignalHiGain();
    150            
    151            
     154              {
     155                signal = sig.GetExtractedSignalHiGain();
     156              }
     157           
    152158            //      Float_t calibrationConvertionFactor = pix.GetMeanConversionFFactorMethod();
    153             Float_t calibrationConversionFactor = pix.GetMeanConversionBlindPixelMethod();
     159            Float_t calibrationConversionFactor      = pix.GetMeanConversionBlindPixelMethod();
    154160            Float_t calibrationConversionFactorError = pix.GetErrorConversionBlindPixelMethod();
    155161           
    156162
    157             Float_t nphot = signal*calibrationConversionFactor;
    158             Float_t nphoterr = signal*calibrationConversionFactorError;;
    159            
    160             fCerPhotEvt->AddPixel(pixid, nphot, nphoterr);
     163            Float_t nphot    = signal*calibrationConversionFactor;
     164
     165            Float_t nphotErr = signal*calibrationConversionFactorError*signal*calibrationConversionFactorError;
     166            nphotErr += signalErr*signalErr*calibrationConversionFactor*calibrationConversionFactor;
     167            nphotErr  = TMath::Sqrt(nphotErr);
     168
     169            fCerPhotEvt->AddPixel(pixid, nphot, nphotErr);
    161170        }
    162171        else
  • trunk/MagicSoft/Mars/manalysis/MCalibrate.h

    r2691 r2725  
    3030    MExtractedSignalCam *fSignals;      // Integrated charge in FADCs counts
    3131    MCerPhotEvt         *fCerPhotEvt; // Cerenkov Photon Event used for calculation
    32  
    33   Int_t PreProcess(MParList *pList);
    34   Int_t Process();
     32
     33    Float_t fConversionHiLo;
     34   
     35    Int_t PreProcess(MParList *pList);
     36    Int_t Process();
    3537
    3638public:
     
    3840    MCalibrate(const char *name=NULL, const char *title=NULL);
    3941
     42    void SetConversionHiLo(Float_t conv)         { fConversionHiLo = conv; }
     43   
    4044    ClassDef(MCalibrate, 0)   // Task to calculate cerenkov photons using calibration constants
    4145};
  • trunk/MagicSoft/Mars/manalysis/MCalibrationCalc.cc

    r2699 r2725  
    124124    SETBIT(fFlags, kUseBlindPixelFit);
    125125    SETBIT(fFlags, kUsePinDiodeFit);
     126
    126127}
    127128
     
    271272    // FIXME: In the future need a much more sophisticated one!!!
    272273    //
    273    
     274
    274275    while (pixel.Next())
    275276      {
     
    308309        Float_t sumhi  = sig.GetExtractedSignalHiGain();
    309310        Float_t sumlo  = sig.GetExtractedSignalLoGain();
    310         Bool_t  logain = sig.IsLoGainUsed();
    311 
    312311        Float_t mtime  = sig.GetMeanArrivalTime();
    313312
     
    356355                    << pixid << " signal = " << sumhi  << " event Nr: " << fEvents << endl;
    357356
    358             if (logain)
     357            if (sig.IsLoGainUsed())
    359358              {
    360359               
  • trunk/MagicSoft/Mars/manalysis/MCalibrationCalc.h

    r2699 r2725  
    4646  Byte_t fFlags;                           // Flag for the fits used
    4747   
    48 
     48  Float_t fConversionHiLo;
     49 
    4950  enum  { kUseTimeFits, kUseBlindPixelFit, kUsePinDiodeFit };
    5051
     
    7475
    7576  void SetPulserColor(PulserColor_t color)    { fColor = color; }
     77
     78  void SetConversionHiLo(Float_t conv)         { fConversionHiLo = conv; }
    7679 
    7780  ClassDef(MCalibrationCalc, 1)   // Task to fill the Calibration Containers from raw data
  • trunk/MagicSoft/Mars/manalysis/MCalibrationPix.cc

    r2719 r2725  
    8383  fTitle = title ? title : "Container of the MHCalibrationPixels and the fit results";
    8484
     85  //
     86  // At the moment, we don't have a database, yet,
     87  // so we get it from the configuration file
     88  //
     89  fConversionHiLo      = gkConversionHiLo;
     90  fConversionHiLoError = gkConversionHiLoError; 
     91
    8592  fHist = new MHCalibrationPixel("MHCalibrationPixel","Calibration Histograms Pixel ");
    8693
     
    124131// 8) Calculate the errors of the F-Factor method
    125132//
    126 // The fit is declared as valid, if:
     133// The fit is declared valid (fFitValid = kTRUE), if:
    127134//
    128135// 1) Pixel has a fitted charge greater than 3*PedRMS
     
    131138// 4) Pixel has a charge sigma bigger than its Pedestal RMS
    132139// 5) If FitTimes is used,
    133 //    the mean arrival time is at least 1.5 slices from the edge
     140//    the mean arrival time is at least 1.0 slices from the used edge slices
    134141//
    135 // The F-Factor method is declared as valid, if:
    136 //
    137 // 1) Pixel is FitValid
     142// The conversion factor after the F-Factor method is declared valid, if:
     143//
     144// 1) fFitValid is kTRUE
    138145// 2) Conversion Factor is bigger than 0.
    139146// 3) The error of the conversion factor is smaller than 10%
     
    142149{
    143150
     151  //
     152  // 1) Return if the charge distribution is already succesfully fitted 
     153  //
    144154  if (fHist->IsFitOK())
    145155    return kTRUE;
    146156
     157  //
     158  // 2) Set a lower Fit range according to 1.5 Pedestal RMS in order to avoid
     159  //    possible remaining cosmics to spoil the fit.
     160  //
    147161  if (fPed && fPedRms)
    148162    fHist->SetLowerFitRange(1.5*fPedRms);
     
    150164    *fLog << warn << "Cannot set lower fit range: Pedestals not available" << endl;
    151165
     166  //
     167  // 3) Decide if the LoGain Histogram is fitted or the HiGain Histogram
     168  //
    152169  if (fHist->UseLoGain())
    153170    {
    154171
    155172      SetHiGainSaturation();
    156 
     173     
     174      //
     175      // 4) Fit the Lo Gain histograms with a Gaussian
     176      //
    157177      if(!fHist->FitChargeLoGain())
    158178        {
    159179          *fLog << warn << "Could not fit Lo Gain charges of pixel " << fPixId << endl;
     180          //         
     181          // 5) In case of failure print out the fit results
     182          //
    160183          fHist->PrintChargeFitResult();
    161184        }
     
    163186  else
    164187    {
     188      //
     189      // 4) Fit the Hi Gain histograms with a Gaussian
     190      //
    165191      if(!fHist->FitChargeHiGain())
    166192        {
    167193          *fLog << warn << "Could not fit Hi Gain charges of pixel " << fPixId << endl;
     194          //         
     195          // 5) In case of failure print out the fit results
     196          //
    168197          fHist->PrintChargeFitResult();
    169198        }
     
    171200 
    172201
     202  //
     203  // 6) Retrieve the results and store them in this class
     204  //
    173205  fCharge         = fHist->GetChargeMean();
    174206  fErrCharge      = fHist->GetChargeMeanErr();
     
    187219    fFitted = kTRUE;
    188220
    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;
    196 
    197   //
    198   // Apply the F-Factor Method
     221
     222  if (fHiGainSaturation)
     223    {
     224      if ( (fCharge     > 0.3*GetPedRms()) &&
     225          (fErrCharge  > 0.)              &&
     226          (fHist->IsFitOK())              &&
     227          (fSigmaCharge > fPedRms/fConversionHiLo)   &&
     228          (fTime > fHist->GetTimeLowerFitRange()+1.) &&
     229          (fTime < fHist->GetTimeUpperFitRange()-1.) )
     230        fFitValid =  kTRUE;
     231    }
     232  else
     233    {
     234      if ( (fCharge > 3.*GetPedRms()) &&
     235           (fErrCharge  > 0.)        &&
     236           (fHist->IsFitOK())        &&
     237           (fSigmaCharge > fPedRms)  &&
     238           (fTime > fHist->GetTimeLowerFitRange()+1.) &&
     239           (fTime < fHist->GetTimeUpperFitRange()-1.) )
     240        fFitValid =  kTRUE;
     241    }
     242 
     243  //
     244  // 7) Calculate the number of photo-electrons after the F-Factor method
     245  // 8) Calculate the errors of the F-Factor method
    199246  //
    200247  if ((fPed > 0.)  && (fPedRms > 0.))
     
    204251      // Square all variables in order to avoid applications of square root
    205252      //
    206       const Float_t chargesquare              =       fCharge*fCharge;
    207       const Float_t chargessquarerelerrsquare = 4.*fErrCharge*fErrCharge/chargesquare;
    208 
    209       const Float_t sigmasquare         =       fSigmaCharge*fSigmaCharge;
    210       const Float_t sigmasquareerr      = 2.*fErrSigmaCharge*fSigmaCharge;
    211 
    212       const Float_t pedrmssquare        =       fPedRms*fPedRms;
    213       const Float_t pedrmssquareerr     = 2.*fErrPedRms*fPedRms;
    214 
    215       const Float_t elecrmssquare       =       fElectronicPedRms*fElectronicPedRms;
    216       const Float_t elecrmssquareerr    = 2.*fErrElectronicPedRms*fElectronicPedRms;
    217 
    218       const Float_t conversionsquare    =    gkConversionHiLo     *gkConversionHiLo;
    219       const Float_t conversionsquareerr = 2.*gkConversionHiLoError*gkConversionHiLo;
    220 
    221       const Float_t ffactorrelerrsquare = fFactorError * fFactorError / fFactor / fFactor;
    222 
    223       Float_t rsigmasquarerelerrsquare  = 0.;
    224       Float_t   pheffactorrelerrsquare  = 0.;
     253      // First the relative error squares
     254      //
     255      const Float_t chargeSquare              =       fCharge*   fCharge;
     256      const Float_t chargeSquareRelErrSquare  = 4.*fErrCharge*fErrCharge / chargeSquare;
     257
     258      const Float_t fFactorRelErrSquare       = fFactorError * fFactorError / (fFactor * fFactor);
     259      //
     260      // Now the absolute error squares
     261      //
     262      const Float_t sigmaSquare               =       fSigmaCharge*   fSigmaCharge;
     263      const Float_t sigmaSquareErrSquare      = 4.*fErrSigmaCharge*fErrSigmaCharge * sigmaSquare;
     264
     265      const Float_t elecRmsSquare             =       fElectronicPedRms*   fElectronicPedRms;
     266      const Float_t elecRmsSquareErrSquare    = 4.*fErrElectronicPedRms*fErrElectronicPedRms * elecRmsSquare;
     267
     268      Float_t pedRmsSquare                    =       fPedRms*   fPedRms;
     269      Float_t pedRmsSquareErrSquare           = 4.*fErrPedRms*fErrPedRms * pedRmsSquare;
    225270
    226271      if (fHiGainSaturation)
    227272        {
    228 
     273         
    229274          //
    230275          // We do not know the Lo Gain Pedestal RMS, so we have to retrieve it
     
    233278          // We extract the pure NSB contribution:
    234279          //
    235           Float_t nsbsquare            = pedrmssquare - elecrmssquare;
    236           Float_t nsbsquareerrsquare   = pedrmssquareerr  * pedrmssquareerr +
    237                                          elecrmssquareerr * elecrmssquareerr;
    238 
    239           if (nsbsquare < 0.)
    240             nsbsquare = 0.;
     280          Float_t nsbSquare             =  pedRmsSquare          - elecRmsSquare;
     281          Float_t nsbSquareRelErrSquare = (pedRmsSquareErrSquare + elecRmsSquareErrSquare)
     282                                          / (nsbSquare * nsbSquare) ;
     283
     284          if (nsbSquare < 0.)
     285            nsbSquare = 0.;
    241286         
    242287          //
     
    244289          // add it quadratically to the electronic noise
    245290          //
    246           Float_t logainrmssquare          = nsbsquare/conversionsquare + elecrmssquare;
    247           Float_t logainrmssquareerrsquare = nsbsquareerrsquare/conversionsquare/conversionsquare
    248                                            + elecrmssquareerr * elecrmssquareerr
    249                                            + conversionsquareerr*conversionsquareerr
    250                                              / (conversionsquare*conversionsquare)
    251                                              / (conversionsquare*conversionsquare);
    252           //
    253           // Calculate the reduced sigma with the new "Pedestal RMS"
    254           //
    255           fRSigmaSquare            = sigmasquare - logainrmssquare;
    256           rsigmasquarerelerrsquare = (sigmasquareerr * sigmasquareerr + logainrmssquareerrsquare)
    257                                      / (fRSigmaSquare * fRSigmaSquare);
    258 
    259           if (fRSigmaSquare > 0.)
    260             {
    261               fPheFFactorMethod      = fFactor * chargesquare / fRSigmaSquare;
    262               pheffactorrelerrsquare =        ffactorrelerrsquare
    263                                       + chargessquarerelerrsquare
    264                                       +  rsigmasquarerelerrsquare ;
    265             }
     291          const Float_t conversionSquare             =    fConversionHiLo     *fConversionHiLo;
     292          const Float_t conversionSquareRelErrSquare = 4.*fConversionHiLoError*fConversionHiLoError/conversionSquare;
     293
     294          //
     295          // Calculate the new "Pedestal RMS"
     296          //
     297          const Float_t convertedNsbSquare          =  nsbSquare             / conversionSquare;
     298          const Float_t convertedNsbSquareErrSquare = (nsbSquareRelErrSquare + conversionSquareRelErrSquare)
     299                                                      * convertedNsbSquare * convertedNsbSquare;
     300
     301          pedRmsSquare           = convertedNsbSquare           + elecRmsSquare;
     302          pedRmsSquareErrSquare  = convertedNsbSquareErrSquare  + elecRmsSquareErrSquare;
    266303         
    267304        }    /* if (fHiGainSaturation) */
    268       else   
     305     
     306      //
     307      // Calculate the reduced sigmas
     308      //
     309      fRSigmaSquare = sigmaSquare - pedRmsSquare;
     310      if (fRSigmaSquare <= 0.)
    269311        {
    270           fRSigmaSquare            = sigmasquare - pedrmssquare;
    271           rsigmasquarerelerrsquare = (  sigmasquareerr *  sigmasquareerr
    272                                      + pedrmssquareerr * pedrmssquareerr)
    273                                    / (fRSigmaSquare * fRSigmaSquare);
    274 
    275           fPheFFactorMethod      = fFactor * chargesquare / fRSigmaSquare;
    276           //
    277           // We first calculate the squared relative error in order to save the
    278           // TMath::Sqrt
    279           //
    280           pheffactorrelerrsquare = (       ffactorrelerrsquare
    281                                    + chargessquarerelerrsquare
    282                                    +  rsigmasquarerelerrsquare );
    283          
    284 
    285         }   /* if (fHiGainSaturation) */
    286      
    287 
    288       if (fPheFFactorMethod <= 0.)
    289         {
    290           *fLog << warn << "Cannot apply F-Factor calibration: Number of PhE smaller than 0 in pixel "
     312          *fLog << warn << "Cannot apply F-Factor calibration: Reduced Sigma smaller than 0 in pixel "
    291313                << fPixId << endl;
     314          if (fHiGainSaturation)
     315            ApplyLoGainConversion();
    292316          return kFALSE;
    293317        }
    294      
    295       fConversionFFactorMethod      =  fPheFFactorMethod /  fCharge ;
    296       fConversionErrorFFactorMethod =  fConversionFFactorMethod  *
    297                                        ( pheffactorrelerrsquare +
    298                                        (fErrCharge * fErrCharge / chargesquare ) );
    299 
    300       fPheFFactorMethodError        =  TMath::Sqrt(pheffactorrelerrsquare) * fPheFFactorMethod;
    301 
    302       if ( IsFitValid()                    &&
    303           (fConversionFFactorMethod > 0.) &&
     318
     319      const Float_t rSigmaSquareRelErrSquare = (sigmaSquareErrSquare + pedRmsSquareErrSquare)
     320        / (fRSigmaSquare * fRSigmaSquare) ;
     321 
     322      //
     323      // Calculate the number of phe's from the F-Factor method
     324      // (independent on Hi Gain or Lo Gain)
     325      //
     326      fPheFFactorMethod = fFactor * chargeSquare / fRSigmaSquare;
     327
     328      const Float_t pheFFactorRelErrSquare =  fFactorRelErrSquare
     329                                            + chargeSquareRelErrSquare
     330                                            + rSigmaSquareRelErrSquare ;
     331         
     332      fPheFFactorMethodError        =  TMath::Sqrt(pheFFactorRelErrSquare) * fPheFFactorMethod;
     333
     334      //
     335      // Calculate the conversion factors
     336      //
     337      if (fHiGainSaturation)
     338        ApplyLoGainConversion();
     339     
     340      const Float_t chargeRelErrSquare = fErrCharge*fErrCharge / (fCharge * fCharge);
     341     
     342      fConversionFFactorMethod        =  fPheFFactorMethod / fCharge ;
     343      fConversionErrorFFactorMethod   =  ( pheFFactorRelErrSquare + chargeRelErrSquare )
     344                                         * fConversionFFactorMethod * fConversionFFactorMethod;
     345     
     346      if ( IsFitValid()                     &&
     347           (fConversionFFactorMethod > 0.) &&
    304348           (fConversionErrorFFactorMethod/fConversionFFactorMethod < 0.1) )
    305349        fFFactorMethodValid = kTRUE;
    306350     
    307 
     351     
    308352    } /*   if ((fPed > 0.)  && (fPedRms > 0.)) */
    309353
    310354  return kTRUE;
     355 
     356}
     357
     358
     359void MCalibrationPix::ApplyLoGainConversion()
     360{
     361 
     362  const Float_t chargeRelErrSquare     =   fErrCharge*fErrCharge
     363                                         /(   fCharge *  fCharge);
     364  const Float_t sigmaRelErrSquare      =   fErrSigmaCharge*fErrSigmaCharge
     365                                         /(   fSigmaCharge *  fSigmaCharge);
     366  const Float_t conversionRelErrSquare =   fConversionHiLoError*fConversionHiLoError
     367                                         /(fConversionHiLo    * fConversionHiLo);
     368 
     369  fCharge         *= fConversionHiLo;
     370  fErrCharge       = TMath::Sqrt(chargeRelErrSquare + conversionRelErrSquare) * fCharge;
     371 
     372  fSigmaCharge    *= fConversionHiLo;
     373  fErrSigmaCharge =  TMath::Sqrt(sigmaRelErrSquare + conversionRelErrSquare) * fSigmaCharge;
    311374 
    312375}
  • trunk/MagicSoft/Mars/manalysis/MCalibrationPix.h

    r2719 r2725  
    1212private:
    1313
    14   Int_t   fPixId;           // the pixel Id
     14  Int_t   fPixId;                        // the pixel Id
    1515 
    16   Float_t fCharge;              // The mean reduced charge after the fit
    17   Float_t fErrCharge;           // The error of reduced mean charge after the fit
    18   Float_t fSigmaCharge;         // The sigma of the mean charge after the fit
    19   Float_t fErrSigmaCharge;      // The error of the sigma of the mean charge after the fit
    20   Float_t fRSigmaSquare;        // The reduced squares of sigmas after the fit
    21   Float_t fChargeProb;          // The probability of the fit function
     16  Float_t fCharge;                       // The mean reduced charge after the fit
     17  Float_t fErrCharge;                    // The error of reduced mean charge after the fit
     18  Float_t fSigmaCharge;                  // The sigma of the mean charge after the fit
     19  Float_t fErrSigmaCharge;               // The error of the sigma of the mean charge after the fit
     20  Float_t fRSigmaSquare;                 // The reduced squares of sigmas after the fit
     21  Float_t fChargeProb;                   // The probability of the fit function
    2222
    23   Float_t fPed;                 // The mean pedestal (from MPedestalPix)
    24   Float_t fPedRms;              // The pedestal  RMS (from MPedestalPix)
    25   Float_t fErrPedRms;           // The error of the pedestal  RMS (from MPedestalPix) 
    26   Float_t fElectronicPedRms;    // The pure electronic component of the RMS
    27   Float_t fErrElectronicPedRms; // The error of the pure electronic component of the RMS
     23  Float_t fPed;                          // The mean pedestal (from MPedestalPix)
     24  Float_t fPedRms;                       // The pedestal  RMS (from MPedestalPix)
     25  Float_t fErrPedRms;                    // The error of the pedestal  RMS (from MPedestalPix) 
     26  Float_t fElectronicPedRms;             // The pure electronic component of the RMS
     27  Float_t fErrElectronicPedRms;          // The error of the pure electronic component of the RMS
    2828
    29   Float_t fTime;                // The mean arrival time after the fit 
    30   Float_t fSigmaTime;           // The error of the mean arrival time after the fit
    31   Float_t fTimeChiSquare;       // The probability of the fit function
     29  Float_t fTime;                         // The mean arrival time after the fit 
     30  Float_t fSigmaTime;                    // The error of the mean arrival time after the fit
     31  Float_t fTimeChiSquare;                // The probability of the fit function
    3232 
    33   Float_t fFactor;                  // The laboratory F-factor
    34   Float_t fFactorError;             // The laboratory F-factor Error
    35   Float_t fPheFFactorMethod;        // The number of Phe's calculated after the F-factor method
    36   Float_t fPheFFactorMethodError;   // The error on the number of Phe's calculated after the F-factor method 
     33  Float_t fFactor;                       // The laboratory F-factor
     34  Float_t fFactorError;                  // The laboratory F-factor Error
     35  Float_t fPheFFactorMethod;             // The number of Phe's calculated (F-factor method)
     36  Float_t fPheFFactorMethodError;        // The error on the number of Phe's calculated (F-factor method)
    3737
    38   Float_t fConversionFFactorMethod;    // The conversion factor to Ph's calculated after the F-factor method
    39   Float_t fConversionBlindPixelMethod; // The conversion factor to Ph's calculated after the Blind Pixel method
    40   Float_t fConversionPINDiodeMethod;   // The conversion factor to Ph's calculated after the PIN Diode method
     38  Float_t fConversionFFactorMethod;      // The conversion factor to Phe's (F-factor method)
     39  Float_t fConversionBlindPixelMethod;   // The conversion factor to Ph's (Blind Pixel method)
     40  Float_t fConversionPINDiodeMethod;     // The conversion factor to Ph's (PIN Diode method)
    4141
    42   Float_t fConversionErrorFFactorMethod;    // The conversion factor to Phe's calculated after the F-factor method
    43   Float_t fConversionErrorBlindPixelMethod; // The conversion factor to Phe's calculated after the Blind Pixel method
    44   Float_t fConversionErrorPINDiodeMethod;   // The conversion factor to Phe's calculated after the PIN Diode method
     42  Float_t fConversionErrorFFactorMethod;    // The error of the conversion factor to Phe's (F-factor method)
     43  Float_t fConversionErrorBlindPixelMethod; // The error of the conversion factor to Ph's (Blind Pixel method)
     44  Float_t fConversionErrorPINDiodeMethod;   // The error of the conversion factor to Ph's (PIN Diode method)
    4545
    46   Float_t fConversionSigmaFFactorMethod;    // The conversion factor to Ph's calculated after the F-factor method
    47   Float_t fConversionSigmaBlindPixelMethod; // The conversion factor to Ph's calculated after the Blind Pixel method
    48   Float_t fConversionSigmaPINDiodeMethod;   // The conversion factor to Phd's calculated after the PIN Diode method
     46  Float_t fConversionSigmaFFactorMethod;    // The sigma of conversion factor to Ph's (F-factor method)
     47  Float_t fConversionSigmaBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method)
     48  Float_t fConversionSigmaPINDiodeMethod;   // The conversion factor to Phd's (PIN Diode method)
    4949
    50   Bool_t  fHiGainSaturation;     // Is Lo-Gain used at all?
     50  Float_t fConversionHiLo;                  // The conversion factor between Hi Gain and Lo Gain 
     51  Float_t fConversionHiLoError;             // The error of the conversion factor between Hi Gain and Lo Gain 
     52 
     53  Bool_t  fHiGainSaturation;                // Is Lo-Gain used at all?
    5154
    5255  Bool_t  fFitValid;       
     
    8184
    8285  void SetPedestal(Float_t ped, Float_t pedrms);
    83   void SetHiGainSaturation()                        { fHiGainSaturation = kTRUE; fHist->SetUseLoGain(); }
     86  void SetHiGainSaturation()                               { fHiGainSaturation = kTRUE; fHist->SetUseLoGain(); }
    8487
     88  void ApplyLoGainConversion();
     89
     90  void SetConversionHiLo(Float_t c)                       { fConversionHiLo      = c;    }
     91  void SetConversionHiLoError(Float_t e)                    { fConversionHiLoError = e;    }
     92
     93  Float_t GetConversionHiLo()                       { return fConversionHiLo;        }
     94  Float_t GetConversionHiLoError()                  { return fConversionHiLoError;   }
     95 
    8596  void SetConversionFFactorMethod(Float_t c, Float_t err, Float_t sig)     
    8697                                                    {
     
    136147  void   SetFitValid()                                     { fFitValid = kTRUE;  }
    137148  void   SetFitted()                                      { fFitted = kTRUE;  }
    138   void   SetBlindPixelMethodValid()                             { fBlindPixelMethodValid = kTRUE;  }
    139   void   SetFFactorMethodValid()                               { fFFactorMethodValid = kTRUE;  }
    140   void   SetPINDiodeMethodValid()                              { fPINDiodeMethodValid = kTRUE;  }
     149  void   SetBlindPixelMethodValid(Bool_t b=kTRUE)               { fBlindPixelMethodValid = b;  }
     150  void   SetFFactorMethodValid(Bool_t b=kTRUE)                 { fFFactorMethodValid = b;  }
     151  void   SetPINDiodeMethodValid(Bool_t b=kTRUE)                { fPINDiodeMethodValid = b;  }
    141152 
    142153  Int_t  GetPixId()                              const  { return fPixId;   }
  • trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc

    r2715 r2725  
    5959                    const char *name, const char *title)
    6060  : fNumHiGainSamples(last-first+1), fNumLoGainSamples(last-first+1),
    61     fSaturationLimit(254), fConversionHiLo(10.)
     61    fSaturationLimit(254)
    6262{
    6363
     
    215215        pix.SetExtractedSignal((Float_t)sumHi - pedes*(Float_t)fNumHiGainSamples,
    216216                               pedrms*fSqrtHiGainSamples,
    217                                ((Float_t)sumLo - pedes*(Float_t)fNumLoGainSamples)*fConversionHiLo,
     217                               ((Float_t)sumLo - pedes*(Float_t)fNumLoGainSamples),
    218218                               pedrms*fSqrtLoGainSamples
    219219                               );
  • trunk/MagicSoft/Mars/manalysis/MExtractSignal.h

    r2715 r2725  
    4141
    4242  Byte_t  fSaturationLimit;
    43   Float_t fConversionHiLo;
    4443
    4544  Bool_t ReInit(MParList *pList);
     
    5049public:
    5150
    52   MExtractSignal(const Byte_t first=4, const Byte_t last=9, const Byte_t logainshift=1, const char *name=NULL, const char *title=NULL);
     51  MExtractSignal(const Byte_t first=4, const Byte_t last=9,
     52                 const Byte_t logainshift=1,
     53                 const char *name=NULL, const char *title=NULL);
    5354 
    5455  void SetSaturationLimit(Byte_t lim)      { fSaturationLimit = lim; }
    55   void SetConversionHiLo(Float_t con)      { fConversionHiLo = con; }
    5656
    5757  ClassDef(MExtractSignal, 0)   // Task to fill the Extracted Signal Containers from raw data
Note: See TracChangeset for help on using the changeset viewer.