Ignore:
Timestamp:
10/24/06 13:40:58 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mpedestal
Files:
2 edited

Legend:

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

    r8154 r8158  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1.2 2006-10-24 08:18:07 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MPedestalSubtract.cc,v 1.3 2006-10-24 12:39:00 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    144144        memcpy(sample+numh, pixel.GetLoGainSamples(), numl);
    145145
    146         // if no pedestals are given we are finished
     146        // start of destination array, end of hi-gain destination array
     147        // and start of hi-gain samples
     148        Float_t *beg = fSignal->GetSamples(pixidx);
     149        Float_t *end = beg + fSignal->GetNumSamples();
     150
     151        const Byte_t *src = sample;
     152
     153        // if no pedestals are given just convert the data into
     154        // floats and we are finished
    147155        if (!fPedestals)
     156        {
     157            while (beg<end)
     158                *beg++ = *src++;
    148159            continue;
     160        }
    149161
    150162        // get pedestal information for this pixel
     
    155167        const Float_t ped = pedpix.GetPedestal();
    156168
    157         // start of destination array, end of hi-gain destination array
    158         // and start of hi-gain samples
    159         Float_t *beg = fSignal->GetSamples(pixidx);
    160         Float_t *end = beg + fSignal->GetNumSamples();
    161 
    162169        // determine with which pedestal (+/- AB offset) to start
    163170        const Bool_t  swap    = (ab&1)==1;
    164171        const Float_t offh    = swap ? -pedpix.GetPedestalABoffset() : pedpix.GetPedestalABoffset();
    165172        const Float_t mean[2] = { ped + offh, ped - offh };
    166 
    167         const Byte_t *src = sample;
    168173
    169174        // Copy hi-gains into array and substract pedestal
  • trunk/MagicSoft/Mars/mpedestal/MPedestalSubtractedEvt.h

    r8154 r8158  
    5656    }
    5757
     58    Int_t GetIntegralRaw(Int_t idx, Int_t first, Int_t last) const
     59    {
     60        Byte_t *ptr = GetSamplesRaw(idx);
     61
     62        const Byte_t *end = ptr + last - first + 1;
     63
     64        Int_t sum = 0;
     65        while (ptr<end)
     66            sum += *ptr++;
     67
     68        return sum;
     69    }
     70
    5871    Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const { return kTRUE; }
    5972    void   DrawPixelContent(Int_t num) const { }
Note: See TracChangeset for help on using the changeset viewer.