22 int pp_inetcc,
float T_cor,
int pp_irho,
float T_cut,
float T_vED,
float T_pen,
float T_ifar) {
24 if(gtype!=
"nre" && gtype!=
"snr" && gtype!=
"ff" && gtype!=
"of" && gtype!=
"ofnre" && gtype!=
"offf" &&
25 gtype!=
"mch1" && gtype!=
"mch2" && gtype!=
"mch3" && gtype!=
"mch4" &&
26 gtype!=
"mch5" && gtype!=
"mch6" && gtype!=
"mch7" && gtype!=
"mch8" &&
27 gtype!=
"mch9" && gtype!=
"mch10" && gtype!=
"mch11" && gtype!=
"mch12") {
28 cout <<
"DrawWRC : Error - wrong input gtype (snr/nre/ff/of/ofnre/offf/mch1:12)" << endl;
35 gCANVAS =
new TCanvas(
"fom",
"PRC", 300,40, 600, 600);
36 gCANVAS->Range(-19.4801,-9.25,-17.4775,83.25);
37 if(gtype==
"ofnre" || gtype==
"offf") gCANVAS->SetRightMargin(0.13);
38 gCANVAS->SetBorderSize(2);
39 gCANVAS->SetFrameFillColor(0);
48 sprintf(sim_file_name,
"merge/wave_%s.%s.root",data_label.Data(),merge_label.Data());
49 TFile* fwave = TFile::Open(sim_file_name);
50 gTRWAVE = (TTree*) gROOT->FindObject(
"waveburst");
56 gCANVAS->SetLogx(
true);
57 if(gtype==
"snr") gCANVAS->SetLogy(
true);
58 if(gtype==
"snr") ptitle=
"Reconstructed SNRnet vs Injected SNRnet";
59 if(gtype==
"nre") ptitle=
"Normalized Residual Energy (NRE)";
60 if(gtype==
"ff") ptitle=
"Fitting Factor (FF)";
61 if(gtype==
"of") ptitle=
"Overlap Factor (OF)";
63 ptitle=
"Overlap Factor vs Normalized Residual Energy (OFNRE)";
64 gCANVAS->SetLogx(
false);
67 ptitle=
"Overlap Factor vs Fitting Factor";
68 gCANVAS->SetLogx(
false);
71 ptitle=
"Rec Chirp Mass vs Inj Chirp Mass (CM)";
72 gCANVAS->SetLogx(
false);
75 ptitle=
"Rec-Inj Chirp Mass vs Injected SNRnet";
76 gCANVAS->SetLogx(
false);
79 ptitle=
"Chirp Ellipticity vs Inj Chirp Mass";
80 gCANVAS->SetLogx(
false);
83 ptitle=
"Chirp Ellipticity vs Injected SNRnet";
84 gCANVAS->SetLogx(
false);
87 ptitle=
"Chirp Pixel Fraction vs Inj Chirp Mass";
88 gCANVAS->SetLogx(
false);
91 ptitle=
"Chirp Pixel Fraction vs Injected SNRnet";
92 gCANVAS->SetLogx(
false);
95 ptitle=
"Chirp Energy Fraction vs Inj Chirp Mass";
96 gCANVAS->SetLogx(
false);
99 ptitle=
"Chirp Energy Fraction vs Injected SNRnet";
100 gCANVAS->SetLogx(
false);
103 ptitle=
"Chirp Mass Error vs Inj Chirp Mass";
104 gCANVAS->SetLogx(
false);
107 ptitle=
"Chirp Mass Error vs Injected SNRnet";
108 gCANVAS->SetLogx(
false);
111 ptitle=
"PE Rec-Inj Chirp Mass vs Injected SNRnet";
112 gCANVAS->SetLogx(
false);
115 ptitle=
"PE Chirp Mass Error vs Injected SNRnet";
116 gCANVAS->SetLogx(
false);
118 gStyle->SetOptStat(0);
121 xtitle =
"Injected SNRnet";
122 if(gtype==
"snr") ytitle =
"Reconstructed SNRnet";
123 if(gtype==
"nre") ytitle =
"NRE";
124 if(gtype==
"ff") ytitle =
"FF";
125 if(gtype==
"of") ytitle =
"OF";
135 xtitle =
"Injected Chirp Mass";
136 ytitle =
"Reconstructed Chirp Mass";
138 if(gtype==
"mch2") ytitle =
"Rec-Inj Chirp Mass";
140 xtitle =
"Injected Chirp Mass";
141 ytitle =
"Chirp Ellipticity";
143 if(gtype==
"mch4") ytitle =
"Chirp Ellipticity";
145 xtitle =
"Injected Chirp Mass";
146 ytitle =
"Chirp Pixel Fraction";
148 if(gtype==
"mch6") ytitle =
"Chirp Pixel Fraction";
150 xtitle =
"Injected Chirp Mass";
151 ytitle =
"Chirp Energy Fraction";
153 if(gtype==
"mch8") ytitle =
"Chirp Energy Fraction";
155 xtitle =
"Injected Chirp Mass";
156 ytitle =
"Chirp Mass Error";
158 if(gtype==
"mch10") ytitle =
"Chirp Mass Error";
159 if(gtype==
"mch11") ytitle =
"PE Rec-Inj Chirp Mass";
160 if(gtype==
"mch12") ytitle =
"PE Chirp Mass Error";
161 Plot(gtype, ptitle, xtitle, ytitle, nIFO, T_win, pp_inetcc, T_cor, pp_irho, T_cut, T_vED, T_pen, T_ifar);
164 if(gtype==
"snr")
sprintf(ofname,
"%s/osnr_vs_isnr.gif",odir.Data());
165 if(gtype==
"nre")
sprintf(ofname,
"%s/nre_vs_isnr.gif",odir.Data());
166 if(gtype==
"ff")
sprintf(ofname,
"%s/ff_vs_isnr.gif",odir.Data());
167 if(gtype==
"of")
sprintf(ofname,
"%s/of_vs_isnr.gif",odir.Data());
168 if(gtype==
"ofnre")
sprintf(ofname,
"%s/of_vs_nre.gif",odir.Data());
169 if(gtype==
"offf")
sprintf(ofname,
"%s/of_vs_ff.gif",odir.Data());
170 if(gtype==
"mch1")
sprintf(ofname,
"%s/omch_vs_imch.gif",odir.Data());
171 if(gtype==
"mch2")
sprintf(ofname,
"%s/dmch_vs_isnr.gif",odir.Data());
172 if(gtype==
"mch3")
sprintf(ofname,
"%s/elch_vs_imch.gif",odir.Data());
173 if(gtype==
"mch4")
sprintf(ofname,
"%s/elch_vs_isnr.gif",odir.Data());
174 if(gtype==
"mch5")
sprintf(ofname,
"%s/pfch_vs_imch.gif",odir.Data());
175 if(gtype==
"mch6")
sprintf(ofname,
"%s/pfch_vs_isnr.gif",odir.Data());
176 if(gtype==
"mch7")
sprintf(ofname,
"%s/efch_vs_imch.gif",odir.Data());
177 if(gtype==
"mch8")
sprintf(ofname,
"%s/efch_vs_isnr.gif",odir.Data());
178 if(gtype==
"mch9")
sprintf(ofname,
"%s/emch_vs_imch.gif",odir.Data());
179 if(gtype==
"mch10")
sprintf(ofname,
"%s/emch_vs_isnr.gif",odir.Data());
180 if(gtype==
"mch11")
sprintf(ofname,
"%s/opemch_vs_isnr.gif",odir.Data());
181 if(gtype==
"mch12")
sprintf(ofname,
"%s/epemch_vs_isnr.gif",odir.Data());
182 gCANVAS->Print(ofname);
185 pfname.ReplaceAll(
".gif",
".png");
186 sprintf(cmd,
"convert %s %s",ofname,pfname.Data());
197 int pp_inetcc,
float T_cor,
int pp_irho,
float T_cut,
float T_vED,
float T_pen,
float T_ifar) {
199 if(gtype==
"mch11" || gtype==
"mch12") {
201 bool pe_mch_exists=
false;
202 TIter
next(gTRWAVE->GetListOfBranches());
203 while ((branch=(TBranch*)
next())) {
204 if(
TString(
"pe_mch").CompareTo(branch->GetName())==0) pe_mch_exists=
true;
207 if(!pe_mch_exists)
return;
230 strcpy(tmp,
"(iSNR[0]+oSNR[0]-2*ioSNR[0])");
234 if(gtype==
"snr")
sprintf(sel,
"sqrt(likelihood):sqrt(%s)>>htemp",den);
235 if(gtype==
"nre")
sprintf(sel,
"(%s)/(%s):sqrt(%s)>>htemp",num,den,den);
236 if(gtype==
"ff")
sprintf(sel,
"(%s)/sqrt((%s)*(%s)):sqrt(%s)>>htemp",ffnum,iffden,iffden,den);
237 if(gtype==
"of")
sprintf(sel,
"(%s)/sqrt((%s)*(%s)):sqrt(%s)>>htemp",ffnum,iffden,offden,den);
238 if(gtype==
"ofnre")
sprintf(sel,
"(%s)/sqrt((%s)*(%s)):1-(%s)/(%s)>>htemp",ffnum,iffden,offden,num,den);
239 if(gtype==
"offf")
sprintf(sel,
"(%s)/sqrt((%s)*(%s)):(%s)/sqrt((%s)*(%s))>>htemp",ffnum,iffden,offden,ffnum,iffden,iffden);
240 if(gtype==
"mch1")
sprintf(sel,
"chirp[1]:chirp[0]>>htemp");
241 if(gtype==
"mch2")
sprintf(sel,
"chirp[1]-chirp[0]:sqrt(%s)>>htemp",den);
242 if(gtype==
"mch3")
sprintf(sel,
"chirp[3]:chirp[0]>>htemp");
243 if(gtype==
"mch4")
sprintf(sel,
"chirp[3]:sqrt(%s)>>htemp",den);
244 if(gtype==
"mch5")
sprintf(sel,
"chirp[4]:chirp[0]>>htemp");
245 if(gtype==
"mch6")
sprintf(sel,
"chirp[4]:sqrt(%s)>>htemp",den);
246 if(gtype==
"mch7")
sprintf(sel,
"chirp[5]:chirp[0]>>htemp");
247 if(gtype==
"mch8")
sprintf(sel,
"chirp[5]:sqrt(%s)>>htemp",den);
248 if(gtype==
"mch9")
sprintf(sel,
"chirp[2]:chirp[0]>>htemp");
249 if(gtype==
"mch10")
sprintf(sel,
"chirp[2]:sqrt(%s)>>htemp",den);
250 if(gtype==
"mch11")
sprintf(sel,
"pe_mch[0]-chirp[0]:sqrt(%s)>>htemp",den);
251 if(gtype==
"mch12")
sprintf(sel,
"pe_mch[1]:sqrt(%s)>>htemp",den);
252 sprintf(cut,
"abs(time[0]-time[%d])<%g && netcc[%d]>%g && rho[%d]>%g",
253 nIFO,T_win,pp_inetcc,T_cor,pp_irho,T_cut);
254 if(T_vED>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && neted[0]/ecor<%f",tmp,T_vED);}
255 if(T_pen>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && penalty>%f",tmp,T_pen);}
256 if(T_ifar>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && ifar>(24.*3600.*365.)*%f",tmp,T_ifar);}
257 gTRWAVE->SetMarkerColor(kRed);
258 gTRWAVE->SetMarkerStyle(20);
259 gTRWAVE->SetMarkerSize(0.5);
260 gTRWAVE->SetLineColor(kRed);
261 gTRWAVE->SetFillColor(kRed);
262 if(gtype==
"ofnre" || gtype==
"offf") gTRWAVE->Draw(sel,cut,
"colz");
263 else gTRWAVE->Draw(sel,cut);
264 int nwave = gTRWAVE->GetSelectedRows();
265 cout <<
"nwave : " << nwave << endl;
269 double* inre = gTRWAVE->GetV1();
270 for(
int i=0;i<nwave;i++) if(inre[i]>1) inre[
i]=1;
271 for(
int i=0;
i<
nwave;
i++)
if(inre[
i]<0.001) inre[
i]=0.001;
274 TH2F *htemp = (TH2F*)gPad->GetPrimitive(
"htemp");
276 htemp->SetTitle(title);
277 htemp->GetXaxis()->SetTitle(xtitle);
278 htemp->GetYaxis()->SetTitle(ytitle);
279 htemp->GetXaxis()->SetMoreLogLabels();
280 if(gtype==
"snr") htemp->GetYaxis()->SetMoreLogLabels();
281 if(gtype==
"nre") htemp->GetYaxis()->SetRangeUser(0.0,1.0);
282 if(gtype==
"ff") htemp->GetYaxis()->SetRangeUser(0.0,1.0);
283 if(gtype==
"of") htemp->GetYaxis()->SetRangeUser(0.0,1.0);
284 if(gtype==
"ofnre") {htemp->GetXaxis()->SetRangeUser(-4.0,1.0);htemp->GetYaxis()->SetRangeUser(-1.0,1.0);}
285 if(gtype==
"offf") {htemp->GetXaxis()->SetRangeUser(-2.0,2.0);htemp->GetYaxis()->SetRangeUser(-1.0,1.0);}
286 htemp->GetXaxis()->SetTitleOffset(1.35);
287 htemp->GetYaxis()->SetTitleOffset(1.50);
288 htemp->GetXaxis()->CenterTitle(
true);
289 htemp->GetYaxis()->CenterTitle(
true);
290 htemp->GetXaxis()->SetLabelFont(42);
291 htemp->GetXaxis()->SetTitleFont(42);
292 htemp->GetYaxis()->SetLabelFont(42);
293 htemp->GetYaxis()->SetTitleFont(42);
296 if(gtype==
"snr" || gtype==
"mch1") {
297 double lmin=htemp->GetYaxis()->GetXmin();
298 double lmax=htemp->GetYaxis()->GetXmax();
299 if(htemp->GetXaxis()->GetXmin()>lmin) lmin=htemp->GetXaxis()->GetXmin();
300 if(htemp->GetXaxis()->GetXmax()<lmax) lmax=htemp->GetXaxis()->GetXmax();
301 TLine *
line =
new TLine(lmin,lmin,lmax,lmax);
302 line->SetLineColor(kBlue);
317 pp_inetcc, T_cor, pp_irho, T_cut, T_vED, T_pen, T_ifar);
void DrawWRC(TString gtype, 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)
TIter next(twave->GetListOfBranches())
void Plot(TString gtype, TString ptitle, TString xtitle, TString ytitle, 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)
TString sel("slag[1]:rho[1]")
strcpy(RunLabel, RUN_LABEL)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
void DrawWRC(TString gtype, 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)