![]() |
AliRoot Core
3dc7879 (3dc7879)
|
Interface to N-dimensional functional representations (THn and TMVA) More...
Functions | |
template<typename T > | |
vector< T > | add_to_vector (vector< T > &z, T v) |
generic variadic function - to get it from boost in the future More... | |
template<typename T , typename... Args> | |
vector< T > | add_to_vector (vector< T > &z, T v, Args...args) |
template<typename T , typename... Args> | |
vector< T > | make_vector (T v, Args...args) |
Variadic function to create an vector (boost implementation ) More... | |
Double_t | GetInterpolationLinear (THn *his, Double_t *xyz, Int_t verbose) |
Linear interpolation of the bin content. More... | |
Double_t | GetDeltaInterpolationLinear (THn *his, Double_t *xyz, Int_t dIndex, Int_t verbose) |
Linear interpolation of the numerical derivative dV/dx (V(i+1)-V(i-1))/(2(delta) More... | |
Double_t | GetInterpolationLinear (Int_t index, Double_t *xyz, Int_t verbose) |
Double_t | GetDeltaInterpolationLinear (Int_t index, Double_t *xyz, Int_t dIndex, Int_t verbose) |
Double_t | GetInterpolationLinear (const char *name, Double_t *xyz, Int_t verbose) |
template<typename T , typename... Args> | |
T | EvalTHnLinear (int id, T v, Args...args) |
void | registerDefaultMVAMethods () |
map of registered TMVA regression methods More... | |
void | registerFactory (std::string factory, std::string content) |
example registering default methods () More... | |
void | registerMethod (std::string method, std::string content, TMVA::Types::EMVA id) |
Int_t | FitMVAClassification (const char *output, const char *inputTrees, const char *cuts, const char *variableList, const char *methodList, const char *factoryString="") |
Int_t | FitMVARegression (const char *output, TTree *tree, const char *varFit, TCut cut, const char *variables, const char *methods, const char *factoryString="") |
MVA Classification. More... | |
TMVA::MethodBase * | LoadMVAReader (Int_t id, const char *inputFile, const char *method, const char *dir) |
new MVA Regression More... | |
Int_t | LoadMVAReaderArray (Int_t id, const char *inputFile, const char *methodMask, const char *dirMask) |
Int_t | AppendMethodToArray (Int_t index, TMVA::MethodBase *method) |
Register TMVA method to the array at index Not assumed to be used by users. More... | |
Double_t | EvalMVAStatArray (int id, int statType, vector< float > point) |
Append method into array of methods - used e.g for bootstrap statistics. More... | |
template<typename T , typename... Args> | |
T | EvalMVA (int id, T v, Args...args) |
Evaluate statistic. More... | |
template<typename T , typename... Args> | |
T | EvalMVAClasification (int id, T v, Args...args) |
variadic function evaluating MVA More... | |
template<typename T , typename... Args> | |
T | EvalMVAStat (int id, int statType, T v, Args...args) |
variadic function evaluating MVA More... | |
Variables | |
Int_t | fVerbose =0 |
std::map< int, THn * > | hnMapArrayInt |
std::map< std::string, THn * > | hnMapArrayName |
map< int, TMVA::MethodBase * > | readerMethodBase |
TMVA interface. More... | |
map< int, TObjArray * > | readerMethodBaseArray |
map of registered TMVA::MethodBase More... | |
map< std::string, std::string > | regressionMethodSetting |
map of registered array of TMVA::MethodBase - used to define TMVA statistics (Mean, Median, RMS, quantile) More... | |
map< std::string, std::string > | FactorySetting |
map of registered TMVA regression methods More... | |
map< std::string, TMVA::Types::EMVA > | regressionMethodID |
map of registered TMVA regression methods More... | |
Interface to N-dimensional functional representations (THn and TMVA)
vector< T > AliNDFunctionInterface::add_to_vector | ( | vector< T > & | z, |
T | v | ||
) |
generic variadic function - to get it from boost in the future
Helper function to create std vector in variadic function.
verbosity
Definition at line 58 of file AliNDFunctionInterface.h.
vector< T > AliNDFunctionInterface::add_to_vector | ( | vector< T > & | z, |
T | v, | ||
Args... | args | ||
) |
Definition at line 59 of file AliNDFunctionInterface.h.
Int_t AliNDFunctionInterface::AppendMethodToArray | ( | Int_t | index, |
TMVA::MethodBase * | method | ||
) |
Register TMVA method to the array at index Not assumed to be used by users.
index | - registered array index |
method | - pointer to the method |
Definition at line 471 of file AliNDFunctionInterface.cxx.
Referenced by LoadMVAReaderArray(), and registerMethod().
T AliNDFunctionInterface::EvalMVA | ( | int | id, |
T | v, | ||
Args... | args | ||
) |
Evaluate statistic.
Variadic function to evaluate MVA regression method registered using method ID.
T | |
Args |
id | |
v | |
args |
some optional verbosity needed
Definition at line 114 of file AliNDFunctionInterface.h.
Referenced by registerMethod().
T AliNDFunctionInterface::EvalMVAClasification | ( | int | id, |
T | v, | ||
Args... | args | ||
) |
variadic function evaluating MVA
some optional verbosity needed
Definition at line 122 of file AliNDFunctionInterface.h.
Referenced by registerMethod().
T AliNDFunctionInterface::EvalMVAStat | ( | int | id, |
int | statType, | ||
T | v, | ||
Args... | args | ||
) |
variadic function evaluating MVA
Template variadic function - Evaluate statistic on top of array (readerMethodBaseArray;) of MVA methods To use the method - array o TMVA methods should be registered before using LoadMVAReaderArray or AppendMethodToArray
T | - template type - be default float |
Args | - |
id | - id of the registered array to evaluate |
statType | - type of statistic (0-mean, 1-median, 2-rms) |
v | - |
args |
variadic function evaluating MVA array stat
Definition at line 147 of file AliNDFunctionInterface.h.
Referenced by registerMethod().
Double_t AliNDFunctionInterface::EvalMVAStatArray | ( | int | id, |
int | statType, | ||
vector< float > | point | ||
) |
Append method into array of methods - used e.g for bootstrap statistics.
Return statistic variable using array of MVA methods
id | - id of the TMVA method array |
statType | - type of the statistic (mean, median, rms, TODO cumulant) |
point | - point to evaluate |
TODO - for the moment in evaluation we assume only one variable
some optional verbosity needed
Definition at line 491 of file AliNDFunctionInterface.cxx.
Referenced by EvalMVAStat(), and registerMethod().
T AliNDFunctionInterface::EvalTHnLinear | ( | int | id, |
T | v, | ||
Args... | args | ||
) |
Variadic function to linearly interpolate THn
T | - template type |
Args | - list of arguments |
id | - id of the function (e.g using hash of the name) |
v | |
args |
Definition at line 91 of file AliNDFunctionInterface.h.
Referenced by GetInterpolationLinear().
Int_t AliNDFunctionInterface::FitMVAClassification | ( | const char * | output, |
const char * | inputTrees, | ||
const char * | cuts, | ||
const char * | variables, | ||
const char * | methods, | ||
const char * | factoryString = "" |
||
) |
FitMVAClassification - TODO add documentation and test
output | |
inputTrees | |
cuts | |
variables | |
methods | |
factoryString |
Write ascii weight files to root file
Definition at line 138 of file AliNDFunctionInterface.cxx.
Referenced by registerMethod().
Int_t AliNDFunctionInterface::FitMVARegression | ( | const char * | output, |
TTree * | tree, | ||
const char * | varFit, | ||
TCut | cut, | ||
const char * | variables, | ||
const char * | methods, | ||
const char * | factoryString = "" |
||
) |
MVA Classification.
FitMVARegression wrapper = Do TMVA regression and save weights into output root file
output | - output path <file>#directory/
|
tree | - input tree |
varFit | - variable to fit (for the moment 1) |
cut | - cut formula |
variables | - : separated list of explanatory variables |
methods | - : separated list of the regression methods (have to be registered before) |
factoryString | - factory string (e.g specifying number of training and test samples). Factory string to be registered before. If empty default used - Fit parameters will be saved in the output destination - return value 0 in case of success Example usage in test macro ( QAtrendingFitExample.C function makeMVAFits() and makeMVABootstrapMI() ), e.g: |
TODO check existence - validity of variable - in case of error - exit with error message
Definition at line 272 of file AliNDFunctionInterface.cxx.
Referenced by makeMVABootstrapMI(), and registerMethod().
Double_t AliNDFunctionInterface::GetDeltaInterpolationLinear | ( | THn * | his, |
Double_t * | xyz, | ||
Int_t | dIndex, | ||
Int_t | verbose | ||
) |
Linear interpolation of the numerical derivative dV/dx (V(i+1)-V(i-1))/(2(delta)
his | |
xyz | |
dIndex | |
verbose |
Definition at line 85 of file AliNDFunctionInterface.cxx.
Referenced by GetDeltaInterpolationLinear().
Double_t AliNDFunctionInterface::GetDeltaInterpolationLinear | ( | Int_t | index, |
Double_t * | xyz, | ||
Int_t | dIndex, | ||
Int_t | verbose | ||
) |
Definition at line 31 of file AliNDFunctionInterface.h.
Double_t AliNDFunctionInterface::GetInterpolationLinear | ( | THn * | his, |
Double_t * | xyz, | ||
Int_t | verbose | ||
) |
Linear interpolation of the bin content.
his | - input N-dimensional histogram to interpolate |
xyz | - NDimensional point where to interpolate |
verbose | - verbosity flag |
Definition at line 52 of file AliNDFunctionInterface.cxx.
Referenced by EvalTHnLinear(), and GetInterpolationLinear().
Double_t AliNDFunctionInterface::GetInterpolationLinear | ( | Int_t | index, |
Double_t * | xyz, | ||
Int_t | verbose | ||
) |
Definition at line 30 of file AliNDFunctionInterface.h.
Double_t AliNDFunctionInterface::GetInterpolationLinear | ( | const char * | name, |
Double_t * | xyz, | ||
Int_t | verbose | ||
) |
Definition at line 34 of file AliNDFunctionInterface.h.
TMVA::MethodBase * AliNDFunctionInterface::LoadMVAReader | ( | Int_t | id, |
const char * | inputFile, | ||
const char * | method, | ||
const char * | dir | ||
) |
new MVA Regression
Load MVA regression object and register it in the map of available readers fr evaluation in TFormula Current ION of TMVA does not allow standard persistence in root file Way around: Writing - ASCII files are stored as TSting in the root file Reading - String written as ASCII file and read back by TMVA::Reader
id | - regression method ID (using e.g. hash value) |
inputFile | - input file (e.g TMVA_RegressionOutput.root) |
method | - method name (e.g MLP) |
dir | - directory usually coding regression variable with dir_ prefix (e.g. dir_meanMIPele) |
TODO check existence - validity of variable - in case of error - exit with error message
write weight from the root file to txt files as it is expected by reader
Definition at line 371 of file AliNDFunctionInterface.cxx.
Referenced by LoadMVAReaderArray(), loadMVAReaders(), and registerMethod().
Int_t AliNDFunctionInterface::LoadMVAReaderArray | ( | Int_t | id, |
const char * | inputFile, | ||
const char * | methodMask, | ||
const char * | dirMask | ||
) |
Load array of the MVA reader and register it in the AliNDFunctionInterface method array maps ( readerMethodBaseArray) Method arrays could be later use for the TMVA array evaluation ()
id | |
inputFile | |
methodMask | |
dirMask |
Definition at line 436 of file AliNDFunctionInterface.cxx.
Referenced by loadMVAReadersBootstrap(), and registerMethod().
vector< T > AliNDFunctionInterface::make_vector | ( | T | v, |
Args... | args | ||
) |
Variadic function to create an vector (boost implementation )
T | - template type |
Args | - list of arguments |
v | |
args |
Definition at line 73 of file AliNDFunctionInterface.h.
void AliNDFunctionInterface::registerDefaultMVAMethods | ( | ) |
map of registered TMVA regression methods
Register example MVA methods.
Definition at line 510 of file AliNDFunctionInterface.cxx.
void AliNDFunctionInterface::registerFactory | ( | std::string | factory, |
std::string | content | ||
) |
example registering default methods ()
Definition at line 43 of file AliNDFunctionInterface.h.
void AliNDFunctionInterface::registerMethod | ( | std::string | method, |
std::string | content, | ||
TMVA::Types::EMVA | id | ||
) |
Definition at line 44 of file AliNDFunctionInterface.h.
Referenced by registerDefaultMVAMethods(), and RegisterFitters().
map<std::string, std::string> AliNDFunctionInterface::FactorySetting |
map of registered TMVA regression methods
Definition at line 40 of file AliNDFunctionInterface.h.
Referenced by FitMVAClassification(), and FitMVARegression().
Int_t AliNDFunctionInterface::fVerbose =0 |
Definition at line 18 of file AliNDFunctionInterface.h.
Referenced by AliExternalInfo::AliExternalInfo(), AliXRDPROOFtoolkit::AliXRDPROOFtoolkit(), and AliCaloRawAnalyzer::SetVerbose().
std::map<int, THn*> AliNDFunctionInterface::hnMapArrayInt |
Definition at line 24 of file AliNDFunctionInterface.h.
Referenced by EvalTHnLinear().
std::map<std::string, THn*> AliNDFunctionInterface::hnMapArrayName |
Definition at line 25 of file AliNDFunctionInterface.h.
map<int, TMVA::MethodBase *> AliNDFunctionInterface::readerMethodBase |
TMVA interface.
variadic function evaluating THn
Definition at line 37 of file AliNDFunctionInterface.h.
Referenced by EvalMVA(), EvalMVAClasification(), GetInterpolationLinear(), and LoadMVAReader().
map<int, TObjArray* > AliNDFunctionInterface::readerMethodBaseArray |
map of registered TMVA::MethodBase
Definition at line 38 of file AliNDFunctionInterface.h.
Referenced by AppendMethodToArray(), and EvalMVAStatArray().
map<std::string, TMVA::Types::EMVA> AliNDFunctionInterface::regressionMethodID |
map of registered TMVA regression methods
Definition at line 41 of file AliNDFunctionInterface.h.
Referenced by FitMVAClassification(), and FitMVARegression().
map<std::string, std::string> AliNDFunctionInterface::regressionMethodSetting |
map of registered array of TMVA::MethodBase - used to define TMVA statistics (Mean, Median, RMS, quantile)
Definition at line 39 of file AliNDFunctionInterface.h.
Referenced by FitMVAClassification(), and FitMVARegression().