Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
30 #if (TYPE_MDC==MDC_SGE || TYPE_MDC==MDC_SGE_LAL || TYPE_MDC==MDC_CGE)
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 #endif
36 
37 #if (TYPE_MDC==MDC_WNB || TYPE_MDC==MDC_WNB_LAL)
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 #endif
46 
47 
48  MDC_TYPE mdc_type = TYPE_MDC;
49 
50  TString wf_name = MDC->AddWaveform(mdc_type, par);
51 
52  MDC->Print();
53 
54  // Get the first waveform hp,hx components
55  // NOTE : The current list contains only 1 waveform
56  waveform wf = MDC->GetWaveform(wf_name,0);
57 
58  if(wf.status==false) {
59  cout << "Error : Waveform " << wf_name << " not exist in the MDC pool !!!" << end << endll;
60  gSystem->Exit(1);
61  }
62 
63  cout << "size : " << wf.hp.size() << " rate : " << wf.hp.rate()
64  << " start : " << (int)wf.hp.start() << endl;
65 
66  wf.hp.start(0); // set start to 0 (needed by draw Method)
67  wf.hx.start(0);
68 
69  watplot* plot = NULL;
70 
71 #ifdef PLOT_TIME
72  plot=MDC->Draw(wf.hp,MDC_TIME,"ALP ZOOM");
73  MDC->Draw(wf.hx,MDC_TIME,"same",kRed);
74 #endif
75 
76 #ifdef PLOT_FFT
77  plot = MDC->Draw(wf.hp,MDC_FFT,"ALP ZOOM NOLOGX"); // draw hp in frequency domain
78  MDC->Draw(wf.hx,MDC_FFT,"same NOLOGX",kRed);
79  plot->graph[0]->GetHistogram()->GetXaxis()->SetRangeUser(0,1100);
80 #endif
81 
82  if(plot) plot->graph[0]->SetTitle(wf_name);
83 
84 #ifdef SAVE_PLOT
85  if(plot) plot->canvas->SaveAs("Plot_LAL_vs_CWB.png");
86 #endif
87 
88 }
void Draw_LAL_vs_CWB()
virtual size_t size() const
Definition: wavearray.hh:127
Definition: mdc.hh:172
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:2288
Definition: mdc.hh:189
bool status
Definition: mdc.hh:191
virtual void rate(double r)
Definition: wavearray.hh:123
Definition: mdc.hh:173
TString("c")
TString mdc[4]
std::vector< TGraph * > graph
Definition: watplot.hh:176
MDC_TYPE
Definition: mdc.hh:118
wavearray< double > hp
Definition: mdc.hh:196
waveform wf
virtual void start(double s)
Definition: wavearray.hh:119
mdcid AddWaveform(MDC_TYPE mdc_type, vector< mdcpar > par, TString uname="")
Definition: mdc.cc:445
void Print(int level=0)
Definition: mdc.cc:2707
CWB::mdc * MDC
TCanvas * canvas
Definition: watplot.hh:174
x plot
Definition: mdc.hh:216
i() int(T_cor *100))
vector< mdcpar > par
wavearray< double > hx
Definition: mdc.hh:197
#define TYPE_MDC
waveform GetWaveform(int ID, int id=0)
Definition: mdc.cc:2512
char wf_name[256]