29 #define MODE "Exclusive"
32 #define IFILE "report/dump/efit_parameters_ifar50_O1_12Sep19Jan_C01_SIM_LALBRSTFRAME_LF_rMRA_run0a_watWP10_run18_bins_cut.txt"
33 #define MDC_INJ_FILE "input/O1_LALBRSTFRAME_LF_L1H1_wnb_Egw.inj"
36 void PlotEgw(
int ninj,
double* freq,
double* egw,
int nset,
size_t* iset, TString* set);
40 double C = watconstants::SpeedOfLightInVacuo();
41 double G = watconstants::GravitationalConstant();
42 double Mo = watconstants::SolarMass();
43 double Pc = watconstants::Parsec();
44 double Pi = TMath::Pi();
58 imdc_name,imdc_fcentral,imdc_fbandwidth);
61 for(
int i=0;i<ninj;i++) imdc_sset[i] = imdc_set[i];
63 TString* imdc_set_name =
new TString[ninj];
65 for(
int i=0;i<ninj;i++) {
67 for(
int j=0;j<nset;j++)
if(imdc_set[i]==imdc_set_name[j]) bnew=
false;
68 if(bnew) imdc_set_name[nset++]=imdc_set[i];
70 cout <<
"nset : " << nset << endl;
71 for(
int i=0;i<nset;i++) {
72 for(
int j=0;j<ninj;j++)
if(imdc_set[j]==imdc_set_name[i]) imdc_iset[j]=i;
82 in.open(
IFILE,ios::in);
83 if (!in.good()) {cout <<
"Error Opening File : " <<
IFILE << endl;
exit(1);}
85 for(
int k=0; k<ninj; k++) {
87 in >> ecount[k] >> chi2[k] >> hrss50[k] >> piumeno[k]
88 >> err[k] >> par1[k] >> par2[k] >> par3[k] >> ewaveform[k];
89 if (!in.good())
break;
94 double Fo = imdc_fcentral[k];
95 double Ho = hrss50[k] ;
96 double Egw = pow(Pi,2) * pow(
C,3)/
G * pow(Ro*Fo*Ho,2);
97 cout << imdc_name[k] <<
"\tEgw(Mo) : " << Egw/(Mo*
C*
C)
98 <<
"\thrss50 : " << hrss50[k] <<
"\t" << imdc_fcentral[k] << endl;
100 imdc_egw[k] = Egw/(Mo*
C*
C);
103 PlotEgw(ninj, imdc_fcentral, imdc_egw, nset, imdc_iset, imdc_sset);
108 void PlotEgw(
int ninj,
double* freq,
double* egw,
int nset,
size_t* iset, TString* set) {
110 gStyle->SetTitleOffset(1.0,
"X");
111 gStyle->SetTitleOffset(1.2,
"Y");
112 gStyle->SetLabelFont(42,
"X");
113 gStyle->SetLabelFont(42,
"Y");
114 gStyle->SetTitleFont(42,
"X");
115 gStyle->SetTitleFont(42,
"Y");
117 gStyle->SetTitleH(0.050);
118 gStyle->SetTitleW(0.95);
119 gStyle->SetTitleY(0.98);
120 gStyle->SetTitleFont(12,
"D");
121 gStyle->SetTitleColor(kBlue,
"D");
122 gStyle->SetTextFont(12);
123 gStyle->SetTitleFillColor(kWhite);
124 gStyle->SetLineColor(kWhite);
125 gStyle->SetNumberContours(256);
126 gStyle->SetCanvasColor(kWhite);
129 gStyle->SetFrameBorderMode(0);
140 mg =
new TMultiGraph();
142 legend =
new TLegend(0.1111111,0.5563636,0.3353909,0.8836364,NULL,
"brNDC");
144 for(
int k=0;k<nset;k++) {
146 gr50[k] =
new TGraphErrors();
147 gr50[k]->SetLineColor(2);
148 gr50[k]->SetLineWidth(1);
149 gr50[k]->SetLineStyle(7);
151 if(k==0) gr50[k]->SetMarkerColor(kBlack);
152 if(k==1) gr50[k]->SetMarkerColor(kRed);
153 if(k==2) gr50[k]->SetMarkerColor(kGreen);
154 if(k==3) gr50[k]->SetMarkerColor(kBlue);
155 if(k==4) gr50[k]->SetMarkerColor(kMagenta);
157 if(k==0) gr50[k]->SetMarkerStyle(20);
158 if(k==1) gr50[k]->SetMarkerStyle(21);
159 if(k==2) gr50[k]->SetMarkerStyle(22);
160 if(k==3) gr50[k]->SetMarkerStyle(23);
161 if(k==4) gr50[k]->SetMarkerStyle(28);
163 if(k==0) gr50[k]->SetMarkerSize(1.4);
164 if(k==1) gr50[k]->SetMarkerSize(1.2);
165 if(k==2) gr50[k]->SetMarkerSize(1.5);
166 if(k==3) gr50[k]->SetMarkerSize(1.5);
167 if(k==4) gr50[k]->SetMarkerSize(1.5);
169 for(
int i=0; i<ninj; i++) {
170 if(iset[i]==k) gr50[k]->SetPoint(i,freq[i],egw[i]);
171 if(iset[i]==k) set_name[k]=set[i];
176 canvas =
new TCanvas(
"Egw",
"Egw",125,82,976,576);
178 canvas->ToggleEventStatus();
183 canvas->SetFillColor(kWhite);
186 mg->SetTitle(TString::Format(
"Egw vs Frequency : %s - IFAR = %d",
MODE,
IFAR));
188 mg->GetHistogram()->GetXaxis()->SetTitle(
"Frequency (Hz)");
189 mg->GetHistogram()->GetXaxis()->CenterTitle(
true);
190 mg->GetHistogram()->GetXaxis()->SetLabelFont(42);
191 mg->GetHistogram()->GetXaxis()->SetTitleFont(42);
192 mg->GetHistogram()->GetYaxis()->SetLabelFont(42);
193 mg->GetHistogram()->GetYaxis()->SetTitleFont(42);
194 mg->GetHistogram()->GetXaxis()->SetTitleOffset(1.20);
195 mg->GetYaxis()->SetNdivisions(10);
196 mg->GetHistogram()->GetYaxis()->SetTitle(
"Egw (Mo)");
197 mg->GetHistogram()->GetXaxis()->SetRangeUser(32,1024+256);
199 mg->GetHistogram()->GetYaxis()->SetRangeUser(2e-10,2e-6);
202 mg->GetHistogram()->GetYaxis()->SetRangeUser(5e-10,5e-6);
207 legend->SetBorderSize(1);
208 legend->SetTextAlign(22);
209 legend->SetTextFont(12);
210 legend->SetLineColor(1);
211 legend->SetLineStyle(1);
212 legend->SetLineWidth(1);
213 legend->SetFillColor(0);
214 legend->SetFillStyle(1001);
215 legend->SetTextSize(0.04);
216 legend->SetLineColor(kBlack);
217 legend->SetFillColor(kWhite);
219 for(
int k=0;k<nset;k++) {
220 legend->AddEntry(gr50[k],set_name[k].Data(),
"lp");
226 TString ofname =
IFILE;
227 ofname.ReplaceAll(
".txt",
".gif");
228 cout << ofname << endl;
231 TString pfname(ofname);
232 pfname.ReplaceAll(
".gif",
".png");
233 sprintf(
cmd,
"convert %s %s",ofname.Data(),pfname.Data());
void PlotEgw(int ninj, double *freq, double *egw, int nset, size_t *iset, TString *set)
sprintf(tag,"wave_%s", data_label)