Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WDMOverlap.hh
Go to the documentation of this file.
1 #ifndef WDMOVERLAP_HH
2 #define WDMOVERLAP_HH
3 
4 #include "WDM.hh"
5 #include "netcluster.hh"
6 #include <algorithm>
7 #include "stdint.h"
8 
9 using namespace std;
10 
11 struct overlaps{int32_t index; float ovlpAA, ovlpAQ, ovlpQA, ovlpQQ;};
12 struct ovlArray{struct overlaps* data; int size;};
13 
14 template <class T>
15 class WDMOverlap{
16 public:
17 
18  // default constructor
19  WDMOverlap();
20 
21  // constructor that builds the catalog
22  //! param: vector of pointers to WDM objects
23  //! param: number of pointers (resolutions)
24  //! param: threshold on overlap values
25  WDMOverlap(WDM<T>** wdm, int nRes, double minOvlp = 0.01);
26 
27  // constructor that reads the catalog from a file
28  //! param: filename
29  WDMOverlap(char* filename);
30 
31  // copy constructor
32  //! param: other WDMOverlap object
33  WDMOverlap(const WDMOverlap<T>& x);
34 
35  // destructor
36  virtual ~WDMOverlap();
37 
38  // performs memory deallocation
39  void deallocate();
40 
41  // write to file
42  //! param: filename
43  void write(char* filename);
44 
45  // read from file
46  //! param: filename
47  void read(char* filename);
48 
49  // access function that returns all 4 overlap values between two pixels
50  //! param: defines resolution 1 (by number of layers)
51  //! param: defines pixel 1 at resolution 1
52  //! param: defines resolution 2 (by number of layers)
53  //! param: defines pixel 2 at resolution 2
54  // returns a struct overlap containing the four possible combinations
55  // amplitude-amplitude, amplitude-quadrature, quadrature-amplitude, quad-quad
56  struct overlaps getOverlap(int nLay1, size_t indx1, int nLay2, size_t indx2);
57 
58  // access function that returns one overlap value between two pixels
59  //! param: defines resolution 1 (by number of layers)
60  //! param: defines whether it's amplitude (0) or quadrature (1) for resolution 1
61  //! param: defines pixel 1 at resolution 1
62  //! param: defines whether it's amplitude (0) or quadrature (1) for resolution 2
63  //! param: defines resolution 2 (by number of layers)
64  //! param: defines pixel 2 at resolution 2
65  // returns the overlap value
66  float getOverlap(int nLay1, int quad1, size_t indx1, int nLay2, int quad2, size_t indx2); //quad: 0/1, 1 for quadrature
67 
68  // FILL cluster overlap amplitudes
69  //! param: pointer to netcluster structure
70  //! param: which cluster to process
71  //! param: number of pixels to process
72  //! param: address where to store the values (format: vector<vector<struct overlap> > )
73  void getClusterOverlaps(netcluster* pwc, int clIndex, int nPix, void* q);
74 
75  //void PrintSums();
76 
77 //protected:
78  struct ovlArray (***catalog)[2]; // stores overlap values [r1][r2][r1_freq][parity] ; r2<=r1
79  int nRes; // number of resolutions
80  int* layers; // M for each resolution
81 
82 // ClassDef(WDMOverlap,1)
83 
84 };
85 
86 #endif
cout<< endl;cout<< "ts size = "<< ts.size()<< " ts rate = "<< ts.rate()<< endl;tf.Forward(ts, wdm);int levels=tf.getLevel();cout<< "tf size = "<< tf.size()<< endl;double dF=tf.resolution();double dT=1./(2 *dF);cout<< "rate(hz) : "<< RATE<< "\t layers : "<< nLAYERS<< "\t dF(hz) : "<< dF<< "\t dT(ms) : "<< dT *1000.<< endl;int itime=TIME_PIXEL_INDEX;int ifreq=FREQ_PIXEL_INDEX;int index=(levels+1)*itime+ifreq;double time=itime *dT;double freq=(ifreq >0)?ifreq *dF:dF/4;cout<< endl;cout<< "PIXEL TIME = "<< time<< " sec "<< endl;cout<< "PIXEL FREQ = "<< freq<< " Hz "<< endl;cout<< endl;wavearray< double > x
WDM< double > wdm(nLAYERS, nLAYERS, 6, 10)
netcluster * pwc
Definition: cwb_job_obj.C:20
STL namespace.
int * layers
Definition: WDMOverlap.hh:80
Definition: WDM.hh:24
wavearray< int > index
float ovlpQQ
Definition: WDMOverlap.hh:11
int size
Definition: WDMOverlap.hh:12