NAGASH 0.9.8
Next Generation Analysis System
|
Tool for conducting profile likelihood fit. More...
#include "NAGASH/ProfileFitter.h"
Classes | |
class | Observable |
class | Parameter |
class | PLH_FCN |
class | ProfileCache |
Public Types | |
enum class | FitMethod { ProfileLikelihood , AnalyticalChiSquare , AnalyticalBoostedProfileLikelihood } |
enum class | ParameterType { Nuisance , Interest , StatGamma , Normalization , Unknown } |
Type of the parameter. More... | |
Public Member Functions | |
ProfileFitter (std::shared_ptr< MSGTool > msg, int nthread=1) | |
void | BookNormalizationParameter (TString name, double init, double min, double max) |
void | BookNuisanceParameter (TString name) |
void | BookNuisanceParameter (TString name, TString gname) |
void | BookObservableData (TString name, const std::vector< double > &vec, const std::vector< double > &vec_stat) |
void | BookObservableNominal (TString name, TString samplename, const std::vector< double > &vec, const std::vector< double > &vec_stat) |
void | BookObservableVariation (TString name, TString samplename, const std::vector< double > &vec, TString parname, double sigma) |
void | BookObservableVariationDown (TString name, TString samplename, const std::vector< double > &vec, TString parname) |
void | BookObservableVariationFromUnc (TString name, TString samplename, const std::vector< double > &vec, const std::vector< double > &vec_unc, TString parname) |
void | BookObservableVariationNominal (TString name, TString samplename, const std::vector< double > &vec, TString parname) |
void | BookObservableVariationUp (TString name, TString samplename, const std::vector< double > &vec, TString parname) |
void | BookParameter (TString name, double init, double min, double max, ParameterType type) |
void | BookParameterOfInterest (TString name, double init, double min, double max) |
std::map< TString, double > | EstimateUnc (const std::vector< TString > &par_vec, FitMethod method, int toy_num) |
Estimate uncertainty decomposition using toy method. | |
std::map< TString, double > | EstimateUnc (TString g_name, FitMethod method, int toy_num) |
Estimate uncertainty decomposition using toy method. | |
void | Fit (FitMethod method) |
void | FixParameter (TString name, double val) |
double | GetChi2 () |
double | GetChi2 (const std::map< TString, double > &par_val) |
int | GetNParameters (ParameterType type=ParameterType::Unknown) |
Parameter * | GetParameter (TString name) |
TString | GetParameterName (int index) |
void | LinkNormalizationSample (TString name, TString samplename) |
void | RebinObservable (TString name, int index) |
void | ReleaseParameter (TString name) |
void | SetGammaPrefix (TString samplename, TString prefix) |
void | SetObservableRange (TString name, int start, int end) |
void | SetParameterGroup (TString gname, TString parname) |
void | SetParameterStrategy (TString name, Parameter::ExtrapStrategy str) |
void | SetSmooth (TString obsname, TString samplename, TString parname, int slevel) |
void | SetSymmetrization (TString obsname, TString samplename, TString parname, bool need=true) |
void | SmoothVariation (std::vector< double > &var, std::vector< double > &norm, int level) |
void | SymmetrizeVariation (std::vector< double > &up, std::vector< double > &down, std::vector< double > &norm) |
Private Member Functions | |
bool | Check () |
void | FitACS () |
void | FitPLH () |
Observable * | InitializeNewObservable (TString name) |
void | Prepare (FitMethod method) |
void | PrintInfo () |
void | PrintResult () |
Private Attributes | |
Eigen::MatrixXd | C_Matrix |
Eigen::MatrixXd | Epsilon_Matrix |
std::map< TString, std::vector< TString > > | Gamma_Map |
Eigen::MatrixXd | Gamma_Matrix |
Eigen::MatrixXd | H_Matrix |
Eigen::MatrixXd | Lambda_Matrix |
double | MAX_NUISANCE_SIGMA = 3.0 |
std::map< TString, std::vector< TString > > | Norm_Map |
int | NTHREAD = 1 |
Eigen::MatrixXd | Nuisance_Cov_Matrix |
Parameter::ExtrapStrategy | NUISANCE_DEFAULT_STRATEGY = Parameter::ExtrapStrategy::POLY6EXP |
Eigen::MatrixXd | Nuisance_Shift |
std::map< TString, Observable > | Obs_Map |
std::map< TString, Parameter > | Par_Map |
std::map< TString, std::vector< TString > > | ParGroup_Map |
Eigen::MatrixXd | POI_Cov_Matrix |
Parameter::ExtrapStrategy | POI_DEFAULT_STRATEGY = Parameter::ExtrapStrategy::FULLLINEAR |
Eigen::MatrixXd | POI_Shift |
std::shared_ptr< ThreadPool > | pool = nullptr |
Eigen::MatrixXd | Q_Matrix |
Eigen::MatrixXd | Rho_Matrix |
Eigen::MatrixXd | S_Matrix |
Eigen::MatrixXd | V_Matrix |
Eigen::MatrixXd | Y0_Matrix |
Additional Inherited Members | |
![]() | |
Tool ()=delete | |
Tool (const Tool &tool)=delete | |
Tool (std::shared_ptr< MSGTool > MSG) | |
Constructor. | |
Tool (Tool &&tool)=delete | |
virtual | ~Tool ()=default |
std::shared_ptr< MSGTool > | MSGUser () |
return the MSGTool inside. | |
Tool & | operator= (const Tool &tool)=delete |
Tool & | operator= (Tool &&tool)=delete |
Tool for conducting profile likelihood fit.
Here is an example on how to use this tool:
Definition at line 29 of file ProfileFitter.h.
|
strong |
Enumerator | |
---|---|
ProfileLikelihood | Traditional profile likelihood. |
AnalyticalChiSquare | Analytical method, described in https://arxiv.org/abs/2307.04007, very fast. |
AnalyticalBoostedProfileLikelihood | use analytical method first, then run profile likelihood fit on top of it. |
Definition at line 41 of file ProfileFitter.h.
|
strong |
Type of the parameter.
Enumerator | |
---|---|
Nuisance | Nuisance parameter. |
Interest | POI. |
StatGamma | Statistical Gamma, used to represent the statistical uncertainties. |
Normalization | Normalization parameter. |
Unknown |
Definition at line 33 of file ProfileFitter.h.
ProfileFitter::ProfileFitter | ( | std::shared_ptr< MSGTool > | msg, |
int | nthread = 1 |
||
) |
Definition at line 113 of file ProfileFitter.cxx.
|
inline |
Definition at line 314 of file ProfileFitter.h.
|
inline |
Definition at line 324 of file ProfileFitter.h.
|
inline |
Definition at line 328 of file ProfileFitter.h.
void ProfileFitter::BookObservableData | ( | TString | name, |
const std::vector< double > & | vec, | ||
const std::vector< double > & | vec_stat | ||
) |
Definition at line 153 of file ProfileFitter.cxx.
void ProfileFitter::BookObservableNominal | ( | TString | name, |
TString | samplename, | ||
const std::vector< double > & | vec, | ||
const std::vector< double > & | vec_stat | ||
) |
Definition at line 181 of file ProfileFitter.cxx.
void ProfileFitter::BookObservableVariation | ( | TString | name, |
TString | samplename, | ||
const std::vector< double > & | vec, | ||
TString | parname, | ||
double | sigma | ||
) |
Definition at line 261 of file ProfileFitter.cxx.
|
inline |
Definition at line 224 of file ProfileFitter.h.
void ProfileFitter::BookObservableVariationFromUnc | ( | TString | name, |
TString | samplename, | ||
const std::vector< double > & | vec, | ||
const std::vector< double > & | vec_unc, | ||
TString | parname | ||
) |
Definition at line 411 of file ProfileFitter.cxx.
|
inline |
Definition at line 216 of file ProfileFitter.h.
|
inline |
Definition at line 220 of file ProfileFitter.h.
void ProfileFitter::BookParameter | ( | TString | name, |
double | init, | ||
double | min, | ||
double | max, | ||
ParameterType | type | ||
) |
Definition at line 123 of file ProfileFitter.cxx.
|
inline |
Definition at line 319 of file ProfileFitter.h.
|
private |
Definition at line 574 of file ProfileFitter.cxx.
std::map< TString, double > ProfileFitter::EstimateUnc | ( | const std::vector< TString > & | par_vec, |
FitMethod | method, | ||
int | toy_num | ||
) |
Estimate uncertainty decomposition using toy method.
par_vec | vector of parameter names. |
method | fit method, ProfileFitter::FitMethod::AnalyticalChiSquare is recommanded for its performance. |
toy_num | number of toy models. |
Definition at line 1828 of file ProfileFitter.cxx.
std::map< TString, double > ProfileFitter::EstimateUnc | ( | TString | g_name, |
FitMethod | method, | ||
int | toy_num | ||
) |
Estimate uncertainty decomposition using toy method.
g_name | name of the parameter group. |
method | fit method, ProfileFitter::FitMethod::AnalyticalChiSquare is recommanded for its performance. |
toy_num | number of toy models. |
Definition at line 1808 of file ProfileFitter.cxx.
void ProfileFitter::Fit | ( | ProfileFitter::FitMethod | method | ) |
Definition at line 471 of file ProfileFitter.cxx.
|
private |
Definition at line 1171 of file ProfileFitter.cxx.
|
private |
Definition at line 1348 of file ProfileFitter.cxx.
|
inline |
Definition at line 301 of file ProfileFitter.h.
double ProfileFitter::GetChi2 | ( | ) |
Definition at line 1912 of file ProfileFitter.cxx.
double ProfileFitter::GetChi2 | ( | const std::map< TString, double > & | par_val | ) |
Definition at line 1936 of file ProfileFitter.cxx.
int ProfileFitter::GetNParameters | ( | ParameterType | type = ParameterType::Unknown | ) |
Definition at line 807 of file ProfileFitter.cxx.
ProfileFitter::Parameter * ProfileFitter::GetParameter | ( | TString | name | ) |
Definition at line 249 of file ProfileFitter.cxx.
TString ProfileFitter::GetParameterName | ( | int | index | ) |
Definition at line 820 of file ProfileFitter.cxx.
|
private |
Definition at line 452 of file ProfileFitter.cxx.
void ProfileFitter::LinkNormalizationSample | ( | TString | name, |
TString | samplename | ||
) |
Definition at line 1587 of file ProfileFitter.cxx.
|
private |
Definition at line 580 of file ProfileFitter.cxx.
|
private |
Definition at line 534 of file ProfileFitter.cxx.
|
private |
Definition at line 498 of file ProfileFitter.cxx.
void ProfileFitter::RebinObservable | ( | TString | name, |
int | index | ||
) |
Definition at line 1691 of file ProfileFitter.cxx.
|
inline |
Definition at line 308 of file ProfileFitter.h.
void ProfileFitter::SetGammaPrefix | ( | TString | samplename, |
TString | prefix | ||
) |
Definition at line 1546 of file ProfileFitter.cxx.
void ProfileFitter::SetObservableRange | ( | TString | name, |
int | start, | ||
int | end | ||
) |
Definition at line 1709 of file ProfileFitter.cxx.
void ProfileFitter::SetParameterGroup | ( | TString | gname, |
TString | parname | ||
) |
Definition at line 1782 of file ProfileFitter.cxx.
|
inline |
Definition at line 232 of file ProfileFitter.h.
void ProfileFitter::SetSmooth | ( | TString | obsname, |
TString | samplename, | ||
TString | parname, | ||
int | slevel | ||
) |
Definition at line 1755 of file ProfileFitter.cxx.
void ProfileFitter::SetSymmetrization | ( | TString | obsname, |
TString | samplename, | ||
TString | parname, | ||
bool | need = true |
||
) |
Definition at line 1728 of file ProfileFitter.cxx.
void ProfileFitter::SmoothVariation | ( | std::vector< double > & | var, |
std::vector< double > & | norm, | ||
int | level | ||
) |
Definition at line 1651 of file ProfileFitter.cxx.
void ProfileFitter::SymmetrizeVariation | ( | std::vector< double > & | up, |
std::vector< double > & | down, | ||
std::vector< double > & | norm | ||
) |
Definition at line 1631 of file ProfileFitter.cxx.
|
private |
Definition at line 285 of file ProfileFitter.h.
|
private |
Definition at line 290 of file ProfileFitter.h.
|
private |
Definition at line 260 of file ProfileFitter.h.
|
private |
Definition at line 281 of file ProfileFitter.h.
|
private |
Definition at line 286 of file ProfileFitter.h.
|
private |
Definition at line 288 of file ProfileFitter.h.
|
private |
Definition at line 267 of file ProfileFitter.h.
|
private |
Definition at line 261 of file ProfileFitter.h.
|
private |
Definition at line 265 of file ProfileFitter.h.
|
private |
Definition at line 296 of file ProfileFitter.h.
|
private |
Definition at line 270 of file ProfileFitter.h.
|
private |
Definition at line 293 of file ProfileFitter.h.
|
private |
Definition at line 259 of file ProfileFitter.h.
|
private |
Definition at line 258 of file ProfileFitter.h.
|
private |
Definition at line 262 of file ProfileFitter.h.
|
private |
Definition at line 295 of file ProfileFitter.h.
|
private |
Definition at line 269 of file ProfileFitter.h.
|
private |
Definition at line 292 of file ProfileFitter.h.
|
private |
Definition at line 264 of file ProfileFitter.h.
|
private |
Definition at line 283 of file ProfileFitter.h.
|
private |
Definition at line 289 of file ProfileFitter.h.
|
private |
Definition at line 284 of file ProfileFitter.h.
|
private |
Definition at line 282 of file ProfileFitter.h.
|
private |
Definition at line 287 of file ProfileFitter.h.