Ignore:
Timestamp:
04/16/04 19:17:36 (21 years ago)
Author:
moralejo
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
2 edited

Legend:

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

    r3689 r3768  
    3939//   MMcFadcHeader
    4040//   MRawRunHeader
    41 //  [MCalibrationCam] (if it existed previously)
     41//  [MCalibrationChargeCam] (if it existed previously)
     42//  [MCalibrationQECam] (if it existed previously)
    4243//
    4344//  Output Containers:
    4445//   MPedPhotCam
    45 //  [MCalibrationCam] (if it did not exist previously)
     46//  [MCalibrationChargeCam] (if it did not exist previously)
     47//  [MCalibrationQECam] (if it did not exist previously)
    4648//
    4749/////////////////////////////////////////////////////////////////////////////
     
    7880    fTitle = title ? title : "Write MC pedestals and conversion factors into MCalibration Container";
    7981
    80     fADC2PhInner = 1.;
    81     fADC2PhOuter = 1.;
     82    //
     83    // As default we set 1 photon = 1 ADC count.
     84    // (this will make Size to be in ADC counts if no previous calibration has been made)
     85    // Hence:
     86    //
     87    fADC2PhElInner = MCalibrationQEPix::gkDefaultAverageQE;
     88    fADC2PhElOuter = MCalibrationQEPix::gkDefaultAverageQE;
    8289
    8390    fAmplitude = -1.;
     
    114121{
    115122    fCalCam = (MCalibrationChargeCam*) pList->FindObject(AddSerialNumber("MCalibrationChargeCam"));
    116     if (!fCalCam)
     123    fQECam = (MCalibrationQECam*) pList->FindObject(AddSerialNumber("MCalibrationQECam"));
     124
     125    if (!fCalCam || !fQECam)
    117126    {
    118127        fCalCam = (MCalibrationChargeCam*) pList->FindCreateObj(AddSerialNumber("MCalibrationChargeCam"));
    119         if (!fCalCam)
     128        fQECam = (MCalibrationQECam*) pList->FindCreateObj(AddSerialNumber("MCalibrationQECam"));
     129        if (!fCalCam || !fQECam)
    120130            return kFALSE;
    121131    }
     
    123133    {
    124134        fFillCalibrationCam = kFALSE;
    125         *fLog << inf << AddSerialNumber("MCalibrationChargeCam") << " already exists... " << endl;
    126     }
    127 
    128     fQECam = (MCalibrationQECam*) pList->FindObject(AddSerialNumber("MCalibrationQECam"));
    129     if (!fQECam)
    130     {
    131         fQECam = (MCalibrationQECam*) pList->FindCreateObj(AddSerialNumber("MCalibrationQECam"));
    132         if (!fQECam)
    133             return kFALSE;
    134     }
    135     else
    136     {
    137         fFillQECam = kFALSE;
    138         *fLog << inf << AddSerialNumber("MCalibrationQECam") << " already exists... " << endl;
    139     }
    140 
     135        *fLog << inf << AddSerialNumber("MCalibrationChargeCam") << " and " <<
     136          AddSerialNumber("MCalibrationQECam") << " already exist... " << endl;
     137    }
    141138
    142139    fPedPhotCam = (MPedPhotCam*) pList->FindCreateObj(AddSerialNumber("MPedPhotCam"));
     
    246243
    247244    if (fOuterPixelsGainScaling)
    248       fADC2PhOuter = fADC2PhInner * (fAmplitude / fAmplitudeOuter);
     245      fADC2PhElOuter = fADC2PhElInner * (fAmplitude / fAmplitudeOuter);
    249246    else
    250       fADC2PhOuter = fADC2PhInner;
     247      fADC2PhElOuter = fADC2PhElInner;
    251248
    252249
     
    272269        // and outer pixels).
    273270        //
    274         Float_t adc2phot = (fGeom->GetPixRatio(i) < fGeom->GetPixRatio(0))?
    275           fADC2PhOuter : fADC2PhInner;
    276 
    277         //
    278         // FIXME: This has now to be split into a adc2phe part and a phe2phot (==QE) part
    279         //
    280         const Float_t qe = MCalibrationQEPix::gkDefaultAverageQE;
    281         calpix.SetMeanConvFADC2Phe(adc2phot*qe); // here, the FADC to phe part should go.
     271        Float_t adc2photel = (fGeom->GetPixRatio(i) < fGeom->GetPixRatio(0))?
     272          fADC2PhElOuter : fADC2PhElInner;
     273
     274        calpix.SetMeanConvFADC2Phe(adc2photel);
    282275        calpix.SetMeanConvFADC2PheVar(0.);
    283276        calpix.SetMeanFFactorFADC2Phot(0.);
     
    334327
    335328        MCalibrationChargePix &calpix = (MCalibrationChargePix&)(*fCalCam)[i];
    336         //        MCalibrationQEPix     &qepix  = (MCalibrationQEPix&)    (*fQECam) [i];
    337 
    338         Float_t qe       = MCalibrationQEPix::gkDefaultAverageQE;
     329        MCalibrationQEPix &qepix = (MCalibrationQEPix&)(*fQECam)[i];
     330
     331        qepix.SetAvNormFFactor(1.);
     332        // This factor should convert the default average QE to average QE for a spectrum
     333        // like that of Cherenkov light. See the documentration of MCalibrationQEPix.
     334
     335        Float_t qe       = qepix.GetAverageQE();
    339336        Float_t adc2phot = calpix.GetMeanConvFADC2Phe() / qe;
    340337        Float_t hi2lo    = calpix.GetConversionHiLo();
  • trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.h

    r3689 r3768  
    2828    MExtractedSignalCam   *fSignalCam;
    2929
    30     Float_t fADC2PhInner; // Conversion factor from ADC counts to photo-electrons
    31     Float_t fADC2PhOuter; // for inner and outer pixels.
     30    Float_t fADC2PhElInner; // Conversion factor from ADC counts to photo-electrons
     31    Float_t fADC2PhElOuter; // for inner and outer pixels.
    3232
    3333    Bool_t  fFillCalibrationCam;
    34     Bool_t  fFillQECam;   
    3534    Bool_t  fOuterPixelsGainScaling;
    3635
Note: See TracChangeset for help on using the changeset viewer.