Omicron  4.2.0
An algorithm to detect and characterize transient events in gravitational-wave detectors
Otile.h
Go to the documentation of this file.
1 
6 #ifndef __Otile__
7 #define __Otile__
8 
9 #include "Oqplane.h"
10 #include "Osequence.h"
11 #include <GwollumPlot.h>
12 
13 using namespace std;
14 
22 vector <double> ComputeQs(const double aQMin, const double aQMax,
23  const double aMaximumMismatch);
24 
25 
39 class Otile: public Osequence, public GwollumPlot {
40 
41  public:
42 
65  Otile(const unsigned int aTimeRange,
66  const unsigned int aTimeOverlap,
67  const double aQMin,
68  const double aQMax,
69  const double aFrequencyMin,
70  const double aFrequencyMax,
71  const unsigned int aSampleFrequency,
72  const double aMaximumMismatch,
73  const unsigned int aFullMapNt=1,
74  const string aPlotStyle="GWOLLUM",
75  const unsigned int aVerbosity=0);
76 
80  virtual ~Otile(void);
88  inline unsigned int GetQN(void){ return nq; };
89 
94  inline double GetQ(const unsigned int aQindex){
95  if(aQindex<nq) return qplanes[aQindex]->GetQ();
96  return 0.0;
97  };
98 
103  inline unsigned int GetBandN(const unsigned int aQindex){
104  if(aQindex<nq) return qplanes[aQindex]->GetBandN();
105  return qplanes[nq-1]->GetBandN();
106  };
107 
113  inline double GetBandFrequency(const unsigned int aQindex, const unsigned int aBandIndex){
114  if(aQindex<nq) return qplanes[aQindex]->GetBandFrequency(aBandIndex);
115  return qplanes[nq-1]->GetBandFrequency(aBandIndex);
116  };
117 
124  inline unsigned int GetBandTileN(const unsigned int aQindex, const unsigned int aBandIndex){
125  if(aQindex<nq) return qplanes[aQindex]->GetBandTileN(aBandIndex);
126  if(FullMapNt>0) return FullMapNt;
127  return qplanes[0]->GetBandTileN(qplanes[0]->GetBandN()-1);
128  };
129 
137  inline double GetTileSnrSq(const unsigned int aQindex, const unsigned int aBandIndex, const unsigned int aTimeTileIndex){
138  return qplanes[aQindex]->GetTileSnrSq(aTimeTileIndex, aBandIndex);
139  };
140 
148  inline double GetTileAmplitude(const unsigned int aQindex, const unsigned int aBandIndex, const unsigned int aTimeTileIndex){
149  return qplanes[aQindex]->GetTileAmplitude(aTimeTileIndex, aBandIndex);
150  };
151 
159  inline double GetTileAmplitudeSq(const unsigned int aQindex, const unsigned int aBandIndex, const unsigned int aTimeTileIndex){
160  return qplanes[aQindex]->GetTileAmplitudeSq(aTimeTileIndex, aBandIndex);
161  };
162 
167  inline double GetSnrSqMax(const unsigned int aQindex){ return qplanes[aQindex]->GetSnrSqMax(); };
168 
174  long unsigned int GetTileN(const double aPadding=0.0);
175 
182  double* GetBands(const unsigned int aQindex);
183 
190  void SetPlotTimeWindows(vector <unsigned int> aWindows);
191 
195  inline vector <unsigned int> GetPlotTimeWindows(void){ return pwin; };
196 
201  void DrawMapTiling(const unsigned int aQindex);
202 
209  inline void SetPower(Spectrum *aSpec1, Spectrum *aSpec2){
210  for(unsigned int q=0; q<nq; q++) qplanes[q]->SetPower(aSpec1, aSpec2);
211  };
212 
222  long unsigned int ProjectData(fft *aDataFft);
223 
237  Segments* GetTileSegments(TH1D *aSnrThreshold, const double aPadding);
238 
252  bool SaveTriggers(TriggerBuffer *aTriggers);
253 
269  double SaveMaps(const string aOutdir, const string aName, const string aFormat,
270  const double aTimeOffset=0.0, const bool aThumb=false);
271 
281  inline void SetMapFill(const string aMapContentType="snr"){
282  if(!aMapContentType.compare("amplitude")) mapfill="amplitude";
283  else if(!aMapContentType.compare("phase")) mapfill="phase";
284  else mapfill="snr";
285  return;
286  };
287 
294  inline void SetRangez(const double aZmin=-1.0, const double aZmax=-1.0){
295  vrange[0] = aZmin;
296  vrange[1] = aZmax;
297  };
298 
302  inline double GetRangezMin(void){ return vrange[0]; };
303 
310  inline void SetSnrThr(const double aSnrThr_map=0.0, const double aSnrThr_trigger=2.0){
311  SnrThr_map=aSnrThr_map;
312  for(unsigned int q=0; q<nq; q++) qplanes[q]->SetSnrThr(aSnrThr_trigger);
313  };
314 
319  inline string GetMapFill(void){ return mapfill; };
320 
325  inline double GetSnrMapThr(void){ return SnrThr_map; };
326 
331  inline double GetSnrTriggerThr(void){ return qplanes[0]->GetSnrThr(); };
332 
337  inline double GetFrequencyMin(void){ return qplanes[0]->GetFrequencyMin(); };
338 
343  inline double GetFrequencyMax(void){ return qplanes[nq-1]->GetFrequencyMax(); };
344 
348  inline double GetMismatchMax(void){ return MaximumMismatch; };
349 
353  inline unsigned int GetTimeRange(void){ return qplanes[0]->GetTimeRange(); };
354 
362  inline void SetChirp(const double aMchirp=-1.0, const double aMergerTime=-1.0){
363  chirpt = aMergerTime;
364  chirpm = aMchirp;
365  chirp->SetParameters(-8.0*96.0/3.0/5.0*TMath::Power(TMath::Pi(),8.0/3.0)*TMath::Power(TMath::G()*chirpm*1.989e30/TMath::C()/TMath::C()/TMath::C(), 5.0/3.0),
366  aMergerTime);
367  }
368 
372  inline double GetChirpMass(void){ return chirpm; };
373 
377  inline void FillMaps(void){
378  for(unsigned int q=0; q<nq; q++)
379  qplanes[q]->FillMap(mapfill, -(double)GetTimeRange()/2.0, (double)GetTimeRange()/2.0);
380  };
381 
389  void FillFullMap(const unsigned int aWindowIndex, const double aTimeOffset = 0.0);
390 
397  inline TH2D* GetFullMap(const unsigned int aWindowIndex){
398  return (TH2D*)fullmap[aWindowIndex]->Clone();
399  };
400 
401  private:
402 
403  unsigned int fVerbosity;
406  unsigned int nq;
407  double vrange[2];
408  double SnrThr_map;
409  string mapfill;
410  unsigned int **t_snrmax;
411  unsigned int **f_snrmax;
412  TF1 *chirp;
413  double chirpm;
414  double chirpt;
415  vector <unsigned int> pwin;
416 
417  // FULL MAP
418  TH2D **fullmap;
419  unsigned int FullMapNt;
420 
421  ClassDef(Otile,0)
422 };
423 
424 #endif
425 
426 
Omicron Q-plane.
Omicron analysis time sequence.
const double const double aMaximumMismatch
Definition: Otile.cc:11
const double aQMax
Definition: Otile.cc:11
vector< double > ComputeQs(const double aQMin, const double aQMax, const double aMaximumMismatch)
Computes a set of Q values.
Create a time-frequency Q-plane.
Definition: Oqplane.h:23
Omicron analysis time sequence.
Definition: Osequence.h:48
Construct a time-frequency-Q tiling structure.
Definition: Otile.h:39
unsigned int GetBandN(const unsigned int aQindex)
Returns the number of frequency bands of a given Q-plane.
Definition: Otile.h:103
vector< unsigned int > pwin
Plot time windows.
Definition: Otile.h:415
double GetTileAmplitudeSq(const unsigned int aQindex, const unsigned int aBandIndex, const unsigned int aTimeTileIndex)
Returns the amplitude squared of a given tile.
Definition: Otile.h:159
double GetSnrTriggerThr(void)
Returns the current SNR threshold for triggers.
Definition: Otile.h:331
TH2D * GetFullMap(const unsigned int aWindowIndex)
Returns a copy of the full map.
Definition: Otile.h:397
double GetSnrMapThr(void)
Returns the current SNR threshold for maps.
Definition: Otile.h:325
TF1 * chirp
Chirp track.
Definition: Otile.h:412
unsigned int ** f_snrmax
Loudest frequency tile (SNR).
Definition: Otile.h:411
void SetRangez(const double aZmin=-1.0, const double aZmax=-1.0)
Sets the map Z-axis range.
Definition: Otile.h:294
double GetFrequencyMax(void)
Returns the highest frequency of this tiling [Hz].
Definition: Otile.h:343
double GetQ(const unsigned int aQindex)
Returns the Q value of a given Q-plane.
Definition: Otile.h:94
unsigned int nq
number of q planes.
Definition: Otile.h:406
Oqplane ** qplanes
Q planes.
Definition: Otile.h:405
unsigned int fVerbosity
Verbosity level.
Definition: Otile.h:399
unsigned int FullMapNt
Number of time bins in the full map (0 for full resolution).
Definition: Otile.h:419
unsigned int GetBandTileN(const unsigned int aQindex, const unsigned int aBandIndex)
Returns the number of tiles in a band of a given Q-plane.
Definition: Otile.h:124
double GetMismatchMax(void)
Returns the maximum mismatch between tiles.
Definition: Otile.h:348
double MaximumMismatch
Maximum mismatch.
Definition: Otile.h:404
string GetMapFill(void)
Returns the current map fill type.
Definition: Otile.h:319
double GetRangezMin(void)
Returns the map Z-axis range minimum.
Definition: Otile.h:302
void FillMaps(void)
Fills the Q-plane maps.
Definition: Otile.h:377
TH2D ** fullmap
Full maps.
Definition: Otile.h:418
string mapfill
Map fill type.
Definition: Otile.h:409
double GetSnrSqMax(const unsigned int aQindex)
Returns the maximum SNR squared estimated in a given Q plane.
Definition: Otile.h:167
double GetTileAmplitude(const unsigned int aQindex, const unsigned int aBandIndex, const unsigned int aTimeTileIndex)
Returns the amplitude of a given tile.
Definition: Otile.h:148
void SetSnrThr(const double aSnrThr_map=0.0, const double aSnrThr_trigger=2.0)
Sets a SNR threshold when saving maps and triggers.
Definition: Otile.h:310
double GetChirpMass(void)
Returns the chirp mass [solar masses].
Definition: Otile.h:372
void SetPower(Spectrum *aSpec1, Spectrum *aSpec2)
Computes the noise power associated to the tiling structure.
Definition: Otile.h:209
unsigned int GetQN(void)
Returns the number of Q-planes.
Definition: Otile.h:88
double GetTileSnrSq(const unsigned int aQindex, const unsigned int aBandIndex, const unsigned int aTimeTileIndex)
Returns the SNR squared of a given tile.
Definition: Otile.h:137
unsigned int ** t_snrmax
Loudest time tile (SNR).
Definition: Otile.h:410
void SetChirp(const double aMchirp=-1.0, const double aMergerTime=-1.0)
Sets the chirp mass [solar mass].
Definition: Otile.h:362
double GetFrequencyMin(void)
Returns the minimum frequency of this tiling [Hz].
Definition: Otile.h:337
double SnrThr_map
Map SNR threshold.
Definition: Otile.h:408
double GetBandFrequency(const unsigned int aQindex, const unsigned int aBandIndex)
Returns the band central frequency [Hz] of a given Q-plane.
Definition: Otile.h:113
double chirpm
Chirp mass [solar mass].
Definition: Otile.h:413
void SetMapFill(const string aMapContentType="snr")
Defines how to fill the maps.
Definition: Otile.h:281
unsigned int GetTimeRange(void)
Returns the time range [s].
Definition: Otile.h:353
vector< unsigned int > GetPlotTimeWindows(void)
Returns the list of time windows for plots.
Definition: Otile.h:195
double chirpt
Chirp merger time [s].
Definition: Otile.h:414