9 #include "TObjString.h"
10 #include "TPaletteAxis.h"
95 char defn[16] =
"watplot";
96 if (name && gROOT->FindObject(name)!=NULL) {
97 printf(
"watplot : Error Canvas Name %s already exist",name);
102 if(!name) name = defn;
103 canvas=
new TCanvas(name, name, i1, i2, i3, i4);
105 canvas->ToggleEventStatus();
108 canvas->SetFillColor(kWhite);
109 canvas->SetRightMargin(0.10);
110 canvas->SetLeftMargin(0.10);
111 canvas->SetBottomMargin(0.13);
115 gStyle->SetFrameBorderMode(0);
118 gStyle->SetTitleH(0.050);
119 gStyle->SetTitleW(0.95);
120 gStyle->SetTitleY(0.98);
121 gStyle->SetTitleFont(12,
"D");
122 gStyle->SetTitleColor(kBlue,
"D");
123 gStyle->SetTextFont(12);
124 gStyle->SetTitleFillColor(kWhite);
125 gStyle->SetLineColor(kWhite);
126 gStyle->SetNumberContours(256);
127 gStyle->SetCanvasColor(kWhite);
128 gStyle->SetStatBorderSize(1);
133 double t1,
double t2,
bool fft,
float f1,
float f2,
bool psd,
float t3,
bool oneside) {
151 printf(
" Plot error: t2 must be greater then t1.\n");
155 printf(
" Plot error: f2 must be greater then f1.\n");
161 double Ts = (td.
rate() == 0)? 1.: 1./td.
rate();
163 int i2 = (t2 == 0.)? td.
size() :
int((t2-td.
start())/Ts);
165 int nmax = (i2-i1)-(i2-i1)%2;
177 for (
int i=0;
i < nmax;
i++) {
178 _x.
data[
i] = x0 + Ts*
i - 0.;
185 if(f2==0.) { f1 = 0.; f2 = td.
rate()/2.; }
187 t3 = t3<0. ? 0. :
t3;
189 int bsize = t3*td.
rate();
191 int loops =
int(_y.
size()/bsize)==0 ? 1 :
int(_y.
size()/bsize);
192 double Fs=(double)td.
rate()/(double)bsize;
197 for (
int n=0;
n<loops;
n++) {
200 for (
int i=0;
i<bsize;
i++) u[
i]=_y[
i+shift];
201 for (
int i=0;
i<bsize;
i++) u[
i]*=w[
i];
203 for (
int i=0;
i<bsize;
i+=2) psd[
i/2]+=pow(u[
i],2)+pow(u[i+1],2);
205 for (
int i=0;
i<bsize/2;
i++) psd[
i]=sqrt(psd[
i]/(
double)loops)*sqrt(1./Fs);
206 if(oneside) psd*=sqrt(2.);
209 for (
int i=0;
i<nmax/2;
i++) _x.
data[
i]=
i*Fs;
212 double Fs=(double)td.
rate()/(double)_y.
size();
216 for (
int i=0;
i<nmax/2;
i++) _x.
data[
i]=
i*Fs;
217 if(oneside)
for(
int i=0;
i<nmax/2;
i++) _y.
data[
i]*=sqrt(2.);
222 for (
int i=0;
i<nmax;
i++) {
230 G =
new TGraph(nmax,_x.
data,_y.
data);
231 G->SetLineColor(col);
232 G->SetMarkerColor(col);
235 G->GetHistogram()->SetTitle(
"");
236 G->SetFillColor(kWhite);
239 G->GetXaxis()->SetTitleFont(42);
240 G->GetXaxis()->SetLabelFont(42);
241 G->GetXaxis()->SetLabelOffset(0.012);
242 G->GetXaxis()->SetTitleOffset(1.5);
245 G->GetYaxis()->SetTitleFont(42);
246 G->GetYaxis()->SetLabelFont(42);
247 G->GetYaxis()->SetLabelOffset(0.01);
248 G->GetYaxis()->SetTitleOffset(1.4);
251 G->GetHistogram()->GetXaxis()->SetRangeUser(f1,f2);
253 G->GetHistogram()->GetYaxis()->SetRangeUser(ymin/2.,ymax*1.1);
254 G->GetHistogram()->SetXTitle(
"freq, hz");
256 G->GetHistogram()->SetXTitle(
"time, s");
258 G->GetHistogram()->SetYTitle(
"magnitude");
274 int nj =
int((t2-t1)*w.
rate())/ni;
277 double freq=rate/2/ni;
280 double** iw =
new double*[nj];
281 for(
int j=0;
j<nj;
j++) iw[
j] =
new double[ni];
285 for(
int i=0;
i<ni;
i++) {
289 for(
int j=nb;
j<ne;
j++) {
298 for(
int n=0;
n<sfact;
n++) smfact*=3;
304 sw =
new double*[snj];
305 for(
int j=0;
j<snj;
j++) sw[
j] =
new double[sni];
306 for(
int i=0;
i<sni;
i++) {
307 for(
int j=0;
j<snj;
j++) {
313 for(
int n=1;
n<=sfact;
n++) {
315 for(
int j=0;
j<snj;
j++)
delete [] sw[
j];
320 sw =
new double*[snj];
321 for(
int j=0;
j<snj;
j++) sw[
j] =
new double[sni];
322 for(
int i=0;
i<sni;
i++)
for(
int j=0;
j<snj;
j++) sw[
j][
i] = 0.;
323 for(
int i=1;
i<sni-1;
i++) {
324 for(
int j=1;
j<snj-1;
j++) {
325 for(
int j3=
j-1;j3<=
j+1;j3++) {
326 for(
int i3=
i-1;i3<=
i+1;i3++) {
328 sw[
j][
i] += iw[(j3-j3%3)/3][(i3-i3%3)/3];
334 for(
int j=0;
j<nj;
j++)
delete [] iw[
j];
336 iw =
new double*[snj];
337 for(
int j=0;
j<snj;
j++) iw[
j] =
new double[sni];
338 for(
int i=0;
i<sni;
i++) {
339 for(
int j=0;
j<snj;
j++) {
345 for(
int j=0;
j<snj;
j++)
delete [] iw[
j];
350 hist2D=
new TH2F(
"WTF",
"", snj, 0., t2-t1, sni, 0., freq*ni);
351 hist2D->SetXTitle(
"time, sec");
352 hist2D->SetYTitle(
"frequency, Hz");
354 Int_t
colors[30]={101,12,114,13,115,14,117,15,16,17,166,18,19,
355 167,0,0,167,19,18,166,17,16,15,117,14,115,13,114,12,101};
356 if(pal==0) gStyle->SetPalette(30,colors);
358 else {gStyle->SetPalette(1,0);gStyle->SetNumberContours(pal);}
370 double srate=smfact*
rate;
371 double sfreq=freq/smfact;
372 for(
int i=0;
i<sni;
i++) {
373 for(
int j=snb;
j<sne;
j++) {
374 double x = sw[
j-snb][
i];
379 hist2D->Fill(
double(
j-snb)/srate,(
i+0.5)*sfreq,x);
383 for(
int j=0;
j<snj;
j++)
delete [] sw[
j];
387 hist2D->SetFillColor(kWhite);
388 hist2D->GetXaxis()->SetTitleFont(42);
389 hist2D->GetXaxis()->SetLabelFont(42);
390 hist2D->GetXaxis()->SetLabelOffset(0.012);
391 hist2D->GetXaxis()->SetTitleOffset(1.1);
392 hist2D->GetYaxis()->SetTitleFont(42);
393 hist2D->GetYaxis()->SetLabelFont(42);
394 hist2D->GetYaxis()->SetLabelOffset(0.01);
395 hist2D->GetZaxis()->SetLabelFont(42);
396 hist2D->SetTitleOffset(1.3,
"Y");
397 if(opt)
hist2D->Draw(opt);
398 else hist2D->Draw(
"COLZ");
402 TPaletteAxis *
palette = (TPaletteAxis*)
hist2D->GetListOfFunctions()->FindObject(
"palette");
403 palette->SetX1NDC(0.91);
404 palette->SetX2NDC(0.933);
405 palette->SetTitleOffset(0.92);
406 palette->GetAxis()->SetTickSize(0.01);
429 int nj =
int((t2-t1)*w.
rate())/ni;
437 for(
int i=0;
i<ni;
i++) {
439 for(
int j=nb;
j<ne;
j++) {
479 printf(
"watplot::plot error: t2 must be greater then t1.\n");
483 printf(
"watplot::plot error: t1 must be in this range [%0.12g,%0.12g]\n",
488 printf(
"watplot::plot error: t2 must be in this range [%0.12g,%0.12g]\n",
502 if(mode==1) {ztitle=
"(E00+E90)/2";}
503 if(mode==2) {ztitle=
"sqrt((E00+E90)/2)";}
505 if(mode==3) {ztitle=
"amplitude:00";A90=0;}
506 if(mode==4) {ztitle=
"energy:00";A00=sqrt(2.);A90=0;}
507 if(mode==5) {ztitle=
"|amplitude:00|";A90=0;}
509 if(mode==6) {ztitle=
"amplitude:90";A00=0;}
510 if(mode==7) {ztitle=
"energy:90";A00=0;A90=sqrt(2.);}
511 if(mode==8) {ztitle=
"|amplitude:90|";A00=0;}
517 double* map00 = wdm->
pWWS;
518 double tsRate = w.
rate();
520 int nTC = w.
size()/(
M+1)/mF;
521 double* map90 = map00 + (mF-1)*(
M+1)*nTC;
526 double* yBins =
new double[
M+2];
527 double dF = tsRate/
M/2.;
530 for(
int i=2;
i<=
M; ++
i) yBins[
i] = yBins[1] + (
i-1)*dF;
531 yBins[
M+1] = tsRate/2.;
533 const double scale = 1./w.
wrate();
535 hist2D=
new TH2F(
"WTF",
"", 2*nTC, 0., nTC*scale,
M+1, yBins);
536 hist2D->SetXTitle(
"time, sec");
537 hist2D->SetYTitle(
"frequency, Hz");
541 int it1 = (t1-w.
start())/scale + 1;
542 int it2 = (t2-w.
start())/scale + 1;
543 if(it2<=it1 || it2>nTC)it2 = nTC;
545 map00+=it1*(
M+1); map90+=it1*(
M+1);
546 for(
int i=it1;
i<it2; ++
i){
548 v =
procOpt(mode%3, A00*map00[0], A90*map90[0]);
549 hist2D->SetBinContent( 2*
i , 1, v);
550 hist2D->SetBinContent( 2*
i+1 , 1, v);
552 v =
procOpt(mode%3, A00*map00[
M], A90*map90[M]);
553 hist2D->SetBinContent( 2*
i , M+1, v);
554 hist2D->SetBinContent( 2*
i+1 , M+1, v);
556 for(
int j=1;
j<
M; ++
j){
557 v =
procOpt(mode%3, A00*map00[
j], A90*map90[j]);
558 hist2D->SetBinContent( 2*
i , j+1, v);
559 hist2D->SetBinContent( 2*
i+1 , j+1, v);
561 map00+=M+1; map90+=M+1;
568 if(mode==0) ztitle=
"amplitude";
569 if(mode==1) ztitle=
"energy";
570 if(mode==2) ztitle=
"|amplitude|";
574 int nj =
int((t2-t1)*w.
rate())/ni;
577 double freq=rate/2/ni;
584 hist2D->SetXTitle(
"time, sec");
585 hist2D->SetYTitle(
"frequency, Hz");
587 Int_t
colors[30]={101,12,114,13,115,14,117,15,16,17,166,18,19,
588 167,0,0,167,19,18,166,17,16,15,117,14,115,13,114,12,101};
589 if(pal==0) gStyle->SetPalette(30,colors);
591 else {gStyle->SetPalette(1,0);gStyle->SetNumberContours(pal);}
597 for(
int i=0;
i<ni;
i++) {
599 for(
int j=nb;
j<=ne;
j++) {
601 hist2D->Fill((
j+0.5)/rate,(
i+0.5)*freq,x);
606 for(
int i=0;
i<ni;
i++) {
608 for(
int j=nb;
j<=ne;
j++) {
610 hist2D->Fill((
j+0.5)/rate,(
i+0.5)*freq,x);
615 for(
int i=0;
i<ni;
i++) {
617 for(
int j=nb;
j<=ne;
j++) {
619 hist2D->Fill((
j+0.5)/rate,(
i+0.5)*freq,x);
624 for(
int i=0;
i<ni;
i++) {
626 for(
int j=nb;
j<=ne;
j++) {
627 x=(wl.
data[
j] > 0.) ? 1. : -1.;
628 hist2D->Fill((
j+0.5)/rate,(
i+0.5)*freq,x);
633 for(
int i=0;
i<ni;
i++) {
635 for(
int j=nb;
j<=ne;
j++) {
636 x=(wl.
data[
j] > 0.) ? 1. : -1.;
637 if(wl.
data[
j] == 0.) x=0.;
638 hist2D->Fill((
j+0.5)/rate,(
i+0.5)*freq,x);
646 for(
int i=0;
i<ni;
i++) {
649 for(
int j=nb;
j<ne-0;
j++) {
652 if(x>1){ sum +=
x; nsum++; }
653 hist2D->Fill(
j/rate,(
i+0.5)*freq,x);
661 hist2D->SetFillColor(kWhite);
664 sprintf(title,
"Scalogram (%s)",ztitle.Data());
667 hist2D->GetXaxis()->SetNdivisions(506);
668 hist2D->GetXaxis()->SetLabelFont(42);
669 hist2D->GetXaxis()->SetLabelOffset(0.014);
670 hist2D->GetXaxis()->SetTitleOffset(1.4);
671 hist2D->GetYaxis()->SetTitleOffset(1.2);
672 hist2D->GetYaxis()->SetNdivisions(506);
673 hist2D->GetYaxis()->SetLabelFont(42);
674 hist2D->GetYaxis()->SetLabelOffset(0.01);
675 hist2D->GetZaxis()->SetLabelFont(42);
676 hist2D->GetZaxis()->SetNoExponent(
false);
677 hist2D->GetZaxis()->SetNdivisions(506);
679 hist2D->GetXaxis()->SetTitleFont(42);
680 hist2D->GetXaxis()->SetTitle(
"Time (sec)");
681 hist2D->GetXaxis()->CenterTitle(
true);
682 hist2D->GetYaxis()->SetTitleFont(42);
683 hist2D->GetYaxis()->SetTitle(
"Frequency (Hz)");
684 hist2D->GetYaxis()->CenterTitle(
true);
686 hist2D->GetZaxis()->SetTitleOffset(0.6);
687 hist2D->GetZaxis()->SetTitleFont(42);
689 hist2D->GetZaxis()->CenterTitle(
true);
691 hist2D->GetXaxis()->SetLabelSize(0.03);
692 hist2D->GetYaxis()->SetLabelSize(0.03);
693 hist2D->GetZaxis()->SetLabelSize(0.03);
696 if(opt)
hist2D->Draw(opt);
697 else hist2D->Draw(
"COLZ");
701 TPaletteAxis *
palette = (TPaletteAxis*)
hist2D->GetListOfFunctions()->FindObject(
"palette");
702 palette->SetX1NDC(0.91);
703 palette->SetX2NDC(0.933);
704 palette->SetTitleOffset(0.92);
705 palette->GetAxis()->SetTickSize(0.01);
723 for(
int i=1;
i<=ni;
i++)
if(nj<
int(sm.
size(
i))) nj = sm.
size(
i);
729 double dt = ni>1 ? (t2-
t1)/(ni-1) : 0.;
730 double dp = nj>0 ? (p2-
p1)/nj : 0.;
733 hist2D=
new TH2F(
"WTS",
"", nj,p1,p2, ni,90.-t2,90.-t1);
734 hist2D->SetXTitle(
"phi, deg.");
735 hist2D->SetYTitle(
"theta, deg.");
737 Int_t
colors[30]={101,12,114,13,115,14,117,15,16,17,166,18,19,
738 167,0,0,167,19,18,166,17,16,15,117,14,115,13,114,12,101};
739 if(pal==0) gStyle->SetPalette(30,colors);
740 else {gStyle->SetPalette(1,0);gStyle->SetNumberContours(pal);}
745 for(
int i=0;
i<ni;
i++) {
746 theta = (t2+
t1)/2.+(
i-ni/2)*
dt;
747 for(
int j=0;
j<nj;
j++) {
748 phi = (p2+
p1)/2.+(
j-nj/2)*dp;
749 hist2D->Fill(phi,90.-theta,sm.
get(theta,phi));
754 hist2D->SetFillColor(kWhite);
757 hist2D->GetXaxis()->SetTitleFont(42);
758 hist2D->GetXaxis()->SetLabelFont(42);
759 hist2D->GetXaxis()->SetLabelOffset(0.012);
760 hist2D->GetXaxis()->SetTitleOffset(1.1);
763 hist2D->GetYaxis()->SetTitleFont(42);
764 hist2D->GetYaxis()->SetLabelFont(42);
765 hist2D->GetYaxis()->SetLabelOffset(0.01);
767 hist2D->GetZaxis()->SetLabelFont(42);
769 if(opt)
hist2D->Draw(opt);
770 else hist2D->Draw(
"COLZ");
774 TPaletteAxis *
palette = (TPaletteAxis*)
hist2D->GetListOfFunctions()->FindObject(
"palette");
775 palette->SetX1NDC(0.91);
776 palette->SetX2NDC(0.933);
777 palette->SetTitleOffset(0.92);
778 palette->GetAxis()->SetTickSize(0.01);
802 bool isPCs = std::isupper(type);
803 type = std::toupper(type);
805 if(type !=
'L' && type !=
'N')
return;
809 std::vector<int>* vint = &(pwc->
cList[cid-1]);
811 int V = vint->size();
816 int mp= size_t(pwc->
rate/pix->
rate+0.1);
819 cout <<
"watplot::plot - Error : monster event display is enabled only for WDM (2G)" << endl;
827 irate = pv!=NULL ? (*pv)[0] : 0;
836 for(
int j=0;
j<V;
j++) {
838 if(!pix->
core)
continue;
840 if((irate)&&(irate !=
int(pix->
rate+0.5)))
continue;
848 if(time<minTime) minTime=
time;
849 if(time+dt>maxTime) maxTime=time+
dt;
852 if(freq<minFreq) minFreq=freq;
853 if(freq>maxFreq) maxFreq=freq;
856 int minRate=RATE/(maxLayers-1);
857 int maxRate=RATE/(minLayers-1);
859 double mindt = 1./maxRate;
860 double maxdt = 1./minRate;
861 double mindf = minRate/2.;
862 double maxdf = maxRate/2.;
870 double iminTime = minTime-maxdt;
871 double imaxTime = maxTime+maxdt;
872 int nTime = (imaxTime-iminTime)*maxRate;
875 hist2D=
new TH2F(
"WTF",
"WTF", nTime, iminTime, imaxTime, 2*(maxLayers-1), 0, RATE/2);
876 hist2D->SetXTitle(
"time, sec");
877 hist2D->SetYTitle(
"frequency, Hz");
879 Int_t
colors[30]={101,12,114,13,115,14,117,15,16,17,166,18,19,
880 167,0,0,167,19,18,166,17,16,15,117,14,115,13,114,12,101};
881 if(pal==0) gStyle->SetPalette(30,colors);
882 else {gStyle->SetPalette(1,0);gStyle->SetNumberContours(pal);}
886 hist2D->SetFillColor(kWhite);
888 hist2D->GetXaxis()->SetNdivisions(506);
889 hist2D->GetXaxis()->SetLabelFont(42);
890 hist2D->GetXaxis()->SetLabelOffset(0.014);
891 hist2D->GetXaxis()->SetTitleOffset(1.4);
892 hist2D->GetYaxis()->SetTitleOffset(1.2);
893 hist2D->GetYaxis()->SetNdivisions(506);
894 hist2D->GetYaxis()->SetLabelFont(42);
895 hist2D->GetYaxis()->SetLabelOffset(0.01);
896 hist2D->GetZaxis()->SetLabelFont(42);
897 hist2D->GetZaxis()->SetNoExponent(
false);
898 hist2D->GetZaxis()->SetNdivisions(506);
900 hist2D->GetXaxis()->SetTitleFont(42);
901 hist2D->GetXaxis()->SetTitle(
"Time (sec)");
902 hist2D->GetXaxis()->CenterTitle(
true);
903 hist2D->GetYaxis()->SetTitleFont(42);
904 hist2D->GetYaxis()->SetTitle(
"Frequency (Hz)");
905 hist2D->GetYaxis()->CenterTitle(
true);
907 hist2D->GetZaxis()->SetTitleOffset(0.6);
908 hist2D->GetZaxis()->SetTitleFont(42);
909 hist2D->GetZaxis()->CenterTitle(
true);
911 hist2D->GetXaxis()->SetLabelSize(0.03);
912 hist2D->GetYaxis()->SetLabelSize(0.03);
913 hist2D->GetZaxis()->SetLabelSize(0.03);
915 double dFreq = (maxFreq-minFreq)/10.>2*maxdf ? (maxFreq-minFreq)/10. : 2*maxdf ;
916 double mFreq = minFreq-dFreq<0 ? 0 : minFreq-
dFreq;
917 double MFreq = maxFreq+dFreq>RATE/2 ? RATE/2 : maxFreq+
dFreq;
918 hist2D->GetYaxis()->SetRangeUser(mFreq, MFreq);
920 double dTime = (maxTime-minTime)/10.>2*maxdt ? (maxTime-minTime)/10. : 2*maxdt ;
921 double mTime = minTime-dTime<iminTime ? iminTime : minTime-dTime;
922 double MTime = maxTime+dTime>imaxTime ? imaxTime : maxTime+dTime;
923 hist2D->GetXaxis()->SetRangeUser(mTime,MTime);
928 for(
int n=0;
n<V;
n++) {
930 if(!pix->
core)
continue;
932 if((irate)&&(irate !=
int(pix->
rate+0.5)))
continue;
938 null = pix->
null>0. ? pix->
null : 0.;
948 if(!isPCs) {sSNR/=2;wSNR/=2;}
953 int iRATE =
int(pix->
rate+0.5);
955 int K=2*(maxLayers-1)/(pix->
layers-1);
959 int i=(itime-iminTime)*maxRate;
961 if(iRATE!=irate && irate!=0)
continue;
964 int L=0;
int R=1;
while (R < iRATE) {R*=2;L++;}
965 for(
int m=0;
m<
M;
m++) {
966 for(
int k=0;
k<
K;
k++) {
968 double A =
hist2D->GetBinContent(i+1+
m,j+1+
k-K/2);
969 if(type==
'L')
hist2D->SetBinContent(i+1+
m,j+1+
k-K/2,like+A);
970 else hist2D->SetBinContent(i+1+
m,j+1+
k-K/2,null+A);
978 if(type==
'L')
sprintf(gtitle,
"Likelihood %3.0f - dt(ms) [%.6g:%.6g] - df(hz) [%.6g:%.6g] - npix %d",
979 Likelihood,1000*mindt,1000*maxdt,mindf,maxdf,npix);
980 else sprintf(gtitle,
"Null %3.0f - dt(ms) [%.6g:%.6g] - df(hz) [%.6g:%.6g] - npix %d",
981 Null,1000*mindt,1000*maxdt,mindf,maxdf,npix);
988 if(opt)
hist2D->Draw(opt);
989 else hist2D->Draw(
"COLZ");
993 TPaletteAxis *
palette = (TPaletteAxis*)
hist2D->GetListOfFunctions()->FindObject(
"palette");
994 palette->SetX1NDC(0.91);
995 palette->SetX2NDC(0.933);
996 palette->SetTitleOffset(0.92);
997 palette->GetAxis()->SetTickSize(0.01);
1012 static TGraphErrors egraph;
1018 for(
int i=0;
i<
np;
i++) {
1019 pcd->
chirp.GetPoint(
i,x,y);
1020 ex=pcd->
chirp.GetErrorX(
i);
1021 ey=pcd->
chirp.GetErrorY(
i);
1022 egraph.SetPoint(
i,x,y);
1023 egraph.SetPointError(
i,ex,ey);
1025 TF1* fit = &(pcd->
fit);
1029 sprintf(title,
"chirp mass : rec = %3.3f [%3.2f] inj = %3.3f , chi2 = %3.2f",
1032 sprintf(title,
"chirp mass : rec = %3.3f [%3.2f] , chi2 = %3.2f",
1035 egraph.SetTitle(title);
1036 egraph.GetHistogram()->SetStats(kFALSE);
1037 egraph.GetHistogram()->SetTitleFont(12);
1038 egraph.SetFillColor(kWhite);
1039 egraph.SetLineColor(kBlack);
1040 egraph.GetXaxis()->SetNdivisions(506);
1041 egraph.GetXaxis()->SetLabelFont(42);
1042 egraph.GetXaxis()->SetLabelOffset(0.014);
1043 egraph.GetXaxis()->SetTitleOffset(1.4);
1044 egraph.GetYaxis()->SetTitleOffset(1.2);
1045 egraph.GetYaxis()->SetNdivisions(506);
1046 egraph.GetYaxis()->SetLabelFont(42);
1047 egraph.GetYaxis()->SetLabelOffset(0.01);
1048 egraph.GetXaxis()->SetTitleFont(42);
1049 egraph.GetXaxis()->SetTitle(
"Time (sec)");
1050 egraph.GetXaxis()->CenterTitle(
true);
1051 egraph.GetYaxis()->SetTitleFont(42);
1052 egraph.GetYaxis()->SetTitle(
"Frequency^{-8/3}");
1053 egraph.GetYaxis()->CenterTitle(
true);
1054 egraph.GetXaxis()->SetLabelSize(0.03);
1055 egraph.GetYaxis()->SetLabelSize(0.03);
1068 const Int_t
NRGBs = 5;
1072 if (
fabs(paletteId)==1) {
1073 Double_t
stops[
NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
1074 Double_t
red[
NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
1075 Double_t
green[
NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
1076 Double_t
blue[
NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
1078 TColor::CreateGradientColorTable(NRGBs, stops, blue, green, red, NCont);
1080 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
1083 if (
fabs(paletteId)==2) {
1084 Double_t
stops[
NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
1085 Double_t
red[
NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
1087 Double_t
green[
NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
1089 Double_t
blue[
NRGBs] = { 1.00, 1.00, 0.00, 0.00, 0.00 };
1091 TColor::CreateGradientColorTable(NRGBs, stops, blue, green, red, NCont);
1093 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
1096 if (
fabs(paletteId)==3) {
1097 Double_t
stops[
NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
1098 Double_t
red[
NRGBs] = { 0.00, 0.09, 0.18, 0.09, 0.00 };
1099 Double_t
green[
NRGBs] = { 0.01, 0.02, 0.39, 0.68, 0.97 };
1100 Double_t
blue[
NRGBs] = { 0.17, 0.39, 0.62, 0.79, 0.97 };
1102 TColor::CreateGradientColorTable(NRGBs, stops, blue, green, red, NCont);
1104 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
1107 if (
fabs(paletteId)==4) {
1108 Double_t
stops[
NRGBs] = { 0.00, 0.50, 0.75, 0.875, 1.00 };
1109 Double_t
red[
NRGBs] = { 1.00, 1.00, 1.00, 1.00, 1.00 };
1110 Double_t
green[
NRGBs] = { 1.00, 0.75, 0.50, 0.25, 0.00 };
1111 Double_t
blue[
NRGBs] = { 0.00, 0.00, 0.00, 0.00, 0.00 };
1113 TColor::CreateGradientColorTable(NRGBs, stops, blue, green, red, NCont);
1115 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
1118 if (
fabs(paletteId)==5) {
1119 Double_t
stops[
NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
1120 Double_t
red[
NRGBs] = { 1.00, 0.84, 0.61, 0.34, 0.00 };
1121 Double_t
green[
NRGBs] = { 1.00, 0.84, 0.61, 0.34, 0.00 };
1122 Double_t
blue[
NRGBs] = { 1.00, 0.84, 0.61, 0.34, 0.00 };
1124 TColor::CreateGradientColorTable(NRGBs, stops, blue, green, red, NCont);
1126 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
1129 gStyle->SetNumberContours(NCont);
1161 for (
int i = 0;
i <
size;
i++)
1164 f = ((double)
i) / ((double) (size - 1));
1172 for (
int i=0;
i<
size;
i++) norm += pow(w[
i],2);
1174 for (
int i=0;i<
size;i++) w[i] /= sqrt(norm);
1183 if(
canvas!=NULL && fname!=
"") {
1184 if(fname.Contains(
".png")) {
1186 gname.ReplaceAll(
".png",
".gif");
1189 sprintf(cmd,
"convert %s %s",gname.Data(),fname.Data());
1192 sprintf(cmd,
"rm %s",gname.Data());
1230 for(
size_t i=0;
i<
graph.size();
i++) {
1249 if(
graph.size()>0) {
1250 if(title!=
"")
graph[0]->SetTitle(title);
1251 if(xtitle!=
"")
graph[0]->GetHistogram()->SetXTitle(xtitle);
1252 if(ytitle!=
"")
graph[0]->GetHistogram()->SetYTitle(ytitle);
1276 cout <<
"watplot::operator(>>) : input array with size=0" << endl;
1280 graph.
opt.ToUpper();
1281 bool logx =
false;
if(graph.
opt.Contains(
"LOGX")) {logx=
true;graph.
opt.ReplaceAll(
"LOGX",
"");}
1282 bool logy =
false;
if(graph.
opt.Contains(
"LOGY")) {logy=
true;graph.
opt.ReplaceAll(
"LOGY",
"");}
1286 double f1 = graph.
f1==0. ? 0. : graph.
f1;
1287 double f2 = graph.
f2==0. ? x.
rate()/2. : graph.
f2;
1292 if(logx) graph.
canvas->SetLogx();
1293 if(logy) graph.
canvas->SetLogy();
1294 graph.
plot(x,
const_cast<char*>(opt.Data()), graph.
col+graph.
ncol, t1, t2, graph.
fft, f1, f2, graph.
psd, graph.
t3, graph.
oneside);
1295 if(graph.
graph.size()>0) {
1312 if(graph.
graph.size()==0) {
1313 cout <<
"watplot::operator (>>) - Error : No graph in the object" << endl;
1317 name.ReplaceAll(
" ",
"");
1320 TObjString* ext_tok = (TObjString*)token->At(token->GetEntries()-1);
1326 if (!out.good()) {cout <<
"watplot::operator (>>) - Error : Opening File : " << name.Data() << endl;
exit(1);}
1331 graph.
graph[0]->GetPoint(
j,x,y);
1332 if(x>graph.
f1 && x<graph.
f2) out << x <<
"\t" << y << endl;
void graph(TString ifile)
std::vector< int > vector_int
virtual size_t size() const
std::vector< vector_int > cRate
void gtitle(TString title="", TString xtitle="", TString ytitle="")
printf("total live time: non-zero lags = %10.1f \n", liveTot)
virtual void rate(double r)
cout<< "skymap size : "<< L<< endl;for(int l=0;l< L;l++) sm.set(l, l);sm > const_cast< char * >("skymap.dat")
double getStatistics(double &mean, double &rms) const
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)
wavearray< double > psd(33)
std::vector< TGraph * > graph
double procOpt(int opt, double val00, double val90=0.)
watplot p1(const_cast< char * >("TFMap1"))
std::vector< vector_int > cList
virtual void start(double s)
void plot(wavearray< double > &, char *=NULL, int=1, double=0., double=0., bool=false, float=0., float=0., bool=false, float=0., bool=false)
int getLayer(wavearray< DataType_t > &w, double n)
param: n - layer number
double getmax(WSeries< double > &w, double t1, double t2)
void goptions(char *opt=NULL, int col=1, double t1=0., double t2=0., bool fft=false, float f1=0., float f2=0., bool psd=false, float t3=0., bool oneside=false)
void plsmooth(WSeries< double > &, int=0, double=0., double=0., char *=NULL, int=256, int=0)
netpixel * getPixel(size_t n, size_t i)
TGraphErrors chirp
chirp fit parameters (don't remove ! fix crash when exit from CINT)
watplot p2(const_cast< char * >("TFMap2"))
void print(TString fname)
double fabs(const Complex &x)
void blackmanharris(wavearray< double > &w)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
void SetPlotStyle(int paletteId, int NCont=255)
double get(size_t i)
param: sky index
WaveDWT< DataType_t > * pWavelet
double getdata(char type='R', size_t n=0)
virtual void resize(unsigned int)
wavearray< double > & operator>>(watplot &graph, wavearray< double > &x)