Changeset 17026


Ignore:
Timestamp:
08/19/13 16:34:29 (11 years ago)
Author:
tbretz
Message:
Directly use the calibrated currents from the feedback.
File:
1 edited

Legend:

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

    r16831 r17026  
    428428    {
    429429        // Check if received event is valid
    430         if (!CheckEventSize(evt, (416+6)*4))
     430        if (!CheckEventSize(evt, (2*416+8)*4))
    431431            return GetCurrentState();
    432432
     
    489489        avg_dev /= fCurrentsMed.size();
    490490
    491         // One could recalculate the median of all pixels incluing the
     491        // One could recalculate the median of all pixels including the
    492492        // correction for the three crazy pixels, but that is three out
    493493        // of 320. The effect on the median should be negligible anyhow.
     
    497497            {
    498498                const PixelMapEntry &hv = fMap.hv(i);
    499                 if (!hv)
    500                     continue;
    501 
    502                 // The current is proportional to the rate. To calculate
    503                 // a measure for the rate, the average current per pixel
    504                 // is caluclated for the trigger patch.
    505                 int weight = hv.group() ? 5 : 4;
    506 
    507                 // Use only the current in the pixels with the correct
    508                 // resistor as a reference, ignore the crazy ones.
    509                 // Effects of these should be corrected by the
    510                 // rate control later, not the initial setup.
    511                 if (i==66)           
    512                     weight = 4./(3+10);
    513                 if (i==191 || i==193)
    514                     weight = 5./(4+10);
    515 
    516                 vec[hv.hw()/9] += it->second[i] * weight;
     499                if (hv)
     500                    vec[hv.hw()/9] += it->second[i]*hv.count();
    517501            }
    518502
     
    531515        {
    532516            vec[i] /= fCurrentsVec.size()*9;
     517
    533518            avg2 += vec[i];
    534519
Note: See TracChangeset for help on using the changeset viewer.