Calculate sensitivity with an MCMC. More...
#include <iostream>
#include <string>
#include <algorithm>
#include <assert.h>
#include <TFile.h>
#include <TH1F.h>
#include <TNtuple.h>
#include <TCanvas.h>
#include <TRandom.h>
#include <TRandom2.h>
#include "config.h"
#include "generator.h"
#include "mcmc.h"
Functions | |
double | upper_limit (TH1F *h, double cl=0.682) |
TH1F * | ensemble (std::vector< Signal > &signals, Range< float > &e_range, Range< float > &r_range, unsigned steps, float burnin_fraction, std::string signal_name, float confidence, unsigned nexperiments) |
int | main (int argc, char *argv[]) |
Calculate sensitivity with an MCMC.
An ensemble of fake experiments is generated and each fit with an MCMC, with parameters defined in the JSON configuration file. Limits are calculated for each.
TH1F* ensemble | ( | std::vector< Signal > & | signals, | |
Range< float > & | e_range, | |||
Range< float > & | r_range, | |||
unsigned | steps, | |||
float | burnin_fraction, | |||
std::string | signal_name, | |||
float | confidence, | |||
unsigned | nexperiments | |||
) |
Run an ensemble of independent fake experiments
Run experiments, fit with mcmc, and tabulate background-fluctuation sensitivity for each, creating a histogram of limits. The estimated sensitivity is the median of the limits of the ensemble.
signals | List of Signals defining PDFs, rates, etc. | |
e_range | Energy range to consider | |
r_range | Radial range to consider | |
steps | Number of MCMC random walk steps to take | |
burnin_fraction | Fraction of initial MCMC steps to throw out | |
signal_name | The name of the Signal that is the signal | |
confidence | Desired confidence level for limits | |
nexperiments | Number of fake experiments to run |
int main | ( | int | argc, | |
char * | argv[] | |||
) |
Run the sensitivity calculation
argc | Argument count: must be 2 | |
argv | Arguments: executable path and configuration filename |
double upper_limit | ( | TH1F * | h, | |
double | cl = 0.682 | |||
) |
Find an upper limit
Locate the x value that a fraction 1-CL/2 of the distribution falls above. This may over-cover due to finite histogram bin widths.
h | 1D histogram to calculate limit on | |
cl | Confidence level |