41 #include "TMatrixDSym.h" 42 #include "TMatrixDSymEigen.h" 90 {
for(
size_t i=0;
i<ifoList.size();
i++) ifoList[
i]->TFmap.Forward(k); }
92 {
for(
size_t i=0;
i<ifoList.size();
i++) ifoList[
i]->TFmap.Inverse(k); }
101 int setTimeShifts(
size_t=1,
double=1.,
size_t=0,
size_t=0,
102 const char* = NULL,
const char* =
"w",
size_t* = NULL);
106 void printwc(
size_t);
114 virtual size_t initwc(
double,
double);
122 void setSkyMaps(
double,
double=0.,
double=180.,
double=0.,
double=360.);
126 void setSkyMaps(
int);
134 bool setndm(
size_t,
size_t,
bool=
true,
int=1);
135 bool SETNDM(
size_t,
size_t,
bool=
true,
int=1);
140 inline double getNDM(
size_t i,
size_t j) {
return NDM[
i][
j]; }
149 void setDelayFilters(
detector* = NULL);
150 void setDelayFilters(
char*,
char* = NULL);
154 void writeFilter(
const char *
fname);
157 void readFilter(
const char*);
161 double setVeto(
double=5.);
170 size_t readMDClog(
char*,
double=0.,
int=11,
int=12);
176 size_t readSEGlist(
char*,
int=1);
190 void setDelayIndex(
double rate);
195 void setDelayIndex(
int=0);
202 size_t setIndexMode(
size_t=0);
208 return getifo(0)->tau.getSkyIndex(theta,phi);
220 void delay(
double theta,
double phi);
236 long coherence(
double,
double=0.,
double=0.);
243 long getNetworkPixels(
int LAG,
double Eo,
double DD=1., TH1F*
hist=NULL);
257 size_t netcut(
double,
char=
'L',
size_t=0,
int=1);
284 long likelihoodB(
char=
'E',
double=sqrt(2.),
int=0,
size_t=0,
int=-1,
bool=
false);
291 long likelihoodI(
char=
'P',
double=sqrt(2.),
int=0,
size_t=0,
int=-1,
bool=
false);
301 long likelihood2G(
char mode,
int lag,
int ID, TH2F*
hist=NULL);
302 long likelihoodWP(
char mode,
int lag,
int ID, TH2F*
hist=NULL);
305 long likelihood(
char=
'E',
double=sqrt(2.),
int=0,
size_t=0,
int=-1,
bool=
false);
310 size_t setRank(
double,
double=0.);
322 if(!wc_List.size())
return 0;
324 for(
size_t n=0;
n<nLag;
n++) m += wc_List[
n].
cluster(kt,kf);
330 if(!wc_List.size())
return 0;
332 for(
size_t n=0;
n<nLag;
n++) {
333 m += wc_List[
n].esize();
342 if(!wc_List.size())
return 0;
343 if(lag>=(
int)nLag) lag=nLag-1;
345 if(lag>=0) m += wc_List[lag].esize(type);
346 else for(
size_t n=0;
n<nLag;
n++) m += wc_List[
n].esize(type);
351 inline void setRMS();
355 for(
size_t i=0;
i<nLag;
i++) wc_List[
i].delink();
363 bool getwave(
size_t,
size_t,
char=
'W');
374 bool getMRAwave(
size_t ID,
size_t lag,
char atype=
'S',
int mode=0,
bool tof=
false);
380 void getSkyArea(
size_t id,
size_t lag,
double T);
382 void getSkyArea(
size_t id,
size_t lag,
double T,
double rms);
392 size_t setSkyMask(
char* fname,
char skycoord);
403 a = 1-
Gamma(ifoList.size(),a*a*ifoList.size());
404 this->e2or =
iGamma(ifoList.size()-1,
a);
418 inline string getmdcList(
size_t n) {
return mdcListSize()>n ? mdcList[
n] :
"\n"; }
420 inline string getmdcType(
size_t n) {
return mdcTypeSize()>n ? mdcType[
n] :
"\n"; }
422 inline std::vector<double>*
getmdcTime() {
return &mdcTime; }
424 inline double getmdcTime(
size_t n) {
return mdcTimeSize()>n ? mdcTime[
n] : 0.; }
426 inline size_t getmdc__ID(
size_t n) {
return mdc__IDSize()>n ? mdc__ID[
n] : 0; }
428 inline double getliveTime(
size_t n) {
return livTimeSize()>n ? livTime[
n] : 0.; }
449 for(
size_t n=0;
n<wdmListSize();
n++)
if(M==(wdmList[
n]->maxLayer()+1))
return wdmList[
n];
464 this->
delta = d==0. ? 0.00001 : d;
471 inline void set2or(
double p) { this->e2or = p; }
476 double threshold(
double,
double);
485 double THRESHOLD(
double bpp,
double shape);
492 double getDelay(
const char*
c=
"");
501 void setDelay(
const char* =
"L1");
507 void updateTDamp(
int,
float**,
float**);
518 static inline double sumx(
double*);
519 static inline double dotx(
double*,
double*);
520 static inline double dotx(
float*,
float*);
521 static inline double dot4(
double*,
double*);
522 static inline double dotx(
double*,
double*,
double*);
523 static inline double dotx(
float*,
float*,
float*);
524 static inline double dot4(
double*,
double*,
double*);
525 static inline double dotx(
double*,
double**,
size_t);
526 static inline double dotx(
double**,
size_t,
double*);
527 static inline double dotx(
double**,
size_t,
double**,
size_t);
528 static inline double dotx(
double**,
size_t,
double**,
size_t,
double*);
529 static inline double dotx(
double*,
double*,
double);
530 static inline double dotx(
float*,
float*,
float);
531 static inline void addx(
double*,
double*,
double*);
532 static inline void addx(
double*,
double**,
size_t,
double*);
533 static inline void addx(
double**,
size_t,
double**,
size_t,
double*);
534 static inline double dotx(
double*,
double**,
size_t,
double*);
535 static inline double dot32(std::vector<float>*,
double*, std::vector<short>*);
536 static inline double dot32(
double*,
double*,
int*);
537 static inline double divx(
double*,
double*);
538 static inline double rotx(
double*,
double,
double*,
double,
double*);
539 static inline double rotx(
float*,
float,
float*,
float,
float*);
540 static inline double rot4(
double*,
double,
double*,
double,
double*);
541 static inline float rots(
float*,
float,
float*,
float,
float*);
542 static inline void mulx(
double**,
size_t,
double**,
size_t,
double*);
543 static inline void mulx(
double*,
double,
double*);
544 static inline void mulx(
float*,
float,
float*);
545 static inline void mulx(
double*,
double);
546 static inline void mulx(
float*,
float);
547 static inline void inix(
double**,
size_t,
double*);
548 static inline void inix(
double*,
double);
549 static inline void inix(
float*,
float);
550 static inline int netx(
double*,
double,
double*,
double,
double);
551 static inline int netx(
float*,
float,
float*,
float,
float);
552 static inline void pnt_(
float**,
float**,
short**,
int,
int);
553 static inline void cpp_(
float*&,
float**);
554 static inline void cpf_(
float*&
a,
double** p);
555 static inline void cpf_(
float*& a,
double** p,
size_t);
557 static inline void dpfx(
float* fp,
float* fx);
558 static inline void pnpx(
float* fp,
float* fx,
float* am,
float* AM,
float* u,
float*
v);
559 static inline void dspx(
float* u,
float* v,
float* am,
float* AM);
560 static inline void dspx(
float* fp,
float* fx,
float* am,
float* AM,
float* u,
float* v);
562 inline int _sse_MRA_ps(
float*,
float*,
float,
int);
563 inline int _sse_mra_ps(
float*,
float*,
float,
int);
564 inline wavearray<float> _avx_norm_ps(
float**,
float**, std::vector<float*> &,
int);
566 inline void _avx_saveGW_ps(
float**,
float**,
int);
568 void test_sse(
int,
int);
666 void like(
char _LIKE) {this->_LIKE=_LIKE;}
667 void wdm(
bool _WDM) {this->_WDM =_WDM; }
680 size_t n = ifoList.size();
681 if(!ifoList.size() || wc_List.size()!=nLag)
return;
682 for(
size_t i=0;
i<
n;
i++) {
683 for(
size_t j=0;
j<nLag;
j++) {
684 if(!getwc(
j)->size())
continue;
685 if(!getifo(
i)->setrms(getwc(
j),
i)) {
686 cout<<
"network::setRMS() error\n";
710 NETX(d+= a[0]*b[0]; ,
723 NETX(d+= a[0]*b[0]; ,
745 NETX(c[0] = a[0]*b[0]; d+=c[0]; ,
746 c[1] = a[1]*b[1]; d+=c[1]; ,
747 c[2] = a[2]*b[2]; d+=c[2]; ,
748 c[3] = a[3]*b[3]; d+=c[3]; ,
749 c[4] = a[4]*b[4]; d+=c[4]; ,
750 c[5] = a[5]*b[5]; d+=c[5]; ,
751 c[6] = a[6]*b[6]; d+=c[6]; ,
752 c[7] = a[7]*b[7]; d+=c[7]; )
758 NETX(c[0] = a[0]*b[0]; d+=c[0]; ,
759 c[1] = a[1]*b[1]; d+=c[1]; ,
760 c[2] = a[2]*b[2]; d+=c[2]; ,
761 c[3] = a[3]*b[3]; d+=c[3]; ,
762 c[4] = a[4]*b[4]; d+=c[4]; ,
763 c[5] = a[5]*b[5]; d+=c[5]; ,
764 c[6] = a[6]*b[6]; d+=c[6]; ,
765 c[7] = a[7]*b[7]; d+=c[7]; )
771 c[0] = a[0]*b[0]; d+=c[0];
772 c[1] = a[1]*b[1]; d+=c[1];
773 c[2] = a[2]*b[2]; d+=c[2];
774 c[3] = a[3]*b[3]; d+=c[3];
780 NETX(d+= a[0]*b[0][j]; ,
793 NETX(d+= a[0][i]*b[0]; ,
806 NETX(d+= a[0][i]*b[0][j]; ,
807 d+= a[1][
i]*b[1][
j]; ,
808 d+= a[2][
i]*b[2][
j]; ,
809 d+= a[3][
i]*b[3][
j]; ,
810 d+= a[4][
i]*b[4][
j]; ,
811 d+= a[5][
i]*b[5][
j]; ,
812 d+= a[6][
i]*b[6][
j]; ,
813 d+= a[7][
i]*b[7][
j]; )
819 NETX(d+= a[0]/b[0]; ,
832 double q = (1.-
g)*um;
833 NETX(d+=
int(u[0]*u[0]>q) -
int((u[0]*u[0]/um+v[0]*v[0]/vm)>g); ,
834 d+=
int(u[1]*u[1]>q) -
int((u[1]*u[1]/um+v[1]*v[1]/vm)>g); ,
835 d+=
int(u[2]*u[2]>q) -
int((u[2]*u[2]/um+v[2]*v[2]/vm)>g); ,
836 d+=
int(u[3]*u[3]>q) -
int((u[3]*u[3]/um+v[3]*v[3]/vm)>g); ,
837 d+=
int(u[4]*u[4]>q) -
int((u[4]*u[4]/um+v[4]*v[4]/vm)>g); ,
838 d+=
int(u[5]*u[5]>q) -
int((u[5]*u[5]/um+v[5]*v[5]/vm)>g); ,
839 d+=
int(u[6]*u[6]>q) -
int((u[6]*u[6]/um+v[6]*v[6]/vm)>g); ,
840 d+=
int(u[7]*u[7]>q) -
int((u[7]*u[7]/um+v[7]*v[7]/vm)>g); )
847 NETX(d+=
int(u[0]*u[0]>q) -
int((u[0]*u[0]/um+v[0]*v[0]/vm)>g); ,
848 d+=
int(u[1]*u[1]>q) -
int((u[1]*u[1]/um+v[1]*v[1]/vm)>g); ,
849 d+=
int(u[2]*u[2]>q) -
int((u[2]*u[2]/um+v[2]*v[2]/vm)>g); ,
850 d+=
int(u[3]*u[3]>q) -
int((u[3]*u[3]/um+v[3]*v[3]/vm)>g); ,
851 d+=
int(u[4]*u[4]>q) -
int((u[4]*u[4]/um+v[4]*v[4]/vm)>g); ,
852 d+=
int(u[5]*u[5]>q) -
int((u[5]*u[5]/um+v[5]*v[5]/vm)>g); ,
853 d+=
int(u[6]*u[6]>q) -
int((u[6]*u[6]/um+v[6]*v[6]/vm)>g); ,
854 d+=
int(u[7]*u[7]>q) -
int((u[7]*u[7]/um+v[7]*v[7]/vm)>g); )
860 NETX(p[0] = a[0][i]*b[0][j];d+=p[0]; ,
861 p[1] = a[1][
i]*b[1][
j];d+=p[1]; ,
862 p[2] = a[2][
i]*b[2][
j];d+=p[2]; ,
863 p[3] = a[3][
i]*b[3][
j];d+=p[3]; ,
864 p[4] = a[4][
i]*b[4][
j];d+=p[4]; ,
865 p[5] = a[5][
i]*b[5][
j];d+=p[5]; ,
866 p[6] = a[6][
i]*b[6][
j];d+=p[6]; ,
867 p[7] = a[7][
i]*b[7][
j];d+=p[7]; )
873 NETX(d+= a[0]*b[0]; ,
886 NETX(d+= a[0]*b[0]; ,
899 NETX(p[0] = a[0]*b[0][j];d+=p[0]; ,
900 p[1] = a[1]*b[1][
j];d+=p[1]; ,
901 p[2] = a[2]*b[2][
j];d+=p[2]; ,
902 p[3] = a[3]*b[3][
j];d+=p[3]; ,
903 p[4] = a[4]*b[4][
j];d+=p[4]; ,
904 p[5] = a[5]*b[5][
j];d+=p[5]; ,
905 p[6] = a[6]*b[6][
j];d+=p[6]; ,
906 p[7] = a[7]*b[7][
j];d+=p[7]; )
911 NETX(p[0] += a[0]*b[0]; ,
923 NETX(p[0] += a[0]*b[0][j]; ,
924 p[1] += a[1]*b[1][
j]; ,
925 p[2] += a[2]*b[2][
j]; ,
926 p[3] += a[3]*b[3][
j]; ,
927 p[4] += a[4]*b[4][
j]; ,
928 p[5] += a[5]*b[5][
j]; ,
929 p[6] += a[6]*b[6][
j]; ,
930 p[7] += a[7]*b[7][
j]; )
935 NETX(p[0] += a[0][i]*b[0][j]; ,
936 p[1] += a[1][
i]*b[1][
j]; ,
937 p[2] += a[2][
i]*b[2][
j]; ,
938 p[3] += a[3][
i]*b[3][
j]; ,
939 p[4] += a[4][
i]*b[4][
j]; ,
940 p[5] += a[5][
i]*b[5][
j]; ,
941 p[6] += a[6][
i]*b[6][
j]; ,
942 p[7] += a[7][
i]*b[7][
j]; )
947 NETX(p[0] = a[0][i]*b[0][j]; ,
948 p[1] = a[1][
i]*b[1][
j]; ,
949 p[2] = a[2][
i]*b[2][
j]; ,
950 p[3] = a[3][
i]*b[3][
j]; ,
951 p[4] = a[4][
i]*b[4][
j]; ,
952 p[5] = a[5][
i]*b[5][
j]; ,
953 p[6] = a[6][
i]*b[6][
j]; ,
954 p[7] = a[7][
i]*b[7][
j]; )
959 NETX(p[0] = a[0]*b; ,
971 NETX(p[0] = a[0]*b; ,
1007 NETX(p[0] = a[0][j]; ,
1044 NETX(e[0] = u[0]*c + v[0]*s;d+=e[0]*e[0]; ,
1045 e[1] = u[1]*c + v[1]*
s;d+=e[1]*e[1]; ,
1046 e[2] = u[2]*c + v[2]*
s;d+=e[2]*e[2]; ,
1047 e[3] = u[3]*c + v[3]*
s;d+=e[3]*e[3]; ,
1048 e[4] = u[4]*c + v[4]*
s;d+=e[4]*e[4]; ,
1049 e[5] = u[5]*c + v[5]*
s;d+=e[5]*e[5]; ,
1050 e[6] = u[6]*c + v[6]*
s;d+=e[6]*e[6]; ,
1051 e[7] = u[7]*c + v[7]*
s;d+=e[7]*e[7]; )
1057 NETX(e[0] = u[0]*c + v[0]*s;d+=e[0]*e[0]; ,
1058 e[1] = u[1]*c + v[1]*
s;d+=e[1]*e[1]; ,
1059 e[2] = u[2]*c + v[2]*
s;d+=e[2]*e[2]; ,
1060 e[3] = u[3]*c + v[3]*
s;d+=e[3]*e[3]; ,
1061 e[4] = u[4]*c + v[4]*
s;d+=e[4]*e[4]; ,
1062 e[5] = u[5]*c + v[5]*
s;d+=e[5]*e[5]; ,
1063 e[6] = u[6]*c + v[6]*
s;d+=e[6]*e[6]; ,
1064 e[7] = u[7]*c + v[7]*
s;d+=e[7]*e[7]; )
1070 e[0] = u[0]*c + v[0]*
s;d+=e[0]*e[0];
1071 e[1] = u[1]*c + v[1]*
s;d+=e[1]*e[1];
1072 e[2] = u[2]*c + v[2]*
s;d+=e[2]*e[2];
1073 e[3] = u[3]*c + v[3]*
s;d+=e[3]*e[3];
1079 NETX(e[0] -= u[0]*c + v[0]*s; d+=e[0]*e[0]; ,
1080 e[1] -= u[1]*c + v[1]*
s; d+=e[1]*e[1]; ,
1081 e[2] -= u[2]*c + v[2]*
s; d+=e[2]*e[2]; ,
1082 e[3] -= u[3]*c + v[3]*
s; d+=e[3]*e[3]; ,
1083 e[4] -= u[4]*c + v[4]*
s; d+=e[4]*e[4]; ,
1084 e[5] -= u[5]*c + v[5]*
s; d+=e[5]*e[5]; ,
1085 e[6] -= u[6]*c + v[6]*
s; d+=e[6]*e[6]; ,
1086 e[7] -= u[7]*c + v[7]*
s; d+=e[7]*e[7]; )
1093 NETX(q[0] = (p[0] + m[0][l]*n);,
1094 q[1] = (p[1] + m[1][
l]*
n);,
1095 q[2] = (p[2] + m[2][
l]*
n);,
1096 q[3] = (p[3] + m[3][
l]*
n);,
1097 q[4] = (p[4] + m[4][
l]*
n);,
1098 q[5] = (p[5] + m[5][
l]*
n);,
1099 q[6] = (p[6] + m[6][
l]*
n);,
1100 q[7] = (p[7] + m[7][
l]*
n);)
1106 for(
int i=0;
i<
XIFO;
i++) *(a++) = *p[
i];
1113 for(
int k=0;
k<
XIFO;
k++) *(a++) = p[
k][
i];
1120 for(
int i=0;
i<
XIFO;
i++) *(a++) = *p[
i]++;
1126 return (*F)[0] *p[(*J)[0]] + (*F)[1] *p[(*J)[1]]
1127 + (*F)[2] *p[(*J)[2]] + (*F)[3] *p[(*J)[3]]
1128 + (*F)[4] *p[(*J)[4]] + (*F)[5] *p[(*J)[5]]
1129 + (*F)[6] *p[(*J)[6]] + (*F)[7] *p[(*J)[7]]
1130 + (*F)[8] *p[(*J)[8]] + (*F)[9] *p[(*J)[9]]
1131 + (*F)[10]*p[(*J)[10]] + (*F)[11]*p[(*J)[11]]
1132 + (*F)[12]*p[(*J)[12]] + (*F)[13]*p[(*J)[13]]
1133 + (*F)[14]*p[(*J)[14]] + (*F)[15]*p[(*J)[15]]
1134 + (*F)[16]*p[(*J)[16]] + (*F)[17]*p[(*J)[17]]
1135 + (*F)[18]*p[(*J)[18]] + (*F)[19]*p[(*J)[19]]
1136 + (*F)[20]*p[(*J)[20]] + (*F)[21]*p[(*J)[21]]
1137 + (*F)[22]*p[(*J)[22]] + (*F)[23]*p[(*J)[23]]
1138 + (*F)[24]*p[(*J)[24]] + (*F)[25]*p[(*J)[25]]
1139 + (*F)[26]*p[(*J)[26]] + (*F)[27]*p[(*J)[27]]
1140 + (*F)[28]*p[(*J)[28]] + (*F)[29]*p[(*J)[29]]
1141 + (*F)[30]*p[(*J)[30]] + (*F)[31]*p[(*J)[31]];
1145 return F[0] *p[J[0]] + F[1] *p[J[1]] + F[2] *p[J[2]] + F[3] *p[J[3]]
1146 + F[4] *p[J[4]] + F[5] *p[J[5]] + F[6] *p[J[6]] + F[7] *p[J[7]]
1147 + F[8] *p[J[8]] + F[9] *p[J[9]] + F[10]*p[J[10]] + F[11]*p[J[11]]
1148 + F[12]*p[J[12]] + F[13]*p[J[13]] + F[14]*p[J[14]] + F[15]*p[J[15]]
1149 + F[16]*p[J[16]] + F[17]*p[J[17]] + F[18]*p[J[18]] + F[19]*p[J[19]]
1150 + F[20]*p[J[20]] + F[21]*p[J[21]] + F[22]*p[J[22]] + F[23]*p[J[23]]
1151 + F[24]*p[J[24]] + F[25]*p[J[25]] + F[26]*p[J[26]] + F[27]*p[J[27]]
1152 + F[28]*p[J[28]] + F[29]*p[J[29]] + F[30]*p[J[30]] + F[31]*p[J[31]];
1162 __m128* _t = (__m128*) t; __m128* _T = (__m128*) T;
1163 __m128* _fp = (__m128*) fp; __m128* _fx = (__m128*) fx;
1171 inline void network::pnpx(
float* fp,
float* fx,
float* am,
float* AM,
float* u,
float*
v) {
1176 __m128* _fp = (__m128*) fp; __m128* _fx = (__m128*) fx;
1177 __m128* _am = (__m128*) am; __m128* _AM = (__m128*) AM;
1178 __m128* _u = (__m128*) u; __m128* _v = (__m128*) v;
1193 __m128* _am = (__m128*) am; __m128* _AM = (__m128*) AM;
1194 __m128* _u = (__m128*) u; __m128* _v = (__m128*) v;
1195 __m128* _U = (__m128*) U; __m128* _V = (__m128*) V;
1203 inline void network::dspx(
float* fp,
float* fx,
float* am,
float* AM,
float* u,
float*
v) {
1208 pnpx(fp, fx, am, AM, u, v);
1226 int V = (
int)this->rNRG.size();
1227 float* ee = this->rNRG.data;
1228 float* pp = this->pNRG.data;
1234 for(j=0; j<V; ++j) if(ee[j]>Eo) pp[j]=0;
1236 __m128* _m00 = (__m128*) mam;
1237 __m128* _m90 = (__m128*) mAM;
1238 __m128* _amp = (__m128*) amp;
1239 __m128* _AMP = (__m128*) AMP;
1240 __m128* _a00 = (__m128*) a_00.data;
1241 __m128* _a90 = (__m128*) a_90.data;
1245 for(j=0; j<V; ++j) if(ee[j]>ee[
m]) m=j;
1246 if(ee[m]<=Eo)
break; mm = m*
f;
1249 int J = wdmMRA.size(m);
1250 float*
c = wdmMRA.getXTalk(m);
1252 if(E/EE < 0.01)
break;
1259 for(j=0; j<J; j++) {
1290 int V = (
int)this->rNRG.size();
1291 float* ee = this->rNRG.data;
1292 float* pp = this->pNRG.data;
1299 __m128* _m00 = (__m128*) mam;
1300 __m128* _m90 = (__m128*) mAM;
1301 __m128* _amp = (__m128*) amp;
1302 __m128* _AMP = (__m128*) AMP;
1303 __m128* _a00 = (__m128*) a_00.data;
1304 __m128* _a90 = (__m128*) a_90.data;
1310 for(j=0; j<V; ++j) if(ee[j]>ee[
m]) m=j;
1311 if(ee[m]<=Eo)
break; mm = m*
f;
1321 c = wdmMRA.getXTalk(m);
1322 for(j=0; j<J; j++) {
1328 if(ee[n]>0) cc += c[1];
1343 c = wdmMRA.getXTalk(m);
1344 for(j=0; j<J; j++) {
1346 if(E<E2 && n!=m) {c+=8;
continue;}
1366 std::vector<float*> &pAVX,
int I) {
1368 float*
g = norm.
data+1; norm=0.;
1377 float* mk = pAVX[1];
1378 float* rn = pAVX[22];
1380 float*
t = tmp.
data; tmp=0.;
1383 float am[4*8]
_ALIGNED; __m128* _am = (__m128*)am;
1384 float x[4*8]
_ALIGNED; __m128* _x = (__m128*)
x;
1385 float h[4*8]
_ALIGNED; __m128* _h = (__m128*)
h;
1387 float* an = pAVX[17];
1388 NETX(__m128* _a0 = (__m128*)(an+4*M*0);, __m128* _a1 = (__m128*)(an+4*M*1);,
1389 __m128* _a2 = (__m128*)(an+4*M*2);, __m128* _a3 = (__m128*)(an+4*M*3);,
1390 __m128* _a4 = (__m128*)(an+4*M*4);, __m128* _a5 = (__m128*)(an+4*M*5);,
1391 __m128* _a6 = (__m128*)(an+4*M*6);, __m128* _a7 = (__m128*)(an+4*M*7);)
1393 for(m=0; m<
M; m++) {
1395 NETX(_a0[m] = _mm_set_ps(q[0][m],q[0][m],p[0][m],p[0][m]); q[0][M+
m]=0; ,
1396 _a1[
m] = _mm_set_ps(q[1][m],q[1][m],p[1][m],p[1][m]); q[1][M+
m]=0; ,
1397 _a2[
m] = _mm_set_ps(q[2][m],q[2][m],p[2][m],p[2][m]); q[2][M+
m]=0; ,
1398 _a3[
m] = _mm_set_ps(q[3][m],q[3][m],p[3][m],p[3][m]); q[3][M+
m]=0; ,
1399 _a4[
m] = _mm_set_ps(q[4][m],q[4][m],p[4][m],p[4][m]); q[4][M+
m]=0; ,
1400 _a5[
m] = _mm_set_ps(q[5][m],q[5][m],p[5][m],p[5][m]); q[5][M+
m]=0; ,
1401 _a6[
m] = _mm_set_ps(q[6][m],q[6][m],p[6][m],p[6][m]); q[6][M+
m]=0; ,
1402 _a7[
m] = _mm_set_ps(q[7][m],q[7][m],p[7][m],p[7][m]); q[7][M+
m]=0; )
1405 for(m=0; m<
M; m++) {
1406 if(mk[m]<=0.)
continue;
1408 int J = wdmMRA.size(m)*2;
1410 float*
c = wdmMRA.getXTalk(m);
1411 __m128* _c = (__m128*)(c+4);
1413 NETX(u=p[0][m]; v=q[0][
m]; _am[0]=_mm_set_ps(v,u,v,u); _x[0]=_mm_setzero_ps(); ,
1414 u=p[1][
m]; v=q[1][
m]; _am[1]=_mm_set_ps(v,u,v,u); _x[1]=_mm_setzero_ps(); ,
1415 u=p[2][
m]; v=q[2][
m]; _am[2]=_mm_set_ps(v,u,v,u); _x[2]=_mm_setzero_ps(); ,
1416 u=p[3][
m]; v=q[3][
m]; _am[3]=_mm_set_ps(v,u,v,u); _x[3]=_mm_setzero_ps(); ,
1417 u=p[4][
m]; v=q[4][
m]; _am[4]=_mm_set_ps(v,u,v,u); _x[4]=_mm_setzero_ps(); ,
1418 u=p[5][
m]; v=q[5][
m]; _am[5]=_mm_set_ps(v,u,v,u); _x[5]=_mm_setzero_ps(); ,
1419 u=p[6][
m]; v=q[6][
m]; _am[6]=_mm_set_ps(v,u,v,u); _x[6]=_mm_setzero_ps(); ,
1420 u=p[7][
m]; v=q[7][
m]; _am[7]=_mm_set_ps(v,u,v,u); _x[7]=_mm_setzero_ps(); )
1422 for(j=0; j<J; j+=2) {
1424 NETX(_x[0]=_mm_add_ps(_x[0],_mm_mul_ps(_c[j],_a0[n]));,
1425 _x[1]=_mm_add_ps(_x[1],_mm_mul_ps(_c[j],_a1[n]));,
1426 _x[2]=_mm_add_ps(_x[2],_mm_mul_ps(_c[j],_a2[n]));,
1427 _x[3]=_mm_add_ps(_x[3],_mm_mul_ps(_c[j],_a3[n]));,
1428 _x[4]=_mm_add_ps(_x[4],_mm_mul_ps(_c[j],_a4[n]));,
1429 _x[5]=_mm_add_ps(_x[5],_mm_mul_ps(_c[j],_a5[n]));,
1430 _x[6]=_mm_add_ps(_x[6],_mm_mul_ps(_c[j],_a6[n]));,
1431 _x[7]=_mm_add_ps(_x[7],_mm_mul_ps(_c[j],_a7[n]));)
1434 NETX(_h[0]=_mm_mul_ps(_x[0],_am[0]);,
1435 _h[1]=_mm_mul_ps(_x[1],_am[1]);,
1436 _h[2]=_mm_mul_ps(_x[2],_am[2]);,
1437 _h[3]=_mm_mul_ps(_x[3],_am[3]);,
1438 _h[4]=_mm_mul_ps(_x[4],_am[4]);,
1439 _h[5]=_mm_mul_ps(_x[5],_am[5]);,
1440 _h[6]=_mm_mul_ps(_x[6],_am[6]);,
1441 _h[7]=_mm_mul_ps(_x[7],_am[7]);)
1443 NETX(t[0]=
h[ 0]+
h[ 1]+
h[ 2]+
h[ 3]; t[0]=t[0]>0?t[0]:0; g[0]+=t[0]; ,
1444 t[1]=
h[ 4]+
h[ 5]+
h[ 6]+
h[ 7]; t[1]=t[1]>0?t[1]:0; g[1]+=t[1]; ,
1445 t[2]=h[ 8]+h[ 9]+h[10]+h[11]; t[2]=t[2]>0?t[2]:0; g[2]+=t[2]; ,
1446 t[3]=h[12]+h[13]+h[14]+h[15]; t[3]=t[3]>0?t[3]:0; g[3]+=t[3]; ,
1447 t[4]=h[16]+h[17]+h[18]+h[19]; t[4]=t[4]>0?t[4]:0; g[4]+=t[4]; ,
1448 t[5]=h[20]+h[21]+h[22]+h[23]; t[5]=t[5]>0?t[5]:0; g[5]+=t[5]; ,
1449 t[6]=h[24]+h[25]+h[26]+h[27]; t[6]=t[6]>0?t[6]:0; g[6]+=t[6]; ,
1450 t[7]=h[28]+h[29]+h[30]+h[31]; t[7]=t[7]>0?t[7]:0; g[7]+=t[7]; )
1454 NETX(u=p[0][m]; v=q[0][
m]; e=(u*u+v*
v)/(t[0]+o); q[0][M+
m]=(e>=1)?0:e; ,
1455 u=p[1][
m]; v=q[1][
m]; e=(u*u+v*
v)/(t[1]+o); q[1][M+
m]=(e>=1)?0:e; ,
1456 u=p[2][
m]; v=q[2][
m]; e=(u*u+v*
v)/(t[2]+o); q[2][M+
m]=(e>=1)?0:e; ,
1457 u=p[3][
m]; v=q[3][
m]; e=(u*u+v*
v)/(t[3]+o); q[3][M+
m]=(e>=1)?0:e; ,
1458 u=p[4][
m]; v=q[4][
m]; e=(u*u+v*
v)/(t[4]+o); q[4][M+
m]=(e>=1)?0:e; ,
1459 u=p[5][
m]; v=q[5][
m]; e=(u*u+v*
v)/(t[5]+o); q[5][M+
m]=(e>=1)?0:e; ,
1460 u=p[6][
m]; v=q[6][
m]; e=(u*u+v*
v)/(t[6]+o); q[6][M+
m]=(e>=1)?0:e; ,
1461 u=p[7][
m]; v=q[7][
m]; e=(u*u+v*
v)/(t[7]+o); q[7][M+
m]=(e>=1)?0:e; )
1463 NETX(u=
x[ 0]+
x[ 2]; v=
x[ 1]+
x[ 3]; rn[
m]+=u*u+v*
v; ,
1464 u=x[ 4]+x[ 6]; v=x[ 5]+x[ 7]; rn[
m]+=u*u+v*
v; ,
1465 u=x[ 8]+x[10]; v=x[ 9]+x[11]; rn[
m]+=u*u+v*
v; ,
1466 u=x[12]+x[14]; v=x[13]+x[15]; rn[
m]+=u*u+v*
v; ,
1467 u=x[16]+x[18]; v=x[17]+x[19]; rn[
m]+=u*u+v*
v; ,
1468 u=x[20]+x[22]; v=x[21]+x[23]; rn[
m]+=u*u+v*
v; ,
1469 u=x[24]+x[26]; v=x[25]+x[27]; rn[
m]+=u*u+v*
v; ,
1470 u=x[28]+x[30]; v=x[29]+x[31]; rn[
m]+=u*u+v*
v; )
1474 for(n=1; n<=
XIFO; n++) {
1476 e = q[n-1][II+4]*q[n-1][II+4];
1478 q[n-1][II+5] = norm.
data[
n];
1494 float* nn = norm.
data;
1497 nn[
n] = q[
n-1][II+5];
1498 p[
n-1][II+5] = nn[
n];
1499 e = p[
n-1][II+4]*p[
n-1][II+4];
1502 for(
int i=0;
i<I;
i++) {
1503 p[
n-1][I+
i] = ec[
i]>0 ? q[
n-1][I+
i] : 0.;
1515 for(
int i=0;
i<I;
i++) {
1517 a_00[
i*NIFO+
n]=p[
n][
i];
1518 a_90[
i*NIFO+
n]=q[
n][
i];
1524 #endif // NETWORK_HH wavearray< double > t(hp.size())
monster wdmMRA
list of pixel pointers for MRA
std::vector< char * > ifoName
detector * getifo(size_t n)
param: detector index
static float _sse_abs_ps(__m128 *_a)
static double g(double e)
wavearray< double > skyHole
void like(char _LIKE)
buffer for standard response 90 ampl
WSeries< double > pixeLHood
std::vector< netcluster > wc_List
void set2or(double p)
param: threshold
std::vector< double > * getmdcTime()
static void cpp_(float *&, float **)
static float rots(float *, float, float *, float, float *)
std::vector< pixel > cluster
wavearray< double > a(hp.size())
size_t setSkyMask(double, char *, bool *, int)
static void mulx(double **, size_t, double **, size_t, double *)
static void inix(double **, size_t, double *)
static void pnpx(float *fp, float *fx, float *am, float *AM, float *u, float *v)
static void _sse_zero_ps(__m128 *_p)
wavearray< float > _avx_norm_ps(float **, float **, std::vector< float *> &, int)
std::vector< vectorD > NDM
wavearray< float > a_90
buffer for cluster sky 00 amplitude
double iGamma(double r, double p)
static void _sse_dsp4_ps(__m128 *u, __m128 *v, __m128 *_am, __m128 *_AM, __m128 *_u, __m128 *_v)
double getliveTime(size_t n)
double getmdcTime(size_t n)
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<< "\ layers : "<< nLAYERS<< "\ dF(hz) : "<< dF<< "\ 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
static void _sse_cpf4_ps(__m128 *_aa, __m128 *_pp)
int _sse_mra_ps(float *, float *, float, int)
WDM< double > wdm(nLAYERS, nLAYERS, 6, 10)
std::vector< netpixel * > pList
string getmdcType(size_t n)
static float _sse_rotsub_ps(__m128 *_u, float c, __m128 *_v, float s, __m128 *_a)
void _avx_saveGW_ps(float **, float **, int)
std::vector< std::string > mdcType
string getmdcList(size_t n)
static void _sse_cpf_ps(float *a, __m128 *_p)
std::vector< size_t > mdc__ID
static double rotx(double *, double, double *, double, double *)
std::vector< double > mdcTime
size_t cluster(int kt, int kf)
param: time gap in pixels return: number of reconstructed clusters
void setRunID(size_t n)
param: run
std::vector< double > vectorD
std::vector< detector * > ifoList
static void _sse_rotadd_ps(__m128 *_u, float c, __m128 *_v, float s, __m128 *_a)
long subNetCut(network *net, int lag, float snc, TH2F *hist)
SUPERCLUSTER.
cout<< "SNR "<< xsnr<< endl;wavearray< double > f
wavearray< double > skyENRG
r add(tfmap, const_cast< char *>("hchannel"))
size_t events(int type, int lag=-1)
virtual void Browse(TBrowser *)
void constraint(double d=1., double g=0.0001)
param: constraint parameter, p=0 - no constraint
WDM< double > * getwdm(size_t M)
param: number of wdm layers
static int netx(double *, double, double *, double, double)
wavearray< float > pNRG
buffers for cluster residual energy
std::vector< delayFilter > filter90
static double divx(double *, double *)
void Forward(size_t k)
param: number of steps
int _sse_MRA_ps(network *net, float *amp, float *AMP, float Eo, int K)
static void dspx(float *u, float *v, float *am, float *AM)
std::vector< double > livTime
static void addx(double *, double *, double *)
std::vector< std::string > mdcList
static void dpfx(float *fp, float *fx)
wavearray< float > a_00
wdm multi-resolution analysis
std::vector< WDM< double > * > wdmList
static void cpf_(float *&a, double **p)
static void pnt_(float **, float **, short **, int, int)
void setOffset(double t)
param: run
std::vector< waveSegment > segList
int _sse_mra_ps(network *NET, float *amp, float *AMP, float Eo, int K)
static double dot32(std::vector< float > *, double *, std::vector< short > *)
int getIndex(double theta, double phi)
param: theta [deg] param: phi [deg]
wavearray< double > skyProb
static double rot4(double *, double, double *, double, double *)
std::vector< delayFilter > filter
WSeries< double > pixeLNull
static void _sse_add_ps(__m128 *_a, __m128 *_b)
static double dot4(double *, double *)
double getNDM(size_t i, size_t j)
param: first detector param: second detector
size_t add(WDM< double > *wdm)
param: pointer to wdm return number of wdm tronsforms in the list
wavearray< double > skyMaskCC
netcluster * getwc(size_t n)
param: delay index
skymap nSensitivity
list of wdm tranformations
int _sse_MRA_ps(float *, float *, float, int)
static double dotx(double *, double *)
static void _sse_mul_ps(__m128 *_a, float b)
wavearray< float > rNRG
buffer for cluster sky 90 amplitudes
void setMRAcatalog(char *fn)
wavearray< short > skyMask
size_t getmdc__ID(size_t n)
static void _sse_dpf4_ps(__m128 *_Fp, __m128 *_Fx, __m128 *_fp, __m128 *_fx)
static double sumx(double *)
static void _sse_pnp4_ps(__m128 *_fp, __m128 *_fx, __m128 *_am, __m128 *_AM, __m128 *_u, __m128 *_v)