Ignore:
Timestamp:
01/15/07 12:06:22 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mpedestal
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mpedestal/MPedestalSubtract.cc

    r8158 r8250  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1.3 2006-10-24 12:39:00 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1.4 2007-01-15 12:06:15 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    128128
    129129    // initialize fSignal
    130     fSignal->InitSamples(fRawEvt->GetNumPixels(), numh+numl);
     130    fSignal->InitSamples(numh+numl);//, fRawEvt->GetNumPixels(), numh+numl);
    131131
    132132    // iterate over all pixels
     
    137137        const Int_t pixidx = pixel.GetPixelId();
    138138
     139        if (pixidx>=fSignal->GetNumPixels())
     140        {
     141            *fLog << err << "ERROR - Pixel index " << pixidx << " out of bounds... abort." << endl;
     142            return kERROR;
     143        }
    139144        // Get pointer were to store merged raw data
    140145        Byte_t *sample = fSignal->GetSamplesRaw(pixidx);
  • trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.cc

    r8154 r8250  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MPedestalSubtractedEvt.cc,v 1.1 2006-10-24 08:22:41 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MPedestalSubtractedEvt.cc,v 1.2 2007-01-15 12:06:15 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    4747// And reset its contents to 0.
    4848//
    49 void MPedestalSubtractedEvt::InitSamples(UInt_t pixels, UInt_t samples)
     49void MPedestalSubtractedEvt::InitSamples(UInt_t samples, UInt_t pixels)
    5050{
    5151    fNumSamples = samples;
    52     fNumPixels  = pixels;
    53 
    54     fSamples.Set(pixels*samples);
    55     fSamplesRaw.Set(pixels*samples);
     52
     53    if (pixels>0)
     54        fNumPixels = pixels;
     55
     56    fSamples.Set(fNumPixels*fNumSamples);
     57    fSamplesRaw.Set(fNumPixels*fNumSamples);
    5658
    5759    fSamples.Reset();
     
    169171}
    170172
     173/*
     174#include <TSpline.h>
     175#include "MArrayD.h"
     176void  MPedestalSubtractedEvt::InterpolateSaturation(const Int_t idx, Int_t limit, Int_t first, Int_t last) const
     177{
     178    MArrayD x(GetNumSamples());
     179    MArrayD y(GetNumSamples());
     180
     181    Float_t *s = GetSamples(idx);
     182
     183    Int_t n = 0;
     184    for (unsigned int i=0; i<GetNumSamples(); i++)
     185    {
     186        if (s[i]>limit)
     187            continue;
     188        x[n] = i;
     189        y[n] = s[i];
     190        n++;
     191    }
     192
     193    TSpline5 sp("", x.GetArray(), y.GetArray(), n);
     194
     195    for (unsigned int i=0; i<GetNumSamples(); i++)
     196    {
     197        if (s[i]>limit)
     198            s[i] = sp.Eval(i);
     199    }
     200}
     201*/
  • trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.h

    r8158 r8250  
    3030    }
    3131
    32     void InitSamples(UInt_t pixels, UInt_t samples);
     32    void InitSize(const UInt_t i) { fNumPixels=i; }
     33    void InitSamples(UInt_t samples, UInt_t pixels=0);
    3334
    3435    Float_t *GetSamples(UInt_t pixel) const;
     
    3940
    4041    Int_t GetSaturation(const Int_t idx, Int_t limit, Int_t &first, Int_t &last) const;
     42    //void  InterpolateSaturation(const Int_t idx, Int_t limit, Int_t first, Int_t last) const;
    4143    Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last, Int_t &val) const;
    4244    Int_t GetMax(const Int_t pixidx, const Int_t first, const Int_t last) const
Note: See TracChangeset for help on using the changeset viewer.