Ignore:
Timestamp:
12/19/03 15:41:03 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.