Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
monster.hh
Go to the documentation of this file.
1 #ifndef MONSTER_HH
2 #define MONSTER_HH
3 
4 #include "WDM.hh"
5 #include "netcluster.hh"
6 #include "wavearray.hh"
7 #include <algorithm>
8 #include "stdint.h"
9 
10 using namespace std;
11 
12 struct xtalk{int index; float CC[4];}; // AA, AQ, QA, QQ
13 
14 struct xtalkArray{struct xtalk* data; int size;};
15 
16 typedef vector<xtalk> vector_XT;
17 
18 //template <class T>
19 class monster{
20 public:
21 
22  // dummy constructor
23  monster();
24 
25  // constructor; computes catalog
26  //! param: array of pointers to WDM transforms
27  //! param: number of WDM transforms in the array
28  monster(WDM<double>** wdm, int nRes);
29 
30  // constructor; reads catalog from file
31  //! param: catalog file name
32  monster(char* filename);
33 
34  // copy constructor
35  //! param: object to be copied
36  monster(const monster& x);
37 
38  // destructor
39  virtual ~monster();
40 
41  // release memory used by the catalog
42  void deallocate();
43 
44  // write the catalog to file
45  //! param: file name
46  void write(char* filename);
47 
48  // read catalog from file
49  //! param: file name
50  void read(char* filename);
51 
52 
53  // returns the overlap values for two pixels
54  //! param: numbers of layers identifying the resolution of the first pixel
55  //! param: TF map index of the first pixel
56  //! param: numbers of layers identifying the resolution of the second pixel
57  //! param: TF map index of the second pixel
58  //! return: xtalk structure, use the CC values (coupling coefficients)
59  xtalk getXTalk(int nLay1, size_t indx1, int nLay2, size_t indx2);
60 
61  // same as above but now the quadratures are specified, too (quad1, quad2)
62  // returns the corresponding overlap (coupling coefficient)
63  float getXTalk(int nLay1, int quad1, size_t indx1, int nLay2, int quad2, size_t indx2);
64 
65  // FILL cluster overlap amplitudes
66  //! param: pointer to netcluster structure
67  //! param: which cluster to process
68  //! param: check TD vectors or not
69  //! return list of pixel IDs
70  std::vector<int> getXTalk(netcluster* pwc, int id, bool check=true);
71 
72  // get xtalk size - number of neighbour pixel including the main one
73  inline int size() {
74  if(clusterCC.size()!=sizeCC.size()) exit(1);
75  return clusterCC.size();
76  }
77 
78  // get xtalk vector size for pixel m
79  inline int size(int m) {
80  return sizeCC[m];
81  }
82 
83  // get pointer to xtalk vector for pixel m
84  inline float* getXTalk(int m) {
85  return clusterCC[m];
86  }
87 
88  // returns 4 x-talk coefficients between pixels p1 and p2
90  return getXTalk(p1->layers, p1->time, p2->layers, p2->time);
91  }
92 
93 
94  //void PrintSums();
95 
96 //protected:
97  xtalkArray (***catalog)[2]; // stores overlap values [r1][r2][r1_freq][parity] ; r2<=r1
98  int tag; // catalog tag number
99  int nRes; // number of resolutions
100  int BetaOrder; // beta function order for Meyer
101  int precision; // wavelet precision
102  int KWDM; // WDM K - parameter K/M
103  int* layers; //! M for each resolution
104  std::vector<float*> clusterCC; // cluster coupling coefficients
105  std::vector<int> sizeCC; // size of the vector for cluster coupling coefficients
106 
107  // used by THtml doc
108  ClassDef(monster,3)
109 };
110 
111 
112 #endif
int KWDM
Definition: monster.hh:102
int index
Definition: monster.hh:12
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
vector< xtalk > vector_XT
Definition: monster.hh:16
float * getXTalk(int m)
Definition: monster.hh:84
STL namespace.
watplot p1(const_cast< char * >("TFMap1"))
size_t layers
Definition: netpixel.hh:94
int m
Definition: cwb_net.C:10
std::vector< int > sizeCC
Definition: monster.hh:105
Definition: monster.hh:12
int size(int m)
Definition: monster.hh:79
xtalk getXTalk(netpixel *p1, netpixel *p2)
Definition: monster.hh:89
size_t time
Definition: netpixel.hh:92
int size()
Definition: monster.hh:73
std::vector< float * > clusterCC
M for each resolution.
Definition: monster.hh:104
watplot p2(const_cast< char * >("TFMap2"))
int * layers
Definition: monster.hh:103
int tag
Definition: monster.hh:98
int nRes
Definition: monster.hh:99
int size
Definition: monster.hh:14
int BetaOrder
Definition: monster.hh:100
int check
exit(0)
int precision
Definition: monster.hh:101