19 #include "TStopwatch.h" 20 #include "TTreeFormula.h" 23 #include <Riostream.h> 24 #include "Math/BrentRootFinder.h" 25 #include "Math/WrappedTF1.h" 29 #define CCAST(PAR) const_cast<char*>(PAR) 43 tree->Draw(
"Entry$>>hist(Entries$,0,Entries$)", selection,
"goff");
44 TH1I*
hist = (TH1I*)gDirectory->Get(
"hist");
45 Long64_t iEntry = hist->GetBinLowEdge(hist->FindFirstBinAbove(0));
140 -TMath::Nint(rho_bkg[index[bkg_entries - 1]] - rho_bkg[index[0]]) /
142 cout <<
"Rho max : " << rho_bkg[index[0]]
143 <<
" Rho min : " << rho_bkg[index[bkg_entries - 1]]
144 <<
" nbins : " << nbins << endl;
147 TH1D*
h =
new TH1D(
"h",
"h", nbins, rho_bkg[index[bkg_entries - 1]],
148 rho_bkg[index[0]] * 1.05);
149 for (
int i = 0;
i < bkg_entries;
i++) {
154 const Int_t nbinsx = h->GetNbinsX();
155 const Int_t nbinsy = h->GetNbinsY();
156 const Int_t nbinsz = h->GetNbinsZ();
157 TH1* hc = (TH1*)h->Clone();
160 for (Int_t binz = nbinsz; binz >= 1; --binz) {
161 for (Int_t biny = nbinsy; biny >= 1; --biny) {
162 for (Int_t binx = nbinsx; binx >= 1; --binx) {
163 const Int_t bin = hc->GetBin(binx, biny, binz);
164 sum += h->GetBinContent(bin);
165 hc->SetBinContent(bin, sum);
170 double far[nbins], efar[nbins], rad[nbins], rhobin[nbins], erad[nbins];
171 for (
int i = 0;
i < nbins;
i++) {
172 far[
i] = (double)hc->GetBinContent(
i) /
liveTot;
173 efar[
i] = (double)hc->GetBinError(
i) /
liveTot;
174 rhobin[
i] = hc->GetBinCenter(
177 rad[
i] = AverageRad->Eval(
190 hc->Scale(1. / liveTot);
191 hc->GetYaxis()->SetTitle(
"FAR [Hz]");
192 hc->GetXaxis()->SetTitle(
"#rho");
195 sprintf(fname,
"%s/FAR.png", odir.Data());
202 c1->SetTheta(89.999);
210 TGraph2DErrors*
gr2 =
211 new TGraph2DErrors(nbins, far, rad, rhobin, efar, erad, erad);
212 gr2->SetMarkerStyle(20);
213 gr2->SetLineColor(20);
214 gr2->SetMinimum(0.0);
215 double RHO_MAX = ceil(rho_bkg[index[0]] * 1.05);
216 gr2->SetMaximum(RHO_MAX);
221 gr2->SetTitle(
"ROC Curve: Average Range vs FAR @rho threshold");
222 gr2->GetHistogram()->GetXaxis()->SetTitle(
"FAR [Hz]");
223 gr2->GetHistogram()->GetZaxis()->SetTitle(
"#rho");
226 gr2->GetHistogram()->GetXaxis()->SetLimits(
229 gr2->GetHistogram()->GetYaxis()->SetTitle(
"Average Range [Mpc]");
230 gr2->GetXaxis()->SetTitleOffset(1.3);
231 gr2->GetYaxis()->SetTitleOffset(1.25);
232 gr2->GetXaxis()->SetTickLength(0.02);
233 gr2->GetYaxis()->SetTickLength(0.01);
234 gr2->GetXaxis()->CenterTitle(kTRUE);
235 gr2->GetYaxis()->CenterTitle(kTRUE);
236 gr2->GetZaxis()->CenterTitle(kTRUE);
237 gr2->GetXaxis()->SetTitleFont(42);
238 gr2->GetXaxis()->SetLabelFont(42);
239 gr2->GetYaxis()->SetTitleFont(42);
240 gr2->GetYaxis()->SetLabelFont(42);
242 gr2->GetYaxis()->SetNoExponent(kTRUE);
244 gr2->Draw(
"err zcolpcol");
245 sprintf(fname,
"%s/ROC.png", odir.Data());
250 sprintf(fname,
"%s/ROC.txt", odir.Data());
251 FILE* frange = fopen(fname,
"w");
252 fprintf(frange,
"#rho FAR[Hz] eFAR range[Mpc] erange\n");
253 for (
int i = 0;
i < nbins;
i++) {
254 fprintf(frange,
"%3.3g %4.3g %4.3g %4.4g %4.4g\n",
255 hc->GetBinCenter(
i), far[
i], efar[
i], rad[
i], erad[
i]);
302 int nbins = (
int)RHO_NBINS;
303 cout <<
"Rho max : " << rho_bkg[index[0]]
304 <<
" Rho min : " << rho_bkg[index[bkg_entries - 1]]
305 <<
" nbins : " << nbins << endl;
308 TH1D*
h =
new TH1D(
"h",
"h", nbins, RHO_MIN, RHO_NBINS * RHO_BIN);
309 for (
int i = 0;
i < bkg_entries;
i++) {
315 const Int_t nbinsx = h->GetNbinsX();
316 const Int_t nbinsy = h->GetNbinsY();
317 const Int_t nbinsz = h->GetNbinsZ();
318 TH1* hc = (TH1*)h->Clone();
321 for (Int_t binz = nbinsz; binz >= 1; --binz) {
322 for (Int_t biny = nbinsy; biny >= 1; --biny) {
323 for (Int_t binx = nbinsx; binx >= 1; --binx) {
324 const Int_t bin = hc->GetBin(binx, biny, binz);
325 sum += h->GetBinContent(bin);
326 hc->SetBinContent(bin, sum);
331 double far[nbins], efar[nbins], rad[nbins], rhobin[nbins], erad[nbins],
332 vol[nbins], evol[nbins], erhobin[nbins];
334 for (
int i = 0;
i < nbins;
i++) {
335 far[
i] = (double)hc->GetBinContent(
i + 1) / liveTot * 365. * 86400.;
336 efar[
i] = (double)hc->GetBinError(
i + 1) / liveTot * 365. * 86400.;
337 rhobin[
i] = hc->GetBinCenter(
340 while (rhobin[
i] > Trho[j]) {
346 vol[
i] = 4. / 3. *
TMath::Pi() * pow(Rrho[j], 3.);
347 evol[
i] = 4. *
TMath::Pi() * pow(Rrho[j], 2.) * eRrho[
j];
357 hc->Scale(365. * 86400. / liveTot);
358 hc->GetYaxis()->SetTitle(
"FAR [year^{-1}]");
359 hc->GetXaxis()->SetTitle(
"#rho");
362 sprintf(fname,
"%s/FAR.png", odir.Data());
369 c1->SetTheta(89.999);
377 TGraph2DErrors*
gr2 =
378 new TGraph2DErrors(nbins, far, rad, rhobin, efar, erad, erhobin);
379 gr2->SetMarkerStyle(20);
380 gr2->SetLineColor(20);
381 gr2->SetMinimum(0.0);
382 double RHO_MAX = ceil(rho_bkg[index[0]] * 1.05);
383 gr2->SetMaximum(RHO_MAX);
388 gr2->SetTitle(
"ROC Curve: Average Range vs FAR @rho threshold");
389 gr2->GetHistogram()->GetXaxis()->SetTitle(
"FAR [year^{-1}]");
390 gr2->GetHistogram()->GetZaxis()->SetTitle(
"#rho");
393 gr2->GetHistogram()->GetXaxis()->SetLimits(
396 gr2->GetHistogram()->GetYaxis()->SetTitle(
"Average Range [Mpc]");
397 gr2->GetXaxis()->SetTitleOffset(1.3);
398 gr2->GetYaxis()->SetTitleOffset(1.25);
399 gr2->GetXaxis()->SetTickLength(0.02);
400 gr2->GetYaxis()->SetTickLength(0.01);
401 gr2->GetXaxis()->CenterTitle(kTRUE);
402 gr2->GetYaxis()->CenterTitle(kTRUE);
403 gr2->GetZaxis()->CenterTitle(kTRUE);
404 gr2->GetXaxis()->SetTitleFont(42);
405 gr2->GetXaxis()->SetLabelFont(42);
406 gr2->GetYaxis()->SetTitleFont(42);
407 gr2->GetYaxis()->SetLabelFont(42);
409 gr2->GetYaxis()->SetNoExponent(kTRUE);
411 gr2->Draw(
"err zcolpcol");
412 sprintf(fname,
"%s/ROC.png", odir.Data());
417 sprintf(fname,
"%s/ROC.txt", odir.Data());
418 FILE* frange = fopen(fname,
"w");
420 "#rho FAR[year^{-1}] eFAR range[Mpc] " 422 for (
int i = 0;
i < nbins;
i++) {
423 fprintf(frange,
"%3.3g %4.3g %4.3g %4.4g %4.4g\n",
424 hc->GetBinCenter(
i), far[
i], efar[
i], rad[
i], erad[
i]);
429 TGraph2DErrors* gr3 =
430 new TGraph2DErrors(nbins, far, vol, rhobin, efar, erad, erhobin);
431 gr3->SetTitle(
"ROC Curve: Average Volume vs FAR @rho threshold");
432 gr3->GetHistogram()->GetYaxis()->SetTitle(
"Average volume [Mpc^3]");
433 gr3->GetHistogram()->GetXaxis()->SetTitle(
"FAR [year^{-1}]");
434 gr3->GetHistogram()->GetZaxis()->SetTitle(
"#rho");
435 gr3->GetHistogram()->GetXaxis()->SetLimits(
439 gr3->Draw(
"err zcolpcol");
440 sprintf(fname,
"%s/ROCV.png", odir.Data());
488 sprintf(fname,
"%s/range_threshold.txt", odir.Data());
489 FILE* frange = fopen(fname,
"w");
490 fprintf(frange,
"#rho range[Mpc] \n");
492 fprintf(frange,
"%3.2f %4.3e\n", Trho[
i], Rrho[i]);
498 TF1*
f2 =
new TF1(
"f2",
"[0]*pow(x,[1])*TMath::Exp(-x*[2])", T_out,
499 Trho[RHO_NBINS - 1]);
502 f2->SetParameters(500., -1., 0.0);
504 TGraphErrors* grtmp =
new TGraphErrors(RHO_NBINS, Trho, Rrho, NULL, eRrho);
505 grtmp->SetMarkerStyle(20);
506 grtmp->SetMarkerSize(1.0);
507 grtmp->GetHistogram()->GetXaxis()->SetTitle(
"#rho");
508 grtmp->GetHistogram()->GetXaxis()->SetRangeUser(RHO_MIN,
509 Trho[RHO_NBINS - 1]);
510 grtmp->GetHistogram()->GetYaxis()->SetRangeUser(
511 f2->Eval(Trho[RHO_NBINS - 1]), f2->Eval(T_out));
512 grtmp->GetHistogram()->GetYaxis()->SetTitle(
"Average Range [Mpc]");
513 grtmp->GetXaxis()->SetTitleOffset(1.3);
514 grtmp->GetYaxis()->SetTitleOffset(1.25);
515 grtmp->GetXaxis()->SetTickLength(0.01);
516 grtmp->GetYaxis()->SetTickLength(0.01);
517 grtmp->GetXaxis()->CenterTitle(kTRUE);
518 grtmp->GetYaxis()->CenterTitle(kTRUE);
519 grtmp->GetXaxis()->SetTitleFont(42);
520 grtmp->GetXaxis()->SetLabelFont(42);
521 grtmp->GetYaxis()->SetTitleFont(42);
522 grtmp->GetYaxis()->SetLabelFont(42);
523 grtmp->GetYaxis()->SetMoreLogLabels(kTRUE);
524 grtmp->GetYaxis()->SetNoExponent(kTRUE);
526 grtmp->Fit(
"f2",
"R");
531 gStyle->SetOptFit(kTRUE);
532 sprintf(fname,
"%s : Range (%s) ", networkname.Data(),
533 f2->GetExpFormula().Data());
534 grtmp->SetTitle(fname);
537 sprintf(fname,
"%s/Range.png", odir.Data());
584 TIter
next(liv.GetListOfBranches());
585 while ((branch = (TBranch*)
next())) {
586 if (
TString(
"slag").CompareTo(branch->GetName()) == 0)
591 cout <<
"CWB::Toolbox::getLiveTime : Error - live tree do not " 601 liv.SetBranchAddress(
"slag", xslag);
602 liv.SetBranchAddress(
"lag", xlag);
604 liv.SetBranchAddress(
"live", &xlive);
605 liv.SetBranchStatus(
"gps",
false);
607 Long64_t
ntrg = liv.GetEntries();
608 for (Long64_t
i = 0;
i <
ntrg;
i++) {
611 if ((lag_number >= 0) && (slag_number >= 0)) {
612 Live = (xlag[
nIFO] == lag_number && xslag[
nIFO] == slag_number)
616 if ((lag_number >= 0) && (slag_number == -1)) {
617 Live = ((xlag[
nIFO] == lag_number) &&
618 !((xlag[nIFO] == 0) && (xslag[
nIFO] == 0)))
622 if ((lag_number == -1) && (slag_number >= 0)) {
623 Live = ((xslag[
nIFO] == slag_number) &&
624 !((xlag[nIFO] == 0) && (xslag[
nIFO] == 0)))
628 if ((lag_number == -1) && (slag_number == -1)) {
629 Live = !((xlag[
nIFO] == 0) && (xslag[nIFO] == 0))
651 TBranch* LIVE = liv.GetBranch(
"live");
652 LIVE->SetAddress(&xlive);
653 Long64_t
nentries = LIVE->GetEntries();
672 sprintf(cut,
"(lag[%d]==0&&slag[%d]==0)", nIFO, nIFO);
674 Long64_t
nentries = liv.Draw(
"live", cut,
"goff");
675 double*
xlive = liv.GetV1();
702 Long64_t
nentries = liv.GetEntries();
703 TBranch* lag = liv.GetBranch(
"lag");
704 lag->SetAddress(xlag);
705 TBranch*
slag = liv.GetBranch(
"slag");
706 slag->SetAddress(xslag);
707 TBranch*
live = liv.GetBranch(
"live");
708 live->SetAddress(&xlive);
713 if (xslag[nIFO] != 0)
730 while ((rho > (
float)hc->GetBinCenter(w)) && (w < hc->GetNbinsX() - 1)) {
733 double far = (double)hc->GetBinContent(w + 1) /
liveTot;
734 double efar = (double)hc->GetBinError(w + 1) /
liveTot;
746 TH2F*
lSlag =
new TH2F(
"LSLAG",
"Live time distribution over slags", NSlag,
747 SlagMin / 86400., SlagMax / 86400., NSlag,
748 SlagMin / 86400., SlagMax / 86400.);
749 cout <<
"Start filling lSlag histogram : " << endl;
751 float xslag[NIFO_MAX + 1];
753 live.SetBranchStatus(
"*", 0);
754 live.SetBranchStatus(
"slag", 1);
755 live.SetBranchStatus(
"live", 1);
756 live.SetBranchAddress(
"slag", xslag);
758 live.SetBranchAddress(
"live", &xlive);
761 long int ntrg = live.GetEntries();
762 for (
long int l = 0;
l <
ntrg;
l++) {
764 lSlag->Fill(xslag[0] / 86400., xslag[1] / 86400., xlive);
765 if (
l % 10000000 == 0) {
766 cout << scientific << (double)
l / ntrg <<
"% - ";
784 c1->SetTheta(89.999);
791 double efar[sel_events];
792 for (
int i = 0;
i < sel_events;
i++) {
796 TGraph2DErrors*
gr2 =
new TGraph2DErrors(sel_events, recMchirp, injMchirp,
797 far, efar, efar, efar);
798 gr2->SetMarkerStyle(20);
799 gr2->SetLineColor(20);
803 gr2->GetHistogram()->GetXaxis()->SetTitle(
"Injected mchirp");
804 gr2->GetHistogram()->GetYaxis()->SetTitle(
"Recovered mchirp");
805 gr2->GetHistogram()->GetXaxis()->SetLimits(
808 gr2->GetHistogram()->GetYaxis()->SetLimits(
811 gr2->GetHistogram()->GetZaxis()->SetTitle(
"False Alarm Rate [years^{-1}]");
812 gr2->GetXaxis()->SetTitleOffset(1.3);
813 gr2->GetYaxis()->SetTitleOffset(1.25);
814 gr2->GetXaxis()->SetTickLength(0.02);
815 gr2->GetYaxis()->SetTickLength(0.01);
816 gr2->GetXaxis()->CenterTitle(kTRUE);
817 gr2->GetYaxis()->CenterTitle(kTRUE);
818 gr2->GetZaxis()->CenterTitle(kTRUE);
819 gr2->GetXaxis()->SetTitleFont(42);
820 gr2->GetXaxis()->SetLabelFont(42);
821 gr2->GetYaxis()->SetTitleFont(42);
822 gr2->GetYaxis()->SetLabelFont(42);
824 gr2->GetYaxis()->SetNoExponent(kTRUE);
826 gr2->Draw(
"err zcolpcol");
828 sprintf(fname,
"%s/ChirpFAR.png", odir.Data());
841 double z1 = 1. + pow((1. - pow(a, 2.)), 1. / 3) *
842 (pow(1. + a, 1. / 3) + pow(1. - a, 1. / 3));
843 double z2 = pow(3. * pow(a, 2.) + pow(z1, 2.), 1. / 2);
844 double a_sign = TMath::Sign(1., a);
845 return 3 + z2 - pow((3. - z1) * (3. + z1 + 2. * z2), 1. / 2) * a_sign;
859 double u_isco = pow(r_isco, -0.5);
862 pow(1. - a * pow(u_isco, 3.) + pow(a, 2.) * pow(u_isco, 6.), 1. / 3.);
881 (3 * pow(r_isco, 1. / 2) - 2 * a_f) * 2. / pow(3 * r_isco, 1. / 2);
885 double L0 = 0.686710;
886 double L1 = 0.613247;
887 double L2a = -0.145427;
888 double L2b = -0.115689;
889 double L2c = -0.005254;
890 double L2d = 0.801838;
891 double L3a = -0.073839;
892 double L3b = 0.004759;
893 double L3c = -0.078377;
894 double L3d = 1.585809;
895 double L4a = -0.003050;
896 double L4b = -0.002968;
897 double L4c = 0.004364;
898 double L4d = -0.047204;
899 double L4e = -0.053099;
900 double L4f = 0.953458;
901 double L4g = -0.067998;
902 double L4h = 0.001629;
903 double L4i = -0.066693;
906 pow((4. * eta), 2.) *
907 (L0 + L1 * S + L2a * Delta * delta_m + L2b * pow(S, 2.) +
908 L2c * pow(Delta, 2.) + L2d * pow(delta_m, 2.) +
909 L3a * Delta * S * delta_m + L3b * S * pow(Delta, 2.) +
910 L3c * pow(S, 3.) + L3d * S * pow(delta_m, 2.) +
911 L4a * Delta * pow(S, 2) * delta_m +
912 L4b * pow(Delta, 3.) * delta_m + L4c * pow(Delta, 4.) +
913 L4d * pow(S, 4.) + L4e * pow(Delta, 2.) * pow(S, 2.) +
914 L4f * pow(delta_m, 4.) + L4g * Delta * pow(delta_m, 3.) +
915 L4h * pow(Delta, 2.) * pow(delta_m, 2.) +
916 L4i * pow(S, 2.) * pow(delta_m, 2.)) +
917 S * (1. + 8. * eta) * pow(delta_m, 4.) +
918 eta * J_isco * pow(delta_m, 6.);
920 return TMath::Abs(a_f - a_f_new);
928 double delta_m = par[1];
930 double Delta = par[3];
940 (3 * pow(r_isco, 1. / 2) - 2 * a_f) * 2. / pow(3 * r_isco, 1. / 2);
944 double L0 = 0.686710;
945 double L1 = 0.613247;
946 double L2a = -0.145427;
947 double L2b = -0.115689;
948 double L2c = -0.005254;
949 double L2d = 0.801838;
950 double L3a = -0.073839;
951 double L3b = 0.004759;
952 double L3c = -0.078377;
953 double L3d = 1.585809;
954 double L4a = -0.003050;
955 double L4b = -0.002968;
956 double L4c = 0.004364;
957 double L4d = -0.047204;
958 double L4e = -0.053099;
959 double L4f = 0.953458;
960 double L4g = -0.067998;
961 double L4h = 0.001629;
962 double L4i = -0.066693;
965 pow((4. * eta), 2.) *
966 (L0 + L1 * S + L2a * Delta * delta_m + L2b * pow(S, 2.) +
967 L2c * pow(Delta, 2.) + L2d * pow(delta_m, 2.) +
968 L3a * Delta * S * delta_m + L3b * S * pow(Delta, 2.) +
969 L3c * pow(S, 3.) + L3d * S * pow(delta_m, 2.) +
970 L4a * Delta * pow(S, 2) * delta_m +
971 L4b * pow(Delta, 3.) * delta_m + L4c * pow(Delta, 4.) +
972 L4d * pow(S, 4.) + L4e * pow(Delta, 2.) * pow(S, 2.) +
973 L4f * pow(delta_m, 4.) + L4g * Delta * pow(delta_m, 3.) +
974 L4h * pow(Delta, 2.) * pow(delta_m, 2.) +
975 L4i * pow(S, 2.) * pow(delta_m, 2.)) +
976 S * (1. + 8. * eta) * pow(delta_m, 4.) +
977 eta * J_isco * pow(delta_m, 6.);
979 return TMath::Abs(a_f - a_f_new);
999 double eta = q / pow((1. + q), 2.);
1000 double delta_m = (m1 -
m2) / m;
1002 double S1 = chi1 * pow(m1, 2.);
1003 double S2 = chi2 * pow(m2, 2.);
1004 double S = (S1 +
S2) / pow(m, 2.);
1007 (S2 / m2 - S1 /
m1) / m;
1021 f.SetParameters(eta, delta_m, S, Delta);
1022 ROOT::Math::WrappedTF1 wf1(f);
1025 ROOT::Math::BrentRootFinder brf;
1028 brf.SetFunction(wf1, -1.0, 1.0);
1032 double a_f = brf.Root();
1041 double M0 = 0.951507;
1042 double K1 = -0.051379;
1043 double K2a = -0.004804;
1044 double K2b = -0.054522;
1045 double K2c = -0.000022;
1046 double K2d = 1.995246;
1047 double K3a = 0.007064;
1048 double K3b = -0.017599;
1049 double K3c = -0.119175;
1050 double K3d = 0.025000;
1051 double K4a = -0.068981;
1052 double K4b = -0.011383;
1053 double K4c = -0.002284;
1054 double K4d = -0.165658;
1055 double K4e = 0.019403;
1056 double K4f = 2.980990;
1057 double K4g = 0.020250;
1058 double K4h = -0.004091;
1059 double K4i = 0.078441;
1064 (1. - 2. / r_isco + a_f / pow(r_isco, 1.5)) /
1065 pow(1. - 3. / r_isco + 2. * a_f / pow(r_isco, 1.5), 1. / 2.);
1068 double mf = pow(4. * eta, 2.) *
1069 (M0 + K1 * S + K2a * Delta * delta_m + K2b * pow(S, 2.) +
1070 K2c * pow(Delta, 2.) + K2d * pow(delta_m, 2.) +
1071 K3a * Delta * S * delta_m + K3b * S * pow(Delta, 2.) +
1072 K3c * pow(S, 3.) + K3d * S * pow(delta_m, 2.) +
1073 K4a * Delta * pow(S, 2.) * delta_m +
1074 K4b * pow(Delta, 3.) * delta_m + K4c * pow(Delta, 4.) +
1075 K4d * pow(S, 4.) + K4e * pow(Delta, 2.) * pow(S, 2.) +
1076 K4f * pow(delta_m, 4.) + K4g * Delta * pow(delta_m, 3.) +
1077 K4h * pow(Delta, 2.) * pow(delta_m, 2.) +
1078 K4i * pow(S, 2.) * pow(delta_m, 2.)) +
1079 (1 + eta * (E_isco + 11.)) * pow(delta_m, 6.);
1101 double m1_2 = m1 *
m1;
1102 double m2_2 = m2 *
m2;
1103 double eta = m1 * m2 / (M *
M);
1106 double chi1_l = s1z;
1107 double chi2_l = s2z;
1110 double S1_perp = m1_2 * sqrt(s1x * s1x + s1y * s1y);
1111 double S2_perp = m2_2 * sqrt(s2x * s2x + s2y * s2y);
1114 double A1 = 2 + (3 *
m2) / (2 * m1);
1115 double A2 = 2 + (3 *
m1) / (2 * m2);
1116 double ASp1 = A1 * S1_perp;
1117 double ASp2 = A2 * S2_perp;
1118 double num = (ASp2 > ASp1) ? ASp2 : ASp1;
1119 double den = (m2 >
m1) ? A2 * m2_2 : A1 * m1_2;
1131 TFile*
f =
new TFile(filein,
"update");
1132 TTree*
T = (TTree*)f->Get(treename);
1136 TBranch* bchip = T->Branch(
"chip", &chip,
"chip/F");
1137 T->SetBranchAddress(
"mass", mass);
1138 T->SetBranchAddress(
"spin", spin);
1139 Long64_t
nentries = T->GetEntries();
1143 spin[3], spin[4], spin[5]);
1159 #define MAXY 50000.0 1160 #define MAXSNR 150.0 1168 double MAXDISTANCE = 5000.,
1173 TCanvas* co_canvas3 =
new TCanvas(
"sd3",
"SD3", 3, 47, 1000, 802);
1174 co_canvas3->SetGridx();
1175 co_canvas3->SetGridy();
1176 co_canvas3->SetLogy();
1178 float myifar, netcc[3];
1191 TFile* filein =
new TFile(sim_file_name);
1192 TTree*
sim =
nullptr;
1193 filein->GetObject(
"waveburst", sim);
1194 if (!sim->GetListOfBranches()->FindObject(
"chip")) {
1195 cout <<
"Adding Chi_p branch to wave tree" << endl;
1198 sim->SetBranchAddress(
"mass", mass);
1199 sim->SetBranchAddress(
"factor", &factor);
1200 sim->SetBranchAddress(
"range", range);
1201 sim->SetBranchAddress(
"chirp", chirp);
1202 sim->SetBranchAddress(
"rho", rho);
1203 sim->SetBranchAddress(
"netcc", netcc);
1204 sim->SetBranchAddress(
"ifar", &myifar);
1205 sim->SetBranchAddress(
"time", mytime);
1206 sim->SetBranchAddress(
"spin", spin);
1207 sim->SetBranchAddress(
"chip", &chip);
1208 sim->SetBranchAddress(
"iSNR", iSNR);
1209 sim->SetBranchAddress(
"iota", iota);
1211 TFile* filein2 =
new TFile(mdc_file_name);
1212 TTree*
mdc =
nullptr;
1213 filein2->GetObject(
"mdc", mdc);
1215 if (!mdc->GetListOfBranches()->FindObject(
"chip")) {
1216 cout <<
"Adding Chi_p branch to mdc tree" << endl;
1220 mdc->SetBranchAddress(
"time", mytime);
1221 mdc->SetBranchAddress(
"mass", mass);
1222 mdc->SetBranchAddress(
"factor", &factor);
1223 mdc->SetBranchAddress(
"distance", &mydistance);
1224 mdc->SetBranchAddress(
"mchirp", &mchirp);
1225 mdc->SetBranchAddress(
"spin", spin);
1226 mdc->SetBranchAddress(
"chip", &chip);
1227 mdc->SetBranchAddress(
"snr", snr);
1228 mdc->SetBranchAddress(
"iota", iota);
1230 int nevts = (
int)mdc->GetEntries();
1231 float CYS = 86400. * 365.25;
1233 cout << nevts <<
" injected signals " << sim->GetEntries(
"ifar>0")
1234 <<
" recovered signals" << endl;
1238 std::vector<double> xi, xr, yi, yr;
1240 auto inj =
new TH2F(
"Injected snr vs stat inj",
"", NBIN_DIST, MINX, MAXX,
1244 TMultiGraph*
mg =
new TMultiGraph();
1246 if (
opt.Contains(
"chieff")) {
1247 inj->GetXaxis()->SetTitle(
"#chi_{eff}");
1248 mg->GetXaxis()->SetTitle(
"#chi_{eff}");
1249 }
else if (
opt.Contains(
"chip")) {
1250 inj->GetXaxis()->SetTitle(
"#chi_{p}");
1251 mg->GetXaxis()->SetTitle(
"#chi_{p}");
1252 }
else if (
opt.Contains(
"chirp")) {
1253 inj->GetXaxis()->SetTitle(
"Chirp Mass (M_{#odot})");
1254 mg->GetXaxis()->SetTitle(
"Chirp Mass (M_{#odot})");
1255 }
else if (
opt.Contains(
"mtot")) {
1256 inj->GetXaxis()->SetTitle(
"Total Mass (M_{#odot})");
1257 mg->GetXaxis()->SetTitle(
"Total Mass (M_{#odot})");
1258 }
else if (
opt.Contains(
"eta")) {
1259 inj->GetXaxis()->SetTitle(
"#eta, Symmetric Mass Ratio");
1260 mg->GetXaxis()->SetTitle(
"#eta, Symmetric Mass Ratio");
1261 }
else if (
opt.Contains(
"iota")) {
1262 inj->GetXaxis()->SetTitle(
"Cos(#iota), Inclination");
1263 mg->GetXaxis()->SetTitle(
"Cos(#iota), Inclination");
1264 }
else if (
opt.Contains(
"distance")) {
1265 inj->GetXaxis()->SetTitle(
"Sensitive Distance (Mpc)");
1266 mg->GetXaxis()->SetTitle(
"Injected snr");
1269 cout <<
"Not a valid option! " 1270 "opt={\"chip\",\"chirp\",\"eta\",\"mtot\", \"chieff\", " 1277 inj->GetYaxis()->SetTitle(
"Injected snr");
1278 inj->GetXaxis()->SetTitleOffset(1.3);
1279 inj->GetYaxis()->SetTitleOffset(1.3);
1280 inj->GetXaxis()->SetTickLength(0.01);
1281 inj->GetYaxis()->SetTickLength(0.01);
1282 inj->GetXaxis()->CenterTitle(kTRUE);
1283 inj->GetYaxis()->CenterTitle(kTRUE);
1284 inj->GetXaxis()->SetTitleFont(42);
1285 inj->GetXaxis()->SetLabelFont(42);
1286 inj->GetYaxis()->SetTitleFont(42);
1287 inj->GetYaxis()->SetLabelFont(42);
1288 inj->SetMarkerStyle(20);
1289 inj->SetMarkerSize(0.5);
1290 inj->SetMarkerColor(2);
1292 TH2F* rec = (TH2F*)inj->Clone(
"Injected snr vs stat rec");
1295 rec->SetMarkerColor(4);
1297 mg->GetYaxis()->SetTitle(
"Sensitive Distance (Mpc)");
1299 mg->GetXaxis()->SetTitleOffset(1.3);
1300 mg->GetYaxis()->SetTitleOffset(1.3);
1301 mg->GetXaxis()->SetTickLength(0.01);
1302 mg->GetYaxis()->SetTickLength(0.01);
1303 mg->GetXaxis()->CenterTitle(kTRUE);
1304 mg->GetYaxis()->CenterTitle(kTRUE);
1305 mg->GetXaxis()->SetTitleFont(42);
1306 mg->GetXaxis()->SetLabelFont(42);
1307 mg->GetYaxis()->SetTitleFont(42);
1308 mg->GetYaxis()->SetLabelFont(42);
1313 for (
int g = 0;
g < (
int)mdc->GetEntries();
g++) {
1315 SNR2 = pow(snr[0], 2.0) + pow(snr[1], 2.0);
1316 for (
int i = 2;
i <
nIFO;
i++) {
1317 SNR2 += pow(snr[
i], 2.0);
1319 mSNR = TMath::Sqrt(SNR2);
1320 yi.push_back(mydistance);
1321 if (
opt.Contains(
"chieff")) {
1322 xi.push_back((spin[2] * mass[0] + spin[5] * mass[1]) /
1323 (mass[1] + mass[0]));
1324 }
else if (
opt.Contains(
"chip")) {
1326 }
else if (
opt.Contains(
"chirp")) {
1327 xi.push_back(mchirp);
1328 }
else if (
opt.Contains(
"mtot")) {
1329 xi.push_back(mass[0] + mass[1]);
1330 }
else if (
opt.Contains(
"eta")) {
1331 xi.push_back(mass[0] * mass[1] / pow(mass[0] + mass[1], 2.0));
1332 }
else if (
opt.Contains(
"iota")) {
1333 xi.push_back(iota[1]);
1334 }
else if (
opt.Contains(
"distance")) {
1335 xi.push_back(mydistance);
1338 inj->Fill(xi[xi.size() - 1], mSNR);
1345 for (
int g = 0;
g < (
int)sim->GetEntries();
g++) {
1350 if (myifar <=
T_ifar * CYS) {
1357 if ((mytime[0] - mytime[
nIFO]) < -
T_win ||
1358 (mytime[0] - mytime[nIFO]) > 2 *
T_win) {
1363 for (
int i = 0;
i <
nIFO;
i++) {
1366 mSNR = TMath::Sqrt(SNR2);
1367 yr.push_back(range[1]);
1368 if (
opt.Contains(
"chieff")) {
1369 xr.push_back((spin[2] * mass[0] + spin[5] * mass[1]) /
1370 (mass[1] + mass[0]));
1372 }
else if (
opt.Contains(
"chip")) {
1375 }
else if (
opt.Contains(
"chirp")) {
1376 xr.push_back(chirp[0]);
1378 }
else if (
opt.Contains(
"mtot")) {
1379 xr.push_back(mass[1] + mass[0]);
1381 }
else if (
opt.Contains(
"eta")) {
1382 xr.push_back(mass[0] * mass[1] / pow(mass[0] + mass[1], 2.0));
1384 }
else if (
opt.Contains(
"iota")) {
1385 xr.push_back(iota[1]);
1387 }
else if (
opt.Contains(
"distance")) {
1388 xr.push_back(range[1]);
1391 rec->Fill(xr[xr.size() - 1], mSNR);
1405 sprintf(fname,
"%s/iSNR_vs_%s.eps", netdir,
opt.Data());
1406 sprintf(fname3,
"%s/Distance_vs_%s.eps", netdir,
opt.Data());
1407 sprintf(fname2,
"%s/%s_distribution.png", netdir,
opt.Data());
1412 rec->Draw(
"p same");
1413 auto leg_D =
new TLegend(0.6, 0.1, 0.9, 0.25,
"",
"brNDC");
1414 sprintf(lab,
"Injections: %i", (
int)mdc->GetEntries());
1415 leg_D->AddEntry(
"", lab,
"a");
1416 sprintf(lab,
"found: %i", cnt);
1417 leg_D->AddEntry(rec, lab,
"p");
1418 sprintf(lab,
"missed: %i", (
int)mdc->GetEntries() -
cnt);
1419 leg_D->AddEntry(inj, lab,
"p");
1420 leg_D->SetFillColor(0);
1421 leg_D->SetFillColorAlpha(0, 0.9);
1423 co_canvas3->SaveAs(fname);
1424 co_canvas3->SetLogx(0);
1426 TGraph* rec_gr =
new TGraph(xr.size(), &xr[0], &yr[0]);
1427 TGraph* inj_gr =
new TGraph(xi.size(), &xi[0], &yi[0]);
1431 if (!
opt.Contains(
"distance")) {
1432 inj_gr->SetMarkerColor(2);
1433 inj_gr->SetMarkerStyle(20);
1434 inj_gr->SetMarkerSize(0.5);
1436 rec_gr->SetMarkerColor(4);
1437 rec_gr->SetMarkerStyle(20);
1438 rec_gr->SetMarkerSize(0.5);
1443 co_canvas3->Clear();
1444 mg->GetXaxis()->SetLimits(MINX, MAXX);
1445 mg->GetYaxis()->SetRangeUser(10., MAXDISTANCE);
1449 co_canvas3->SaveAs(fname3);
1450 injx = (TH1D*)inj->ProjectionX();
1451 recx = (TH1D*)rec->ProjectionX();
1452 snrx = (TH1D*)inj->ProfileX();
1454 injx = (TH1D*)inj->ProjectionX();
1455 recx = (TH1D*)rec->ProjectionX();
1456 snrx = (TH1D*)inj->ProfileX();
1461 injx->SetFillColorAlpha(kRed, 0.3);
1462 injx->SetFillStyle(3004);
1464 recx->SetFillColorAlpha(kBlue, 0.99);
1465 recx->SetFillStyle(3001);
1467 co_canvas3->Clear();
1468 co_canvas3->SetLogx(0);
1471 auto rp1 =
new TRatioPlot(recx, injx,
"divsym");
1472 rp1->SetH1DrawOpt(
"PEBAR");
1473 rp1->SetH2DrawOpt(
"PEBAR");
1474 rp1->SetGraphDrawOpt(
"PB");
1475 rp1->SetSeparationMargin(0.01);
1479 rp1->SetSplitFraction(0.5);
1481 rp1->GetUpperRefYaxis()->SetRangeUser(1.,
MAXY);
1493 rp1->GetLowerRefYaxis()->SetTitle(
"ratio");
1494 rp1->GetLowerRefYaxis()->CenterTitle(kTRUE);
1495 rp1->GetUpperRefYaxis()->SetTitle(
"entries");
1496 rp1->GetUpperRefYaxis()->CenterTitle(kTRUE);
1498 rp1->GetLowerRefYaxis()->SetLabelColor(kBlue);
1499 rp1->GetLowerRefXaxis()->CenterTitle(kTRUE);
1500 rp1->GetLowerRefXaxis()->SetTitleOffset(1.3);
1501 rp1->GetLowerRefGraph()->SetFillColor(kBlue);
1502 rp1->GetLowerRefGraph()->SetFillStyle(3001);
1505 auto leg_D3 =
new TLegend(0.6, 0.8455, 0.8965, 0.94555,
"",
"brNDC");
1508 sprintf(lab,
"Injected: %i", (
int)mdc->GetEntries());
1509 leg_D3->AddEntry(inj, lab,
"p");
1510 sprintf(lab,
"Found: %i", cnt);
1511 leg_D3->AddEntry(rec, lab,
"p");
1513 leg_D3->SetFillColorAlpha(0, 0.9);
1519 rp1->GetLowerPad()->cd();
1522 Float_t rightmax = 1.2 * snrx->GetMaximum();
1523 Float_t rightmin = 0.8 * snrx->GetMinimum();
1524 double ymax = rp1->GetLowerRefYaxis()->GetXmax();
1525 double ymin = rp1->GetLowerRefYaxis()->GetXmin();
1526 double xmax = rp1->GetLowerRefXaxis()->GetXmax();
1527 Float_t scale = (ymax) / (rightmax);
1531 snrx->SetLineColor(kGreen + 2);
1532 snrx->SetMarkerColor(kGreen + 2);
1534 snrx->SetFillColorAlpha(kGreen + 2, 0.4);
1535 snrx->SetFillStyle(3001);
1536 snrx->SetMarkerStyle(20);
1537 snrx->SetMarkerSize(0.5);
1539 snrx->Draw(
"SAME PEBAR");
1543 new TGaxis(xmax, ymin, xmax, ymax, rightmin, rightmax, 510,
"+SL");
1544 myaxis->SetLineColor(kGreen + 2);
1545 myaxis->SetLabelColor(kGreen + 2);
1546 myaxis->SetTitle(
"Average Injected SNR");
1547 myaxis->SetTitleOffset(0.7);
1548 myaxis->SetTickLength(0.01);
1549 myaxis->CenterTitle(kTRUE);
1550 myaxis->SetTitleFont(42);
1551 myaxis->SetLabelFont(42);
1552 myaxis->SetLabelSize(0.06);
1553 myaxis->SetTitleSize(0.06);
1557 auto leg_D4 =
new TLegend(0.6, 0.75, 0.9, 0.975,
"",
"brNDC");
1560 sprintf(lab,
"Ratio (i.e. Found / Injected)");
1561 leg_D4->AddEntry(recx, lab,
"p");
1562 sprintf(lab,
"Average Injected SNR");
1563 leg_D4->AddEntry(snrx, lab,
"p");
1565 leg_D4->SetFillColorAlpha(0, 0.9);
1568 co_canvas3->Update();
1570 if (!
opt.Contains(
"I")) {
1571 rp1->GetLowerPad()->SetEditable(kFALSE);
1572 co_canvas3->SaveAs(fname2);
1575 delete filein, filein2;
1577 delete inj, rec, injx, recx, snrx, leg_D, leg_D3, leg_D4, rp1, myaxis;
1578 xi.clear(), xr.clear(), yi.clear(), yr.clear();
1579 delete inj_gr, rec_gr,
mg;
1590 #define MINMAXIFAR 4278. 1596 Color_t color = kBlue,
1605 float myifar, netcc[3];
1618 TFile* filein =
new TFile(sim_file_name);
1619 TTree* sim_org =
nullptr;
1620 filein->GetObject(
"waveburst", sim_org);
1622 if (!sim_org->GetListOfBranches()->FindObject(
"chip")) {
1623 cout <<
"Adding Chi_p branch to wave tree" << endl;
1624 cbcTool.
AddChip(sim_file_name,
"waveburst");
1626 TTree*
sim = sim_org->CopyTree(
SEL);
1627 sim->SetBranchAddress(
"mass", mass);
1628 sim->SetBranchAddress(
"factor", &factor);
1629 sim->SetBranchAddress(
"range", range);
1630 sim->SetBranchAddress(
"chirp", chirp);
1631 sim->SetBranchAddress(
"rho", rho);
1632 sim->SetBranchAddress(
"netcc", netcc);
1633 sim->SetBranchAddress(
"ifar", &myifar);
1634 sim->SetBranchAddress(
"time", mytime);
1635 sim->SetBranchAddress(
"spin", spin);
1637 TFile* filein2 =
new TFile(mdc_file_name);
1638 TTree* mdc_org =
nullptr;
1639 filein2->GetObject(
"mdc", mdc_org);
1641 SEL.ReplaceAll(
"chirp[0]",
"mchirp");
1642 if (!mdc_org->GetListOfBranches()->FindObject(
"chip")) {
1643 cout <<
"Adding Chi_p branch to mdc tree" << endl;
1644 cbcTool.
AddChip(mdc_file_name,
"mdc");
1646 TTree*
mdc = mdc_org->CopyTree(
SEL);
1647 mdc->SetBranchAddress(
"time", mytime);
1648 mdc->SetBranchAddress(
"mass", mass);
1649 mdc->SetBranchAddress(
"factor", &factor);
1650 mdc->SetBranchAddress(
"distance", &distance);
1651 mdc->SetBranchAddress(
"mchirp", &mchirp);
1652 mdc->SetBranchAddress(
"spin", spin);
1655 std::vector<double>
vdv;
1656 std::vector<double>
vifar;
1657 std::vector<double> vrho;
1658 std::vector<double>
vV;
1659 std::vector<double>
veV;
1660 std::vector<double>
vR;
1661 std::vector<double>
veR;
1662 std::vector<double>
vsifar;
1664 std::vector<double> vVr;
1665 std::vector<double> veVr;
1666 std::vector<double> vRr;
1667 std::vector<double> veRr;
1668 std::vector<double> vsrho;
1669 TGraphErrors* co_gr =
nullptr;
1671 int nevts = (
int)mdc->GetEntries();
1673 cout <<
"No events left after cut!" << endl;
1675 vsifar.push_back(0.0);
1676 co_gr =
new TGraphErrors(vR.size(), &vsifar[0], &vR[0], 0, 0);
1679 float shell_volume_per_injection = shell_volume / nevts;
1681 float maxIFAR = 0.0;
1682 float CYS = 86400. * 365.25;
1683 if (sim->GetListOfBranches()->FindObject(
"ifar")) {
1684 maxIFAR = TMath::CeilNint(sim->GetMaximum(
"ifar") /
CYS);
1688 cout <<
"Missing ifar branch: either use cbc_plots or add it " 1693 if (
opt.Contains(
"rho")) {
1694 sim->BuildIndex(
"0",
"rho[1]*10000");
1701 TTreeIndex* I1 = (TTreeIndex*)sim->GetTreeIndex();
1710 double mpcTscale = 1.0;
1711 for (
int g = 0;
g < (
int)sim->GetEntries();
g++) {
1712 sim->GetEntry(index1[
g]);
1713 ifactor = (
int)factor - 1;
1716 if (myifar <=
T_ifar * CYS) {
1723 if ((mytime[0] - mytime[
nIFO]) < -
T_win ||
1724 (mytime[0] - mytime[
nIFO]) > 2 *
T_win) {
1729 if (
opt.Contains(
"DDistrVolume")) {
1730 dV = shell_volume_per_injection;
1731 }
else if (
opt.Contains(
"DDistrUniform")) {
1732 dV = pow(range[1], 2) * shell_volume_per_injection;
1733 }
else if (
opt.Contains(
"DDistrChirpMass")) {
1734 dV = pow(range[1], 2) * shell_volume_per_injection *
1735 pow(chirp[0] / 1.22, 5. / 6.);
1736 }
else if (
opt.Contains(
"Redshift")) {
1737 dV =
VT / (double)nevts;
1741 cout <<
"No defined distance distribution? " 1742 "WARNING: Assuming uniform in volume" 1746 dV = shell_volume_per_injection;
1750 vifar.push_back(myifar);
1751 vrho.push_back(rho[1]);
1760 vV.push_back(vdv[vdv.size() - 1]);
1761 veV.push_back(pow(vdv[vdv.size() - 1], 2));
1763 vsifar.push_back(vifar[vdv.size() - 1]);
1767 vVr.push_back(vdv[vdv.size() - 1]);
1768 veVr.push_back(pow(vdv[vdv.size() - 1], 2));
1769 vsrho.push_back(vrho[vdv.size() - 1]);
1773 int mcount_ifar = 0;
1775 for (
int i = vdv.size() - 1;
i >= 0;
i--) {
1776 if (vifar[
i] == 0) {
1779 if (vifar[
i] > vsifar[0]) {
1781 veV[0] += pow(vdv[
i], 2);
1782 }
else if (vifar[
i] == vsifar[mcount_ifar]) {
1783 vV[mcount_ifar] += vdv[
i];
1784 veV[mcount_ifar] += pow(vdv[
i], 2);
1786 vsifar.push_back(vifar[
i]);
1787 vseifar.push_back(TMath::Sqrt(TMath::Nint(
liveTot * vifar[i])));
1788 vV.push_back(vV[mcount_ifar] + vdv[i]);
1789 veV.push_back(veV[mcount_ifar] + pow(vdv[i], 2));
1794 if (vrho[
i] == vsrho[mcount_rho]) {
1795 vVr[mcount_rho] += vdv[
i];
1796 veVr[mcount_rho] += pow(vdv[
i], 2);
1798 vsrho.push_back(vrho[
i]);
1799 vVr.push_back(vVr[mcount_rho] + vdv[i]);
1800 veVr.push_back(veVr[mcount_rho] + pow(vdv[i], 2));
1807 for (
int i = 0;
i < (
int)vV.size();
i++) {
1808 veV[
i] = TMath::Sqrt(veV[
i]);
1810 vR.push_back(pow(3. / (4. *
TMath::Pi() * mpcTscale) * vV[i], 1. / 3.));
1811 veR.push_back(pow(3. / (4 *
TMath::Pi() * mpcTscale), 1. / 3.) * 1. /
1812 3 * pow(vV[i], -2. / 3.) * veV[i]);
1817 for (
int i = 0;
i < (
int)vVr.size();
i++) {
1818 veVr[
i] = TMath::Sqrt(veVr[
i]);
1820 pow(3. / (4. *
TMath::Pi() * mpcTscale) * vVr[i], 1. / 3.));
1821 veRr.push_back(pow(3. / (4 *
TMath::Pi() * mpcTscale), 1. / 3.) * 1. /
1822 3 * pow(vVr[i], -2. / 3.) * veVr[i]);
1832 if (
opt.Contains(
"rho")) {
1833 co_gr =
new TGraphErrors(vRr.size(), &vsrho[0], &vRr[0], 0, &veRr[0]);
1835 co_gr =
new TGraphErrors(vR.size(), &vsifar[0], &vR[0], 0, &veR[0]);
1842 co_gr->GetXaxis()->SetTitleOffset(1.3);
1843 co_gr->GetYaxis()->SetTitleOffset(1.25);
1844 co_gr->GetXaxis()->SetTickLength(0.01);
1845 co_gr->GetYaxis()->SetTickLength(0.01);
1846 co_gr->GetXaxis()->CenterTitle(kTRUE);
1847 co_gr->GetYaxis()->CenterTitle(kTRUE);
1848 co_gr->GetXaxis()->SetTitleFont(42);
1849 co_gr->GetXaxis()->SetLabelFont(42);
1850 co_gr->GetYaxis()->SetTitleFont(42);
1851 co_gr->GetYaxis()->SetLabelFont(42);
1852 co_gr->SetMarkerStyle(20);
1853 co_gr->SetMarkerSize(1.0);
1854 co_gr->SetMarkerColor(1);
1855 co_gr->SetLineColor(color);
1856 co_gr->SetLineWidth(3);
1857 co_gr->SetTitle(
"");
1858 co_gr->SetFillColor(color);
1859 co_gr->SetFillStyle(3001);
1864 delete filein, filein2;
1865 delete mdc, mdc_org,
sim, sim_org;
static double g(double e)
std::vector< double > vseifar
wavearray< double > a(hp.size())
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<< "\ layers : "<< nLAYERS<< "\ dF(hz) : "<< dF<< "\ 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
cout<< "SNR "<< xsnr<< endl;wavearray< double > f
fprintf(stdout,"start=%f duration=%f rate=%f\, x.start(), x.size()/x.rate(), x.rate())
std::vector< double > vdv
std::vector< double > vsifar
TIter next(twave->GetListOfBranches())
std::vector< double > veR
std::vector< double > iSNR[NIFO_MAX]
std::vector< double > vifar
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
Meyer< double > S(1024, 2)
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)