diff --git a/BDTcutScanner.cpp.md b/BDTcutScanner.cpp.md index 23ca147..b739731 100644 --- a/BDTcutScanner.cpp.md +++ b/BDTcutScanner.cpp.md @@ -1,5 +1,31 @@ + +## Table of Contents + + +* [Global variables](#global-variables) +* [Classes](#classes) + * [YieldInfo](#yieldinfo) +* [Functions and their parameters:](#functions-and-their-parameters) + * [void YieldInfo::addYield()](#void-yieldinfoaddyield) + * [double GetBackgroundFromSidebandFit()](#double-getbackgroundfromsidebandfit) + * [double GetMVAefficiency()](#double-getmvaefficiency) + * [double GetSelectionEfficiency()](#double-getselectionefficiency) + * [string GetBackgroundFunction()](#string-getbackgroundfunction) + * [YieldInfo GetSigAndBkgEstimation()](#yieldinfo-getsigandbkgestimation) + * [YieldInfo GetSigAndBkgEstimationFromData()](#yieldinfo-getsigandbkgestimationfromdata) + * [int SaveTGraphs()](#int-savetgraphs) + * [int ScanSignalAndBckgndEstimation()](#int-scansignalandbckgndestimation) + * [int ScanSignalAndBckgndEstimationPerYear()](#int-scansignalandbckgndestimationperyear) + * [int ScanSignalAndBckgndEstimationAllYears()](#int-scansignalandbckgndestimationallyears) + * [int ScanSignalAndBckgndEstimationSimple()](#int-scansignalandbckgndestimationsimple) + * [int ScanSignalAndBckgndEstimationSimplePerYear()](#int-scansignalandbckgndestimationsimpleperyear) + * [int ScanSignalAndBckgndEstimationSimpleAllYears()](#int-scansignalandbckgndestimationsimpleallyears) + * [double getMaxBDTresponse()](#double-getmaxbdtresponse) + * [int optimizeBDTCut()](#int-optimizebdtcut) + + ## Global variables -[comment]: # (This actually is the most platform independent comment) + bool FixShape = true (When performing the B+ mass fit to obtain the yields, fix the shape to TMed MC/MVAed data?) bool RemoveMultiple = true (When performing the B+ mass fit, remove multiple events first?) @@ -72,6 +98,8 @@ Fits the upper mass sideband (defined by `range`) with an exponential, creates t * Either a double or signle exponential. For K+pi, always \"SingleExponential\". ### YieldInfo GetSigAndBkgEstimation() +[comment]: # (string-getbackgroundfunction) + Opens (and possibly also runs) the B mass fit file, loads it into the YieldInfo. Removal of multiple candidates is assumed. Retrievs the MVA efficiency files to get the estimation on the signal yield. Retrieves the estimated background from the upper mass sideband. * **Parameters** * string year @@ -84,7 +112,8 @@ Opens (and possibly also runs) the B mass fit file, loads it into the YieldInfo. * The YieldInfo class with loaded information from the fit and efficiency files. Background obtianed by upper mass sideband fit. ### YieldInfo GetSigAndBkgEstimationFromData() -Opens (and possibly also runs) the B mass fit file, loads it into the YieldInfo. Removal of multiple candidates is assumed. Retrievs the MVA efficiency files to get the estimation on the signal yield. Retrieves the estimated background from the number of signal candidates: Number of events = number of signal + number of background events. +[comment]: # (yieldinfo-getsigandbkgestimationfromdata) +Opens (and possibly also runs) the B mass fit file, loads it into the YieldInfo. Removal of multiple candidates is assumed. Retrievs the MVA efficiency files to get the reference and signal yields directly from the fit. * **Parameters** * string year = "2011" * int Run = 0 @@ -115,7 +144,8 @@ Calls [designYieldGraph()](https://git.physi.uni-heidelberg.de/kopecna/EWP-Bplus * Always 1 ### int ScanSignalAndBckgndEstimation() -Performs a scan of the MVA cut efficiency. Loads the information into a `YieldInfo`, if scan is set to false, it also performs the fits. The steps are either done in steps of `BDTstep` defined in [[GlobalFunctions.hh|GlobalFunctions.hh]] (set `section` inside the function to false) or in iterative steps (defined by `n_divisions`). Let's say we set `n_divisions` to three. It starts by diving the MVA response into three regons (assuming the MVA response range is 0.0-1.0, we would have 0,0.33,0.66,1.0) and calculating the significance in these points. Then it divides 0.33,1.0 into three regions and performs the calculations acordingly. This is done until the starting point reaches 0.999 (so until it wants to perform fits in 0.99933, 0.99966). The results of the scan, ie the signal yields, the bkg yields from upper mass sideband fit and counting, the reference channel yields and the significances are saved as TGraphs. +[comment]: # ([ScanSignalAndBckgndEstimation()](#int-scansignalandbckgndestimation)) +Performs a scan of the MVA cut efficiency. Loads the information into a `YieldInfo`, if scan is set to false, it also performs the fits. The steps are either done in steps of `BDTstep` defined in [[GlobalFunctions.hh|GlobalFunctions.hh]] (set `section` inside the function to false) or in iterative steps (defined by `n_divisions`). Let's say we set `n_divisions` to three. It starts by diving the MVA response into three regons (assuming the MVA response range is 0.0-1.0, we would have 0,0.33,0.66,1.0) and calculating the significance in these points. Then it divides 0.33,1.0 into three regions and performs the calculations acordingly. This is done until the starting point reaches 0.999 (so until it wants to perform fits in 0.99933, 0.99966). Calls [Getbackgroundfunction()](#string-getbackgroundfunction) The results of the scan, ie the signal yields, the bkg yields from upper mass sideband fit and counting, the reference channel yields and the significances are saved as TGraphs. * **Parameters** * string year @@ -151,10 +181,11 @@ Calls [ScanSignalAndBckgndEstimationPerYear()](#int-scansignalandbckgndestimatio * bool scan = false * bool fineScan = true * **Return** + * Always 1 ### int ScanSignalAndBckgndEstimationSimple() -[comment]: # (int-scansignalandbckgndestimationsimple) - +[comment]: # ([ScanSignalAndBckgndEstimationSimple()](#int-scansignalandbckgndestimationsimple)) +Performs a scan of the MVA cut efficiency. Loads the information into a `YieldInfo`, if scan is set to false, it also performs the fits. The steps are either done in steps of `BDTstep` defined in [[GlobalFunctions.hh|GlobalFunctions.hh]] (set `section` inside the function to false) or in iterative steps (defined by `n_divisions`). Let's say we set `n_divisions` to three. It starts by diving the MVA response into three regons (assuming the MVA response range is 0.0-1.0, we would have 0,0.33,0.66,1.0) and calculating the significance in these points. Then it divides 0.33,1.0 into three regions and performs the calculations acordingly. This is done until the starting point reaches 0.999 (so until it wants to perform fits in 0.99933, 0.99966). The results of the scan, obtained by calling [GetSigAndBkgEstimationFromData()](#yieldinfo-getsigandbkgestimationfromdata), are saved as TGraphs. * **Parameters** * string year = "2011" * int Run = 1 @@ -165,10 +196,11 @@ Calls [ScanSignalAndBckgndEstimationPerYear()](#int-scansignalandbckgndestimatio * bool scan = false * bool fineScan = true * **Return** + * Always 1 ### int ScanSignalAndBckgndEstimationSimplePerYear() -[comment]: # (int-scansignalandbckgndestimationsimpleperyear) - +[comment]: # ([ScanSignalAndBckgndEstimationSimplePerYear()](#int-scansignalandbckgndestimationsimpleperyear)) +Calls [ScanSignalAndBckgndEstimationSimple()](#int-scansignalandbckgndestimationsimple) for given year. * **Parameters** * string year = "2011" * Double_t BDTstep = 0.01 @@ -178,10 +210,11 @@ Calls [ScanSignalAndBckgndEstimationPerYear()](#int-scansignalandbckgndestimatio * bool scan = false * bool fineScan = true * **Return** + * Always 1 ### int ScanSignalAndBckgndEstimationSimpleAllYears() -[comment]: # (int-scansignalandbckgndestimationsimpleallyears) - +[comment]: # ([ScanSignalAndBckgndEstimationSimpleAllYears()](#int-scansignalandbckgndestimationsimpleallyears)) +Calls [ScanSignalAndBckgndEstimationSimplePerYear()](#int-scansignalandbckgndestimationsimpleperyear) for all years. * **Parameters** * Double_t BDTstep = 0.01 * int randomSubset = 0 @@ -190,10 +223,11 @@ Calls [ScanSignalAndBckgndEstimationPerYear()](#int-scansignalandbckgndestimatio * bool scan = false * bool fineScan = true * **Return** + * Always 1 ### double getMaxBDTresponse() -[comment]: # (double-getmaxbdtresponse) - +[comment]: # ([getMaxBDTresponse()](#double-getmaxbdtresponse)) +Opens the file with the saved TGraphs and gets the MVA response corresponding to maximal significance from the TGrahp. * **Parameters** * string year = "2011" * int Run = 0 @@ -203,10 +237,11 @@ Calls [ScanSignalAndBckgndEstimationPerYear()](#int-scansignalandbckgndestimatio * bool KshortDecaysInVelo = true * bool UseLowQ2Range = false * **Return** + * 1 if everything is okay, 0 if something fails ### int optimizeBDTCut() -[comment]: # (int-optimizebdtcut) - +[comment]: # ([optimizeBDTCut()](#int-optimizebdtcut)) +Calls [ScanSignalAndBckgndEstimation()](#int-scansignalandbckgndestimation) for the given year OR run and then get the MVA response corresponding to maximal significance by calling [getMaxBDTresponse()](#double-getmaxbdtresponse)). * **Parameters** * string year = "2011" * int Run = 0 @@ -217,4 +252,5 @@ Calls [ScanSignalAndBckgndEstimationPerYear()](#int-scansignalandbckgndestimatio * bool scan = false * bool fineScan = false * bool directScan = false -* **Return** \ No newline at end of file +* **Return** + * MVA response corresponding to maximal significance