Changeset 13562


Ignore:
Timestamp:
05/04/12 19:52:00 (13 years ago)
Author:
tbretz
Message:
Removed event counter - there is only one event per second anyway; implemented different scaling depending on whether the event is calibrated or not
File:
1 edited

Legend:

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

    r13555 r13562  
    6868    deque<float> fFtmControlTriggerRateHist;
    6969
    70     uint8_t fFadControlEventCounter;
    71 
    7270    // ------------- Initialize variables before the Dim stuff ------------
    7371
     
    383381            return;
    384382
    385         //if (fFadControlEventCounter++%30)
    386         //    return;
    387383
    388384        //const float *avg = d.ptr<float>();
    389385        //const float *rms = d.ptr<float>(1440*sizeof(float));
    390         const float *max = d.ptr<float>(1440*sizeof(float)*2);
     386        const float *dat = d.ptr<float>(1440*sizeof(float)*2);
    391387        //const float *pos = d.ptr<float>(1440*sizeof(float)*3);
    392388
    393         vector<float> dat(160, 0);
     389        vector<float> max(160, -2000);
    394390        for (int i=0; i<1440; i++)
    395391        {
    396392            const int idx = fPixelMap.index(i).hw()/9;
    397             if (max[i]>dat[idx])
    398                 dat[idx]=max[i];
    399             //dat[idx] += max[i];
    400         }
    401 
    402         WriteBinary("fadcontrol-eventdata", dat, 4000, 2000);
     393            if (dat[i]>max[idx])
     394                max[idx]=dat[i];
     395        }
     396
     397        switch (d.qos)
     398        {
     399        case 0:  WriteBinary("fadcontrol-eventdata", max, 2000, 1000); break;
     400        case 1:  WriteBinary("fadcontrol-eventdata", max, 2000,    0); break;
     401        default: WriteBinary("fadcontrol-eventdata", max, 1000,  500); break;
     402        }
    403403    }
    404404
     
    617617public:
    618618    StateMachineSmartFACT(ostream &out=cout) : StateMachineDim(out, "SMART_FACT"),
    619         fFadControlEventCounter(0),
    620619        //---
    621620        fStatusDim         (make_pair(Time(), -2)),
Note: See TracChangeset for help on using the changeset viewer.