//g++ `root-config --glibs --cflags` -I/sw/include/gsl/ -lgsl -lgslcblas gsl_fft.cxx -o gsl_fft #include #include #include #include #include #include "TStyle.h" #include "TFile.h" #include "TCanvas.h" #include "TMath.h" #include "TSystem.h" #include "TTree.h" #include "TVector3.h" #include "TMatrixT.h" #include "TApplication.h" #include "TObject.h" #include "TGraph.h" #include "TGraphErrors.h" #include "TF1.h" int main (void) { TApplication theApp("myApp",NULL,NULL); int i, n = 100; double data[n]; double data2[n]; double data_initial[n]; double data_fft[n]; double data_final[n]; double xvals[n]; for(int i=0;iSetMarkerStyle(20); graph_final->SetMarkerStyle(24); graph_self->SetMarkerStyle(20); graph_initial->SetMarkerSize(0.8); graph_final->SetMarkerSize(1.8); graph_self->SetMarkerSize(0.8); graph_initial->SetMarkerColor(kBlue); graph_final->SetMarkerColor(kRed); graph_self->SetMarkerColor(kGreen); graph_self->SetTitle("time"); graph_final->SetTitle("time"); // graph_self->Draw("APL"); graph_final->Draw("APL"); graph_initial->Draw("PL"); TCanvas c2("c2","",550,0,500,500); TGraph* graph_fft=new TGraph(n,xvals,data_fft); graph_fft->SetMarkerStyle(20); graph_fft->SetMarkerSize(0.8); graph_fft->SetMarkerColor(kBlue); graph_fft->SetTitle("frequency"); graph_fft->Draw("APL"); theApp.Run(); return 0; }