NAGASH 0.9.8
Next Generation Analysis System
|
Manage systematic variations. More...
#include "NAGASH/SystTool.h"
Classes | |
struct | AuxVar |
struct | VarWithSyst |
Public Member Functions | |
SystTool (std::shared_ptr< MSGTool > MSG) | |
template<typename T > | |
void | BookVariation (const TString &name, const TString &systname, T *var) |
Book a systematic variation of a parameter. | |
const TString & | CurrentVariation () |
Get the name of the current systematic variation. | |
template<typename T > | |
T | Get (const TString &name) |
Get the value of the parameter with the current systematic variation. | |
const std::vector< TString > & | GetListOfVariations () |
get the list of all systematic variations. | |
std::vector< TString > | GetListOfVariations (const TString &name) |
get the list of all systematic variations of given parameter. | |
int | GetNVariations () |
get the number of systematic variations. | |
int | GetNVariations (const TString &name) |
get the number of systematic variations of given parameter. | |
double | GetVariationCorrelation (const TString &name) |
Get the correlation factor of the given systematic variation. | |
void | SetToVariation (const TString &name) |
set the current variation to the given one. | |
void | SetVariationCorrelation (const TString &name, double correlation) |
Set the correlation factor of the given systematic variation. | |
Private Attributes | |
std::map< TString, double > | CorrMap |
TString | currentvar |
bool | isSetVar = false |
bool | isSystListSorted = false |
std::vector< TString > | SystList |
std::map< TString, std::vector< TString > > | SystListMap |
std::map< TString, std::vector< AuxVar > > | SystMapFull |
std::map< TString, VarWithSyst > | VarMapFull |
Additional Inherited Members | |
Protected Member Functions inherited from NAGASH::Tool | |
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 |
Manage systematic variations.
Here is a demonstration of how to use the SystTool:
You can run the code and check the content of the output file output.root
.
Definition at line 13 of file SystTool.h.
|
inline |
Definition at line 16 of file SystTool.h.
void NAGASH::SystTool::BookVariation | ( | const TString & | name, |
const TString & | systname, | ||
T * | var | ||
) |
Book a systematic variation of a parameter.
T | the type of the parameter. |
name | the name of the parameter. |
systname | the name of the systematic variation. |
var | the pointer to the variation. |
Definition at line 60 of file SystTool.h.
const TString & SystTool::CurrentVariation | ( | ) |
Get the name of the current systematic variation.
Definition at line 85 of file SystTool.cxx.
T NAGASH::SystTool::Get | ( | const TString & | name | ) |
Get the value of the parameter with the current systematic variation.
T | the type of the parameter. |
name | the name of the parameter. |
Definition at line 108 of file SystTool.h.
const std::vector< TString > & SystTool::GetListOfVariations | ( | ) |
get the list of all systematic variations.
Definition at line 136 of file SystTool.cxx.
std::vector< TString > SystTool::GetListOfVariations | ( | const TString & | name | ) |
get the list of all systematic variations of given parameter.
name | the name of the parameter. |
Definition at line 160 of file SystTool.cxx.
int SystTool::GetNVariations | ( | ) |
get the number of systematic variations.
Definition at line 237 of file SystTool.cxx.
int SystTool::GetNVariations | ( | const TString & | name | ) |
get the number of systematic variations of given parameter.
name | the name of the parameter. |
Definition at line 244 of file SystTool.cxx.
double SystTool::GetVariationCorrelation | ( | const TString & | name | ) |
Get the correlation factor of the given systematic variation.
name | the name of the systematic variation. |
Definition at line 119 of file SystTool.cxx.
void SystTool::SetToVariation | ( | const TString & | name | ) |
set the current variation to the given one.
name | the name of the systematic variation. |
Definition at line 178 of file SystTool.cxx.
void SystTool::SetVariationCorrelation | ( | const TString & | name, |
double | correlation | ||
) |
Set the correlation factor of the given systematic variation.
name | the name of the systematic variation. |
correlation | the correlation factor of the systematic variation. |
Definition at line 102 of file SystTool.cxx.
|
private |
Definition at line 49 of file SystTool.h.
|
private |
Definition at line 46 of file SystTool.h.
|
private |
Definition at line 44 of file SystTool.h.
|
private |
Definition at line 45 of file SystTool.h.
|
private |
Definition at line 51 of file SystTool.h.
|
private |
Definition at line 50 of file SystTool.h.
|
private |
Definition at line 48 of file SystTool.h.
|
private |
Definition at line 47 of file SystTool.h.