Ignore:
Timestamp:
02/09/05 19:37:19 (20 years ago)
Author:
moralejo
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r5977 r6318  
    3030//  MMcFadcHeader and translates it to the pedestal mean and rms (in adc counts).
    3131//  If not already existing in the parameter list, an MCalibrationCam object
    32 //  is created, with the conversion factor between photons and ADC counts is
    33 //  set to 1 to allow the analysis to proceed.
     32//  is created, with the conversion factor between ADC counts and photons or
     33//  photoelectrons (depending on fSignalType) is set to 1 to allow the analysis
     34//  to proceed.
    3435//
    3536//  Then it creates and fills also the MPedPhotCam object containing the pedestal
    36 //  mean and rms in units of photons.
     37//  mean and rms in units of photons or photoelectrons.
    3738//
    3839//  Input Containers:
     
    7172#include "MMcFadcHeader.hxx"
    7273#include "MMcConfigRunHeader.h"
     74#include "MCalibrateData.h"
    7375
    7476ClassImp(MMcCalibrationUpdate);
     
    8587    fAmplitudeOuter = -1.;
    8688    fConversionHiLo = -1.;
     89
     90    fSignalType = MCalibrateData::kPhe;
    8791
    8892    fFillCalibrationCam = kTRUE;
     
    221225    // If MCalibrationChargeCam and MCalibrationQECam already existed
    222226    // in the parameter list before MMcCalibrationUpdate::PreProcess was
    223     // executed (from a previous calibration loop) we must not fill it,
     227    // executed (from a previous calibration loop) we must not fill them,
    224228    // hence nothing else has to be done in ReInit:
    225229    //
     
    233237    // perpendicular to the camera plane.
    234238    //
    235     // FIXME! We should look for AddSerialNumber("MMcConfigRunHeader") but
     239    // FIXME! We look for AddSerialNumber("MMcConfigRunHeader") but
    236240    // for the moment the stereo version of camera does not write one such
    237241    // header per telescope (it should!)
     
    254258    // (at angle = 90 deg)
    255259
    256     // Set now the default conversion from ADC counts to "photoelectrons"
     260    // Set now the default conversion from ADC counts to photoelectrons
    257261    // (in case no previous calibration existed in the parameter list).
    258     // As default we want 1 photon = 1 inner pixel ADC count
    259     // (this will make Size to be in ADC counts, which is what we want for
    260     // the MC calibration loop). To achieve this we set the ADC to
    261     // photoelectron conversion equal to the QE, which will later make the
    262     // ADC to photon conversion factor (= ADC2PhotEl/QE) to be = 1.
    263     //
    264     fADC2PhElInner = MCalibrationQEPix::gkDefaultAverageQE;
     262    //
     263    // As default we want to have SIZE in ADC counts, or rather, in "inner pixel
     264    // equivalent ADC counts".
     265    //
     266    // To achieve this:
     267    // - In the case fSignalType==kPhot: we set the ADC to photoelectron conversion
     268    // equal to the QE, which will later make the ADC to photon conversion factor
     269    // (= ADC2PhotEl/QE) to be = 1,
     270    //
     271    // - In the case fSignalType==kPhe: we set the ADC to photoelectron conversion
     272    // equal to 1, since this will be applied directly to the signals...
     273
     274    if (fSignalType == MCalibrateData::kPhot)
     275      fADC2PhElInner = MCalibrationQEPix::gkDefaultAverageQE;
     276    else
     277      fADC2PhElInner = 1.;
    265278
    266279    //
     
    281294
    282295    if (fOuterPixelsGainScaling)
    283       fADC2PhElOuter =  MCalibrationQEPix::gkDefaultAverageQE
     296      fADC2PhElOuter = fADC2PhElInner
    284297        * (fAmplitude / fAmplitudeOuter);
    285298    else
     
    397410
    398411        Float_t qe       = qepix.GetAverageQE();
    399         Float_t adc2phot = calpix.GetMeanConvFADC2Phe() / qe;
     412
     413
     414        Float_t conv = (fSignalType == MCalibrateData::kPhot?
     415          calpix.GetMeanConvFADC2Phe() / qe  :
     416          calpix.GetMeanConvFADC2Phe());
     417
    400418        Float_t hi2lo    = calpix.GetConversionHiLo();
    401419
    402420        if (sigpix.IsLoGainUsed())
    403             pedpix.Set(adc2phot*hi2lo*pedestmean, adc2phot*hi2lo*pedestrms);
     421            pedpix.Set(conv*hi2lo*pedestmean, conv*hi2lo*pedestrms);
    404422        else
    405             pedpix.Set(adc2phot*pedestmean, adc2phot*pedestrms);
     423            pedpix.Set(conv*pedestmean, conv*pedestrms);
    406424
    407425    }
     
    409427    return kTRUE;
    410428}
     429
Note: See TracChangeset for help on using the changeset viewer.