31 #include "TMultiGraph.h" 41 #include "TRotation.h" 42 #include "Math/Vector3Dfwd.h" 43 #include "Math/Rotation3D.h" 54 char wave_file_name[1024];
55 sprintf(wave_file_name,
"merge/wave_%s.%s.root",data_label.Data(),merge_label.Data());
57 TFile*
ifile = TFile::Open(wave_file_name);
58 TTree*
itree = (TTree *) gROOT->FindObject(
"waveburst");
62 sprintf(cut,
"abs(time[0]-time[%d])<%f && netcc[%d]>%f && rho[%d]>%f",
63 nIFO,T_win,pp_inetcc,T_cor,pp_irho,T_cut);
64 if(T_vED>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && neted[0]/ecor<%f",tmp,T_vED);}
65 if(T_pen>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && penalty>%f",tmp,T_pen);}
66 if(T_ifar>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && ifar>(24.*3600.*365.)*%f",tmp,T_ifar);}
68 itree->Draw(
"erA[0]",cut,
"goff");
69 int size = itree->GetSelectedRows();
70 cout <<
"detected events : " << size << endl;
72 double* erA0 = itree->GetV1();
75 TMath::Sort(size,itree->GetV1(),
index,
false);
77 double area_min = pow(erA0[index[0]],2);
78 double area_max = pow(erA0[index[size-1]],2);
79 area_min = area_min ? area_min : 0.1;
80 int nbin = TMath::Ceil(area_max/area_min);
82 sa_hist =
new TH1F(
"sa_hist",
"sa_hist",nbin,area_min,area_max);
85 double sarea = erA0[index[
i]]*erA0[index[
i]];
95 double search_area50=0;
97 cout <<
"search_area50 : " << search_area50 << endl;
99 double search_area90=0;
101 cout <<
"search_area90 : " << search_area90 << endl;
104 sa_canvas =
new TCanvas(
"fom",
"PRC", 300,40, 600, 600);
113 sprintf(ofname,
"%s/search_area.txt",odir.Data());
115 if (!out.good()) {cout <<
"DrawSearchAreaPRC.C: Error Opening Output File : " << ofname << endl;
exit(1);}
116 cout <<
"Create Dump Search Area Output File : " << ofname << endl;
117 int hsize =
sa_hist->GetNbinsX()+1;
118 double* fraction =
new double[hsize];
119 double* perc =
new double[hsize];
120 double* eperc =
new double[hsize];
125 double k = integral*
sa_hist->GetBinContent(
i);
129 eperc[
i] = (1/
N)*sqrt(k*(1-k/N));
135 TGraphErrors* sa_graph =
new TGraphErrors(hsize, fraction, perc, 0, eperc);
136 sa_graph->GetXaxis()->SetTitleOffset(1.3);
137 sa_graph->GetYaxis()->SetTitleOffset(1.25);
138 sa_graph->GetXaxis()->SetTickLength(0.01);
139 sa_graph->GetYaxis()->SetTickLength(0.01);
140 sa_graph->GetXaxis()->CenterTitle(kTRUE);
141 sa_graph->GetYaxis()->CenterTitle(kTRUE);
142 sa_graph->GetXaxis()->SetTitleFont(42);
143 sa_graph->GetXaxis()->SetLabelFont(42);
144 sa_graph->GetYaxis()->SetTitleFont(42);
145 sa_graph->GetYaxis()->SetLabelFont(42);
146 sa_graph->SetMarkerStyle(20);
147 sa_graph->SetMarkerSize(0.2);
148 sa_graph->SetMarkerColor(1);
149 sa_graph->SetLineColor(kOrange);
150 sa_graph->SetLineWidth(3);
151 sa_graph->SetTitle(
"");
152 sa_graph->SetFillColor(kOrange);
153 sa_graph->SetFillStyle(3001);
156 sprintf(title,
"Search Area - Ndet = %d",size);
157 sa_graph->SetTitle(title);
158 sa_graph->Paint(
"alp");
159 sa_graph->GetXaxis()->SetTitle(
"Searched area deg^{2}");
160 sa_graph->GetYaxis()->SetTitle(
"Cumulative fraction of events");
161 sa_graph->GetXaxis()->SetLimits(1, 10000);
162 sa_graph->GetYaxis()->SetRangeUser(0, 1);
163 sa_graph->GetXaxis()->SetTitleOffset(1.3);
164 sa_graph->GetYaxis()->SetTitleOffset(1.25);
165 sa_graph->GetXaxis()->SetTickLength(0.01);
166 sa_graph->GetYaxis()->SetTickLength(0.01);
167 sa_graph->GetXaxis()->CenterTitle(kTRUE);
168 sa_graph->GetYaxis()->CenterTitle(kTRUE);
169 sa_graph->GetXaxis()->SetTitleFont(132);
170 sa_graph->GetXaxis()->SetLabelFont(132);
171 sa_graph->GetYaxis()->SetTitleFont(132);
172 sa_graph->GetYaxis()->SetLabelFont(132);
174 sa_graph->Draw(
"aple3");
177 TLegend *legend =
new TLegend(0.1, 0.75, 0.5, 0.9,NULL,
"brNDC");
178 legend->SetBorderSize(1);
179 legend->SetTextFont(132);
180 legend->SetTextSize(0.03);
181 legend->SetLineColor(kBlack);
182 legend->SetFillColor(kWhite);
184 sprintf(label,
"50%% : %0.2f (deg^{2})",search_area50);
185 legend->AddEntry(sa_graph,label,
"");
186 sprintf(label,
"90%% : %0.2f (deg^{2})",search_area90);
187 legend->AddEntry(sa_graph,label,
"");
190 sprintf(ofname,
"%s/search_area.gif",odir.Data());
195 pfname.ReplaceAll(
".gif",
".png");
196 sprintf(cmd,
"convert %s %s",ofname,pfname.Data());
void DrawSearchAreaPRC(TString data_label, TString odir, TString merge_label, int nIFO, float T_win, int pp_inetcc, float T_cor, int pp_irho, float T_cut, float T_vED, float T_pen, float T_ifar)
strcpy(RunLabel, RUN_LABEL)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)