Changeset 2721 for trunk


Ignore:
Timestamp:
12/18/03 20:14:53 (21 years ago)
Author:
moralejo
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2720 r2721  
    66
    77 2003/12/18: Abelardo Moralejo
     8
     9   * manalysis/MMcCalibrationCalc.[h,cc]
     10     - Changed names of conversion factors, because their meaning
     11       changed from "ADC->photoelectrons" to "ADC->photons before
     12       the PM". Added some comments. Added calls to MCalibrationPix::
     13       SetBlindPixelMethodValid() and SetConversionBlindPixelMethod()
    814
    915   * manalysis/MCalibrate.cc
    1016     - Corrected variable names: Convertion -> Conversion, and also
    1117       removed the "f" in from of local (non-member) variables.
     18     - Added fGeomCam, fPedPhotCam (created in the PreProcess).
    1219
    1320 2003/12/18: Markus Gaug, Michele Doro
  • trunk/MagicSoft/Mars/manalysis/MMcCalibrationCalc.cc

    r2669 r2721  
    5454#include "MExtractedSignalCam.h"
    5555#include "MExtractedSignalPix.h"
     56#include "MGeomCam.h"
    5657#include "MPedPhotCam.h"
    5758#include "MPedPhotPix.h"
     
    6970    fTitle = title ? title : "Write MC pedestals and conversion factors into MCalibration Container";
    7071
    71     fADC2PheInner = 1.;
    72     fADC2PheOuter = 1.;
     72    fADC2PhInner = 1.;
     73    fADC2PhOuter = 1.;
    7374
    7475}
     
    110111    }
    111112
     113  if ( ! pList->FindCreateObj(AddSerialNumber("MPedPhotCam")))
     114    {
     115      *fLog << err << dbginf << "Cannot create MPedPhotCam... aborting." << endl;
     116      return kFALSE;
     117    }
     118
     119  fGeom = (MGeomCam*) pList->FindObject(AddSerialNumber("MGeomCam"));
     120  if ( ! fGeom )
     121    {
     122      *fLog << err << dbginf << "Cannot find MGeomCam... aborting." << endl;
     123      return kFALSE;
     124    }
     125
    112126  fSignalCam = (MExtractedSignalCam*) pList->FindObject(AddSerialNumber("MExtractedSignalCam"));
    113127  if ( ! fSignalCam)
     
    124138//
    125139// Check for the runtype.
    126 // Search for MCalibrationCam and MMcFadcHeader.
     140// Search for MCalibrationCam, MPedPhotCam and MMcFadcHeader.
    127141//
    128142Bool_t MMcCalibrationCalc::ReInit(MParList *pList)
     
    154168    }
    155169
     170    fPedPhotCam = (MPedPhotCam*)pList->FindObject(AddSerialNumber("MPedPhotCam"));
     171
     172    if (!fPedPhotCam)
     173    {
     174        *fLog << err << dbginf << "Could not create MPedPhotCam... aborting. " << endl;
     175        return kFALSE;
     176    }
     177
    156178    return kTRUE;
    157179}
     
    160182// --------------------------------------------------------------------------
    161183//
    162 // Fill the MCalibrationCam object
     184// Fill the MCalibrationCam and MCerPhotPed objects
    163185//
    164186Int_t MMcCalibrationCalc::Process()
     
    171193        MExtractedSignalPix &sigpix = (*fSignalCam)[i];
    172194
     195        //
     196        // ped mean and rms per pixel, in ADC counts, according to signal
     197        // calculation (hi or low gain and number of integrated slices):
     198        //
    173199        const Float_t pedestmean = sigpix.IsLoGainUsed()?
    174200          fSignalCam->GetNumUsedLoGainFADCSlices()*fHeaderFadc->GetPedestal(i) :
     
    179205          sqrt((Double_t)(fSignalCam->GetNumUsedHiGainFADCSlices())) * fHeaderFadc->GetPedestalRmsHigh(i);
    180206
    181         // ped mean and rms per pixel, according to signal calculation:
    182 
    183207        calpix.SetPedestal(pedestmean, pedestrms);
    184 
    185         if (i < 397) // FIXME!
    186           calpix.SetConversionBlindPixelMethod(fADC2PheInner, 0., 0.);
     208        calpix.SetBlindPixelMethodValid();
     209
     210        if ( fGeom->GetPixRatio(i) > fGeom->GetPixRatio(0) )
     211          calpix.SetConversionBlindPixelMethod(fADC2PhOuter, 0., 0.);
    187212        else
    188           calpix.SetConversionBlindPixelMethod(fADC2PheOuter, 0., 0.);
     213          calpix.SetConversionBlindPixelMethod(fADC2PhInner, 0., 0.);
    189214
    190215    }
Note: See TracChangeset for help on using the changeset viewer.