35 if (!in.good()) {cout <<
"Error Opening File : " << ifname.Data() << endl;
exit(1);}
43 in >> gw_name[
N] >> dummy >> dummy >> match[
N] >> dummy >> pvalue[
N] >> dummy >> median[
N]
44 >> dummy >> l99[
N] >> dummy >> l90[
N] >> dummy >> l50[
N] >> dummy >> u50[
N] >> dummy >> u90[
N] >> dummy >> u99[
N];
46 cout <<
" "<< gw_name[
N] <<
" "<< match[
N] <<
" "<< pvalue[
N] <<
" "<< median[
N]
47 <<
" "<< l99[
N] <<
" "<< l90[
N] <<
" "<< l50[
N] <<
" "<< u50[
N] <<
" "<< u90[
N] <<
" "<< u99[
N] << endl;;
50 l50[
N] =
fabs(median[N]-l50[N]);
51 u50[
N] =
fabs(u50[N]-median[N]);
53 l90[
N] = (median[
N]-l90[
N]);
54 u90[
N] = (u90[
N]-median[
N]);
56 l99[
N] =
fabs(median[N]-l99[N]);
57 u99[
N] =
fabs(u99[N]-median[N]);
65 TMath::Sort(N,match,index,
false);
71 for(
int n=0;
n<
N;
n++) {
73 smatch[
n]=match[index[
n]];
74 smedian[
n]=median[index[
n]];
75 sl50[
n]=l50[index[
n]];
76 su50[
n]=u50[index[
n]];
77 sl90[
n]=l90[index[
n]];
78 su90[
n]=u90[index[
n]];
79 sl99[
n]=l99[index[
n]];
80 su99[
n]=u99[index[
n]];
81 sgw_name[
n]=gw_name[index[
n]];
82 if(smatch[
n]>xmax) xmax=smatch[
n];
83 if(smedian[
n]+su99[
n]>ymax) ymax=smedian[
n]+su99[
n];
84 cout <<
n <<
"\t" << sgw_name[
n] <<
"\tmatch " << smatch[
n] <<
"\tmedian " << smedian[
n] <<
"\tlow90 " << sl90[
n] <<
"\tup90 " << su90[
n] << endl;
87 TCanvas*
canvas =
new TCanvas(
"fom",
"fom", 300,40, 800, 800);
89 canvas->SetLeftMargin(0.15);
90 canvas->SetBottomMargin(0.15);
92 gStyle->SetGridStyle(3);
93 gStyle->SetGridWidth(1);
94 gStyle->SetFrameBorderMode(0);
95 gStyle->SetTitleTextColor(kBlack);
96 gStyle->SetTitleFont(12,
"D");
99 TH2F *frame =
new TH2F(
"frame",
"",1000,0.,1,1000,0.,1);
100 if(
title) frame->SetTitle(
TString(
"Matching")+
" ( "+label+
" )");
else frame->SetTitle(
"");
102 frame->GetXaxis()->SetTitle(
"OnSource Match");
103 frame->GetYaxis()->SetTitle(
"OffSource Match");
104 frame->GetXaxis()->SetTitleOffset(1.50);
105 frame->GetYaxis()->SetTitleOffset(1.50);
106 frame->GetXaxis()->CenterTitle(kTRUE);
107 frame->GetYaxis()->CenterTitle(kTRUE);
108 frame->GetXaxis()->SetTitleFont(132);
109 frame->GetXaxis()->SetLabelFont(132);
110 frame->GetYaxis()->SetTitleFont(132);
111 frame->GetYaxis()->SetLabelFont(132);
112 frame->GetXaxis()->SetTitleSize(0.04);
113 frame->GetXaxis()->SetLabelSize(0.04);
114 frame->GetYaxis()->SetTitleSize(0.04);
115 frame->GetYaxis()->SetLabelSize(0.04);
116 frame->GetYaxis()->SetLabelOffset(0.01);
117 frame->GetXaxis()->SetNdivisions(9);
118 frame->GetYaxis()->SetNdivisions(9);
119 frame->LabelsOption(
"x");
123 TGraphAsymmErrors* gmatch =
new TGraphAsymmErrors(N,match,median,zero,zero,l90,u90);
124 gmatch->SetMarkerStyle(20);
125 gmatch->SetMarkerSize(1.0);
126 gmatch->SetLineWidth(1);
127 gmatch->SetLineColor(kBlack);
128 gmatch->SetMarkerColor(color[0]);
129 gmatch->Draw(
"PSAME");
132 double xdiag[2]={0,1};
133 double ydiag[2]={0,1};
134 TGraph* gdiag =
new TGraph(2,xdiag,ydiag);
135 gmatch->SetLineColor(color[1]);
136 gdiag->SetLineStyle(9);
140 TLegend *leg =
new TLegend(0.4047619,0.1614987,0.8897243,0.2635659,NULL,
"brNDC");
141 leg->SetBorderSize(1);
142 leg->SetTextAlign(22);
143 leg->SetTextFont(12);
144 leg->SetLineColor(1);
145 leg->SetLineStyle(1);
146 leg->SetLineWidth(1);
147 leg->SetFillColor(0);
148 leg->SetFillStyle(1001);
149 leg->SetTextSize(0.03);
150 leg->SetLineColor(kBlack);
151 leg->SetFillColor(kWhite);
152 leg->AddEntry(gmatch,
"median ( 90% confidence )",
"lp");
153 leg->AddEntry(gdiag,
"null hypothesis",
"lp");
156 if(odir!=
"") odir=odir+
"/";
157 TString ofname=odir+gSystem->BaseName(ifname);;
158 ofname.ReplaceAll(
".txt",
"_match.png");
160 canvas->Print(ofname);
void DrawMatchPE(TString ifname, TString odir, TString label, bool title=true)
double median(std::vector< double > &vec)
double fabs(const Complex &x)