49 #define MAXRADIUS 1000 58 co_canvas =
new TCanvas(
"sd2",
"SD2", 3, 47, 1000, 802);
59 co_canvas->SetGridx();
60 co_canvas->SetGridy();
64 float myifar,
ecor,
m1,
m2, netcc[3], neted, penalty;
75 TFile* filein =
new TFile(sim_file_name);
76 TTree* sim_org =
nullptr;
77 filein->GetObject(
"waveburst",sim_org);
79 TTree*
sim = sim_org->CopyTree(
SEL);
80 sim->SetBranchAddress(
"mass", mass);
81 sim->SetBranchAddress(
"factor", &factor);
82 sim->SetBranchAddress(
"range", range);
83 sim->SetBranchAddress(
"chirp", chirp);
84 sim->SetBranchAddress(
"rho", rho);
85 sim->SetBranchAddress(
"netcc", netcc);
86 sim->SetBranchAddress(
"ifar", &myifar);
87 sim->SetBranchAddress(
"time", mytime);
88 sim->SetBranchAddress(
"spin", spin);
105 TFile* filein2 =
new TFile(mdc_file_name);
106 TTree* mdc_org =
nullptr;
107 filein2->GetObject(
"mdc",mdc_org);
109 TTree*
mdc = mdc_org->CopyTree(
SEL);
110 mdc->SetBranchAddress(
"time",mytime);
111 mdc->SetBranchAddress(
"mass", mass);
112 mdc->SetBranchAddress(
"factor", &factor);
113 mdc->SetBranchAddress(
"distance", &distance);
114 mdc->SetBranchAddress(
"mchirp", &mchirp);
115 mdc->SetBranchAddress(
"spin", spin);
118 int nevts = (
int)mdc->GetEntries();
119 float shell_volume_per_injection = shell_volume/nevts;
122 float CYS = 86400.*365.25;
123 if (sim->GetListOfBranches()->FindObject(
"ifar")) {
125 TMath::CeilNint(sim->GetMaximum(
"ifar") /
CYS );
126 cout <<
"Maximum empirically estimated IFAR : " << maxIFAR <<
" [years]" << endl;
128 cout <<
"Missing ifar branch: either use cbc_plots or add it " 134 std::vector<double>
vdv;
135 std::vector<double>
vifar;
136 std::vector<double> vMtot;
138 sim->BuildIndex(
"ifar",
"rho[1]");
139 TTreeIndex *I1=(TTreeIndex*)sim->GetTreeIndex();
140 Long64_t* index1=I1->GetIndex();
142 cout << nevts <<
" injected signals " << sim->GetEntries(
"ifar>0") <<
" recovered signals" <<endl;
145 for (
int g = 0;
g < (
int)sim->GetEntries();
g++) {
146 sim->GetEntry(index1[
g]);
148 if (myifar <=
T_ifar * CYS) {
155 if ((mytime[0] - mytime[
nIFO]) < -
T_win ||
156 (mytime[0] - mytime[nIFO]) > 2 *
T_win) {
161 dV = pow(range[1], 2) * shell_volume_per_injection * pow(chirp[0] / 1.22,5./6.);
162 vdv.push_back(dV+internal_volume);
163 vifar.push_back(myifar);
164 vMtot.push_back(mass[0]+mass[1]);
168 cout << countvifar <<
" events vetoed by T_ifar : " <<
T_ifar << endl;
169 cout << countv <<
" events vetoed by T_win" << endl;
170 cout << vdv.size() <<
" events selected" << endl;
173 std::vector<double>
vV;
174 std::vector<double>
veV;
175 std::vector<double>
vR;
176 std::vector<double>
veR;
177 std::vector<double>
vsifar;
181 vV.push_back(vdv[vdv.size()-1]);
182 veV.push_back(pow(vdv[vdv.size()-1], 2));
183 vsifar.push_back(vifar[vdv.size()-1]);
187 for (
int i = vdv.size()-1;
i >= 0;
i--) {
191 if (vifar[
i] == vsifar[mcount]) {
195 vsifar.push_back(vifar[
i]);
196 vseifar.push_back(TMath::Sqrt(TMath::Nint(
liveTot * vifar[i])));
197 vV.push_back(vV[mcount] + vdv[i]);
198 veV.push_back(veV[mcount] + pow(vdv[i], 2));
202 cout <<
"Length of ifar/volume vector: " << vV.size() << endl;
204 for (
int i = 0;
i < vV.size();
i++) {
205 veV[
i] = TMath::Sqrt(veV[
i]);
210 pow(3. / (4. *
TMath::Pi()* Tscale) * vV[i], 1. / 3.));
211 veR.push_back(pow(3. / (4 *
TMath::Pi() * Tscale), 1. / 3.) *
212 1. / 3 * pow(vV[i], -2. / 3.) * veV[i]);
220 TGraphErrors *co_gr =
new TGraphErrors(vR.size(), &vsifar[0], &vR[0], 0, &veR[0]);
221 co_gr->GetYaxis()->SetTitle(
"Sensitive Distance [Mpc]");
222 co_gr->GetXaxis()->SetTitle(
"Inverse False Alarm Rate [yr]");
225 co_gr->GetXaxis()->SetTitleOffset(1.3);
226 co_gr->GetYaxis()->SetTitleOffset(1.25);
227 co_gr->GetXaxis()->SetTickLength(0.01);
228 co_gr->GetYaxis()->SetTickLength(0.01);
229 co_gr->GetXaxis()->CenterTitle(kTRUE);
230 co_gr->GetYaxis()->CenterTitle(kTRUE);
231 co_gr->GetXaxis()->SetTitleFont(42);
232 co_gr->GetXaxis()->SetLabelFont(42);
233 co_gr->GetYaxis()->SetTitleFont(42);
234 co_gr->GetYaxis()->SetLabelFont(42);
235 co_gr->SetMarkerStyle(20);
236 co_gr->SetMarkerSize(1.0);
237 co_gr->SetMarkerColor(1);
238 co_gr->SetLineColor(kBlue);
240 co_gr->SetFillColor(kBlue);
241 co_gr->SetFillStyle(3001);
243 co_gr->Draw(
"aple3");
static double g(double e)
std::vector< double > vseifar
std::vector< double > vdv
std::vector< double > vfar
std::vector< double > vsifar
cout<< fileout<< endl;out.open(fileout, ios::out);if(!out.good()) { cout<< "cwb_mkhtml_cbc.C : Error Opening File : "<< fileout<< endl;exit(1);} out<< "<br><br><< endl; MakePlotsHtmlCellTable( &out, "Effective Radii", "data/Effective_radius.png", "Effective radius:m1 vs m2", "data/Effective_radius_chi.png", "Effective radius:M< sub > total</sub > vs & chi
std::vector< double > veR
std::vector< double > vifar
TGraphErrors * DrawRadiusIFAR2(char *sim_file_name, char *mdc_file_name, TString SEL, float shell_volume)
std::vector< double > veV
cout<< endl;if(write_ascii) { fev.close();for(int l=0;l< nfactor;l++) { fev_single[l].close();} } cout<< "Recovered entries: "<< cnt<< endl;cout<< "Recovered entries: "<< cnt2<< endl;cout<< "Recovered entries cut by frequency: "<< cntfreq<< endl;cout<< "Recovered entries vetoed: "<< countv<< endl;cout<< "dV : "<< dV<< " dV1 : "<< dV1<< endl;internal_volume=4./3. *TMath::Pi() *pow(minDistance[0]/1000., 3.);if(INCLUDE_INTERNAL_VOLUME) { for(int i=0;i< vdv.size();i++) { if(vdv[i] > 0.0) { vdv[i]+=internal_volume;} } for(int i=0;i< RHO_NBINS;i++) { if(Vrho[i] > 0.0) { Vrho[i]+=internal_volume;} } for(int i=0;i< NBINS_MTOT+1;i++) { for(int j=0;j< NBINS_SPIN+1;j++) { if(spin_mtot_volume[i][j] > 0.0) { spin_mtot_volume[i][j]+=internal_volume;} } } for(int i=0;i< NBINS_mass;i++) { for(int j=0;j< NBINS_mass2;j++) { if(volume[i][j] > 0.0) { volume[i][j]+=internal_volume;} } } } Int_t *mindex=new Int_t[vdv.size()];TMath::Sort((int) vdv.size(), &vifar[0], mindex, true);std::vector< double > vV
std::vector< double > vefar