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]]. 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 # Classes
### struct MVAconfiguration ### struct MVAconfiguration
Defines basic properties of the used sample 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:** * **Functions:**
* **MVA_variables()** //default constructor * **MVA_variables()** //default constructor
* **MVA_variables(std::string DL)** // constructor * **MVA_variables(std::string DL)** // constructor
* **~MVA_variables()** //destuctor * **~MVA_variables()** //destuctor, sets NoBariables to zero and empties AllVariables
* **void print()** * **void print()**
* **vector \<string> GetAllReaderNames()** * **vector \<string> GetAllReaderNames()**
* **int NumberOfVariables()** // Returns `NoVariables` * **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` * **vector \<string> GetAllBranches()** //Returns `AllBranches`
# Functions
# Functions and their parameters:
### MVA_variables::MVA_variables() ### 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** * **Parameters**
* std::string DL * std::string DL
* **Return** * **Return**
* MVA_variables calss filled in from the input file.
### MVA_variables::~MVA_variables()
* **Parameters**
*
* **Return**
### void MVA_variables::print() ### void MVA_variables::print()
Prints the contents of MVA_variables. Useful to check the input file was read correctly.
* **Parameters**
*
* **Return**
### vector \<string> MVA_variables::GetAllReaderNames() ### vector \<string> MVA_variables::GetAllReaderNames()
* **Parameters**
*
* **Return** * **Return**
* Returns a vector of strings of all variables' ReaderNames.
# Functions and their parameters:
### Int_t MVA_b2kmm() ### Int_t MVA_b2kmm()
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.
* **Parameters**
*
* **Return** * **Return**
* 0 if something fails, otherwise 1
### Int_t RunMore() ### Int_t RunMore()
Sets the `MVAconfiguration` options and runs the training (calls [MVA_b2kmm](#intt-mvab2kmm) for KS sample with 4 different configurations.
* **Parameters** * **Parameters**
* Int_t Run = 1 * Int_t Run = 1
* **Return** * **Return**
* 0 if something fails, otherwise 1
### Int_t RunDDandLLKshort() ### Int_t RunDDandLLKshort()
Sets the `MVAconfiguration` options and runs the final training (calls [MVA_b2kmm](#intt-mvab2kmm) for KS sample.
* **Parameters** * **Parameters**
* Int_t Run = 1 * Int_t Run = 1
* **Return** * **Return**
* 0 if something fails, otherwise 1
### Int_t RunKplusPizeroResolved() ### Int_t RunKplusPizeroResolved()
Sets the `MVAconfiguration` options and runs the final training (calls [MVA_b2kmm](#intt-mvab2kmm) for K+pi0 sample.
* **Parameters** * **Parameters**
* Int_t Run = 1 * Int_t Run = 1
* int config=0 * int config=0
* string customTMbranch ="" * string customTMbranch =""
* bool gammaTM = false * bool gammaTM = false
* **Return** * **Return**
* 0 if something fails, otherwise 1
### Int_t RunMVA() ### Int_t RunMVA()
Calls either RunDDandLLKshort(Run) or RunKplusPizeroResolved(Run)
* **Parameters** * **Parameters**
* Int_t Run = 1 * Int_t Run = 1
* **Return** * **Return**
* 0 if something fails, otherwise 1