Update 'MVA Class'

Renata Kopecná 2022-01-31 16:46:31 +01:00
parent 2b84bd2672
commit 229d2c4317

@ -1,6 +1,20 @@
The classes are defined in MVAclass.hpp, the functions performing the training are in MVA.cpp. The input variables are saved in [[TMVA_variables_KplusPi0Resolved.txt|Input-MVA-variables]].
## Table of Contents
* [Classes](#classes)
* [struct MVAconfiguration](#struct-mvaconfiguration)
* [struct MVA_def](#struct-mva_def)
* [class MVA_variables](#class-mva_variables)
* [Functions](#functions)
* [MVA_variables::MVA_variables()](#mva_variables-mva_variables)
* [void MVA_variables::print()](#void-mva_variables-print)
* [vector <string> MVA_variables::GetAllReaderNames()](#vector-string-mva_variables-getallreadernames)
* [Int_t MVA_b2kmm()](#int_t-mva_b2kmm)
* [Int_t RunMore()](#int_t-runmore)
* [Int_t RunDDandLLKshort()](#int_t-runddandllkshort)
* [Int_t RunKplusPizeroResolved()](#int_t-runkpluspizeroresolved)
* [Int_t RunMVA()](#int_t-runmva)
# Classes
### struct MVAconfiguration
Defines basic properties of the used sample
@ -35,7 +49,7 @@ Structure with information needed to read and define the variables used in train
* **Functions:**
* **MVA_variables()** //default constructor
* **MVA_variables(std::string DL)** // constructor
* **~MVA_variables()** //destuctor
* **~MVA_variables()** //destuctor, sets NoBariables to zero and empties AllVariables
* **void print()**
* **vector \<string> GetAllReaderNames()**
* **int NumberOfVariables()** // Returns `NoVariables`
@ -43,62 +57,53 @@ Structure with information needed to read and define the variables used in train
* **vector \<string> GetAllBranches()** //Returns `AllBranches`
# Functions and their parameters:
# Functions
### MVA_variables::MVA_variables()
Reads the input file thePath+"/TMVA_variables_" + TheDecay + DL + ".txt";
Reads the input file thePath+"/TMVA_variables_" + TheDecay + DL + ".txt" and initializes the [MVA_variables class](#class-mvavariables).
* **Parameters**
* std::string DL
* **Return**
### MVA_variables::~MVA_variables()
* **Parameters**
*
* **Return**
* MVA_variables calss filled in from the input file.
### void MVA_variables::print()
* **Parameters**
*
* **Return**
Prints the contents of MVA_variables. Useful to check the input file was read correctly.
### vector \<string> MVA_variables::GetAllReaderNames()
* **Parameters**
*
* **Return**
* Returns a vector of strings of all variables' ReaderNames.
# Functions and their parameters:
### Int_t MVA_b2kmm()
* **Parameters**
*
Training and testing of the BDT for final signal selection. The parameters are set inside the function, as well as in [[GlobalFunctions.hh|GlobalFunctions.hh]]. The results of the BDT training are saved in an .XML file and read-in by [[TMVAClassificationApplication_b2kmm.cc|TMVA-Class-application]]. The settings of the tmva training are done using `BookMethod` function, see [TMVA Users Guide](https://root.cern.ch/download/doc/tmva/TMVAUsersGuide.pdf), section 3.1.5.
* **Return**
* 0 if something fails, otherwise 1
### Int_t RunMore()
Sets the `MVAconfiguration` options and runs the training (calls [MVA_b2kmm](#intt-mvab2kmm) for KS sample with 4 different configurations.
* **Parameters**
* Int_t Run = 1
* **Return**
* 0 if something fails, otherwise 1
### Int_t RunDDandLLKshort()
Sets the `MVAconfiguration` options and runs the final training (calls [MVA_b2kmm](#intt-mvab2kmm) for KS sample.
* **Parameters**
* Int_t Run = 1
* **Return**
* 0 if something fails, otherwise 1
### Int_t RunKplusPizeroResolved()
Sets the `MVAconfiguration` options and runs the final training (calls [MVA_b2kmm](#intt-mvab2kmm) for K+pi0 sample.
* **Parameters**
* Int_t Run = 1
* int config=0
* string customTMbranch =""
* bool gammaTM = false
* **Return**
* 0 if something fails, otherwise 1
### Int_t RunMVA()
Calls either RunDDandLLKshort(Run) or RunKplusPizeroResolved(Run)
* **Parameters**
* Int_t Run = 1
* **Return**
* 0 if something fails, otherwise 1