ra4_stats
0341147a0dc35f80f4e12c6003afb76a38e2ed6e
|
#include "test_abcd.hpp"
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <limits>
#include <string>
#include <random>
#include <functional>
#include <array>
#include <algorithm>
#include "TMath.h"
#include "TH1D.h"
#include "TF1.h"
#include "TCanvas.h"
#include "TLegend.h"
#include "TLine.h"
Go to the source code of this file.
Namespaces | |
anonymous_namespace{test_abcd.cxx} | |
Functions | |
int | main (int argc, char *argv[]) |
string | GetParamString (int argc, char *argv[]) |
double | GetTestStatistic (double a, double b, double c, double d) |
double | QToP (double q) |
double | QToZ (double q) |
double | ZToQ (double z) |
double | ZToP (double z) |
double | PToZ (double p) |
double | PToQ (double p) |
vector< double > | GetSignificances (const vector< double > &b_qs, const vector< double > &sb_qs) |
vector< double > | GetSignificances (const vector< double > &sb_qs) |
double | FindFraction (const vector< double > &qs, double q) |
vector< double > | SampleTestStatistic (mt19937 &prng, size_t n, double a, double b, double c, double d) |
void | GetPredictions (double a_in, double b_in, double c_in, double d_in, double &a_out, double &b_out, double &c_out, double &d_out) |
double | BinLogLikelihood (double obs, double pred) |
void | PrintRates (ostream &out, const string &name, double a, double b, double c, double d) |
void | InitializePRNG (mt19937 &prng) |
void | PlotQDistributions (const string ¶ms, const vector< double > &b_qs, const vector< double > &sb_qs) |
void | PlotZDistributions (const string ¶ms, const vector< double > &b_qs, const vector< double > &sb_qs, double z) |
void | NormalizeWithOverflow (TH1D &h) |
double | RealMax (const TH1D &h) |
Variables | |
size_t | anonymous_namespace{test_abcd.cxx}::num_bkg_toys = 1e7 |
size_t | anonymous_namespace{test_abcd.cxx}::num_sig_toys = 1e5 |
double | anonymous_namespace{test_abcd.cxx}::inf = numeric_limits<double>::infinity() |
double BinLogLikelihood | ( | double | obs, |
double | pred | ||
) |
Definition at line 192 of file test_abcd.cxx.
References anonymous_namespace{test_abcd.cxx}::inf.
Referenced by GetTestStatistic().
double FindFraction | ( | const vector< double > & | qs, |
double | q | ||
) |
Definition at line 166 of file test_abcd.cxx.
References wilks_coverage::lower_bound().
Referenced by GetSignificances().
string GetParamString | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 92 of file test_abcd.cxx.
Referenced by main().
void GetPredictions | ( | double | a_in, |
double | b_in, | ||
double | c_in, | ||
double | d_in, | ||
double & | a_out, | ||
double & | b_out, | ||
double & | c_out, | ||
double & | d_out | ||
) |
Definition at line 183 of file test_abcd.cxx.
Referenced by GetTestStatistic(), and main().
vector<double> GetSignificances | ( | const vector< double > & | b_qs, |
const vector< double > & | sb_qs | ||
) |
Definition at line 150 of file test_abcd.cxx.
References FindFraction(), and PToZ().
Referenced by PlotZDistributions().
vector<double> GetSignificances | ( | const vector< double > & | sb_qs | ) |
Definition at line 158 of file test_abcd.cxx.
References QToZ().
double GetTestStatistic | ( | double | a, |
double | b, | ||
double | c, | ||
double | d | ||
) |
Definition at line 102 of file test_abcd.cxx.
References BinLogLikelihood(), and GetPredictions().
Referenced by main(), and SampleTestStatistic().
void InitializePRNG | ( | mt19937 & | prng | ) |
Definition at line 208 of file test_abcd.cxx.
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 32 of file test_abcd.cxx.
References GetParamString(), GetPredictions(), GetTestStatistic(), InitializePRNG(), anonymous_namespace{test_abcd.cxx}::num_bkg_toys, anonymous_namespace{test_abcd.cxx}::num_sig_toys, scan_aggregate::params, PlotQDistributions(), PlotZDistributions(), PrintRates(), QToZ(), and SampleTestStatistic().
void NormalizeWithOverflow | ( | TH1D & | h | ) |
Definition at line 319 of file test_abcd.cxx.
Referenced by PlotQDistributions(), and PlotZDistributions().
void PlotQDistributions | ( | const string & | params, |
const vector< double > & | b_qs, | ||
const vector< double > & | sb_qs | ||
) |
Definition at line 216 of file test_abcd.cxx.
References plot_variations::c, anonymous_namespace{test_agnostic.cxx}::e, and NormalizeWithOverflow().
Referenced by main().
void PlotZDistributions | ( | const string & | params, |
const vector< double > & | b_qs, | ||
const vector< double > & | sb_qs, | ||
double | z | ||
) |
Definition at line 259 of file test_abcd.cxx.
References plot_variations::c, GetSignificances(), plot_variations::leg, NormalizeWithOverflow(), and QToZ().
Referenced by main().
void PrintRates | ( | ostream & | out, |
const string & | name, | ||
double | a, | ||
double | b, | ||
double | c, | ||
double | d | ||
) |
Definition at line 196 of file test_abcd.cxx.
Referenced by main().
double PToQ | ( | double | p | ) |
Definition at line 146 of file test_abcd.cxx.
double PToZ | ( | double | p | ) |
Definition at line 139 of file test_abcd.cxx.
References anonymous_namespace{test_abcd.cxx}::inf.
Referenced by GetSignificances(), and PToQ().
double QToP | ( | double | q | ) |
Definition at line 123 of file test_abcd.cxx.
double QToZ | ( | double | q | ) |
Definition at line 127 of file test_abcd.cxx.
Referenced by GetSignificances(), main(), and PlotZDistributions().
double RealMax | ( | const TH1D & | h | ) |
Definition at line 337 of file test_abcd.cxx.
vector<double> SampleTestStatistic | ( | mt19937 & | prng, |
size_t | n, | ||
double | a, | ||
double | b, | ||
double | c, | ||
double | d | ||
) |
double ZToP | ( | double | z | ) |
Definition at line 135 of file test_abcd.cxx.
double ZToQ | ( | double | z | ) |
Definition at line 131 of file test_abcd.cxx.
Referenced by PToQ().