Ignore:
Timestamp:
12/18/03 20:14:53 (21 years ago)
Author:
moralejo
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.