Logo coherent WaveBurst  
Library Reference Guide
Logo
DrawRootEBBH.C
Go to the documentation of this file.
1 #define DRAW_TIME
2 //#define DRAW_FFT
3 //#define SAVE_PLOT
4 
6 
7  TFile* efile = new TFile(fName);
8  if(efile==NULL) {
9  cout << "CWB::mdc::AddWaveform - Error opening root file : " << fName.Data() << endl;
10  exit(1);
11  }
12 
13  int id;
14  double m1,m2,rp0,e0;
17 
18  TTree* etree = (TTree *) efile->Get("ebbh");
19  if(etree==NULL) {
20  cout << "CWB::mdc::AddWaveform - file : " << fName.Data()
21  << " not contains tree ebbh" << endl;
22  exit(1);
23  }
24  etree->SetBranchAddress("id",&id);
25  etree->SetBranchAddress("m1",&m1);
26  etree->SetBranchAddress("m2",&m2);
27  etree->SetBranchAddress("rp0",&rp0);
28  etree->SetBranchAddress("e0",&e0);
29  etree->SetBranchAddress("hp",&hp);
30  etree->SetBranchAddress("hx",&hx);
31 
32  int esize = etree->GetEntries();
33 
34  if(entry>=esize) {
35  cout << "entry not present in the tree" << endl;
36  return;
37  }
38 
39  etree->GetEntry(entry);
40  cout << id << " " << m1 << " " << m2 << " " << rp0 << " " << e0 << endl;
41 
43 
44 #ifdef DRAW_TIME
45  gw->Draw();
46  gw->Draw(hx,GWAT_TIME,"SAME",kRed);
47 #endif
48 
49 #ifdef DRAW_FFT
50  gw->Draw(GWAT_FFT);
51  gw->Draw(hx,GWAT_FFT,"SAME",kRed);
52 #endif
53 
54 #ifdef SAVE_PLOT
55  watplot* plot = gw->GetWATPLOT();
56 
57  char gtitle[256];
58  sprintf(gtitle,"eBBH : hp(black) - hx(red)");
59 #ifdef DRAW_TIME
60  plot->gtitle(gtitle,"time(sec)","amplitude");
61  TString gfile="eBHH_time_plot.png";
62 #endif
63 #ifdef DRAW_FFT
64  plot->gtitle(gtitle,"freq(hz)","amplitude");
65  TString gfile="eBHH_freq_plot.png";
66 #endif
67 
68  // save plot to file
69  (*plot) >> gfile;
70 
71  exit(0);
72 #endif
73 
74  delete hp;
75  delete hx;
76  delete efile;
77 
78 }
void gtitle(TString title="", TString xtitle="", TString ytitle="")
Definition: watplot.cc:1256
void DrawRootEBBH(TString fName, int entry)
Definition: DrawRootEBBH.C:5
double m1
TString("c")
plot gtitle(gtitle,"frequency (Hz)","strain/#sqrt{Hz}")
wavearray< double > hp
Definition: DrawInspiral.C:43
gWSeries< double > gw(w)
x plot
wavearray< double > hx
Definition: DrawInspiral.C:44
double * entry
Definition: cwb_setcuts.C:224
double e0
Definition: RescaleEBBH.C:17
Definition: gwat.hh:30
double m2
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
TString gfile
watplot * GetWATPLOT()
Definition: gwavearray.hh:88
Long_t id
char fName[256]
double rp0
Definition: RescaleEBBH.C:16
void Draw(GWAT_DRAW type=GWAT_TIME, TString options="ALP", Color_t color=kBlack)
Definition: gwavearray.cc:89
exit(0)