11 #define MODE "Exclusive"
14 #define IFILE "report/dump/efit_parameters_ifar50_O1_12Sep19Jan_C01_SIM_LALBRSTFRAME_LF_rMRA_run0a_watWP10_run18_bins_cut.txt"
15 #define MDC_INJ_FILE "input/O1_LALBRSTFRAME_LF_L1H1_wnb_Egw.inj"
18 void PlotEgw(
int ninj,
double* freq,
double* egw,
int nset,
size_t* iset, TString* set);
22 double C = watconstants::SpeedOfLightInVacuo();
23 double G = watconstants::GravitationalConstant();
24 double Mo = watconstants::SolarMass();
25 double Pc = watconstants::Parsec();
26 double Pi = TMath::Pi();
40 imdc_name,imdc_fcentral,imdc_fbandwidth);
43 for(
int i=0;i<ninj;i++) imdc_sset[i] = imdc_set[i];
45 TString* imdc_set_name =
new TString[ninj];
47 for(
int i=0;i<ninj;i++) {
49 for(
int j=0;j<nset;j++)
if(imdc_set[i]==imdc_set_name[j]) bnew=
false;
50 if(bnew) imdc_set_name[nset++]=imdc_set[i];
52 cout <<
"nset : " << nset << endl;
53 for(
int i=0;i<nset;i++) {
54 for(
int j=0;j<ninj;j++)
if(imdc_set[j]==imdc_set_name[i]) imdc_iset[j]=i;
64 in.open(
IFILE,ios::in);
65 if (!in.good()) {cout <<
"Error Opening File : " <<
IFILE << endl;
exit(1);}
67 for(
int k=0; k<ninj; k++) {
69 in >> ecount[k] >> chi2[k] >> hrss50[k] >> piumeno[k]
70 >> err[k] >> par1[k] >> par2[k] >> par3[k] >> ewaveform[k];
71 if (!in.good())
break;
76 double Fo = imdc_fcentral[k];
77 double Ho = hrss50[k] ;
78 double Egw = pow(Pi,2) * pow(C,3)/G * pow(Ro*Fo*Ho,2);
79 cout << imdc_name[k] <<
"\tEgw(Mo) : " << Egw/(Mo*C*
C)
80 <<
"\thrss50 : " << hrss50[k] <<
"\t" << imdc_fcentral[k] << endl;
82 imdc_egw[k] = Egw/(Mo*C*
C);
85 PlotEgw(ninj, imdc_fcentral, imdc_egw, nset, imdc_iset, imdc_sset);
90 void PlotEgw(
int ninj,
double* freq,
double* egw,
int nset,
size_t* iset, TString* set) {
92 gStyle->SetTitleOffset(1.0,
"X");
93 gStyle->SetTitleOffset(1.2,
"Y");
94 gStyle->SetLabelFont(42,
"X");
95 gStyle->SetLabelFont(42,
"Y");
96 gStyle->SetTitleFont(42,
"X");
97 gStyle->SetTitleFont(42,
"Y");
99 gStyle->SetTitleH(0.050);
100 gStyle->SetTitleW(0.95);
101 gStyle->SetTitleY(0.98);
102 gStyle->SetTitleFont(12,
"D");
103 gStyle->SetTitleColor(kBlue,
"D");
104 gStyle->SetTextFont(12);
105 gStyle->SetTitleFillColor(kWhite);
106 gStyle->SetLineColor(kWhite);
107 gStyle->SetNumberContours(256);
108 gStyle->SetCanvasColor(kWhite);
111 gStyle->SetFrameBorderMode(0);
122 mg =
new TMultiGraph();
124 legend =
new TLegend(0.1111111,0.5563636,0.3353909,0.8836364,NULL,
"brNDC");
126 for(
int k=0;k<nset;k++) {
128 gr50[k] =
new TGraphErrors();
129 gr50[k]->SetLineColor(2);
130 gr50[k]->SetLineWidth(1);
131 gr50[k]->SetLineStyle(7);
133 if(k==0) gr50[k]->SetMarkerColor(kBlack);
134 if(k==1) gr50[k]->SetMarkerColor(kRed);
135 if(k==2) gr50[k]->SetMarkerColor(kGreen);
136 if(k==3) gr50[k]->SetMarkerColor(kBlue);
137 if(k==4) gr50[k]->SetMarkerColor(kMagenta);
139 if(k==0) gr50[k]->SetMarkerStyle(20);
140 if(k==1) gr50[k]->SetMarkerStyle(21);
141 if(k==2) gr50[k]->SetMarkerStyle(22);
142 if(k==3) gr50[k]->SetMarkerStyle(23);
143 if(k==4) gr50[k]->SetMarkerStyle(28);
145 if(k==0) gr50[k]->SetMarkerSize(1.4);
146 if(k==1) gr50[k]->SetMarkerSize(1.2);
147 if(k==2) gr50[k]->SetMarkerSize(1.5);
148 if(k==3) gr50[k]->SetMarkerSize(1.5);
149 if(k==4) gr50[k]->SetMarkerSize(1.5);
151 for(
int i=0; i<ninj; i++) {
152 if(iset[i]==k) gr50[k]->SetPoint(i,freq[i],egw[i]);
153 if(iset[i]==k) set_name[k]=set[i];
158 canvas =
new TCanvas(
"Egw",
"Egw",125,82,976,576);
160 canvas->ToggleEventStatus();
162 canvas->SetLogx(
true);
165 canvas->SetFillColor(kWhite);
168 mg->SetTitle(TString::Format(
"Egw vs Frequency : %s - IFAR = %d",
MODE,
IFAR));
170 mg->GetHistogram()->GetXaxis()->SetTitle(
"Frequency (Hz)");
171 mg->GetHistogram()->GetXaxis()->CenterTitle(
true);
172 mg->GetHistogram()->GetXaxis()->SetLabelFont(42);
173 mg->GetHistogram()->GetXaxis()->SetTitleFont(42);
174 mg->GetHistogram()->GetYaxis()->SetLabelFont(42);
175 mg->GetHistogram()->GetYaxis()->SetTitleFont(42);
176 mg->GetHistogram()->GetXaxis()->SetTitleOffset(1.20);
177 mg->GetYaxis()->SetNdivisions(10);
178 mg->GetHistogram()->GetYaxis()->SetTitle(
"Egw (Mo)");
179 mg->GetHistogram()->GetXaxis()->SetRangeUser(32,1024+256);
181 mg->GetHistogram()->GetYaxis()->SetRangeUser(2e-10,2e-6);
184 mg->GetHistogram()->GetYaxis()->SetRangeUser(5e-10,5e-6);
189 legend->SetBorderSize(1);
190 legend->SetTextAlign(22);
191 legend->SetTextFont(12);
192 legend->SetLineColor(1);
193 legend->SetLineStyle(1);
194 legend->SetLineWidth(1);
195 legend->SetFillColor(0);
196 legend->SetFillStyle(1001);
197 legend->SetTextSize(0.04);
198 legend->SetLineColor(kBlack);
199 legend->SetFillColor(kWhite);
201 for(
int k=0;k<nset;k++) {
202 legend->AddEntry(gr50[k],set_name[k].Data(),
"lp");
208 TString ofname =
IFILE;
209 ofname.ReplaceAll(
".txt",
".gif");
210 cout << ofname << endl;
211 canvas->Print(ofname);
213 TString pfname(ofname);
214 pfname.ReplaceAll(
".gif",
".png");
215 sprintf(cmd,
"convert %s %s",ofname.Data(),pfname.Data());
218 sprintf(cmd,
"rm %s",ofname.Data());
sprintf(tag,"wave_%s", data_label)
void PlotEgw(int ninj, double *freq, double *egw, int nset, size_t *iset, TString *set)