Changeset 8129 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
10/19/06 12:49:49 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8128 r8129  
    2323   * mpedestal/MHPedestalCam.[h,cc]:
    2424     - removed (due to inheritance it belongs to mhcalib)
     25
     26   * mbase/MArrayD.h, marrayF.h:
     27     - added GetSum() member function
    2528
    2629
  • trunk/MagicSoft/Mars/mbase/MArrayD.h

    r7808 r8129  
    157157    }
    158158
     159    Double_t GetSum() const
     160    {
     161        const Double_t *end = fArray+fN;
     162
     163        Double_t sum = 0;
     164        for (Double_t *ptr = fArray; ptr<end; ptr++)
     165            sum += *ptr;
     166        return sum;
     167    }
     168
    159169    static void  StripZeros(TArrayD &arr);
    160170    void  StripZeros();
  • trunk/MagicSoft/Mars/mbase/MArrayF.h

    r7808 r8129  
    163163    }
    164164
     165    Double_t GetSum() const
     166    {
     167        const Float_t *end = fArray+fN;
     168
     169        Double_t sum = 0;
     170        for (Float_t *ptr=fArray; ptr<end; ptr++)
     171            sum += *ptr;
     172
     173        return sum;
     174    }
     175
    165176    static void  StripZeros(TArrayF &arr);
    166177    void  StripZeros();
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc

    r7895 r8129  
    184184  // size of 6. The exact numbers have to be found still.
    185185  //
    186   fNumHiGainSamples = (Float_t)fWindowSizeHiGain/2.4;
    187   fNumLoGainSamples = (Float_t)fWindowSizeLoGain/2.4;
     186  fNumHiGainSamples = fAmpWeightsHiGain.GetSum()/fBinningResolutionHiGain;
     187  fNumLoGainSamples = fAmpWeightsLoGain.GetSum()/fBinningResolutionLoGain;
    188188  fSqrtHiGainSamples = TMath::Sqrt(fNumHiGainSamples);
    189189  fSqrtLoGainSamples = TMath::Sqrt(fNumLoGainSamples);
Note: See TracChangeset for help on using the changeset viewer.