Logo coherent WaveBurst  
Library Reference Guide
Logo
DrawRadiusIFAR.C
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Francesco Salemi
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17 
18 
19 //
20 // Draw PRC Cos Omega distribution
21 // Note : this macro is used to generate the PRC report (cwb_report merge_label prc)
22 // Author : Gabriele Vedovato
23 /*
24 #include "TROOT.h"
25 #include "TSystem.h"
26 #include "TFile.h"
27 #include "TTree.h"
28 #include <fstream>
29 #include <iostream>
30 #include "TGraph.h"
31 #include "TMultiGraph.h"
32 #include "TCanvas.h"
33 #include "TH1F.h"
34 #include "TMath.h"
35 #include "TH1F.h"
36 #include "TH2F.h"
37 #include <TComplex.h>
38 #include <TStyle.h>
39 #include <TRandom.h>
40 #include "TVector3.h"
41 #include "TRotation.h"
42 #include "Math/Vector3Dfwd.h"
43 #include "Math/Rotation3D.h"
44 */
45 
46 TCanvas* co_canvas;
47 
48 void DrawRadiusIFAR(std::vector<double> vR, std::vector<double> veR, std::vector<double> vsifar, std::vector<double> vseifar, char* netdir){
49 
50 
51  co_canvas = new TCanvas("sd", "SD", 3, 47, 1000, 802);
52  co_canvas->SetGridx();
53  co_canvas->SetGridy();
54  co_canvas->SetLogx();
55 
56  TGraphErrors *co_gr = new TGraphErrors(vR.size(), &vsifar[0], &vR[0], 0, &veR[0]);
57  co_gr->GetYaxis()->SetTitle("Sensitive Distance [Mpc]");
58  co_gr->GetXaxis()->SetTitle("Inverse False Alarm Rate [yr]");
59  co_gr->GetXaxis()->SetLimits(0.01,1000.);
60  co_gr->GetYaxis()->SetRangeUser(500,800);
61  co_gr->GetXaxis()->SetTitleOffset(1.3);
62  co_gr->GetYaxis()->SetTitleOffset(1.25);
63  co_gr->GetXaxis()->SetTickLength(0.01);
64  co_gr->GetYaxis()->SetTickLength(0.01);
65  co_gr->GetXaxis()->CenterTitle(kTRUE);
66  co_gr->GetYaxis()->CenterTitle(kTRUE);
67  co_gr->GetXaxis()->SetTitleFont(42);
68  co_gr->GetXaxis()->SetLabelFont(42);
69  co_gr->GetYaxis()->SetTitleFont(42);
70  co_gr->GetYaxis()->SetLabelFont(42);
71  co_gr->SetMarkerStyle(20);
72  co_gr->SetMarkerSize(1.0);
73  co_gr->SetMarkerColor(1);
74  co_gr->SetLineColor(kBlue);
75  co_gr->SetTitle("");
76  co_gr->SetFillColor(kBlue);
77  co_gr->SetFillStyle(3001);
78  // h->Draw("e2same");
79  co_gr->Draw("aple3");
80 
81 
82 
83 
84  char fname[1024];
85  sprintf(fname, "%s/ROC_IFAR.png", netdir);
86  co_canvas->Update();
87  co_canvas->SaveAs(fname);
88 
89  //exit(0);
90 
91 }
92 
std::vector< double > vseifar
std::vector< double > vR
char netdir[1024]
std::vector< double > vsifar
char fname[1024]
std::vector< double > veR
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
void DrawRadiusIFAR(std::vector< double > vR, std::vector< double > veR, std::vector< double > vsifar, std::vector< double > vseifar, char *netdir)
TCanvas * co_canvas