hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
|
description More...
#include <BumpHunter.h>
Public Member Functions | |
BumpHunter (FitFunction::BkgModel model, int poly_order, int toy_poly_order, int res_factor, double res_scale=1.00, bool asymptotic_limit=true) | |
Default Constructor. | |
~BumpHunter () | |
HpsFitResult * | performSearch (TH1 *histogram, double mass_hypothesis, bool skip_bkg_fit, bool skip_ul) |
Perform a search for a resonance at the given mass hypothesis. | |
void | initialize (TH1 *histogram, double &mass_hypothesis) |
Given the mass of interest, setup the window parameters and initialize the fit parameters. | |
void | calculatePValue (HpsFitResult *result) |
description | |
void | fitBkgOnly () |
Fit using a background only model. | |
void | setBounds (double low_bound, double high_bound) |
Set the histogram bounds. | |
void | enableDebug (bool debug=true) |
Enable/disable debug. | |
void | runBatchMode (bool batch=true) |
Enable batch running. | |
void | writeResults (bool write_results=true) |
Write the fit results to a text file. | |
void | getUpperLimit (TH1 *histogram, HpsFitResult *result) |
Get the signal upper limit. | |
void | getUpperLimitAsymptotic (TH1 *histogram, HpsFitResult *result) |
description | |
void | getUpperLimitAsymCLs (TH1 *histogram, HpsFitResult *result) |
description | |
void | getUpperLimitPower (TH1 *histogram, HpsFitResult *result) |
description | |
void | setResolutionScale (double res_scale) |
Set the resolution after instantiation. | |
void | setWindowSizeUsesResScale (bool window_use_res_scale) |
Sets whether the window size is scaled according to the resolution scaling factor. | |
std::vector< TH1 * > | generateToys (TH1 *histogram, double n_toys, int seed, int toy_sig_samples, int bkg_mult=1, TH1 *signal_hist=nullptr) |
description | |
double | getMassResolution (double mass) |
Private Member Functions | |
double | getMassResolution (double mass, double res_scale) |
Get Mass Resolution. | |
double | correctMass (double mass) |
description | |
void | printDebug (std::string message) |
Print debug statement. | |
void | getChi2Prob (double min_nll_null, double min_nll, double &q0, double &p_value) |
description | |
Private Attributes | |
HpsFitResult * | bkg_only_result_ {nullptr} |
std::ofstream * | ofs |
double | corr_mass_ {0} |
double | lower_bound_ {0.016} |
double | upper_bound_ {0.115} |
double | integral_ {0} |
FitFunction::BkgModel | bkg_model_ {FitFunction::BkgModel::EXP_CHEBYSHEV} |
bool | asymptotic_limit_ {true} |
double | res_factor_ {13} |
double | window_size_ {0} |
int | bins_ {0} |
double | bin_width_ {0.0} |
int | poly_order_ {0} |
int | toy_poly_order_ {0} |
double | res_scale_ {1.00} |
bool | _batch {false} |
bool | debug {false} |
bool | _write_results {false} |
double | window_start_ {0} |
double | window_end_ {0} |
double | mass_hypothesis_ {0} |
double | mass_resolution_ {0} |
bool | window_use_res_scale_ {true} |
BumpHunter | ( | FitFunction::BkgModel | model, |
int | poly_order, | ||
int | toy_poly_order, | ||
int | res_factor, | ||
double | res_scale = 1.00 , |
||
bool | asymptotic_limit = true |
||
) |
Default Constructor.
model | |
poly_order | |
toy_poly_order | |
res_factor | |
res_scale | |
asymptotic_limit |
Definition at line 14 of file BumpHunter.cxx.
~BumpHunter | ( | ) |
Destructor
Definition at line 23 of file BumpHunter.cxx.
void calculatePValue | ( | HpsFitResult * | result | ) |
|
private |
|
inline |
void fitBkgOnly | ( | ) |
Fit using a background only model.
std::vector< TH1 * > generateToys | ( | TH1 * | histogram, |
double | n_toys, | ||
int | seed, | ||
int | toy_sig_samples, | ||
int | bkg_mult = 1 , |
||
TH1 * | signal_hist = nullptr |
||
) |
description
histogram | |
n_toys | |
seed | |
toy_sig_samples | |
bkg_mult | |
signal_hist |
Definition at line 589 of file BumpHunter.cxx.
|
private |
description
min_nll_null | |
min_nll | |
q0 | |
p_value |
Definition at line 619 of file BumpHunter.cxx.
|
inline |
Get the HPS mass resolution at the given mass. The functional form of the mass resolution was determined using MC.
mass | The mass of interest. |
Definition at line 202 of file BumpHunter.h.
|
inlineprivate |
Get Mass Resolution.
mass | |
res_scale |
Definition at line 223 of file BumpHunter.h.
void getUpperLimit | ( | TH1 * | histogram, |
HpsFitResult * | result | ||
) |
Get the signal upper limit.
histogram | |
result |
Definition at line 320 of file BumpHunter.cxx.
void getUpperLimitAsymCLs | ( | TH1 * | histogram, |
HpsFitResult * | result | ||
) |
void getUpperLimitAsymptotic | ( | TH1 * | histogram, |
HpsFitResult * | result | ||
) |
void getUpperLimitPower | ( | TH1 * | histogram, |
HpsFitResult * | result | ||
) |
void initialize | ( | TH1 * | histogram, |
double & | mass_hypothesis | ||
) |
Given the mass of interest, setup the window parameters and initialize the fit parameters.
This includes setting the size of the window and the window edges as well as estimating the initial value of some fit parameters.
histogram | Histogram containing the mass spectrum that will be used to search for a resonance. |
mass_hypothesis | The mass of interest. |
Definition at line 25 of file BumpHunter.cxx.
HpsFitResult * performSearch | ( | TH1 * | histogram, |
double | mass_hypothesis, | ||
bool | skip_bkg_fit, | ||
bool | skip_ul | ||
) |
Perform a search for a resonance at the given mass hypothesis.
histogram | Histogram containing the mass spectrum that will be used to search for a resonance. |
mass_hypothesis | The mass of interest. |
Definition at line 108 of file BumpHunter.cxx.
|
private |
Print debug statement.
message | Debug statement to print. |
Definition at line 316 of file BumpHunter.cxx.
|
inline |
void setBounds | ( | double | low_bound, |
double | high_bound | ||
) |
Set the histogram bounds.
low_bound | |
high_bound |
Definition at line 634 of file BumpHunter.cxx.
|
inline |
Set the resolution after instantiation.
res_scale |
Definition at line 170 of file BumpHunter.h.
|
inline |
Sets whether the window size is scaled according to the resolution scaling factor.
window_use_res_scale |
Definition at line 177 of file BumpHunter.h.
|
inline |
Write the fit results to a text file.
write_results |
Definition at line 131 of file BumpHunter.h.
|
private |
Flag denoting if application should run in batch mode. If set to true, plots aren't generated and fit results aren't logged.
Definition at line 311 of file BumpHunter.h.
|
private |
Write the results to a file.
Definition at line 317 of file BumpHunter.h.
|
private |
Flag to specify whether the power constrained or asymptotic upper limit should be employed.
Definition at line 280 of file BumpHunter.h.
|
private |
The bin width
Definition at line 295 of file BumpHunter.h.
|
private |
The total number of bins
Definition at line 292 of file BumpHunter.h.
|
private |
The background fit function model to use.
Definition at line 274 of file BumpHunter.h.
|
private |
Background only fit result.
Definition at line 253 of file BumpHunter.h.
|
private |
The mass after the mass scale correction.
Definition at line 262 of file BumpHunter.h.
|
private |
Debug flag
Definition at line 314 of file BumpHunter.h.
|
private |
The total number of events within the fit window.
Definition at line 271 of file BumpHunter.h.
|
private |
The lower bound of the histogram.
Definition at line 265 of file BumpHunter.h.
|
private |
mass hypothesis
Definition at line 326 of file BumpHunter.h.
|
private |
mass resolution
Definition at line 329 of file BumpHunter.h.
|
private |
Output file stream
Definition at line 256 of file BumpHunter.h.
|
private |
Polynomial order used to model the background.
Definition at line 298 of file BumpHunter.h.
|
private |
Resolution multiplicative factor used in determining the fit window size.
Definition at line 286 of file BumpHunter.h.
|
private |
The scaling factor for the mass resolution. Was 1.56 for Sebouh's, should 1.00 for Rafo's.
Definition at line 305 of file BumpHunter.h.
|
private |
Polynomial order used to model the toy fit.
Definition at line 301 of file BumpHunter.h.
|
private |
The upper bound of the histogram.
Definition at line 268 of file BumpHunter.h.
|
private |
end of mass window
Definition at line 323 of file BumpHunter.h.
|
private |
Size of the background window that will be used to fit.
Definition at line 289 of file BumpHunter.h.
|
private |
start of mass window
Definition at line 320 of file BumpHunter.h.
|
private |
desription
Definition at line 332 of file BumpHunter.h.