28 #define NTRIES 1000000
34 #define PLOT_POSTFIX "_WM"
47 #define COORDINATES "Geographic"
53 #define DISPLAY_WORLD_MAP
62 static inline int net9(
double*,
double,
double*,
double,
double);
75 if (ndet==0) {cout <<
"No detector !!!" << endl;
exit(0);}
81 h2->GetXaxis()->SetNdivisions(70318);
82 h2->GetXaxis()->SetLabelFont(42);
83 h2->GetXaxis()->SetLabelOffset(0.012);
84 h2->GetXaxis()->SetTitleOffset(1.1);
85 h2->GetXaxis()->SetTitleFont(72);
86 h2->GetYaxis()->SetNdivisions(409);
87 h2->GetYaxis()->SetLabelFont(42);
88 h2->GetYaxis()->SetLabelOffset(0.01);
89 h2->GetZaxis()->SetLabelFont(42);
90 h2->GetXaxis()->SetTitleFont(42);
91 h2->GetXaxis()->SetTitle(
"Phi");
92 h2->GetXaxis()->CenterTitle(
true);
93 h2->GetYaxis()->SetTitleFont(42);
94 h2->GetYaxis()->SetTitle(
"Theta");
95 h2->GetYaxis()->CenterTitle(
true);
96 h2->GetZaxis()->SetLabelOffset(0.00001);
97 h2->GetZaxis()->SetNoExponent(
false);
100 #ifdef DISPLAY_PERC_UNDER2
107 int ii=
int(x[
i]);
if(ii>359) ii=359;
108 int jj=
int(y[i]);
if(jj>179) jj=179;
112 #ifdef DISPLAY_PERC_UNDER2
113 if(z[i]<2) ncnt_under2[ii][jj]++;
114 Fx->SetBinContent(ii+1,jj+1,t[i]);
116 double binc = h2->GetBinContent(ii+1,jj+1);
117 h2->SetBinContent(ii+1,jj+1,binc+z[i]);
121 #ifdef DISPLAY_PERC_UNDER2
122 if(ncnt[
i][
j]>0) h2->SetBinContent(
i+1,
j+1,100.*(
double(ncnt_under2[
i][
j])/
double(ncnt[
i][j])));
124 double binc = h2->GetBinContent(
i+1,j+1);
125 if(ncnt[
i][j]>0) binc/=ncnt[
i][
j];
126 h2->SetBinContent(
i+1,j+1,binc);
132 double*
xx =
new double[
size];
133 double*
yy =
new double[
size];
134 double* zz =
new double[
size];
138 #ifdef DISPLAY_PERC_UNDER2
139 double perc_under2 = h2->GetBinContent(
i+1,
j+1);
140 double fx = Fx->GetBinContent(
i+1,
j+1);
142 double nri = h2->GetBinContent(
i+1,
j+1);
146 #ifdef DISPLAY_PERC_UNDER2
162 #ifdef DISPLAY_WORLD_MAP
179 cout <<
"Print File : " << ofileName.Data() << endl;
192 detector_selected[0]=
true;
194 detector_selected[0]=
false;
197 detector_selected[1]=
true;
199 detector_selected[1]=
false;
202 detector_selected[2]=
true;
204 detector_selected[2]=
false;
207 detector_selected[3]=
true;
209 detector_selected[3]=
false;
212 detector_selected[4]=
true;
214 detector_selected[4]=
false;
217 detector_selected[5]=
true;
219 detector_selected[5]=
false;
222 detector_selected[6]=
true;
224 detector_selected[6]=
false;
227 detector_selected[7]=
true;
229 detector_selected[7]=
false;
232 detector_selected[8]=
true;
234 detector_selected[8]=
false;
238 detector_name[0]=
"H1";
239 detector_name[1]=
"L1";
240 detector_name[2]=
"G1";
241 detector_name[3]=
"V1";
242 detector_name[4]=
"T1";
243 detector_name[5]=
"H2";
244 detector_name[6]=
"A1";
245 detector_name[7]=
"A2";
246 detector_name[8]=
"J1";
260 if (detector_selected[0]) sdetectors+=
"LHO1 ";
261 if (detector_selected[1]) sdetectors+=
"LLO ";
262 if (detector_selected[2]) sdetectors+=
"GEO ";
263 if (detector_selected[3]) sdetectors+=
"VIRGO ";
264 if (detector_selected[4]) sdetectors+=
"TAMA ";
265 if (detector_selected[5]) sdetectors+=
"LHO2 ";
266 if (detector_selected[6]) sdetectors+=
"AIGO ";
267 if (detector_selected[7]) sdetectors+=
"AIGO2 ";
268 if (detector_selected[8]) sdetectors+=
"LCGT ";
271 if (detector_selected[
k]) {
276 char hacc_title[256];
278 sprintf(hacc_title,
"%s Network Response Index (gamma=%2.2f)",sdetectors.Data(),
NET_GAMMA);
280 sprintf(hacc_title,
"%s Network Response Index (gamma=%2.2f)",sdetectors.Data(),
NET_GAMMA);
285 char ofile_title[256];
292 else sprintf(ofile_title,
"%s.png",ofile_title);
293 ofileName = ofile_title;
294 ofileName.ReplaceAll(
" ",
"_");
308 x =
new double[
size];
309 y =
new double[
size];
310 z =
new double[
size];
311 t =
new double[
size];
315 if(
i%100000==0) cout <<
i << endl;
316 int idx =
int(gRandom->Uniform(0,L));
322 double phi=gRandom->Uniform(0,360);
323 double theta=gRandom->Uniform(0,180);
324 double psi=gRandom->Uniform(0,180);
326 double Hp=gRandom->Uniform(-1,1);
327 double Hx=gRandom->Uniform(-1,1);
331 if (detector_selected[
k]) {
338 X[
k] = A*gRandom->Gaus(0,1);
343 #ifdef WRONG_DIRECTION
344 F[
k] = D[
k]->
antenna(gRandom->Uniform(0,180),gRandom->Uniform(0,360),0);
350 if (detector_selected[
k]) {
351 X[
k] = X[
k]*
SNR/E + gRandom->Gaus(0.,1.);
359 if (detector_selected[
k]) {
365 double gR = (gp-
gx)/2.;
366 double gr = (gp+
gx)/2.;
367 double gc = sqrt(gR*gR+gI*gI);
376 if (detector_selected[
k]) {
378 mFp_dpf+=Fp_dpf[
k]*Fp_dpf[
k];
380 mFx_dpf+=Fx_dpf[
k]*Fx_dpf[
k];
389 if (detector_selected[
k]) {
394 double ri=rip*rip/mFp_dpf+rix*rix/mFx_dpf;
400 if (detector_selected[
k]) {
405 double uc = (Xp*gx - Xx*gI);
406 double us = (Xx*gp - Xp*gI);
407 double vc = (gp*uc + gI*us);
408 double vs = (gx*us + gI*uc);
416 if (detector_selected[
k]) {
426 if (detector_selected[
k]) {
431 double Xri=Xrip*Xrip/um+Xrix*Xrix/vm;
435 double GAMMA = 1.-gamma*gamma;
436 double ndi=
net9(u,um,v,vm,GAMMA);
441 if (detector_selected[
k]) {
446 uFp/=sqrt(mFp_dpf*um);
447 uFx/=sqrt(mFx_dpf*um);
448 double angle =
fabs(atan2(uFx,uFp)*180./pi);
449 if (angle>90) angle=180.-
angle;
457 if (detector_selected[
k]) {
462 om+=Fp_dpf[
k]*Fp_dpf[
k];
465 double sh = (1-cw*cw/(wm*
Et))/(1-ch*ch/(om*
Et));
473 double Fp = sqrt(gr+gc);
474 double Fx = sqrt(gr-gc);
482 inline int net9(
double* u,
double um,
double*
v,
double vm,
double g) {
483 double q = (1.-
g)*um;
485 return int(u[0]*u[0]>q) -
int((u[0]*u[0]/um+v[0]*v[0]/vm)>g) +
486 int(u[1]*u[1]>q) -
int((u[1]*u[1]/um+v[1]*v[1]/vm)>g) +
487 int(u[2]*u[2]>q) -
int((u[2]*u[2]/um+v[2]*v[2]/vm)>g) +
488 int(u[3]*u[3]>q) -
int((u[3]*u[3]/um+v[3]*v[3]/vm)>g) +
489 int(u[4]*u[4]>q) -
int((u[4]*u[4]/um+v[4]*v[4]/vm)>g) +
490 int(u[5]*u[5]>q) -
int((u[5]*u[5]/um+v[5]*v[5]/vm)>g) +
491 int(u[6]*u[6]>q) -
int((u[6]*u[6]/um+v[6]*v[6]/vm)>g) +
492 int(u[7]*u[7]>q) -
int((u[7]*u[7]/um+v[7]*v[7]/vm)>g) +
493 int(u[8]*u[8]>q) -
int((u[8]*u[8]/um+v[8]*v[8]/vm)>g);
wavearray< double > t(hp.size())
static double g(double e)
static int net9(double *, double, double *, double, double)
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
void Draw(int dpaletteId=0, Option_t *option="colfz")
void FillData(int size, double *phi, double *theta, double *binc)
wavecomplex antenna(double, double, double=0.)
param: source theta,phi, polarization angle psi in degrees
gwavearray< double > * gx
void SetTitle(TString title)
int GetSkyMapSensitivity(double *&x, double *&y, double *&z, double *&t, TString &title, TString &ofileName, int &ndet)
void SetWorldMap(bool drawWorldMap=true)
double fabs(const Complex &x)
void CwbToGeographic(double ilongitude, double ilatitude, double &olongitude, double &olatitude)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
void SetOptions(TString projection="hammer", TString coordinate="Geographic", double resolution=1, bool goff=false)