00001
00002
00004 #ifndef __Oqplane__
00005 #define __Oqplane__
00006
00007 #include "CUtils.h"
00008 #include "Triggers.h"
00009 #include "Spectrum.h"
00010 #include "FFT.h"
00011 #include "TFile.h"
00012 #include "TGraph.h"
00013 #include "TH2.h"
00014
00015
00016 #define NFROWMAX 1000
00017
00018
00019 using namespace std;
00020
00027 class FreqRow {
00028
00029 public:
00030 friend class Oqplane;
00031
00032 private:
00033
00034 FreqRow(const int aTimeRange,
00035 const int aTimePad,
00036 const int aSampleFrequency,
00037 const double aF,
00038 const double aQ,
00039 const double aMismatchStep,
00040 const double aSNRThreshold);
00041 virtual ~FreqRow(void);
00042
00043 double* GetSNRs(double *aDataRe, double *aDataIm);
00044 bool GetTriggers(Triggers *aTriggers, double *aDataRe, double *aDataIm, const int aStartTime);
00045 inline void SetPower(const double aPower){ fPower=aPower; };
00046
00047
00048 double fF;
00049 double fQ;
00050 int fTimeRange;
00051 int fTimePad;
00052 int fSampleFrequency;
00053 double fMismatchStep;
00054 double fSNRThreshold;
00055
00056
00057 double fBandWidth;
00058 double fDuration;
00059
00060
00061 vector <double> fTime;
00062 int fNumberOfTiles;
00063 bool *ValidIndices;
00064 double fPower;
00065
00066
00067 vector <double> fWindow;
00068 vector <double> fWindowFrequency;
00069 vector <int> fDataIndices;
00070 int fZeroPadLength;
00071 fft *offt;
00072 };
00073
00074
00081 class Oqplane {
00082
00083 public:
00084 friend class Otile;
00085
00086 private:
00087
00088 Oqplane(const double aQ,
00089 const int aSampleFrequency,
00090 const int aTimeRange,
00091 const int aTimePad,
00092 const double aFrequencyMin,
00093 const double aFrequencyMax,
00094 const double aMismatchStep,
00095 const double aSNRThreshold);
00096 virtual ~Oqplane(void);
00097
00098 bool GetTriggers(Triggers *aTriggers, double *aDataRe, double *aDataIm, const int aTimeStart);
00099 bool SetPowerSpectrum(Spectrum *aSpec);
00100 TH2D* GetMap(double *aDataRe, double *aDataIm, const double time_offset=0.0, const bool printamplitude=false);
00101
00102
00103 bool status_OK;
00104
00105
00106 double fQ;
00107 int fTimeRange;
00108 int fTimePad;
00109 int fSampleFrequency;
00110 double fFrequencyMin,
00111 fFrequencyMax;
00112 double fMismatchStep;
00113 double fSNRThreshold;
00114
00115
00116 double fQPrime;
00117
00118
00119 TH2D *hplane;
00120 int fNumberOfRows;
00121 double fPlaneNormalization;
00122 vector <double> fFreq;
00123 FreqRow *freqrow[NFROWMAX];
00124 int fNumberOfTiles;
00125
00126 bool CheckParameters(void);
00127 void GetPlaneNormalization(void);
00128 void BuildTiles(void);
00129
00130 ClassDef(Oqplane,0)
00131 };
00132
00133
00134 #endif
00135
00136