13 #include "TMultiGraph.h"
23 #include "TRotation.h"
24 #include "Math/Vector3Dfwd.h"
25 #include "Math/Rotation3D.h"
36 char wave_file_name[1024];
37 sprintf(wave_file_name,
"merge/wave_%s.%s.root",data_label.Data(),merge_label.Data());
39 TFile*
ifile = TFile::Open(wave_file_name);
40 TTree*
itree = (TTree *) gROOT->FindObject(
"waveburst");
44 sprintf(cut,
"abs(time[0]-time[%d])<%f && netcc[%d]>%f && rho[%d]>%f",
45 nIFO,T_win,pp_inetcc,T_cor,pp_irho,T_cut);
46 if(T_vED>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && neted[0]/ecor<%f",tmp,T_vED);}
47 if(T_pen>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && penalty>%f",tmp,T_pen);}
48 if(T_ifar>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && ifar>(24.*3600.*365.)*%f",tmp,T_ifar);}
50 itree->Draw(
"erA[0]",cut,
"goff");
51 int size = itree->GetSelectedRows();
52 cout <<
"detected events : " << size << endl;
54 double* erA0 = itree->GetV1();
57 TMath::Sort(size,itree->GetV1(),
index,
false);
59 double area_min = pow(erA0[index[0]],2);
60 double area_max = pow(erA0[index[size-1]],2);
61 area_min = area_min ? area_min : 0.1;
62 int nbin = TMath::Ceil(area_max/area_min);
64 sa_hist =
new TH1F(
"sa_hist",
"sa_hist",nbin,area_min,area_max);
67 double sarea = erA0[index[
i]]*erA0[index[
i]];
77 double search_area50=0;
79 cout <<
"search_area50 : " << search_area50 << endl;
81 double search_area90=0;
83 cout <<
"search_area90 : " << search_area90 << endl;
86 sprintf(title,
"Ndet = %d",size);
88 sa_hist->GetXaxis()->SetTitle(
"search area (deg^{2})");
89 sa_hist->GetYaxis()->SetTitle(
"cumulative probability");
90 sa_hist->GetXaxis()->SetRangeUser(area_min,area_max);
91 sa_hist->GetYaxis()->SetRangeUser(0,1);
94 sa_canvas =
new TCanvas(
"fom",
"PRC", 300,40, 600, 600);
100 gStyle->SetTitleH(0.062);
101 gStyle->SetTitleW(0.98);
102 gStyle->SetTitleY(0.98);
103 gStyle->SetTitleFont(72);
104 gStyle->SetLineColor(kWhite);
107 sa_hist->GetXaxis()->SetTitleOffset(1.35);
108 sa_hist->GetYaxis()->SetTitleOffset(1.35);
109 sa_hist->GetXaxis()->CenterTitle(
true);
110 sa_hist->GetYaxis()->CenterTitle(
true);
111 sa_hist->GetXaxis()->SetLabelFont(42);
112 sa_hist->GetXaxis()->SetTitleFont(42);
113 sa_hist->GetYaxis()->SetLabelFont(42);
114 sa_hist->GetYaxis()->SetTitleFont(42);
118 TLegend *legend =
new TLegend(0.3708054,0.174216,0.8892617,0.2770035,NULL,
"brNDC");
119 legend->SetTextFont(42);
120 legend->SetTextSize(0.03);
121 legend->SetLineColor(kBlack);
122 legend->SetFillColor(kWhite);
124 sprintf(label,
"search area 50%% : %0.2f (deg^{2})",search_area50);
125 legend->AddEntry(
sa_hist,label,
"lp");
126 sprintf(label,
"search area 90%% : %0.2f (deg^{2})",search_area90);
127 legend->AddEntry(
sa_hist,label,
"lp");
131 sprintf(ofname,
"%s/search_area.gif",odir.Data());
135 pfname.ReplaceAll(
".gif",
".png");
136 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)