![]() |
AliRoot Core
ee782a0 (ee782a0)
|
Interface to Ndimension 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 | registerMethod (std::string method, std::string content, TMVA::Types::EMVA id) |
example registering default methods () More... | |
Int_t | FitMVA (TTree *tree, const char *varFit, TCut cut, const char *variableList, const char *methodList, const char *weights=NULL, Int_t index=-1) |
TMVA::MethodBase * | LoadMVAReader (Int_t id, const char *inputFile, const char *method, const char *dir) |
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 | 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, quantiles) More... | |
map< std::string, TMVA::Types::EMVA > | regressionMethodID |
map of registered TMVA regression methods More... | |
Interface to Ndimension 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 55 of file AliNDFunctionInterface.h.
vector< T > AliNDFunctionInterface::add_to_vector | ( | vector< T > & | z, |
T | v, | ||
Args... | args | ||
) |
Definition at line 56 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 337 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 111 of file AliNDFunctionInterface.h.
Referenced by registerMethod().
T AliNDFunctionInterface::EvalMVAStat | ( | int | id, |
int | statType, | ||
T | v, | ||
Args... | args | ||
) |
variadic function evaluating MVA
Templated 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 136 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 357 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 | |
Args |
id | |
v | |
args |
Definition at line 88 of file AliNDFunctionInterface.h.
Referenced by GetInterpolationLinear().
Int_t AliNDFunctionInterface::FitMVA | ( | TTree * | tree, |
const char * | varFit, | ||
TCut | cut, | ||
const char * | variables, | ||
const char * | methods, | ||
const char * | weights = NULL , |
||
Int_t | index = -1 |
||
) |
Fit MVA regression
tree | - input tree (or chain) |
varFit | - colon separated variable string |
cut | - selection (TTree cut) |
variables | - colon separated explanatory variable list |
methods | - colon separated method list - only registered methods can be used (using registerMethod(std::string method, std::string content, TMVA::Types::EMVA id)) |
0. Declare Factory
1.) Declare DataLoader
TODO check existence - validity of variable - in case of error - exit with error message
3.) Setup DataSet
4.) Book regression methods from the methods list
5.) Train all methods
6.) Write ascii weight files to root file
Definition at line 157 of file AliNDFunctionInterface.cxx.
Referenced by makeMVABootstrapMI(), makeMVAFits(), 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 Ndimensional histogram to iterpolate |
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 | ||
) |
MVA regression.
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) |
dummy booking it is not used - TODO - ask TMVA to remove requirement
write weight from the root file to txt files as it is expected by reader
Definition at line 240 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 302 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 | |
Args |
v | |
args |
Definition at line 70 of file AliNDFunctionInterface.h.
void AliNDFunctionInterface::registerDefaultMVAMethods | ( | ) |
map of registered TMVA regression methods
Register example MVA methods.
Definition at line 376 of file AliNDFunctionInterface.cxx.
void AliNDFunctionInterface::registerMethod | ( | std::string | method, |
std::string | content, | ||
TMVA::Types::EMVA | id | ||
) |
example registering default methods ()
Definition at line 42 of file AliNDFunctionInterface.h.
Referenced by registerDefaultMVAMethods(), and RegisterFitters().
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(), 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 40 of file AliNDFunctionInterface.h.
Referenced by FitMVA().
map<std::string, std::string> AliNDFunctionInterface::regressionMethodSetting |
map of registered array of TMVA::MethodBase - used to define TMVA statistics (Mean, Median, RMS, quantiles)
Definition at line 39 of file AliNDFunctionInterface.h.
Referenced by FitMVA().