00001
00002
00004 #ifndef __TriggerBuffer__
00005 #define __TriggerBuffer__
00006 #include "CUtils.h"
00007 #include "MakeTriggers.h"
00008
00009 using namespace std;
00010
00017 class TriggerBuffer: public MakeTriggers {
00018
00019 public:
00020
00032 TriggerBuffer(const int aSize, const string aStreamName, const int aVerbose=0);
00033
00037 virtual ~TriggerBuffer(void);
00047 bool FlushBuffer(void);
00048
00053 void ResetBuffer(void);
00054
00062 bool SetBufferSegments(Segments *aSeg);
00063
00080 bool AddTrigger(const double aTime, const double aFrequency,
00081 const double aSNR, const double aQ,
00082 const double aTstart, const double aTend,
00083 const double aFstart, const double aFend,
00084 const double aAmplitude, const double aPhase);
00085
00091 void ResetAfter(const double aTime);
00092
00096 inline int GetBufferSize(void){ return BufferSize; };
00097
00102 inline int GetNtriggers(void){
00103 if(BufferSize) return b_pos;
00104 return MakeTriggers::GetNtriggers();
00105 };
00106
00107 inline double GetBufferLiveTime(void){ return b_seg->GetLiveTime(); };
00108
00109
00110 private:
00111
00112
00113 int BufferSize;
00114 int b_pos;
00115 double *b_time;
00116 double *b_freq;
00117 double *b_tstart;
00118 double *b_tend;
00119 double *b_fstart;
00120 double *b_fend;
00121 double *b_q;
00122 double *b_snr;
00123 double *b_amp;
00124 double *b_ph;
00125
00126
00127 vector<double> s_start;
00128 vector<double> s_end;
00129 vector<double> s_pos;
00130 Segments *b_seg;
00131
00132 ClassDef(TriggerBuffer,0)
00133 };
00134
00135
00136 #endif
00137
00138