Logo coherent WaveBurst  
Library Reference Guide
Logo
Draw_LAL_vs_CWB.C
Go to the documentation of this file.
1 //
2 // Show comparison between SGE/WNB CWB vs LAL waveforms
3 //
4 // MDC_SGE_LAL use CG instead of SG !!!
5 // MDC_WNB_LAL has a gaussian envelope also in frequency
6 //
7 // Author : Gabriele Vedovato
8 //
9 
10 //#define TYPE_MDC MDC_CGE // CWB
11 //#define TYPE_MDC MDC_SGE // CWB
12 #define TYPE_MDC MDC_SGE_LAL // LAL
13 
14 //#define TYPE_MDC MDC_WNB // CWB
15 //#define TYPE_MDC MDC_WNB_LAL // LAL
16 
17 #define PLOT_TIME
18 //#define PLOT_FFT
19 
20 //#define SAVE_PLOT
21 
23 
25 
26  MDC = new CWB::mdc();
27 
28  vector<mdcpar> par;
29 
31  par.resize(3);
32  par[0].name="frequency"; par[0].value=831.3633225811645;
33  par[1].name="Q"; par[1].value=6.239809618564323;
34  par[2].name="decimals"; par[2].value=2;
35  }
36 
38  par.resize(6);
39  par[0].name="frequency"; par[0].value=539.1519966628402;
40  par[1].name="bandwidth"; par[1].value=196.8777744751424;
41  par[2].name="duration"; par[2].value=0.07535462749423459;
42  par[3].name="lseed"; par[3].value=1549043712;
43  par[4].name="hseed"; par[4].value=523230030;
44  par[5].name="decimals"; par[5].value=2;
45  }
46 
47 
48  MDC_TYPE mdc_type = TYPE_MDC;
49 
50  mdcid wf_mdcid = MDC->AddWaveform(mdc_type, par);
51  TString wf_name = wf_mdcid.name;
52 
53  MDC->Print();
54 
55  // Get the first waveform hp,hx components
56  // NOTE : The current list contains only 1 waveform
57  waveform wf = MDC->GetWaveform(wf_name,0);
58 
59  if(wf.status==false) {
60  cout << "Error : Waveform " << wf_name << " not exist in the MDC pool !!!" << endl << endl;
61  gSystem->Exit(1);
62  }
63 
64  cout << "size : " << wf.hp.size() << " rate : " << wf.hp.rate()
65  << " start : " << (int)wf.hp.start() << endl;
66 
67  wf.hp.start(0); // set start to 0 (needed by draw Method)
68  wf.hx.start(0);
69 
70  watplot* plot = NULL;
71 
72 #ifdef PLOT_TIME
73  plot=MDC->Draw(wf.hp,MDC_TIME,"ALP ZOOM");
74  MDC->Draw(wf.hx,MDC_TIME,"same",kRed);
75 #endif
76 
77 #ifdef PLOT_FFT
78  plot = MDC->Draw(wf.hp,MDC_FFT,"ALP ZOOM NOLOGX"); // draw hp in frequency domain
79  MDC->Draw(wf.hx,MDC_FFT,"same NOLOGX",kRed);
80  plot->graph[0]->GetHistogram()->GetXaxis()->SetRangeUser(0,1100);
81 #endif
82 
83  if(plot) plot->graph[0]->SetTitle(wf_name);
84 
85 #ifdef SAVE_PLOT
86  if(plot) plot->canvas->SaveAs("Plot_LAL_vs_CWB.png");
87 #endif
88 
89 }
void Draw_LAL_vs_CWB()
Definition: mdc.hh:202
watplot * Draw(TString name, int id=0, TString polarization="hp", MDC_DRAW type=MDC_TIME, TString options="ALP", Color_t color=kBlack)
Definition: mdc.cc:2317
Definition: mdc.hh:219
bool status
Definition: mdc.hh:221
virtual void rate(double r)
Definition: wavearray.hh:141
Definition: mdc.hh:207
Definition: mdc.hh:203
TString("c")
TString mdc[4]
std::vector< TGraph * > graph
Definition: watplot.hh:194
MDC_TYPE
Definition: mdc.hh:148
wavearray< double > hp
Definition: mdc.hh:226
waveform wf
virtual void start(double s)
Definition: wavearray.hh:137
mdcid AddWaveform(MDC_TYPE mdc_type, vector< mdcpar > par, TString uname="")
Definition: mdc.cc:472
void Print(int level=0)
Definition: mdc.cc:2736
CWB::mdc * MDC
virtual size_t size() const
Definition: wavearray.hh:145
TCanvas * canvas
Definition: watplot.hh:192
x plot
Definition: mdc.hh:248
i() int(T_cor *100))
Definition: mdc.hh:152
vector< mdcpar > par
wavearray< double > hx
Definition: mdc.hh:227
#define TYPE_MDC
waveform GetWaveform(int ID, int id=0)
Definition: mdc.cc:2541
char wf_name[256]
Definition: mdc.hh:157
TString name
Definition: mdc.hh:208
Definition: mdc.hh:166