13 #include "TMultiGraph.h"
23 #include "TRotation.h"
24 #include "Math/Vector3Dfwd.h"
25 #include "Math/Rotation3D.h"
34 if (!gROOT->GetClass(
"Polar3DVector")) gSystem->Load(
"libMathCore");
38 char wave_file_name[1024];
39 sprintf(wave_file_name,
"merge/wave_%s.%s.root",data_label.Data(),merge_label.Data());
41 TFile*
ifile = TFile::Open(wave_file_name);
42 TTree*
itree = (TTree *) gROOT->FindObject(
"waveburst");
46 sprintf(cut,
"abs(time[0]-time[%d])<%f && netcc[%d]>%f && rho[%d]>%f",
47 nIFO,T_win,pp_inetcc,T_cor,pp_irho,T_cut);
48 if(T_vED>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && neted[0]/ecor<%f",tmp,T_vED);}
49 if(T_pen>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && penalty>%f",tmp,T_pen);}
50 if(T_ifar>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && ifar>(24.*3600.*365.)*%f",tmp,T_ifar);}
52 itree->Draw(
"theta[0]:phi[0]:theta[1]:phi[1]",cut,
"goff");
53 int size = itree->GetSelectedRows();
54 cout <<
"detected events : " << size << endl;
56 double* th0 = itree->GetV1();
57 double* ph0 = itree->GetV2();
58 double* th1 = itree->GetV3();
59 double* ph1 = itree->GetV4();
61 co_hist =
new TH1F(
"co_hist",
"co_hist",24,-1,1);
71 Polar3DVector v0(1, th0[
i]*deg2rad, ph0[
i]*deg2rad);
72 Polar3DVector v1(1, th1[
i]*deg2rad, ph1[
i]*deg2rad);
74 double Dot = v0.Dot(v1);
75 double dOmega = 180.*TMath::ACos(Dot)/
TMath::Pi();
97 sprintf(title,
"angle offset : #events = %d",size);
99 co_hist->GetXaxis()->SetTitle(
"cos(angle offset)");
100 co_hist->GetYaxis()->SetTitle(
"probability density");
101 co_hist->GetXaxis()->SetRangeUser(-1,1);
102 co_hist->GetYaxis()->SetRangeUser(0.001,1);
104 co_hist->GetXaxis()->SetTitleOffset(1.35);
105 co_hist->GetYaxis()->SetTitleOffset(1.35);
106 co_hist->GetXaxis()->CenterTitle(
true);
107 co_hist->GetYaxis()->CenterTitle(
true);
108 co_hist->GetXaxis()->SetLabelFont(42);
109 co_hist->GetXaxis()->SetTitleFont(42);
110 co_hist->GetYaxis()->SetLabelFont(42);
111 co_hist->GetYaxis()->SetTitleFont(42);
116 co_canvas =
new TCanvas(
"fom",
"PRC", 300,40, 600, 500);
123 sprintf(ofname,
"%s/cos_theta.gif",odir.Data());
127 pfname.ReplaceAll(
".gif",
".png");
128 sprintf(cmd,
"convert %s %s",ofname,pfname.Data());
void DrawCosOmegaPRC(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)
strcpy(RunLabel, RUN_LABEL)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)