Xephyr
0.0
|
Class to handle the fitting of toy dataset for limit production. More...
#include <ToyFitterExclusion.h>
Public Member Functions | |
ToyFitterExclusion (TString CollectionName) | |
constructor, CollectionName is the name of the tree collection to fit, by convention set by ToyGenerator this is also the name of the file. | |
double | computeTS (double mu) |
returns the Test Statistic q_tilde(mu) for a value of mu_test. More... | |
void | fit (double mu, int stopAt=-999) |
given as input a file with many data toys, it writes a tree with fit outputs More... | |
void | setTheLikelihood (ProfileLikelihood *like) |
set the likelihood to fit | |
TGraphAsymmErrors | computeTSDistros (TString fileName, double *mu_list, int mu_size) |
produces a TGraph with the 90% quantiles of the alternate Hypothesis. More... | |
TGraphAsymmErrors | computeTSDistros (TTree *tree, double *mu_list, int mu_size) |
produces a TGraph with the 90% quantiles of the alternate Hypothesis. More... | |
void | spitTheLimit (TGraphAsymmErrors *ninety_quantiles, int sopAt=-999) |
void | setInputDir (TString path) |
set path to input file (only dir no file name) | |
void | setOutputDir (TString path) |
set the path to dir in which the fits are stored otherwise is current | |
void | setRandomizeMeasure (bool doOrNot) |
void | setTreeName (TString newName) |
void | setSeed (ULong_t seed) |
void | setCalibrationTreeName (TString newName) |
void | setOutputSuffix (TString name) |
void | setGeneration (int generation) |
set the Generation, this info will be available in the generated tree (so that u can hadd them), it is optional and non ncecessary. | |
![]() | |
errorHandler (TString name) | |
void | Error (TString functionName, TString message) |
Send an Error message to the user. More... | |
void | Warning (TString functionName, TString message) |
Send a Warning message to the user. More... | |
void | Info (TString functionName, TString message) |
Send an Info message to the user. More... | |
void | Debug (TString functionName, TString message) |
Send a Debug message to the user. More... | |
void | setPrintLevel (int level) |
Set the local printing level (for this instance only) More... | |
int | getPrintLevel () |
Return the current print level for this instance. remind that if you set with setPrintLevel this will override the global print level. | |
Additional Inherited Members | |
![]() | |
int | localPrintLevel |
TString | className |
![]() | |
static int | globalPrintLevel = 1 |
Class to handle the fitting of toy dataset for limit production.
double ToyFitterExclusion::computeTS | ( | double | mu | ) |
returns the Test Statistic q_tilde(mu) for a value of mu_test.
It is a reproduction of q_tilde test statistic from equation 16 of: https://arxiv.org/abs/1007.1727 this is suitable for upper limit in which the parameter of interest must be >0. For it to work correctly is important to set up the likelihood beforehand.
mu | the signal strenght for conditional fit. |
TGraphAsymmErrors ToyFitterExclusion::computeTSDistros | ( | TString | fileName, |
double * | mu_list, | ||
int | mu_size | ||
) |
produces a TGraph with the 90% quantiles of the alternate Hypothesis.
it is used to compute limits. The TH1F of the test statistic f(q_mu | H_mu) are stored in a root file toghether with the TGraph of 90% quantiles.
fileName | takes as input the hadded post fit output from fit() of this class. |
mu_list | is the list of true mu hypothesis present in the file tree. |
mu_size | is the size of the previous list. |
TGraphAsymmErrors ToyFitterExclusion::computeTSDistros | ( | TTree * | tree, |
double * | mu_list, | ||
int | mu_size | ||
) |
produces a TGraph with the 90% quantiles of the alternate Hypothesis.
it is used to compute limits. The TH1F of the test statistic f(q_mu | H_mu) are stored in a root file toghether with the TGraph of 90% quantiles.
tree | takes as input the tree of post fit output from fit() of this class. |
mu_list | is the list of true mu hypothesis present in the file tree. |
mu_size | is the size of the previous list. |
void ToyFitterExclusion::fit | ( | double | mu, |
int | stopAt = -999 |
||
) |
given as input a file with many data toys, it writes a tree with fit outputs
Note that it expects a toy file generated with naming convention of ToyGenerator. The output tree contains: conditional and unconditional nuisance parameter post fit values, and the test statistic. This is supposed to be used for the alternative hypotesis fits, to be able to generate aftewards the graph of 90th percentiles. mu: the signal strenght of the conditional fit. soptAt: optional, the number of toy in file you want to fit. NOTE: by deafulte this will randomize the NP measures during fit for each toy, setRandomizeMeasure(false) if you don't want.
void ToyFitterExclusion::spitTheLimit | ( | TGraphAsymmErrors * | ninety_quantiles, |
int | sopAt = -999 |
||
) |
given a input file with N null Hypo toy trees it produce an out tree containing post fits and limit.
note that this can be used also with just a signle tree, for real data limit production.
ninety_quantiles | graph of 90% quantiles as produced from computeTSDistros(). |
TreeName | prefix name of the tree list you fit. To se the input file file use setPathToFile() method. soptAt: optional, the number of toy in file you want to fit. NOTE: by deafulte this will randomize the NP measures during fit for each toy, setRandomizeMeasure(false) if you don't want. |