Changeset 14991


Ignore:
Timestamp:
03/07/13 09:56:09 (12 years ago)
Author:
tbretz
Message:
Added calibration start and calibration end time to RATE_CONTROL/THRESHOLD and send QoS to signal what kind of result we have.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/HeadersRateControl.h

    r14432 r14991  
    1818            kInProgress,
    1919        };
    20     }
     20    };
     21
     22    struct DimThreshold
     23    {
     24        uint16_t threshold;
     25        double   begin;
     26        double   end;
     27    }  __attribute__((__packed__));
    2128}
    2229
  • trunk/FACT++/src/ratecontrol.cc

    r14990 r14991  
    5252
    5353    uint64_t fCounter;
     54
     55    Time fCalibrationTimeStart;
    5456
    5557    bool CheckEventSize(const EventImp &evt, size_t size)
     
    283285        {
    284286            fThresholds.assign(160, fThresholdMin);
    285             fDimThreshold.Update(fThresholdMin);
     287
     288            const RateControl::DimThreshold data = { fThresholdMin, fCalibrationTimeStart.Mjd(), Time().Mjd() };
     289            fDimThreshold.setQuality(0);
     290            fDimThreshold.Update(data);
     291
     292            ostringstream out;
     293            out << setprecision(3);
     294            out << "Measured rate " << fTriggerRate << "Hz below target rate " << fTargetRate << "... mininum threshold set to " << fThresholdMin;
     295            Info(out);
     296
    286297            return RateControl::State::kGlobalThresholdSet;
    287298        }
     
    294305        if (diff<=fThresholdMin)
    295306        {
    296             fDimThreshold.Update(fThresholdMin);
     307            const RateControl::DimThreshold data = { fThresholdMin, fCalibrationTimeStart.Mjd(), Time().Mjd() };
     308            fDimThreshold.setQuality(1);
     309            fDimThreshold.Update(data);
     310
     311            ostringstream out;
     312            out << setprecision(3);
     313            out << "Next step would be 0... mininum threshold set to " << fThresholdMin;
     314            Info(out);
     315
    297316            return RateControl::State::kGlobalThresholdSet;
    298317        }
     
    368387        fTriggerRate  = -1;
    369388        fCounter      = 0;
     389
     390        fCalibrationTimeStart = Time();
    370391
    371392        ostringstream out;
     
    455476        fDimFTM("FTM_CONTROL"),
    456477        fDimRS("RATE_SCAN"),
    457         fDimThreshold("RATE_CONTROL/THRESHOLD", "S:1", "Resulting threshold after calibration|threshold[dac]:Resulting threshold from calibration")
     478
     479        fDimThreshold("RATE_CONTROL/THRESHOLD", "S:1;D:1;D:1",
     480                      "Resulting threshold after calibration"
     481                      "|threshold[dac]:Resulting threshold from calibration"
     482                      "|begin[mjd]:Start time of calibration"
     483                      "|end[mjd]:End time of calibration")
    458484    {
    459485        // ba::io_service::work is a kind of keep_alive for the loop.
Note: See TracChangeset for help on using the changeset viewer.