31 #include "TMultiGraph.h" 41 #include "TRotation.h" 42 #include "Math/Vector3Dfwd.h" 43 #include "Math/Rotation3D.h" 52 if (!gROOT->GetClass(
"Polar3DVector")) gSystem->Load(
"libMathCore");
56 char wave_file_name[1024];
57 sprintf(wave_file_name,
"merge/wave_%s.%s.root",data_label.Data(),merge_label.Data());
59 TFile*
ifile = TFile::Open(wave_file_name);
60 TTree*
itree = (TTree *) gROOT->FindObject(
"waveburst");
64 sprintf(cut,
"abs(time[0]-time[%d])<%f && netcc[%d]>%f && rho[%d]>%f",
65 nIFO,T_win,pp_inetcc,T_cor,pp_irho,T_cut);
66 if(T_vED>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && neted[0]/ecor<%f",tmp,T_vED);}
67 if(T_pen>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && penalty>%f",tmp,T_pen);}
68 if(T_ifar>0) {
strcpy(tmp,cut);
sprintf(cut,
"%s && ifar>(24.*3600.*365.)*%f",tmp,T_ifar);}
70 itree->Draw(
"theta[0]:phi[0]:theta[1]:phi[1]",cut,
"goff");
71 int size = itree->GetSelectedRows();
72 cout <<
"detected events : " << size << endl;
74 double* th0 = itree->GetV1();
75 double* ph0 = itree->GetV2();
76 double* th1 = itree->GetV3();
77 double* ph1 = itree->GetV4();
79 co_hist =
new TH1F(
"co_hist",
"co_hist",24,-1,1);
89 Polar3DVector v0(1, th0[
i]*deg2rad, ph0[
i]*deg2rad);
90 Polar3DVector v1(1, th1[
i]*deg2rad, ph1[
i]*deg2rad);
92 double Dot = v0.Dot(v1);
93 double dOmega = 180.*TMath::ACos(Dot)/
TMath::Pi();
115 sprintf(title,
"angle offset : #events = %d",size);
117 co_hist->GetXaxis()->SetTitle(
"cos(angle offset)");
118 co_hist->GetYaxis()->SetTitle(
"probability density");
119 co_hist->GetXaxis()->SetRangeUser(-1,1);
120 co_hist->GetYaxis()->SetRangeUser(0.001,1);
122 co_hist->GetXaxis()->SetTitleOffset(1.35);
123 co_hist->GetYaxis()->SetTitleOffset(1.35);
124 co_hist->GetXaxis()->CenterTitle(
true);
125 co_hist->GetYaxis()->CenterTitle(
true);
126 co_hist->GetXaxis()->SetLabelFont(42);
127 co_hist->GetXaxis()->SetTitleFont(42);
128 co_hist->GetYaxis()->SetLabelFont(42);
129 co_hist->GetYaxis()->SetTitleFont(42);
134 co_canvas =
new TCanvas(
"fom",
"PRC", 300,40, 600, 500);
141 sprintf(ofname,
"%s/cos_theta.gif",odir.Data());
145 pfname.ReplaceAll(
".gif",
".png");
146 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)