6 #define NETSNR (10*sqrt(3.)) 13 TString mdc[4] = {
"WNB250_100_0d100",
"SG235Q3",
"SG235Q8d9",
"SGC235Q9"};
21 TObjString* sfile = (TObjString*)token->At(token->GetEntries()-1);
24 ofile.ReplaceAll(
".root",
".txt");
25 TITLE.ReplaceAll(
".root",
"");
29 if (!out.good()) {cout <<
"Error Opening File : " << ofile.Data() << endl;
exit(1);}
30 cout <<
"Create file : " << ofile.Data() << endl;
35 double coverage[
NMDC][11];
39 for (
int j=1;
j<10;
j++) {
41 out <<
mdc[
i].Data() <<
" " <<
j*10 <<
" " << coverage[
i][
j] << endl;
47 TCanvas*
canvas =
new TCanvas(
"fom",
"PRC", 300,40, 600, 600);
49 canvas->ToggleEventStatus();
50 canvas->SetFillColor(0);
53 canvas->SetLogy(
false);
54 canvas->SetLogx(
false);
56 gStyle->SetTitleH(0.032);
57 gStyle->SetTitleW(0.98);
58 gStyle->SetTitleY(0.98);
59 gStyle->SetTitleFont(72);
60 gStyle->SetLineColor(kWhite);
61 gStyle->SetPalette(1,0);
62 gStyle->SetNumberContours(256);
64 Style_t markers[32]= {20,21,22,23,29,29,21,22,20,21,22,23,29,20,21,22,
65 21,22,23,29,29,21,22,20,21,22,23,29,20,21,22,20 };
67 Color_t
colors[32] = { 6, 3, 2, 8,43, 7, 8, 4, 4, 2,43, 1, 3, 1, 6, 7,
68 6, 3, 2, 8,43, 7, 8, 4, 4, 2,43, 1, 3, 1, 6, 7 };
70 double perc[11]={0,10,20,30,40,50,60,70,80,90,100};
73 gr[
i] =
new TGraph(11,perc,coverage[
i]);
74 gr[
i]->SetLineColor(colors[i]);
75 gr[
i]->SetLineWidth(1);
76 gr[
i]->SetMarkerColor(colors[i]);
77 gr[
i]->SetMarkerStyle(markers[i]);
81 gr[NMDC+1] =
new TGraph(2,x,y);
82 gr[NMDC+1]->SetLineColor(1);
83 gr[NMDC+1]->SetLineWidth(2);
84 gr[NMDC+1]->SetLineStyle(2);
86 TMultiGraph*
mg =
new TMultiGraph();
87 for(
int i=0;
i<
NMDC;
i++) mg->Add(gr[
i],
"lp");
88 mg->Add(gr[NMDC+1],
"lp");
92 mg->GetHistogram()->SetTitle(title);
93 mg->GetHistogram()->GetXaxis()->SetTitle(
"Percentage");
94 mg->GetHistogram()->GetYaxis()->SetTitle(
"Coverage");
95 mg->GetHistogram()->GetXaxis()->SetRangeUser(0,100);
96 mg->GetHistogram()->GetYaxis()->SetRangeUser(0,100);
97 mg->GetHistogram()->GetXaxis()->SetTitleOffset(1.3);
98 mg->GetHistogram()->GetYaxis()->SetTitleOffset(1.3);
99 mg->GetHistogram()->GetXaxis()->CenterTitle(
true);
100 mg->GetHistogram()->GetYaxis()->CenterTitle(
true);
101 mg->GetHistogram()->GetXaxis()->SetLabelFont(42);
102 mg->GetHistogram()->GetXaxis()->SetTitleFont(42);
103 mg->GetHistogram()->GetYaxis()->SetLabelFont(42);
104 mg->GetHistogram()->GetYaxis()->SetTitleFont(42);
108 double hleg = 0.8-NMDC*0.05;
109 leg =
new TLegend(0.1291513,hleg,0.6244966,0.8738739,NULL,
"brNDC");
111 leg->SetBorderSize(1);
112 leg->SetTextAlign(22);
113 leg->SetTextFont(12);
114 leg->SetLineColor(1);
115 leg->SetLineStyle(1);
116 leg->SetLineWidth(1);
117 leg->SetFillColor(0);
118 leg->SetFillStyle(1001);
119 leg->SetTextSize(0.04);
120 leg->SetLineColor(kBlack);
121 leg->SetFillColor(kWhite);
124 for(
int i=0;i<
NMDC;i++) {
126 leg->AddEntry(gr[i],label,
"lp");
131 char label[64];
sprintf(label,
"_%g_CovVsPerc.gif",
factors[idfactor]);
133 gfileName.ReplaceAll(
".txt",label);
134 canvas->Print(gfileName);
136 pfileName.ReplaceAll(
".gif",
".png");
138 sprintf(cmd,
"convert %s %s",gfileName.Data(),pfileName.Data());
141 sprintf(cmd,
"rm %s",gfileName.Data());
150 TFile *
ifile = TFile::Open(fname.Data());
151 TTree*
itree = (TTree *) gROOT->FindObject(
"waveburst");
152 itree->SetEstimate(itree->GetEntries());
154 char selection[1024];
156 sprintf(tree_cut,
"abs(time[0]-time[3])<0.1 && type[1]==%d && abs(factor-%f)<0.1",idmdc,
factors[idfactor]);
159 sprintf(selection,
"erA[0]-erA[%d]>>hist_cumulative_erA1(2000,-100,100)",iderA);
160 itree->Draw(selection,tree_cut,
"goff");
161 int size = itree->GetSelectedRows();
162 TH1D* hist_cumulative_erA1 = (TH1D*)gDirectory->Get(
"hist_cumulative_erA1");
165 delete hist_cumulative_erA1;
171 double integral = hist_cumulative_erA1->ComputeIntegral();
172 if (integral==0) {cout <<
"Empty histogram !!!" << endl;
exit(0);}
173 double* cumulative = hist_cumulative_erA1->GetIntegral();
174 for (
int i=0;
i<hist_cumulative_erA1->GetNbinsX();
i++) hist_cumulative_erA1->SetBinContent(
i,cumulative[
i]/integral);
178 double perc = 100.*hist_cumulative_erA1->GetBinContent(1001);
179 delete hist_cumulative_erA1;
cout<< endl;cout<< "ts size = "<< ts.size()<< " ts rate = "<< ts.rate()<< endl;tf.Forward(ts, wdm);int levels=tf.getLevel();cout<< "tf size = "<< tf.size()<< endl;double dF=tf.resolution();double dT=1./(2 *dF);cout<< "rate(hz) : "<< RATE<< "\ layers : "<< nLAYERS<< "\ dF(hz) : "<< dF<< "\ dT(ms) : "<< dT *1000.<< endl;int itime=TIME_PIXEL_INDEX;int ifreq=FREQ_PIXEL_INDEX;int index=(levels+1) *itime+ifreq;double time=itime *dT;double freq=(ifreq >0) ? ifreq *dF :dF/4;cout<< endl;cout<< "PIXEL TIME = "<< time<< " sec "<< endl;cout<< "PIXEL FREQ = "<< freq<< " Hz "<< endl;cout<< endl;wavearray< double > x
void DrawCoverageVsPercentagePRC(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)
double GetPercentage(TString gtype, int iderA, TString fname, 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)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)