#ifndef HVFEEDBACK_H_SEEN #define HVFEEDBACK_H_SEEN #define BUF_LENGTH 1000 #include #include "RawDataCTX.h" #include "DAQReadout.h" #include "SlowData.h" enum FBState {FB_Off, FB_Active, FB_Targets, FB_ResponseFirst, FB_ResponseSecond}; class HVFeedback { class DAQReadout *m; class PixelMap *PixMap; class SlowData *SlowDataClass; FBState FBMode; float (*Average)[kNumberOfChips][kNumberOfChannels]; float (*Sigma)[kNumberOfChips][kNumberOfChannels]; float (*Response)[kNumberOfChips][kNumberOfChannels]; float (*Target)[kNumberOfChips][kNumberOfChannels]; float (*Buffer)[kNumberOfChips][kNumberOfChannels]; unsigned int NumAverages; // Events to take before feedback acts unsigned int Count; // Number of currently integrated events float Gain; // Feedback gain float DiffVoltage; // for response measurement int SocketDescriptor; char TextBuf[BUF_LENGTH]; int fLedTrigBoard; int fLedTrigChip; int fLedTrigChannel; int fLedTrigSample; float fLedTrigThreshold; int fLedSignalSample; int fLedBaselineSample; unsigned int fIntHalfWidth; int fDefaultNumAverage; char fHVControlServer[BUF_LENGTH]; int fHVControlPort; int fMaxCmdAckDelay; public: HVFeedback(class DAQReadout*, char*); ~HVFeedback(); bool ProcessEvent(); void SetTarget(int, int, int, float); void GetTargets(); void SetGain(float); float GetGain(); void SetNumAverages(unsigned int); unsigned int GetNumAverages(); void SetFBMode(FBState); FBState GetFBMode(); unsigned int GetCurrentCount(); void MeasureResponse(float); void GetResponse(); void ClearAverages(); bool WriteHVCommand(const char *, ...); void PrintConfig(); }; #endif