diff --git a/PlotTMVA.cpp.md b/PlotTMVA.cpp.md index 295daef..ac85dd0 100644 --- a/PlotTMVA.cpp.md +++ b/PlotTMVA.cpp.md @@ -1,16 +1,41 @@ -Welcome to the Wiki. +## Table of Contents -## Global variables: - -*} -*return v_var +* [Functions](#functions) + * [TFile *GetTMVAfile()](#tfile-gettmvafile) + * [TH2F *GetCorrelationMatrix()](#th2f-getcorrelationmatrix) + * [TH2F *GetCorrelationMatrixSignal()](#th2f-getcorrelationmatrixsignal) + * [TH2F *GetCorrelationMatrixBackground()](#th2f-getcorrelationmatrixbackground) + * [string oberFolder()](#string-oberfolder) + * [TH1F *GetTMVAresponse()](#th1f-gettmvaresponse) + * [TH1F *GetTMVAresponseSignal()](#th1f-gettmvaresponsesignal) + * [TH1F *GetTMVAresponseBackground()](#th1f-gettmvaresponsebackground) + * [TH1F *GetTMVAresponseTrainingSignal()](#th1f-gettmvaresponsetrainingsignal) + * [TH1F *GetTMVAresponseTrainingBackground()](#th1f-gettmvaresponsetrainingbackground) + * [TH1F *GetVariableSignal()](#th1f-getvariablesignal) + * [TH1F *GetVariableBackground()](#th1f-getvariablebackground) + * [TH1F *GetEfficiencySignal()](#th1f-getefficiencysignal) + * [TH1F *GetEfficiencyBackground()](#th1f-getefficiencybackground) + * [TH1F *GetROC()](#th1f-getroc) + * [TTree *GetTrainTree()](#ttree-gettraintree) + * [TTree *GetTestTree()](#ttree-gettesttree) + * [int GetTrainEvents()](#int-gettrainevents) + * [int GetTrainSignalEvents()](#int-gettrainsignalevents) + * [int GetTrainBackgroundEvents()](#int-gettrainbackgroundevents) + * [bool SaveCorrelationPlot()](#bool-savecorrelationplot) + * [vector <string> v_variables()](#vector-string-v_variables) + * [bool SaveVariablesSignalVsBackground()](#bool-savevariablessignalvsbackground) + * [bool SaveMVAResponse()](#bool-savemvaresponse) + * [bool SaveMVAOvertraining()](#bool-savemvaovertraining) + * [bool SaveEfficiency()](#bool-saveefficiency) + * [string getROCmethod()](#string-getrocmethod) + * [bool SaveROCs()](#bool-saverocs) + * [bool SaveMultipleROCS()](#bool-savemultiplerocs) + * [void nEvents()](#void-nevents) + * [bool SaveAllFromOneFile()](#bool-saveallfromonefile) + * [bool SaveMultipleROCS()](#bool-savemultiplerocs-1) -# Classes - - - -# Functions and their parameters: +# Functions ### TFile \*GetTMVAfile() * **Parameters** @@ -23,43 +48,46 @@ Welcome to the Wiki. * string customTMbranch * bool gammaTM * **Return** + * Opens and returns the TFile with the MVA training information (config file) ### TH2F \*GetCorrelationMatrix() * **Parameters** * TFile \*file - * string type //type = S - * B + * string type //S or B (for signal or background) * **Return** + * Returns the signal or background correlation matrix from the config file ### TH2F \*GetCorrelationMatrixSignal() * **Parameters** * TFile \*file * **Return** + * Returns the signal correlation matrix from the config file ### TH2F \*GetCorrelationMatrixBackground() * **Parameters** * TFile \*file * **Return** + * Returns the background correlation matrix from the config file + ### string oberFolder() * **Parameters** * string method * **Return** + * A string with the name of the folder where the histograms are saved in the TFile ### TH1F \*GetTMVAresponse() * **Parameters** * TFile \*file * string method - * string type //type = S - * B - * Train_S - * Train_B + * string type // S, B, Train_S, Train_B * **Return** + * Histogram with the MVA responses for the signal and background either from training or from all ### TH1F \*GetTMVAresponseSignal() @@ -67,6 +95,7 @@ Welcome to the Wiki. * TFile \*file * string method * **Return** + * Histogram with the signal MVA response ### TH1F \*GetTMVAresponseBackground() @@ -74,6 +103,7 @@ Welcome to the Wiki. * TFile \*file * string method * **Return** + * Histogram with the background MVA response ### TH1F \*GetTMVAresponseTrainingSignal() @@ -81,6 +111,7 @@ Welcome to the Wiki. * TFile \*file * string method * **Return** + * Histogram with the signal MVA response in the training sample ### TH1F \*GetTMVAresponseTrainingBackground() @@ -88,6 +119,7 @@ Welcome to the Wiki. * TFile \*file * string method * **Return** + * Histogram with the background MVA response in the training sample ### TH1F \*GetVariableSignal() @@ -95,6 +127,7 @@ Welcome to the Wiki. * TFile \*file * string variable * **Return** + * Histogram with the disrtibution of the desired variable, signal events only ### TH1F \*GetVariableBackground() @@ -102,6 +135,7 @@ Welcome to the Wiki. * TFile \*file * string variable * **Return** + * Histogram with the disrtibution of the desired variable, background events only ### TH1F \*GetEfficiencySignal() @@ -109,6 +143,7 @@ Welcome to the Wiki. * TFile \*file * string method * **Return** + * Histogram with the MVA efficiency for signal ### TH1F \*GetEfficiencyBackground() @@ -116,6 +151,7 @@ Welcome to the Wiki. * TFile \*file * string method * **Return** + * Histogram with the MVA efficiency for signal ### TH1F \*GetROC() @@ -123,79 +159,88 @@ Welcome to the Wiki. * TFile \*file * string method * **Return** + * Histogram with the ROC curve for the given method ### TTree \*GetTrainTree() * **Parameters** * TFile \*file * **Return** + * The TTree used for the MVA training ### TTree \*GetTestTree() * **Parameters** * TFile \*file * **Return** + * The TTree used for the MVA testing ### int GetTrainEvents() * **Parameters** * TFile \*file * **Return** + * The number of events used for the MVA training ### int GetTrainSignalEvents() * **Parameters** * TFile \*file * **Return** + * The number of signal events used for the MVA training ### int GetTrainBackgroundEvents() * **Parameters** * TFile \*file * **Return** + * The number of background events used for the MVA training ### bool SaveCorrelationPlot() - +Read the correlation histograms from the file, makes them pretty and saves them. * **Parameters** * TFile \*file * string type * string savePath * **Return** + * True if everything is fine, False if something fails -### vector v_variables() +### vector \ v_variables() * **Parameters** - * string DL="" + * string DL="" //LL or DD * **Return** + * A vector with all variable names from the MVA reader (see [MVA.cpp](https://git.physi.uni-heidelberg.de/kopecna/EWP-BplusToKstMuMu-AngAna/wiki/MVA-Class#mva_variables-mva_variables) ) ### bool SaveVariablesSignalVsBackground() - +Loads the variable distributions in the signal and background sample, plots them both and saves the plot. * **Parameters** * TFile \*file * string savePath - * string DL="" + * string DL="" //LL or DD * **Return** + * True if everything is fine, False if something fails ### bool SaveMVAResponse() - +Loads the MVA response in the signal and background samples,plots them both and saves the plot. * **Parameters** * TFile \*file * string savePath - * string method //Check if folder for the plots exists and if not - * create one + * string method * **Return** + * True if everything is fine, False if something fails ### bool SaveMVAOvertraining() - +Retrieves and plots the training and test sample MVA response for the signal and background. The plot is saved. * **Parameters** * TFile \*file * string savePath - * string method //Check if folder for the plots exists and if not - * create one + * string method * **Return** + * True if everything is fine, False if something fails ### bool SaveEfficiency() - +Retrieves and plots the MVA efficiency, purity, and significance of the signal and background. The plot is saved. * **Parameters** * TFile \*file * string savePath @@ -203,31 +248,35 @@ Welcome to the Wiki. * int nSig * int nBkg * **Return** + * True if everything is fine, False if something fails ### string getROCmethod() * **Parameters** * TH1F \*h_ROC * **Return** + * The name of the ROC histogram stripped of the MVA_ at the begining. ### bool SaveROCs() - +Retrieves the ROC curves for listed methods, plots them in one canvas, saves the plot. * **Parameters** * TFile \*file * string savePath - * vector methods + * vector \ methods * **Return** + * True if everything is fine, False if something fails ### bool SaveMultipleROCS() - +Retrieves the ROC curves from the listed files, plots them in one canvas, saves the plot. * **Parameters** - * vector files + * vector \ files * string savePath * string method * **Return** + * True if everything is fine, False if something fails ### void nEvents() - +Saves the number of signal and background events into `nSig` and `nBkg`. It has to be checked, as the input is hardcoded! * **Parameters** * int year * int Run @@ -237,10 +286,10 @@ Welcome to the Wiki. * bool UseLowQ2Range * int& nSig * int& nBkg -* **Return** + ### bool SaveAllFromOneFile() - +Effectivelly saves all plots needed for the MVA training. Calls [SaveAllFromOneFile()](#int-saveallfromonefile), [SaveVariablesSignalVsBackground()](#int-savevariablessignalvsbackground), [nEvents()](#void-nevents), [SaveMVAOvertraining()](#int-savemvaovertraining), [SaveEfficiency()](#int-saveefficiency) and [SaveROCs()](#int-saverocs) for the given file. * **Parameters** * int year * int Run @@ -251,23 +300,13 @@ Welcome to the Wiki. * string customTMbranch * bool gammaTM * **Return** + * True if everything is fine, False if something fails ### bool SaveMultipleROCS() - +Gets a list of config files and calls [SaveMultipleROCS()](#int-savemultiplerocs). * **Parameters** * int Run =1 * int nLow = 0 * int nHigh = 3 * **Return** - -### bool testFunction() - -* **Parameters** - * int Run =1 -* **Return** - -### void test() - -* **Parameters** - * -* **Return** + * True if everything is fine, False if something fails