26 #include "TObjArray.h" 27 #include "TObjString.h" 28 #include "TPaletteAxis.h" 113 char defn[16] =
"watplot";
114 if (name && gROOT->FindObject(name)!=NULL) {
115 printf(
"watplot : Error Canvas Name %s already exist",name);
120 if(!name) name = defn;
121 canvas=
new TCanvas(name, name, i1, i2, i3, i4);
123 canvas->ToggleEventStatus();
126 canvas->SetFillColor(kWhite);
127 canvas->SetRightMargin(0.10);
128 canvas->SetLeftMargin(0.10);
129 canvas->SetBottomMargin(0.13);
133 gStyle->SetFrameBorderMode(0);
136 gStyle->SetTitleH(0.050);
137 gStyle->SetTitleW(0.95);
138 gStyle->SetTitleY(0.98);
139 gStyle->SetTitleFont(12,
"D");
140 gStyle->SetTitleColor(kBlue,
"D");
141 gStyle->SetTextFont(12);
142 gStyle->SetTitleFillColor(kWhite);
143 gStyle->SetLineColor(kWhite);
144 gStyle->SetNumberContours(256);
145 gStyle->SetCanvasColor(kWhite);
146 gStyle->SetStatBorderSize(1);
151 double t1,
double t2,
bool fft,
float f1,
float f2,
bool psd,
float t3,
bool oneside) {
169 printf(
" Plot error: t2 must be greater then t1.\n");
173 printf(
" Plot error: f2 must be greater then f1.\n");
179 double Ts = (td.
rate() == 0)? 1.: 1./td.
rate();
181 int i2 = (t2 == 0.)? td.
size() :
int((t2-td.
start())/Ts);
183 int nmax = (i2-i1)-(i2-i1)%2;
195 for (
int i=0;
i < nmax;
i++) {
196 _x.
data[
i] = x0 + Ts*
i - 0.;
203 if(f2==0.) { f1 = 0.; f2 = td.
rate()/2.; }
205 t3 = t3<0. ? 0. :
t3;
207 int bsize = t3*td.
rate();
209 int loops =
int(_y.
size()/bsize)==0 ? 1 :
int(_y.
size()/bsize);
210 double Fs=(double)td.
rate()/(double)bsize;
215 for (
int n=0;
n<loops;
n++) {
218 for (
int i=0;
i<bsize;
i++) u[
i]=_y[
i+shift];
219 for (
int i=0;
i<bsize;
i++) u[
i]*=w[
i];
221 for (
int i=0;
i<bsize;
i+=2) psd[
i/2]+=pow(u[
i],2)+pow(u[i+1],2);
223 for (
int i=0;
i<bsize/2;
i++) psd[
i]=sqrt(psd[
i]/(
double)loops)*sqrt(1./Fs);
224 if(oneside) psd*=sqrt(2.);
227 for (
int i=0;
i<nmax/2;
i++) _x.
data[
i]=
i*Fs;
230 double Fs=(double)td.
rate()/(double)_y.
size();
234 for (
int i=0;
i<nmax/2;
i++) _x.
data[
i]=
i*Fs;
235 if(oneside)
for(
int i=0;
i<nmax/2;
i++) _y.
data[
i]*=sqrt(2.);
240 for (
int i=0;
i<nmax;
i++) {
248 G =
new TGraph(nmax,_x.
data,_y.
data);
249 G->SetLineColor(col);
250 G->SetMarkerColor(col);
253 G->GetHistogram()->SetTitle(
"");
254 G->SetFillColor(kWhite);
257 G->GetXaxis()->SetTitleFont(42);
258 G->GetXaxis()->SetLabelFont(42);
259 G->GetXaxis()->SetLabelOffset(0.012);
260 G->GetXaxis()->SetTitleOffset(1.5);
263 G->GetYaxis()->SetTitleFont(42);
264 G->GetYaxis()->SetLabelFont(42);
265 G->GetYaxis()->SetLabelOffset(0.01);
266 G->GetYaxis()->SetTitleOffset(1.4);
269 G->GetHistogram()->GetXaxis()->SetRangeUser(f1,f2);
271 G->GetHistogram()->GetYaxis()->SetRangeUser(ymin/2.,ymax*1.1);
272 G->GetHistogram()->SetXTitle(
"freq, hz");
274 G->GetHistogram()->SetXTitle(
"time, s");
276 G->GetHistogram()->SetYTitle(
"magnitude");
292 int nj =
int((t2-t1)*w.
rate())/ni;
295 double freq=rate/2/ni;
298 double** iw =
new double*[nj];
299 for(
int j=0;
j<nj;
j++) iw[
j] =
new double[ni];
303 for(
int i=0;
i<ni;
i++) {
307 for(
int j=nb;
j<ne;
j++) {
316 for(
int n=0;
n<sfact;
n++) smfact*=3;
322 sw =
new double*[snj];
323 for(
int j=0;
j<snj;
j++) sw[
j] =
new double[sni];
324 for(
int i=0;
i<sni;
i++) {
325 for(
int j=0;
j<snj;
j++) {
331 for(
int n=1;
n<=sfact;
n++) {
333 for(
int j=0;
j<snj;
j++)
delete [] sw[
j];
338 sw =
new double*[snj];
339 for(
int j=0;
j<snj;
j++) sw[
j] =
new double[sni];
340 for(
int i=0;
i<sni;
i++)
for(
int j=0;
j<snj;
j++) sw[
j][
i] = 0.;
341 for(
int i=1;
i<sni-1;
i++) {
342 for(
int j=1;
j<snj-1;
j++) {
343 for(
int j3=
j-1;j3<=
j+1;j3++) {
344 for(
int i3=
i-1;i3<=
i+1;i3++) {
346 sw[
j][
i] += iw[(j3-j3%3)/3][(i3-i3%3)/3];
352 for(
int j=0;
j<nj;
j++)
delete [] iw[
j];
354 iw =
new double*[snj];
355 for(
int j=0;
j<snj;
j++) iw[
j] =
new double[sni];
356 for(
int i=0;
i<sni;
i++) {
357 for(
int j=0;
j<snj;
j++) {
363 for(
int j=0;
j<snj;
j++)
delete [] iw[
j];
368 hist2D=
new TH2F(
"WTF",
"", snj, 0., t2-t1, sni, 0., freq*ni);
369 hist2D->SetXTitle(
"time, sec");
370 hist2D->SetYTitle(
"frequency, Hz");
372 Int_t
colors[30]={101,12,114,13,115,14,117,15,16,17,166,18,19,
373 167,0,0,167,19,18,166,17,16,15,117,14,115,13,114,12,101};
374 if(pal==0) gStyle->SetPalette(30,colors);
376 else {gStyle->SetPalette(1,0);gStyle->SetNumberContours(pal);}
388 double srate=smfact*
rate;
389 double sfreq=freq/smfact;
390 for(
int i=0;
i<sni;
i++) {
391 for(
int j=snb;
j<sne;
j++) {
392 double x = sw[
j-snb][
i];
397 hist2D->Fill(
double(
j-snb)/srate,(
i+0.5)*sfreq,x);
401 for(
int j=0;
j<snj;
j++)
delete [] sw[
j];
405 hist2D->SetFillColor(kWhite);
406 hist2D->GetXaxis()->SetTitleFont(42);
407 hist2D->GetXaxis()->SetLabelFont(42);
408 hist2D->GetXaxis()->SetLabelOffset(0.012);
409 hist2D->GetXaxis()->SetTitleOffset(1.1);
410 hist2D->GetYaxis()->SetTitleFont(42);
411 hist2D->GetYaxis()->SetLabelFont(42);
412 hist2D->GetYaxis()->SetLabelOffset(0.01);
413 hist2D->GetZaxis()->SetLabelFont(42);
414 hist2D->SetTitleOffset(1.3,
"Y");
415 if(opt)
hist2D->Draw(opt);
416 else hist2D->Draw(
"COLZ");
420 TPaletteAxis *
palette = (TPaletteAxis*)
hist2D->GetListOfFunctions()->FindObject(
"palette");
421 palette->SetX1NDC(0.91);
422 palette->SetX2NDC(0.933);
423 palette->SetTitleOffset(0.92);
424 palette->GetAxis()->SetTickSize(0.01);
447 int nj =
int((t2-t1)*w.
rate())/ni;
455 for(
int i=0;
i<ni;
i++) {
457 for(
int j=nb;
j<ne;
j++) {
497 printf(
"watplot::plot error: t2 must be greater then t1.\n");
501 printf(
"watplot::plot error: t1 must be in this range [%0.12g,%0.12g]\n",
506 printf(
"watplot::plot error: t2 must be in this range [%0.12g,%0.12g]\n",
511 Int_t
colors[30]={101,12,114,13,115,14,117,15,16,17,166,18,19,
512 167,0,0,167,19,18,166,17,16,15,117,14,115,13,114,12,101};
513 if(pal==0) gStyle->SetPalette(30,colors);
515 else {gStyle->SetPalette(1,0);gStyle->SetNumberContours(pal);}
526 if(mode==1) {ztitle=
"(E00+E90)/2";}
527 if(mode==2) {ztitle=
"sqrt((E00+E90)/2)";}
529 if(mode==3) {ztitle=
"amplitude:00";A90=0;}
530 if(mode==4) {ztitle=
"energy:00";A00=sqrt(2.);A90=0;}
531 if(mode==5) {ztitle=
"|amplitude:00|";A90=0;}
533 if(mode==6) {ztitle=
"amplitude:90";A00=0;}
534 if(mode==7) {ztitle=
"energy:90";A00=0;A90=sqrt(2.);}
535 if(mode==8) {ztitle=
"|amplitude:90|";A00=0;}
541 double* map00 = wdm->
pWWS;
542 double tsRate = w.
rate();
544 int nTC = w.
size()/(
M+1)/mF;
545 double* map90 = map00 + (mF-1)*(
M+1)*nTC;
550 double* yBins =
new double[
M+2];
551 double dF = tsRate/
M/2.;
554 for(
int i=2;
i<=
M; ++
i) yBins[
i] = yBins[1] + (
i-1)*dF;
555 yBins[
M+1] = tsRate/2.;
557 const double scale = 1./w.
wrate();
559 hist2D=
new TH2F(
"WTF",
"", 2*nTC, 0., nTC*scale,
M+1, yBins);
560 hist2D->SetXTitle(
"time, sec");
561 hist2D->SetYTitle(
"frequency, Hz");
565 int it1 = (t1-w.
start())/scale + 1;
566 int it2 = (t2-w.
start())/scale + 1;
567 if(it2<=it1 || it2>nTC)it2 = nTC;
569 map00+=it1*(
M+1); map90+=it1*(
M+1);
570 for(
int i=it1;
i<it2; ++
i){
572 v =
procOpt(mode%3, A00*map00[0], A90*map90[0]);
573 hist2D->SetBinContent( 2*
i , 1, v);
574 hist2D->SetBinContent( 2*
i+1 , 1, v);
576 v =
procOpt(mode%3, A00*map00[
M], A90*map90[M]);
577 hist2D->SetBinContent( 2*
i , M+1, v);
578 hist2D->SetBinContent( 2*
i+1 , M+1, v);
580 for(
int j=1;
j<
M; ++
j){
581 v =
procOpt(mode%3, A00*map00[
j], A90*map90[j]);
582 hist2D->SetBinContent( 2*
i , j+1, v);
583 hist2D->SetBinContent( 2*
i+1 , j+1, v);
585 map00+=M+1; map90+=M+1;
592 if(mode==0) ztitle=
"amplitude";
593 if(mode==1) ztitle=
"energy";
594 if(mode==2) ztitle=
"|amplitude|";
598 int nj =
int((t2-t1)*w.
rate())/ni;
601 double freq=rate/2/ni;
608 hist2D->SetXTitle(
"time, sec");
609 hist2D->SetYTitle(
"frequency, Hz");
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++) {
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++) {
637 hist2D->Fill((
j+0.5)/rate,(
i+0.5)*freq,x);
642 for(
int i=0;
i<ni;
i++) {
644 for(
int j=nb;
j<=ne;
j++) {
645 x=(wl.
data[
j] > 0.) ? 1. : -1.;
646 hist2D->Fill((
j+0.5)/rate,(
i+0.5)*freq,x);
651 for(
int i=0;
i<ni;
i++) {
653 for(
int j=nb;
j<=ne;
j++) {
654 x=(wl.
data[
j] > 0.) ? 1. : -1.;
655 if(wl.
data[
j] == 0.) x=0.;
656 hist2D->Fill((
j+0.5)/rate,(
i+0.5)*freq,x);
664 for(
int i=0;
i<ni;
i++) {
667 for(
int j=nb;
j<ne-0;
j++) {
670 if(x>1){ sum +=
x; nsum++; }
671 hist2D->Fill(
j/rate,(
i+0.5)*freq,x);
679 hist2D->SetFillColor(kWhite);
682 sprintf(title,
"Scalogram (%s)",ztitle.Data());
685 hist2D->GetXaxis()->SetNdivisions(506);
686 hist2D->GetXaxis()->SetLabelFont(42);
687 hist2D->GetXaxis()->SetLabelOffset(0.014);
688 hist2D->GetXaxis()->SetTitleOffset(1.4);
689 hist2D->GetYaxis()->SetTitleOffset(1.2);
690 hist2D->GetYaxis()->SetNdivisions(506);
691 hist2D->GetYaxis()->SetLabelFont(42);
692 hist2D->GetYaxis()->SetLabelOffset(0.01);
693 hist2D->GetZaxis()->SetLabelFont(42);
694 hist2D->GetZaxis()->SetNoExponent(
false);
695 hist2D->GetZaxis()->SetNdivisions(506);
697 hist2D->GetXaxis()->SetTitleFont(42);
698 hist2D->GetXaxis()->SetTitle(
"Time (sec)");
699 hist2D->GetXaxis()->CenterTitle(
true);
700 hist2D->GetYaxis()->SetTitleFont(42);
701 hist2D->GetYaxis()->SetTitle(
"Frequency (Hz)");
702 hist2D->GetYaxis()->CenterTitle(
true);
704 hist2D->GetZaxis()->SetTitleOffset(0.6);
705 hist2D->GetZaxis()->SetTitleFont(42);
707 hist2D->GetZaxis()->CenterTitle(
true);
709 hist2D->GetXaxis()->SetLabelSize(0.03);
710 hist2D->GetYaxis()->SetLabelSize(0.03);
711 hist2D->GetZaxis()->SetLabelSize(0.03);
714 if(opt)
hist2D->Draw(opt);
715 else hist2D->Draw(
"COLZ");
719 TPaletteAxis *
palette = (TPaletteAxis*)
hist2D->GetListOfFunctions()->FindObject(
"palette");
720 palette->SetX1NDC(0.91);
721 palette->SetX2NDC(0.933);
722 palette->SetTitleOffset(0.92);
723 palette->GetAxis()->SetTickSize(0.01);
741 for(
int i=1;
i<=ni;
i++)
if(nj<
int(sm.
size(
i))) nj = sm.
size(
i);
747 double dt = ni>1 ? (t2-
t1)/(ni-1) : 0.;
748 double dp = nj>0 ? (p2-
p1)/nj : 0.;
751 hist2D=
new TH2F(
"WTS",
"", nj,p1,p2, ni,90.-t2,90.-t1);
752 hist2D->SetXTitle(
"phi, deg.");
753 hist2D->SetYTitle(
"theta, deg.");
755 Int_t
colors[30]={101,12,114,13,115,14,117,15,16,17,166,18,19,
756 167,0,0,167,19,18,166,17,16,15,117,14,115,13,114,12,101};
757 if(pal==0) gStyle->SetPalette(30,colors);
758 else {gStyle->SetPalette(1,0);gStyle->SetNumberContours(pal);}
763 for(
int i=0;
i<ni;
i++) {
764 theta = (t2+
t1)/2.+(
i-ni/2)*
dt;
765 for(
int j=0;
j<nj;
j++) {
766 phi = (p2+
p1)/2.+(
j-nj/2)*dp;
767 hist2D->Fill(phi,90.-theta,sm.
get(theta,phi));
772 hist2D->SetFillColor(kWhite);
775 hist2D->GetXaxis()->SetTitleFont(42);
776 hist2D->GetXaxis()->SetLabelFont(42);
777 hist2D->GetXaxis()->SetLabelOffset(0.012);
778 hist2D->GetXaxis()->SetTitleOffset(1.1);
781 hist2D->GetYaxis()->SetTitleFont(42);
782 hist2D->GetYaxis()->SetLabelFont(42);
783 hist2D->GetYaxis()->SetLabelOffset(0.01);
785 hist2D->GetZaxis()->SetLabelFont(42);
787 if(opt)
hist2D->Draw(opt);
788 else hist2D->Draw(
"COLZ");
792 TPaletteAxis *
palette = (TPaletteAxis*)
hist2D->GetListOfFunctions()->FindObject(
"palette");
793 palette->SetX1NDC(0.91);
794 palette->SetX2NDC(0.933);
795 palette->SetTitleOffset(0.92);
796 palette->GetAxis()->SetTickSize(0.01);
820 bool isPCs = std::isupper(type);
821 type = std::toupper(type);
823 if(type !=
'L' && type !=
'N')
return;
827 std::vector<int>* vint = &(pwc->
cList[cid-1]);
829 int V = vint->size();
834 int mp= size_t(pwc->
rate/pix->
rate+0.1);
837 cout <<
"watplot::plot - Error : monster event display is enabled only for WDM (2G)" << endl;
845 irate = pv!=NULL ? (*pv)[0] : 0;
854 for(
int j=0;
j<V;
j++) {
856 if(!pix->
core)
continue;
858 if((irate)&&(irate !=
int(pix->
rate+0.5)))
continue;
866 if(time<minTime) minTime=time;
867 if(time+dt>maxTime) maxTime=time+
dt;
870 if(freq<minFreq) minFreq=
freq;
871 if(freq>maxFreq) maxFreq=
freq;
874 int minRate=RATE/(maxLayers-1);
875 int maxRate=RATE/(minLayers-1);
877 double mindt = 1./maxRate;
878 double maxdt = 1./minRate;
879 double mindf = minRate/2.;
880 double maxdf = maxRate/2.;
888 double iminTime = minTime-maxdt;
889 double imaxTime = maxTime+maxdt;
890 int nTime = (imaxTime-iminTime)*maxRate;
893 hist2D=
new TH2F(
"WTF",
"WTF", nTime, iminTime, imaxTime, 2*(maxLayers-1), 0, RATE/2);
894 hist2D->SetXTitle(
"time, sec");
895 hist2D->SetYTitle(
"frequency, Hz");
897 Int_t
colors[30]={101,12,114,13,115,14,117,15,16,17,166,18,19,
898 167,0,0,167,19,18,166,17,16,15,117,14,115,13,114,12,101};
899 if(pal==0) gStyle->SetPalette(30,colors);
900 else {gStyle->SetPalette(1,0);gStyle->SetNumberContours(pal);}
904 hist2D->SetFillColor(kWhite);
906 hist2D->GetXaxis()->SetNdivisions(506);
907 hist2D->GetXaxis()->SetLabelFont(42);
908 hist2D->GetXaxis()->SetLabelOffset(0.014);
909 hist2D->GetXaxis()->SetTitleOffset(1.4);
910 hist2D->GetYaxis()->SetTitleOffset(1.2);
911 hist2D->GetYaxis()->SetNdivisions(506);
912 hist2D->GetYaxis()->SetLabelFont(42);
913 hist2D->GetYaxis()->SetLabelOffset(0.01);
914 hist2D->GetZaxis()->SetLabelFont(42);
915 hist2D->GetZaxis()->SetNoExponent(
false);
916 hist2D->GetZaxis()->SetNdivisions(506);
918 hist2D->GetXaxis()->SetTitleFont(42);
919 hist2D->GetXaxis()->SetTitle(
"Time (sec)");
920 hist2D->GetXaxis()->CenterTitle(
true);
921 hist2D->GetYaxis()->SetTitleFont(42);
922 hist2D->GetYaxis()->SetTitle(
"Frequency (Hz)");
923 hist2D->GetYaxis()->CenterTitle(
true);
925 hist2D->GetZaxis()->SetTitleOffset(0.6);
926 hist2D->GetZaxis()->SetTitleFont(42);
927 hist2D->GetZaxis()->CenterTitle(
true);
929 hist2D->GetXaxis()->SetLabelSize(0.03);
930 hist2D->GetYaxis()->SetLabelSize(0.03);
931 hist2D->GetZaxis()->SetLabelSize(0.03);
933 double dFreq = (maxFreq-minFreq)/10.>2*maxdf ? (maxFreq-minFreq)/10. : 2*maxdf ;
934 double mFreq = minFreq-dFreq<0 ? 0 : minFreq-
dFreq;
935 double MFreq = maxFreq+dFreq>RATE/2 ? RATE/2 : maxFreq+
dFreq;
936 hist2D->GetYaxis()->SetRangeUser(mFreq, MFreq);
938 double dTime = (maxTime-minTime)/10.>2*maxdt ? (maxTime-minTime)/10. : 2*maxdt ;
939 double mTime = minTime-dTime<iminTime ? iminTime : minTime-dTime;
940 double MTime = maxTime+dTime>imaxTime ? imaxTime : maxTime+dTime;
941 hist2D->GetXaxis()->SetRangeUser(mTime,MTime);
946 for(
int n=0;
n<V;
n++) {
948 if(!pix->
core)
continue;
950 if((irate)&&(irate !=
int(pix->
rate+0.5)))
continue;
956 null = pix->
null>0. ? pix->
null : 0.;
966 if(!isPCs) {sSNR/=2;wSNR/=2;}
971 int iRATE =
int(pix->
rate+0.5);
973 int K=2*(maxLayers-1)/(pix->
layers-1);
977 int i=(itime-iminTime)*maxRate;
979 if(iRATE!=irate && irate!=0)
continue;
982 int L=0;
int R=1;
while (R < iRATE) {R*=2;L++;}
983 for(
int m=0;
m<
M;
m++) {
984 for(
int k=0;
k<
K;
k++) {
986 double A =
hist2D->GetBinContent(i+1+
m,j+1+
k-K/2);
987 if(type==
'L')
hist2D->SetBinContent(i+1+
m,j+1+
k-K/2,like+A);
988 else hist2D->SetBinContent(i+1+
m,j+1+
k-K/2,null+A);
992 if(type==
'L' && like>0) npix++;
993 if(type==
'N' && null>0) npix++;
997 if(type==
'L')
sprintf(gtitle,
"Likelihood %3.0f - dt(ms) [%.6g:%.6g] - df(hz) [%.6g:%.6g] - npix %d",
998 Likelihood,1000*mindt,1000*maxdt,mindf,maxdf,npix);
999 else sprintf(gtitle,
"Null %3.0f - dt(ms) [%.6g:%.6g] - df(hz) [%.6g:%.6g] - npix %d",
1000 Null,1000*mindt,1000*maxdt,mindf,maxdf,npix);
1002 hist2D->SetTitle(gtitle);
1007 if(opt)
hist2D->Draw(opt);
1008 else hist2D->Draw(
"COLZ");
1012 TPaletteAxis *
palette = (TPaletteAxis*)
hist2D->GetListOfFunctions()->FindObject(
"palette");
1013 palette->SetX1NDC(0.91);
1014 palette->SetX2NDC(0.933);
1015 palette->SetTitleOffset(0.92);
1016 palette->GetAxis()->SetTickSize(0.01);
1031 static TGraphErrors egraph;
1037 for(
int i=0;
i<
np;
i++) {
1038 pcd->
chirp.GetPoint(
i,x,y);
1039 ex=pcd->
chirp.GetErrorX(
i);
1040 ey=pcd->
chirp.GetErrorY(
i);
1041 egraph.SetPoint(
i,x,y);
1042 egraph.SetPointError(
i,ex,ey);
1044 TF1* fit = &(pcd->
fit);
1048 sprintf(title,
"chirp mass : rec = %3.3f [%3.2f] inj = %3.3f , chi2 = %3.2f",
1051 sprintf(title,
"chirp mass : rec = %3.3f [%3.2f] , chi2 = %3.2f",
1054 egraph.SetTitle(title);
1055 egraph.GetHistogram()->SetStats(kFALSE);
1056 egraph.GetHistogram()->SetTitleFont(12);
1057 egraph.SetFillColor(kWhite);
1058 egraph.SetLineColor(kBlack);
1059 egraph.GetXaxis()->SetNdivisions(506);
1060 egraph.GetXaxis()->SetLabelFont(42);
1061 egraph.GetXaxis()->SetLabelOffset(0.014);
1062 egraph.GetXaxis()->SetTitleOffset(1.4);
1063 egraph.GetYaxis()->SetTitleOffset(1.2);
1064 egraph.GetYaxis()->SetNdivisions(506);
1065 egraph.GetYaxis()->SetLabelFont(42);
1066 egraph.GetYaxis()->SetLabelOffset(0.01);
1067 egraph.GetXaxis()->SetTitleFont(42);
1068 egraph.GetXaxis()->SetTitle(
"Time (sec)");
1069 egraph.GetXaxis()->CenterTitle(
true);
1070 egraph.GetYaxis()->SetTitleFont(42);
1071 egraph.GetYaxis()->SetTitle(
"Frequency^{-8/3}");
1072 egraph.GetYaxis()->CenterTitle(
true);
1073 egraph.GetXaxis()->SetLabelSize(0.03);
1074 egraph.GetYaxis()->SetLabelSize(0.03);
1087 const Int_t
NRGBs = 5;
1091 if (
fabs(paletteId)==1) {
1092 Double_t
stops[
NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
1093 Double_t
red[
NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
1094 Double_t
green[
NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
1095 Double_t
blue[
NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
1097 TColor::CreateGradientColorTable(NRGBs, stops, blue, green, red, NCont);
1099 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
1102 if (
fabs(paletteId)==2) {
1103 Double_t
stops[
NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
1104 Double_t
red[
NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
1106 Double_t
green[
NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
1108 Double_t
blue[
NRGBs] = { 1.00, 1.00, 0.00, 0.00, 0.00 };
1110 TColor::CreateGradientColorTable(NRGBs, stops, blue, green, red, NCont);
1112 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
1115 if (
fabs(paletteId)==3) {
1116 Double_t
stops[
NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
1117 Double_t
red[
NRGBs] = { 0.00, 0.09, 0.18, 0.09, 0.00 };
1118 Double_t
green[
NRGBs] = { 0.01, 0.02, 0.39, 0.68, 0.97 };
1119 Double_t
blue[
NRGBs] = { 0.17, 0.39, 0.62, 0.79, 0.97 };
1121 TColor::CreateGradientColorTable(NRGBs, stops, blue, green, red, NCont);
1123 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
1126 if (
fabs(paletteId)==4) {
1127 Double_t
stops[
NRGBs] = { 0.00, 0.50, 0.75, 0.875, 1.00 };
1128 Double_t
red[
NRGBs] = { 1.00, 1.00, 1.00, 1.00, 1.00 };
1129 Double_t
green[
NRGBs] = { 1.00, 0.75, 0.50, 0.25, 0.00 };
1130 Double_t
blue[
NRGBs] = { 0.00, 0.00, 0.00, 0.00, 0.00 };
1132 TColor::CreateGradientColorTable(NRGBs, stops, blue, green, red, NCont);
1134 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
1137 if (
fabs(paletteId)==5) {
1138 Double_t
stops[
NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
1139 Double_t
red[
NRGBs] = { 1.00, 0.84, 0.61, 0.34, 0.00 };
1140 Double_t
green[
NRGBs] = { 1.00, 0.84, 0.61, 0.34, 0.00 };
1141 Double_t
blue[
NRGBs] = { 1.00, 0.84, 0.61, 0.34, 0.00 };
1143 TColor::CreateGradientColorTable(NRGBs, stops, blue, green, red, NCont);
1145 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
1148 gStyle->SetNumberContours(NCont);
1180 for (
int i = 0;
i <
size;
i++)
1183 f = ((double)
i) / ((double) (size - 1));
1191 for (
int i=0;
i<
size;
i++) norm += pow(w[
i],2);
1193 for (
int i=0;i<
size;i++) w[i] /= sqrt(norm);
1202 if(
canvas!=NULL && fname!=
"") {
1203 if(fname.Contains(
".png")) {
1205 gname.ReplaceAll(
".png",
".gif");
1208 sprintf(cmd,
"convert %s %s",gname.Data(),fname.Data());
1211 sprintf(cmd,
"rm %s",gname.Data());
1249 for(
size_t i=0;
i<
graph.size();
i++) {
1268 if(
graph.size()>0) {
1269 if(title!=
"")
graph[0]->SetTitle(title);
1270 if(xtitle!=
"")
graph[0]->GetHistogram()->SetXTitle(xtitle);
1271 if(ytitle!=
"")
graph[0]->GetHistogram()->SetYTitle(ytitle);
1295 cout <<
"watplot::operator(>>) : input array with size=0" << endl;
1299 graph.
opt.ToUpper();
1300 bool logx =
false;
if(graph.
opt.Contains(
"LOGX")) {logx=
true;graph.
opt.ReplaceAll(
"LOGX",
"");}
1301 bool logy =
false;
if(graph.
opt.Contains(
"LOGY")) {logy=
true;graph.
opt.ReplaceAll(
"LOGY",
"");}
1305 double f1 = graph.
f1==0. ? 0. : graph.
f1;
1306 double f2 = graph.
f2==0. ? x.
rate()/2. : graph.
f2;
1311 if(logx) graph.
canvas->SetLogx();
1312 if(logy) graph.
canvas->SetLogy();
1313 graph.
plot(x, const_cast<char*>(opt.Data()), graph.
col+graph.
ncol, t1, t2, graph.
fft, f1, f2, graph.
psd, graph.
t3, graph.
oneside);
1314 if(graph.
graph.size()>0) {
1331 if(graph.
graph.size()==0) {
1332 cout <<
"watplot::operator (>>) - Error : No graph in the object" << endl;
1336 name.ReplaceAll(
" ",
"");
1339 TObjString* ext_tok = (TObjString*)token->At(token->GetEntries()-1);
1340 TString ext = ext_tok->GetString();
1345 if (!out.good()) {cout <<
"watplot::operator (>>) - Error : Opening File : " << name.Data() << endl;
exit(1);}
1350 graph.
graph[0]->GetPoint(
j,x,y);
1351 if(x>graph.
f1 && x<graph.
f2) out << x <<
"\t" << y << endl;
std::vector< int > vector_int
std::vector< vector_int > cRate
void gtitle(TString title="", TString xtitle="", TString ytitle="")
virtual void rate(double r)
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
WDM< double > wdm(nLAYERS, nLAYERS, 6, 10)
wavearray< double > psd(33)
std::vector< TGraph * > graph
double procOpt(int opt, double val00, double val90=0.)
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)
cout<< "SNR "<< xsnr<< endl;wavearray< double > f
watplot p2(const_cast< char *>("TFMap2"))
virtual size_t size() const
watplot p1(const_cast< char *>("TFMap1"))
int getLayer(wavearray< DataType_t > &w, double n)
param: n - layer number
printf("total live time: non-zero lags = %10.1f \, liveTot)
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)
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 getStatistics(double &mean, double &rms) const
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)
float wSNR[PE_MAX_EVENTS][NIFO_MAX]