3 #pragma GCC system_header
10 #include "TObjArray.h"
11 #include "TObjString.h"
25 #include "../../cwb/postproduction/O1/GW150914_search_bins.hh"
28 if(bin!=
"UNMODELED" && bin!=
"CONSTRAINED" && bin!=
"CHIRP" && bin!=
"EUNMODELED" && bin!=
"ECONSTRAINED") {
29 cout <<
"MakeFAR - Error : bin not defined !!!" << endl;
34 cout <<
"MakeFAR - Error : bkg_livetime <= 0 !!!" << endl;
41 if(bin==
"UNMODELED") selection =
unmodeled.GetTitle();
42 if(bin==
"CONSTRAINED") selection =
constrained.GetTitle();
43 if(bin==
"CHIRP") selection =
chirp.GetTitle();
44 if(bin==
"EUNMODELED") selection =
eunmodeled.GetTitle();
45 if(bin==
"ECONSTRAINED") selection =
econstrained.GetTitle();
47 TFile *
wfile = TFile::Open(wave_file.Data());
48 TTree* twave = (TTree *) gROOT->FindObject(
"waveburst");
52 sprintf(sel,
"%s && (lag[2]!=0 || slag[2]!=0)", sel);
55 twave->Draw(
"rho[0]",sel,
"goff");
56 double* trho = twave->GetV1();
57 int N = twave->GetSelectedRows();
58 cout <<
"N " << N << endl;
62 float pp_rho_wbin = 0.01;
63 int pp_rho_bin = float(pp_rho_max-pp_rho_min)/pp_rho_wbin;
64 double drho = double(pp_rho_max-pp_rho_min)/double(pp_rho_bin);
68 for(
int j=0;
j<Xcut.
size();
j++) {
69 Xcut.
data[
j] = pp_rho_min+
j*drho;
70 for(
int i=0;
i<
N;
i++) {
75 vector<double>
rho,far;
76 for(
int j=Xcut.
size()-1;
j>=0;
j--) {
77 if (Ycut[
j]<=0)
continue;
78 rho.push_back(Xcut[
j]);
79 far.push_back(Ycut[j]);
85 if(!outa.good()) {cout <<
"Error Opening File " << ofName << endl;
exit(1);}
87 for(
int i=0;
i<Xcut.
size();
i++)
if (Ycut[
i]>0) {
90 double y = Ycut[
i]/bkg_livetime;
91 double ey = sqrt(Ycut[
i])/bkg_livetime;
93 if(y>=1) outa << x <<
"\t\t" << y << endl;
94 if(y<1) outa << x <<
"\t\t" << y << endl;
97 if(y>=1) outa << x <<
"\t\t" << y <<
"\t\t" << ex <<
"\t" << ey << endl;
98 if(y<1) outa << x <<
"\t\t" << y <<
"\t" << ex <<
"\t" << ey << endl;
virtual size_t size() const
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<< "\t layers : "<< nLAYERS<< "\t dF(hz) : "<< dF<< "\t 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 MakeFARvsRHO(TString bin, TString wave_file, double bkg_livetime, TString ofName, bool ocolumns2=true)
wavearray< double > Ycut(pp_rho_bin)
wavearray< double > Xcut(pp_rho_bin)
TString sel("slag[1]:rho[1]")
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)