00001
00002
00004 #ifndef __Otile__
00005 #define __Otile__
00006
00007 #include "Oqplane.h"
00008 #include "GwollumPlot.h"
00009
00010 using namespace std;
00011
00044 class Otile: public GwollumPlot {
00045
00046 public:
00047
00073 Otile(const int aTimeRange,
00074 const double aQMin,
00075 const double aQMax,
00076 const double aFrequencyMin,
00077 const double aFrequencyMax,
00078 const int aSampleFrequency,
00079 const double aMaximumMismatch,
00080 const string aPlotStyle="GWOLLUM",
00081 const int aVerbosity=0);
00082
00086 virtual ~Otile(void);
00094 inline int GetNQ(void){ return nq; };
00095
00101 inline double GetQ(const int aQindex){
00102 if(aQindex<0) return -1.0;
00103 if(aQindex>=nq) return -1.0;
00104 return qplanes[aQindex]->GetQ();
00105 };
00106
00111 bool DrawMapTiling(const int aQindex);
00112
00124 bool SetPower(Spectrum *aSpec1, Spectrum *aSpec2);
00125
00135 int ProjectData(fft *aDataFft);
00136
00147 bool SaveTriggers(TriggerBuffer *aTriggers);
00148
00163 double SaveMaps(const string aOutdir, const string aName, const string aFormat, vector <int> aWindows, const bool aThumb=false);
00164
00172 static vector <double> ComputeQs(const double aQMin, const double aQMax, const double aMaximumMismatch);
00173
00181 inline void SetMapFill(const string aMapFill="snr"){
00182 if(!aMapFill.compare("amplitude")) mapfill="amplitude";
00183 else if(!aMapFill.compare("phase")) mapfill="phase";
00184 else mapfill="snr";
00185 for(int q=0; q<nq; q++) qplanes[q]->GetZaxis()->SetTitle(StringToUpper(mapfill).c_str());
00186 return;
00187 };
00188
00195 inline void SetRangez(const double aZmin=-1.0, const double aZmax=-1.0){
00196 vrange[0]=aZmin;
00197 vrange[1]=aZmax;
00198 };
00199
00206 inline void SetSNRThr(const double aSNRThr_map=0.0, const double aSNRThr_trigger=2.0){
00207 SNRThr_map=aSNRThr_map;
00208 for(int q=0; q<nq; q++) qplanes[q]->SetSNRThr(aSNRThr_trigger);
00209 };
00210
00215 inline string GetMapFill(void){ return mapfill; };
00216
00221 inline double GetSNRMapThr(void){ return SNRThr_map; };
00222
00227 inline double GetSNRTriggerThr(void){ return qplanes[0]->GetSNRThr(); };
00228
00233 inline double GetFrequencyMin(void){ return qplanes[0]->GetFrequencyMin(); };
00234
00239 inline double GetFrequencyMax(void){ return qplanes[nq-1]->GetFrequencyMax(); };
00240
00244 inline double GetMismatchMax(void){ return MaximumMismatch; };
00245
00249 inline int GetTimeRange(void){ return TimeRange; };
00250
00260 bool SetSegments(Segments *aInSeg, Segments *aOutSeg=NULL);
00261
00267 inline void SetOverlapDuration(const int aOverlapDuration){
00268 SeqOverlap=aOverlapDuration+aOverlapDuration%2;
00269 };
00270
00278 bool NewChunk(bool &aNewSegFlag);
00279
00283 inline int GetChunkTimeCenter(void){ return SeqT0; };
00284
00288 inline int GetChunkTimeStart(void){ return SeqT0-TimeRange/2; };
00289
00293 inline int GetChunkTimeEnd(void){ return SeqT0+TimeRange/2; };
00294
00299 inline int GetCurrentOverlapDuration(void){ return SeqOverlapCurrent; };
00300
00304 inline int GetOverlapDuration(void){ return SeqOverlap; };
00305
00306
00307 private:
00308
00309 int fVerbosity;
00310 double MaximumMismatch;
00311 Oqplane **qplanes;
00312 int nq;
00313 int TimeRange;
00314 double vrange[2];
00315 double SNRThr_map;
00316 string mapfill;
00317 int **t_snrmax;
00318 int **f_snrmax;
00319
00320 TH2D* MakeFullMap(const int aTimeRange);
00321 void ApplyOffset(TH2D *aMap, const double aOffset);
00322
00323
00324 Segments *SeqOutSegments;
00325 Segments *SeqInSegments;
00326 int SeqOverlap;
00327 int SeqOverlapCurrent;
00328 int SeqT0;
00329 int SeqSeg;
00330
00331 ClassDef(Otile,0)
00332 };
00333
00334 #endif
00335
00336