9 if(ifname.CompareTo(
"")==0) {
10 if(gSystem->Getenv(
"CWB_SENSITIVITY_FILE_NAME")!=NULL) {
11 ifname=
TString(gSystem->Getenv(
"CWB_SENSITIVITY_FILE_NAME"));
13 if(gSystem->Getenv(
"CWB_SENSITIVITY_SAVE_PLOT")!=NULL) {
14 TString cwb_save_plot=
TString(gSystem->Getenv(
"CWB_SENSITIVITY_SAVE_PLOT"));
15 if(cwb_save_plot.CompareTo(
"")!=0) {
16 if(!cwb_save_plot.IsFloat()) {cout<<
"Error : CWB_SENSITIVITY_SAVE_PLOT is not a number" << endl;
exit(1);}
17 if((cwb_save_plot.Atoi()==0)||(cwb_save_plot.Atoi()==1)) save_plot=cwb_save_plot.Atoi();
20 if(gSystem->Getenv(
"CWB_SENSITIVITY_RANGE_FIX")!=NULL) {
21 TString cwb_range_fix=
TString(gSystem->Getenv(
"CWB_SENSITIVITY_RANGE_FIX"));
22 if(cwb_range_fix.CompareTo(
"")!=0) {
23 if(!cwb_range_fix.IsFloat()) {cout<<
"Error : CWB_SENSITIVITY_RANGE_FIX is not a number" << endl;
exit(1);}
24 if((cwb_range_fix.Atoi()==0)||(cwb_range_fix.Atoi()==1)) range_fix=cwb_range_fix.Atoi();
28 if(ifname.CompareTo(
"")==0) {cout <<
"cwb_draw_sensitivity - Error : File not exist ! " << endl;
exit(1);}
31 stitle.ReplaceAll(
".txt",
"");
34 sprintf(title,
"Sensitivity One Side - %s",((TObjString*)token->At(token->GetEntries()-1))->GetString().Data());
37 in.open(ifname.Data(),
ios::in);
38 if (!in.good()) {cout <<
"Error Opening File : " << ifname.Data() << endl;
exit(1);}
45 if (!in.good())
break;
46 if(str[0] !=
'#') size++;
49 in.clear(ios::goodbit);
50 in.seekg(0, ios::beg);
52 double* freq =
new double[
size];
53 double* sh =
new double[
size];
56 in >> freq[lines] >> sh[lines];
57 if (!in.good())
break;
64 gStyle->SetTitleH(0.032);
65 gStyle->SetTitleW(0.98);
66 gStyle->SetTitleY(0.98);
67 gStyle->SetTitleFont(72);
68 gStyle->SetMarkerColor(50);
69 gStyle->SetLineColor(kWhite);
71 gr =
new TGraph(size,freq,sh);
72 gr->SetLineColor(kBlue);
74 gr->SetMarkerColor(kBlue);
76 canvas =
new TCanvas(
"Sensitivity",
"ShOneSide", 300,40, 1000, 600);
78 canvas->ToggleEventStatus();
83 canvas->SetFillColor(kWhite);
86 gStyle->SetFrameBorderMode(0);
89 gStyle->SetTitleH(0.050);
90 gStyle->SetTitleW(0.95);
91 gStyle->SetTitleY(0.98);
92 gStyle->SetTitleFont(12,
"D");
93 gStyle->SetTitleColor(kBlue,
"D");
94 gStyle->SetTextFont(12);
95 gStyle->SetTitleFillColor(kWhite);
96 gStyle->SetLineColor(kWhite);
97 gStyle->SetNumberContours(256);
98 gStyle->SetMarkerStyle(7);
99 gStyle->SetMarkerSize(2);
100 gStyle->SetCanvasColor(kWhite);
101 gStyle->SetStatBorderSize(1);
103 mg =
new TMultiGraph;
105 gStyle->SetTitleW(0.98);
106 gStyle->SetTitleH(0.03);
107 gStyle->SetFillColor(kWhite);
108 gStyle->SetLineColor(kWhite);
113 mg->GetHistogram()->GetXaxis()->SetLabelSize(0.03);
114 mg->GetHistogram()->GetYaxis()->SetLabelSize(0.03);
115 mg->GetHistogram()->GetXaxis()->SetTitleSize(0.04);
116 mg->GetHistogram()->GetYaxis()->SetTitleSize(0.04);
117 mg->GetHistogram()->GetXaxis()->SetLabelFont(80);
118 mg->GetHistogram()->GetYaxis()->SetLabelFont(82);
119 mg->GetHistogram()->GetYaxis()->SetLabelOffset(0.01);
120 mg->GetHistogram()->GetYaxis()->SetTitleOffset(1.5);
123 mg->GetHistogram()->GetXaxis()->SetRangeUser(16,8*1024);
124 mg->GetHistogram()->GetYaxis()->SetRangeUser(5
e-24,1
e-21);
127 mg->GetXaxis()->SetLabelFont(22);
128 mg->GetYaxis()->SetLabelFont(22);
129 mg->GetXaxis()->SetTitleFont(22);
130 mg->GetYaxis()->SetTitleFont(22);
131 mg->GetXaxis()->SetTitleSize(0.03);
132 mg->GetYaxis()->SetTitleSize(0.03);
133 mg->GetXaxis()->SetTitle(
"Frequency (Hz)");
134 mg->GetYaxis()->SetTitle(
"#frac{1}{#sqrt{Hz}}");
139 ofname.ReplaceAll(
".txt",
".gif");
140 cout << ofname.Data() << endl;
141 canvas->Print(ofname.Data());
144 pfname.ReplaceAll(
".gif",
".png");
145 sprintf(cmd,
"convert %s %s",ofname.Data(),pfname.Data());
148 sprintf(cmd,
"rm %s",ofname.Data());
void cwb_draw_sensitivity(TString ifname="", bool save_plot=false, bool range_fix=true)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)