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.
Table of Contents
Classes
struct MVAconfiguration
Defines basic properties of the used sample
- Members:
- bool SplitYears = false //Train MVA for each year?
- Int_t Run = 1
- std::vector<Int_t> years = {2011}
- Int_t KShortDecaysInVelo = 1 //LL?
- bool SplitInQ2Range = SplitInQ2 //Split the training in Q2 below and above Q2?
- bool UseLowQ2Range = true //If split, use Q2<J/psi?
- bool gammaTM = false //True only true gammas, False: include random gamma
- string customTMbranch = "TMed" //Name of the used truth matching branch
- Int_t nConfiguration = 0 //Tag for the outputfiles, useful for testing
struct MVA_def
Structure with information needed to read and define the variables used in training
- Private members:
- string ReaderName //Name of the MVA reader
- string LaTeXName //Displayed name in the plots
- string Unit //Unit for the branch
- int NoBr //Number of used branches for the reader (eg min(mu+ chi2, mi- chi2)), one needs 2 branches
- string Formula //formula: Reader = f(Branches)
- char DataType //D: Double_t, F: Float_t, I: Int_t,... (needed to load the branch, because ROOT)
class MVA_variables
- Private members: int NoVariables //Total number of variables int NoBranches //Total number of branches
- Public members:
- vector <MVA_def> AllVariables // Vector of all variables used in the MVA training
- vector <string> AllBranches // Vector of all branches that needs to be read from the tree
- Functions:
- MVA_variables() //default constructor
- MVA_variables(std::string DL) // constructor
- ~MVA_variables() //destuctor, sets NoBariables to zero and empties AllVariables
- void print()
- vector <string> GetAllReaderNames()
- int NumberOfVariables() // Returns
NoVariables
- int NumberOfBranches() // Returns
NoBranches
- vector <string> GetAllBranches() //Returns
AllBranches
Functions
MVA_variables::MVA_variables()
Reads the input file thePath+"/TMVA_variables_" + TheDecay + DL + ".txt" and initializes the MVA_variables class.
- Parameters
- std::string DL
- Return
- MVA_variables calss filled in from the input file.
void MVA_variables::print()
Prints the contents of MVA_variables. Useful to check the input file was read correctly.
vector <string> MVA_variables::GetAllReaderNames()
- Return
- Returns a vector of strings of all variables' ReaderNames.
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. The results of the BDT training are saved in an .XML file and read-in by TMVAClassificationApplication_b2kmm.cc. The settings of the tmva training are done using BookMethod
function, see TMVA Users Guide, section 3.1.5. The training control plots are saved in a separate ROOT file.
- Return
- 0 if something fails, otherwise 1
Int_t RunMore()
Sets the MVAconfiguration
options and runs the training (calls MVA_b2kmm()) 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()) 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()) 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