Changeset 2669


Ignore:
Timestamp:
12/12/03 15:00:48 (21 years ago)
Author:
moralejo
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2668 r2669  
    44
    55                                                 -*-*- END OF LINE -*-*-
     6 2003/12/12: Abelardo Moralejo
     7
     8   * manalysis/MMcCalibrationCalc.[h,cc]
     9     - added fADC2PheInner, fADC2PheOuter and setter functions. Put
     10       these values into MCalibrationCam. Look for MExtractedSignalCam
     11       to check which gain branch has been used (relevant for the
     12       conversion factor) for each pixel.
     13
    614
    715 2003/12/12: Markus Gaug
  • trunk/MagicSoft/Mars/manalysis/MMcCalibrationCalc.cc

    r2648 r2669  
    2828//
    2929//  This task looks for the ìnformation about FADC pedestals in
    30 //  MMcFadcHeader and translates it to the pedestal mean and rms,
     30//  MMcFadcHeader and translates it to the pedestal mean and rms (in adc counts),
    3131//  and in the conversion factor between photons and ADC counts in
    3232//  MCalibrationCam.
     33//  Then we create and fill also the MPedPhotCam object containing the pedestal
     34//  rms in units of photons.
    3335//
    3436//  Input Containers:
     
    3840//  Output Containers:
    3941//   MCalibrationCam
     42//   MPedPhotCam
    4043//
    4144/////////////////////////////////////////////////////////////////////////////
     
    4952#include "MCalibrationPix.h"
    5053#include "MCalibrationCam.h"
     54#include "MExtractedSignalCam.h"
     55#include "MExtractedSignalPix.h"
     56#include "MPedPhotCam.h"
     57#include "MPedPhotPix.h"
    5158
    5259#include "MRawRunHeader.h"
     
    6168    fName  = name  ? name  : "MMcCalibrationCalc";
    6269    fTitle = title ? title : "Write MC pedestals and conversion factors into MCalibration Container";
     70
     71    fADC2PheInner = 1.;
     72    fADC2PheOuter = 1.;
    6373
    6474}
     
    94104    return kTRUE;
    95105
    96   return pList->FindCreateObj(AddSerialNumber("MCalibrationCam")) ? kTRUE : kFALSE;
     106  if ( ! pList->FindCreateObj(AddSerialNumber("MCalibrationCam")))
     107    {
     108      *fLog << err << dbginf << "Cannot create MCalibrationCam... aborting." << endl;
     109      return kFALSE;
     110    }
     111
     112  fSignalCam = (MExtractedSignalCam*) pList->FindObject(AddSerialNumber("MExtractedSignalCam"));
     113  if ( ! fSignalCam)
     114    {
     115      *fLog << err << dbginf << "Cannot find MExtractedSignalCam... aborting." << endl;
     116      return kFALSE;
     117    }
     118
     119  return kTRUE;
     120
    97121}
    98122
     
    122146    }
    123147
    124     fCalCam = (MCalibrationCam*)pList->FindCreateObj(AddSerialNumber("MCalibrationCam"));
     148    fCalCam = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationCam"));
    125149
    126150    if (!fCalCam)
     
    144168    for (int i=0; i<num; i++)
    145169    {
    146         MCalibrationPix &pix = (*fCalCam)[i];
     170        MCalibrationPix &calpix = (*fCalCam)[i];
     171        MExtractedSignalPix &sigpix = (*fSignalCam)[i];
    147172
    148         const Float_t pedestmean = fHeaderFadc->GetPedestal(i);
    149         const Float_t pedestrms  = fHeaderFadc->GetPedestalRmsHigh(i);
    150         // per slice
     173        const Float_t pedestmean = sigpix.IsLoGainUsed()?
     174          fSignalCam->GetNumUsedLoGainFADCSlices()*fHeaderFadc->GetPedestal(i) :
     175          fSignalCam->GetNumUsedHiGainFADCSlices()*fHeaderFadc->GetPedestal(i);
    151176
    152         pix.SetPedestal(pedestmean, pedestrms);
     177        const Float_t pedestrms  = sigpix.IsLoGainUsed()?
     178          sqrt((Double_t)(fSignalCam->GetNumUsedLoGainFADCSlices())) * fHeaderFadc->GetPedestalRmsLow(i) :
     179          sqrt((Double_t)(fSignalCam->GetNumUsedHiGainFADCSlices())) * fHeaderFadc->GetPedestalRmsHigh(i);
     180
     181        // ped mean and rms per pixel, according to signal calculation:
     182
     183        calpix.SetPedestal(pedestmean, pedestrms);
     184
     185        if (i < 397) // FIXME!
     186          calpix.SetConversionBlindPixelMethod(fADC2PheInner, 0., 0.);
     187        else
     188          calpix.SetConversionBlindPixelMethod(fADC2PheOuter, 0., 0.);
     189
    153190    }
    154191
  • trunk/MagicSoft/Mars/manalysis/MMcCalibrationCalc.h

    r2648 r2669  
    88class MCalibrationCam;
    99class MMcFadcHeader;
     10class MExtractedSignalCam;
    1011
    1112class MMcCalibrationCalc : public MTask
     
    1718    Bool_t ReInit(MParList *pList);
    1819
    19     MCalibrationCam *fCalCam;
    20     MMcFadcHeader   *fHeaderFadc;
     20    MCalibrationCam     *fCalCam;
     21    MMcFadcHeader       *fHeaderFadc;
     22    MExtractedSignalCam *fSignalCam;
     23
     24    Float_t fADC2PheInner;
     25    Float_t fADC2PheOuter;
    2126
    2227public:
    2328    MMcCalibrationCalc(const char *name=NULL, const char *title=NULL);
     29
     30    void SetADC2PheInner(Float_t x) {fADC2PheInner = x; }
     31    void SetADC2PheOuter(Float_t x) {fADC2PheOuter = x; }
    2432
    2533    ClassDef(MMcCalibrationCalc, 0)   // Task which obtains, for MC files, the pedestal mean and rms, and the calibration factor from ADC counts to photons.
Note: See TracChangeset for help on using the changeset viewer.