Logo coherent WaveBurst  
Library Reference Guide
Logo
wat.hh
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Sergey Klimenko, Gabriele Vedovato
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17 
18 
19 #ifndef WAT_HH
20 #define WAT_HH
21 
22 const int NIFO_MAX=8;
23 const int NRES_MAX=12;
24 
25 namespace WAT {
26 
27 // return if HEALPix is enabled/disabled
28 #ifdef _USE_HEALPIX
29 inline bool USE_HEALPIX() {return true;}
30 #else
31 inline bool USE_HEALPIX() {return false;}
32 #endif
33 
34 // return if LAL is enabled/disabled
35 #ifdef _USE_LAL
36 inline bool USE_LAL() {return true;}
37 #else
38 inline bool USE_LAL() {return false;}
39 #endif
40 
41 // return if EBBH is enabled/disabled
42 #ifdef _USE_EBBH
43 inline bool USE_EBBH() {return true;}
44 #else
45 inline bool USE_EBBH() {return false;}
46 #endif
47 
48 // return if ROOT6 is enabled/disabled
49 #ifdef _USE_ROOT6
50 inline bool USE_ROOT6() {return true;}
51 #else
52 inline bool USE_ROOT6() {return false;}
53 #endif
54 
55 // return if CPP11 is enabled/disabled
56 #ifdef _USE_CPP11
57 inline bool USE_CPP11() {return true;}
58 #else
59 inline bool USE_CPP11() {return false;}
60 #endif
61 
62 // return if ICC is enabled/disabled
63 #ifdef _USE_ICC
64 inline bool USE_ICC() {return true;}
65 #else
66 inline bool USE_ICC() {return false;}
67 #endif
68 
69 } // end namespace
70 
71 #define _ALIGNED __attribute__((aligned(32)))
72 
73 #if XIFO < 5
74 #define NIFO 4
75 #endif
76 
77 #if XIFO > 4
78 #define NIFO 8
79 #endif
80 
81 #if XIFO < 5
82 #define _NET(P1,P2) \
83 P1
84 #endif
85 
86 #if XIFO > 4
87 #define _NET(P1,P2) \
88 P1 \
89 P2
90 #endif
91 
92 #if XIFO == 1
93 #define NETX(P1,P2,P3,P4,P5,P6,P7,P8) \
94 P1
95 #endif
96 
97 #if XIFO == 2
98 #define NETX(P1,P2,P3,P4,P5,P6,P7,P8) \
99 P1 \
100 P2
101 #endif
102 
103 #if XIFO == 3
104 #define NETX(P1,P2,P3,P4,P5,P6,P7,P8) \
105 P1 \
106 P2 \
107 P3
108 #endif
109 
110 #if XIFO == 4
111 #define NETX(P1,P2,P3,P4,P5,P6,P7,P8) \
112 P1 \
113 P2 \
114 P3 \
115 P4
116 #endif
117 
118 #if XIFO == 5
119 #define NETX(P1,P2,P3,P4,P5,P6,P7,P8) \
120 P1 \
121 P2 \
122 P3 \
123 P4 \
124 P5
125 #endif
126 
127 #if XIFO == 6
128 #define NETX(P1,P2,P3,P4,P5,P6,P7,P8) \
129 P1 \
130 P2 \
131 P3 \
132 P4 \
133 P5 \
134 P6
135 #endif
136 
137 #if XIFO == 7
138 #define NETX(P1,P2,P3,P4,P5,P6,P7,P8) \
139 P1 \
140 P2 \
141 P3 \
142 P4 \
143 P5 \
144 P6 \
145 P7
146 #endif
147 
148 #if XIFO == 8
149 #define NETX(P1,P2,P3,P4,P5,P6,P7,P8) \
150 P1 \
151 P2 \
152 P3 \
153 P4 \
154 P5 \
155 P6 \
156 P7 \
157 P8
158 #endif
159 
160 #if XIFO==1
161 #define XSUM(X) X[0]
162 #define YSUM(Y) 0
163 #endif
164 #if XIFO==2
165 #define XSUM(X) X[0]+X[1]
166 #define YSUM(Y) 0
167 #endif
168 #if XIFO==3
169 #define XSUM(X) X[0]+X[1]+X[2]
170 #define YSUM(Y) 0
171 #endif
172 #if XIFO==4
173 #define XSUM(X) X[0]+X[1]+X[2]+X[3]
174 #define YSUM(Y) 0
175 #endif
176 #if XIFO==5
177 #define XSUM(X) X[0]+X[1]+X[2]+X[3]
178 #define YSUM(Y) Y[0]
179 #endif
180 #if XIFO==6
181 #define XSUM(X) X[0]+X[1]+X[2]+X[3]
182 #define YSUM(Y) Y[0]+Y[1]
183 #endif
184 #if XIFO==7
185 #define XSUM(X) X[0]+X[1]+X[2]+X[3]
186 #define YSUM(Y) Y[0]+Y[1]+Y[2]
187 #endif
188 #if XIFO==8
189 #define XSUM(X) X[0]+X[1]+X[2]+X[3]
190 #define YSUM(Y) Y[0]+Y[1]+Y[2]+Y[3]
191 #endif
192 
193 #endif
194 
195 ; // DO NOT REMOVE !!!
bool USE_EBBH()
Definition: wat.hh:45
bool USE_ROOT6()
Definition: wat.hh:52
bool USE_ICC()
Definition: wat.hh:66
bool USE_CPP11()
Definition: wat.hh:59
const int NIFO_MAX
Definition: wat.hh:22
const int NRES_MAX
Definition: wat.hh:23
bool USE_HEALPIX()
Definition: wat.hh:31
Definition: wat.hh:25
bool USE_LAL()
Definition: wat.hh:38