Changeset 18479 for trunk/Mars/manalysis


Ignore:
Timestamp:
04/30/16 18:38:36 (8 years ago)
Author:
tbretz
Message:
After some study this seems right now to be the most consistent implementation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/manalysis/MSoftwareTrigger.cc

    r18478 r18479  
    106106    MArrayF buf(160*num);
    107107
     108    double avg = 0;
     109
    108110    for (int hw=0; hw<1440; hw++)
    109111    {
     
    121123            continue;
    122124
    123         const UInt_t sw = idx[hw];
    124 
    125         const Float_t *raw = fSignal->GetSamples(sw);
     125        const Float_t *raw = fSignal->GetSamples(idx[hw]);
    126126
    127127        Float_t *sum = buf.GetArray()+(hw/9)*num;
     
    154154*/
    155155
    156     Float_t max = 0;
    157     double avg = 0;
     156    Float_t max = -50000;
    158157
    159158    const UInt_t nsum = buf.GetSize();
     
    163162        Float_t v[4] = { 0, 0, 0, 0 };
    164163
    165         for (Float_t *ptr=sum+20; ptr<sum+num; ptr++)
     164        for (Float_t *ptr=sum+15; ptr<sum+num; ptr++)
    166165        {
    167             *ptr -= 0.6 * ptr[-20];
    168             avg += *ptr;
    169             v[idx++%4] = *ptr;
     166            ptr[0] -= 0.5*ptr[-15];
     167
     168            avg += ptr[0];
     169            v[idx++%4] = ptr[0];
    170170
    171171            const Float_t min = *std::min_element(v, v+4);
     
    175175    }
    176176
    177     avg /= num*(1440-9);  // excluding the 0's from the broken DRS board
     177    // Question: Should we also keep position and patch id?
     178
     179    avg /= (num-15)*(1440-24);
    178180
    179181    fTriggerSignal->SetVal(max);
Note: See TracChangeset for help on using the changeset viewer.