41 int pp_inetcc,
float T_cor,
int pp_irho,
float T_cut,
float T_vED,
float T_pen,
float T_ifar) {
43 if(gtype!=
"distance" && gtype!=
"snr") {
44 cout <<
"DrawRECvsINJ : Error - wrong input gtype (snr/distance)" << endl;
51 gCANVAS =
new TCanvas(
"fom",
"PRC", 300,40, 600, 500);
52 gCANVAS->Range(-19.4801,-9.25,-17.4775,83.25);
53 gCANVAS->SetBorderSize(2);
54 gCANVAS->SetFrameFillColor(0);
63 sprintf(sim_file_name,
"merge/wave_%s.%s.root",data_label.Data(),merge_label.Data());
64 TFile* fwave = TFile::Open(sim_file_name);
65 gTRWAVE = (TTree*) gROOT->FindObject(
"waveburst");
68 sprintf(mdc_file_name,
"merge/mdc_%s.%s.root",data_label.Data(),merge_label.Data());
69 TFile *fmdc = TFile::Open(mdc_file_name);
70 gTRMDC = (TTree*) gROOT->FindObject(
"mdc");
76 if(gtype==
"snr") gCANVAS->SetLogx(
true);
77 gCANVAS->SetLogy(
true);
78 ptitle=
"Reconstructed events vs Injected events";
79 gStyle->SetOptStat(0);
82 xtitle = gtype==
"snr" ?
"Injected SNRnet" :
"distance (Mpc)";
85 RECvsINJ(0, gtype, ptitle, xtitle, ytitle, nIFO, T_win, pp_inetcc, T_cor, pp_irho, T_cut, T_vED, T_pen, T_ifar);
89 sprintf(ofname,
"%s/inj_vs_rec_snr.gif",odir.Data());
91 sprintf(ofname,
"%s/inj_vs_rec_distance.gif",odir.Data());
93 gCANVAS->Print(ofname);
96 pfname.ReplaceAll(
".gif",
".png");
97 sprintf(cmd,
"convert %s %s",ofname,pfname.Data());
108 int pp_inetcc,
float T_cor,
int pp_irho,
float T_cut,
float T_vED,
float T_pen,
float T_ifar) {
118 strcpy(tmp,
"snr[0]*snr[0]");
120 strcpy(tmp,sel);
sprintf(sel,
"sqrt(%s)>>hist(10000,1,10000)",tmp);
122 double dmin = gTRMDC->GetMinimum(
"distance");
123 double dmax = gTRMDC->GetMaximum(
"distance");
124 sprintf(sel,
"distance>>hist(30,%f,%f)",dmin,dmax);
126 gTRMDC->Draw(sel,cut,
"");
127 int nmdc = gTRMDC->GetSelectedRows();
128 cout <<
"nmdc : " << nmdc << endl;
130 TH2F *htemp = (TH2F*)gPad->GetPrimitive(
"hist");
131 htemp->GetXaxis()->SetTitle(xtitle);
132 htemp->GetYaxis()->SetTitle(ytitle);
135 htemp->GetYaxis()->SetRangeUser(0.1, pow(10.,TMath::Ceil(TMath::Log10(htemp->GetMaximum()))));
137 htemp->GetXaxis()->SetRangeUser(gTRMDC->GetMinimum(
"distance"),gTRMDC->GetMaximum(
"distance"));
138 htemp->SetMinimum(0.9);
140 htemp->GetXaxis()->SetTitleOffset(1.35);
141 htemp->GetYaxis()->SetTitleOffset(1.35);
142 htemp->GetXaxis()->CenterTitle(
true);
143 htemp->GetYaxis()->CenterTitle(
true);
144 htemp->GetXaxis()->SetLabelFont(42);
145 htemp->GetXaxis()->SetTitleFont(42);
146 htemp->GetYaxis()->SetLabelFont(42);
147 htemp->GetYaxis()->SetTitleFont(42);
158 sprintf(cut,
"abs(time[0]-time[%d])<%g && netcc[%d]>%g && rho[%d]>%g",
159 nIFO,T_win,pp_inetcc,T_cor,pp_irho,T_cut);
160 if(T_vED>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && neted[0]/ecor<%f",tmp,T_vED);}
161 if(T_pen>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && penalty>%f",tmp,T_pen);}
162 if(T_ifar>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && ifar>(24.*3600.*365.)*%f",tmp,T_ifar);}
163 gTRWAVE->SetLineColor(kRed);
164 gTRWAVE->SetFillColor(kRed);
165 gTRWAVE->Draw(sel,cut,
"same");
166 int nwave = gTRWAVE->GetSelectedRows();
167 cout <<
"nwave : " << nwave << endl;
171 htemp->SetTitle(title);
197 pp_inetcc, T_cor, pp_irho, T_cut, T_vED, T_pen, T_ifar);
void DrawRECvsINJ(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)
TString sel("slag[1]:slag[2]")
void RECvsINJ(int mtype, 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)
strcpy(RunLabel, RUN_LABEL)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)