Changeset 11741 for trunk/FACT++


Ignore:
Timestamp:
08/02/11 20:19:52 (13 years ago)
Author:
tbretz
Message:
Fixed scale for gain and secondaroy offset; increase fStep after Close(); changed some variable types to match the big range needed for the gain and secondary baseline.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/DataCalib.cc

    r11732 r11741  
    1111
    1212vector<int32_t> DataCalib::fOffset(1440*1024, 0);
    13 vector<int32_t> DataCalib::fGain  (1440*1024, 2);
    14 vector<int32_t> DataCalib::fTrgOff(1440*1024, 0);
     13vector<int64_t> DataCalib::fGain  (1440*1024, 2);
     14vector<int64_t> DataCalib::fTrgOff(1440*1024, 0);
    1515vector<float>   DataCalib::fStats (1440*1024*6+3);
    1616
     
    172172        fNumOffset = fNumEntries;
    173173
     174        cout << "NUM_OFF=" << fNumOffset << endl;
     175
    174176        // 0.5: Scale from ADC to Millivolt
    175177        GetSampleStats(fStats.data()+3, 0.5);
     
    179181    {
    180182        fGain.assign(fSum.begin(), fSum.end());
    181         //fNumGain = fNumEntries*1000;
     183        fNumGain = fNumEntries*fNumOffset;
    182184
    183185        // DAC:  0..2.5V == 0..65535
    184186        // V-mV: 1000
     187        //fNumGain *= 2500*50000;
     188        //for (int i=0; i<1024*1440; i++)
     189        //    fGain[i] *= 65536;
     190        fNumGain *= 1953125;
    185191        for (int i=0; i<1024*1440; i++)
    186             fGain[i] *= 125;
    187         fNumGain = fNumEntries * 65535;
     192            fGain[i] *= 1024;
    188193
    189194        // 0.5: Scale from ADC to Millivolt
    190         GetSampleStats(fStats.data()+1024*1440*2+3, 0.5);
     195        GetSampleStats(fStats.data()+1024*1440*2+3, 1./fNumOffset);//0.5);
    191196        reinterpret_cast<uint32_t*>(fStats.data())[1] = GetRunId();;
    192197    }
     
    194199    {
    195200        fTrgOff.assign(fSum.begin(), fSum.end());
    196         fNumTrgOff = fNumEntries;
     201        fNumTrgOff = fNumEntries*fNumOffset;
    197202
    198203        // 0.5: Scale from ADC to Millivolt
    199         GetSampleStats(fStats.data()+1024*1440*4+3, 0.5);
     204        GetSampleStats(fStats.data()+1024*1440*4+3, 1./fNumOffset);//0.5);
    200205        reinterpret_cast<uint32_t*>(fStats.data())[2] = GetRunId();;
    201206    }
     
    207212
    208213    fDim.Update(fStats);
     214
     215    fStep++;
    209216
    210217    return true;
Note: See TracChangeset for help on using the changeset viewer.