Ignore:
Timestamp:
05/11/07 19:30:04 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mextralgo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mextralgo/MExtralgoDigitalFilter.cc

    r8218 r8500  
    3131#include "MExtralgoDigitalFilter.h"
    3232
     33#include <TRandom.h>
     34
    3335using namespace std;
    3436
    35 Float_t MExtralgoDigitalFilter::ExtractNoise(Int_t iter) const
     37Float_t MExtralgoDigitalFilter::ExtractNoise() const
    3638{
    37     return Eval(fWeightsAmp, 0, iter-fWeightsPerBin/2);
     39    const Int_t pos  = gRandom->Integer(fNum-fWindowSize+1);
     40    const Int_t frac = gRandom->Integer(fWeightsPerBin);
     41
     42    return Eval(fWeightsAmp, pos, frac-fWeightsPerBin/2);
    3843}
    3944
  • trunk/MagicSoft/Mars/mextralgo/MExtralgoDigitalFilter.h

    r8154 r8500  
    161161    void GetTime(Float_t &sig, Float_t &dsig) const   { sig=fTime; dsig=fTimeDev; }
    162162
    163     Float_t ExtractNoise(Int_t iter) const;
     163    Float_t ExtractNoise() const;
    164164    void Extract(Int_t maxpos=-1);
    165165
  • trunk/MagicSoft/Mars/mextralgo/MExtralgoSpline.cc

    r8480 r8500  
    225225}
    226226
    227 Float_t MExtralgoSpline::ExtractNoise(/*Int_t iter*/)
     227Float_t MExtralgoSpline::ExtractNoise()
    228228{
    229229    if (fNum<5)
    230230        return 0;
    231231
    232     // FIXME: Shell we keep the extraction inside one slice
    233     // or randomize it along the extraction window?
    234     const Float_t nsx = gRandom->Uniform(); //iter * fResolution;
    235 
    236232    if (fExtractionType == kAmplitude)
    237         return Eval(2, nsx);
     233    {
     234        const Int_t   pos = gRandom->Integer(fNum-1);
     235        const Float_t nsx = gRandom->Uniform();
     236        return Eval(pos, nsx);
     237    }
    238238    else
    239         return CalcIntegral(2 + nsx);
     239    {
     240        const Float_t pos = gRandom->Uniform(fNum-1-fRiseTime-fFallTime)+fRiseTime;
     241        return CalcIntegral(pos);
     242    }
    240243}
    241244
Note: See TracChangeset for help on using the changeset viewer.