sensitivity.cpp File Reference

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[])

Detailed Description

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.


Function Documentation

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.

Parameters:
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
Returns:
A histogram of limits from the experiments
int main ( int  argc,
char *  argv[] 
)

Run the sensitivity calculation

Parameters:
argc Argument count: must be 2
argv Arguments: executable path and configuration filename
Returns:
0 on success, non-zero on failure
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.

Parameters:
h 1D histogram to calculate limit on
cl Confidence level
Returns:
The nearest bin edge covering at least the desired confidence
 All Classes Files Functions Variables Typedefs
Generated on Wed May 22 15:57:24 2013 for sxmc by  doxygen 1.6.3