32 #define SNNAME "s27fheat1p05" 33 #define SNDIR "/home/waveburst/WAVEFORMS/SN/Ott2013/WaveformFiles" 34 #define ODIR "sn_o1/s27fheat1p05" // output plot directory 39 #define HEADER // add cwb header to html 43 void Plot_SN_O1(vector<waveform> wfList,
int ID,
int id);
48 gROOT->SetBatch(
true);
54 if(snList.size()==0) {
55 cout <<
"No SN files are present on the directory : " <<
SNDIR << endl;
58 for(
int j=0;
j<snList.size();
j++) {
62 TString hc_name = snList[
j]; hc_name.ReplaceAll(
"plus.txt",
"cross.txt");
63 TString name = gSystem->BaseName(hp_name.Data()); name.ReplaceAll(
"-plus.txt",
"");
66 vector<mdcpar> sn_par(4);
67 sn_par[0].name=
"name"; sn_par[0].svalue=
name;
68 sn_par[1].name=
"theta"; sn_par[1].value=sth.Atof();
69 sn_par[2].name=
"phi"; sn_par[2].value=sph.Atof();
70 sn_par[3].name=
"hrss"; sn_par[3].value=-1;
71 MDC->
AddWaveform(sn_name,hp_name,hc_name,16384,sn_par);
78 gSystem->mkdir(TString::Format(
"%s/plots",
ODIR),
true);
81 for(
int n=0;
n<wfList.size();
n++) {
88 TString texiName=TString::Format(
"%s/html_index.texi",
ODIR);
90 if(!overwrite) gSystem->Exit(0);
94 out <<
"@c include texi macros" << endl;
95 out <<
"@include macros.texi" << endl;
96 out <<
"@include mathjax.texi" << endl << endl;
97 for(
int n=0;
n<wfList.size();
n++) {
110 TString exec_cmd = TString::Format(
"%s/cwb_mkhtml.csh %s wheader",
111 cwb_scripts.Data(),texiName.Data());
113 TString exec_cmd = TString::Format(
"%s/cwb_mkhtml.csh %s",
114 cwb_scripts.Data(),texiName.Data());
116 int ret=gSystem->Exec(exec_cmd);
118 cout <<
"Make_SN_O1.C : Error while executing cwb_mkhtml html_index.texi !!!" << endl;
121 cout << endl <<
"New html file created : " <<
ODIR <<
"/html_index/index.html" << endl << endl;
130 cout <<
"Error : Waveform " << wf.
name <<
" not exist in the MDC pool !!!" << endl << endl;
134 cout << ID <<
" " << wf.
name <<
" size : " << wf.
hp.
size() <<
" rate : " << wf.
hp.
rate()
145 if(plot) plot->
graph[0]->SetTitle(TString::Format(
"%s : h+(black), hx(red))",name.Data()));
146 if(plot) plot->
canvas->SaveAs(TString::Format(
"%s/plots/%s_TIME.png",
ODIR,name.Data()));
150 plot->
graph[0]->GetHistogram()->GetXaxis()->SetRangeUser(0,8*1024);
151 if(plot) plot->
graph[0]->SetTitle(TString::Format(
"%s : h+(black), hx(red))",name.Data()));
152 if(plot) plot->
canvas->SaveAs(TString::Format(
"%s/plots/%s_FFT.png",
ODIR,name.Data()));
159 TString parms = TString::Format(
"hrss @@ 10kpc : %s = %0.3g - %s = %0.3g",
160 wf.
par[4].name.Data(),wf.
par[4].value,
161 wf.
par[5].name.Data(),wf.
par[5].value);
163 out <<
"@center @txtfont{"<<TString::Format(
"%d - %s",index,name.Data()).Data() <<
", red, h1}" << endl;
164 out <<
"@center @txtfont{"<<parms<<
", blue, h2}" << endl;
165 out <<
"@multitable @columnfractions .5 .5" << endl;
166 out <<
"@item @center @displayimage{../plots," 167 <<TString::Format(
"%s_TIME",name.Data())<<
",480}"<<endl;
168 out <<
"@tab @center @displayimage{../plots," 169 <<TString::Format(
"%s_FFT",name.Data())<<
",480}"<<endl;
170 out <<
"@end multitable" << endl;
watplot * Draw(TString name, int id=0, TString polarization="hp", MDC_DRAW type=MDC_TIME, TString options="ALP", Color_t color=kBlack)
virtual void rate(double r)
void Plot_SN_O1(vector< waveform > wfList, int ID, int id)
std::vector< TGraph * > graph
vector< waveform > GetWaveformList()
virtual void start(double s)
mdcid AddWaveform(MDC_TYPE mdc_type, vector< mdcpar > par, TString uname="")
virtual size_t size() const
void WriteHtml_SN_O1(ofstream &out, vector< waveform > wfList, int ID, int id, int index)
waveform GetWaveform(int ID, int id=0)