Xephyr  0.0
Public Member Functions | List of all members
ToyFitterExclusion Class Reference

Class to handle the fitting of toy dataset for limit production. More...

#include <ToyFitterExclusion.h>

Inheritance diagram for ToyFitterExclusion:
errorHandler

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.
 
- Public Member Functions inherited from errorHandler
 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

- Public Attributes inherited from errorHandler
int localPrintLevel
 
TString className
 
- Static Public Attributes inherited from errorHandler
static int globalPrintLevel = 1
 

Detailed Description

Class to handle the fitting of toy dataset for limit production.

Member Function Documentation

◆ computeTS()

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.

Parameters
muthe signal strenght for conditional fit.

◆ computeTSDistros() [1/2]

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.

Parameters
fileNametakes as input the hadded post fit output from fit() of this class.
mu_listis the list of true mu hypothesis present in the file tree.
mu_sizeis the size of the previous list.

◆ computeTSDistros() [2/2]

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.

Parameters
treetakes as input the tree of post fit output from fit() of this class.
mu_listis the list of true mu hypothesis present in the file tree.
mu_sizeis the size of the previous list.

◆ fit()

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.

◆ spitTheLimit()

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.

Parameters
ninety_quantilesgraph of 90% quantiles as produced from computeTSDistros().
TreeNameprefix 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.

The documentation for this class was generated from the following files: