From 0bc72d76fd81ca9d07bb965e15d861ff5550b734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Renata=20Kopecn=C3=A1?= Date: Thu, 3 Feb 2022 11:26:41 +0100 Subject: [PATCH] Update 'BDTcutScanner.cpp' --- BDTcutScanner.cpp.md | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/BDTcutScanner.cpp.md b/BDTcutScanner.cpp.md index 7081aee..23ca147 100644 --- a/BDTcutScanner.cpp.md +++ b/BDTcutScanner.cpp.md @@ -1,4 +1,5 @@ -## Global variables +## 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?) @@ -62,27 +63,28 @@ Fits the upper mass sideband (defined by `range`) with an exponential, creates t * bool sig * **Return** * The selection efficiency for given TMVA cut read from efficiency file created by [[Efficiency.cpp|Efficiency.cpp]] - * + ### string GetBackgroundFunction() * **Parameters** * bool KshortDecaysInVelo * **Return** * Either a double or signle exponential. For K+pi, always \"SingleExponential\". - * + ### YieldInfo GetSigAndBkgEstimation() - +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 * int Run * bool KshortDecaysInVelo * bool UseLowQ2Range * Double_t TMVAcut - * bool scan + * bool scan = false (If false, run the fit. If true, just open the files) * **Return** + * 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. * **Parameters** * string year = "2011" * int Run = 0 @@ -90,11 +92,12 @@ Fits the upper mass sideband (defined by `range`) with an exponential, creates t * bool KshortDecaysInVelo = false * bool UseLowQ2Range = false * Double_t TMVAcut = -1.0 - * bool scan = false + * bool scan = false (If false, run the fit. If true, just open the files) * **Return** + * The YieldInfo class with loaded information from the fit and efficiency files. Background obtianed from counting. ### int SaveTGraphs() - +Calls [designYieldGraph()](https://git.physi.uni-heidelberg.de/kopecna/EWP-BplusToKstMuMu-AngAna/wiki/Design.cpp#user-content-void-designyieldgraph) to plot and save the signal and background yields, the significance and the total amount of events. * **Parameters** * string path * bool fineScan @@ -109,8 +112,10 @@ Fits the upper mass sideband (defined by `range`) with an exponential, creates t * TGraphErrors \*significance * TGraphErrors \*significanceFromAllEvts * **Return** - + * 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. * **Parameters** * string year @@ -118,12 +123,15 @@ Fits the upper mass sideband (defined by `range`) with an exponential, creates t * Double_t BDTstep * bool KshortDecaysInVelo * bool UseLowQ2Range - * bool scan - * bool fineScan + * bool scan (If false, run the fit. If true, just open the files) + * bool fineScan (If false, start at the starting MVA response point, if true, start at 0.9) * **Return** + * Always 1 -### int ScanSignalAndBckgndEstimationPerYear() +### int ScanSignalAndBckgndEstimationPerYear() + +Calls [ScanSignalAndBckgndEstimation()](#int-scansignalandbckgndestimation) for the given year. * **Parameters** * string year = "2011" * Double_t BDTstep = 0.01 @@ -132,9 +140,10 @@ Fits the upper mass sideband (defined by `range`) with an exponential, creates t * bool scan = false * bool fineScan = false * **Return** + * Always 1 ### int ScanSignalAndBckgndEstimationAllYears() - +Calls [ScanSignalAndBckgndEstimationPerYear()](#int-scansignalandbckgndestimationperyear) for all years. * **Parameters** * Double_t BDTstep = 0.01 * bool KshortDecaysInVelo = true @@ -144,6 +153,7 @@ Fits the upper mass sideband (defined by `range`) with an exponential, creates t * **Return** ### int ScanSignalAndBckgndEstimationSimple() +[comment]: # (int-scansignalandbckgndestimationsimple) * **Parameters** * string year = "2011" @@ -157,6 +167,7 @@ Fits the upper mass sideband (defined by `range`) with an exponential, creates t * **Return** ### int ScanSignalAndBckgndEstimationSimplePerYear() +[comment]: # (int-scansignalandbckgndestimationsimpleperyear) * **Parameters** * string year = "2011" @@ -169,6 +180,7 @@ Fits the upper mass sideband (defined by `range`) with an exponential, creates t * **Return** ### int ScanSignalAndBckgndEstimationSimpleAllYears() +[comment]: # (int-scansignalandbckgndestimationsimpleallyears) * **Parameters** * Double_t BDTstep = 0.01 @@ -180,6 +192,7 @@ Fits the upper mass sideband (defined by `range`) with an exponential, creates t * **Return** ### double getMaxBDTresponse() +[comment]: # (double-getmaxbdtresponse) * **Parameters** * string year = "2011" @@ -192,6 +205,7 @@ Fits the upper mass sideband (defined by `range`) with an exponential, creates t * **Return** ### int optimizeBDTCut() +[comment]: # (int-optimizebdtcut) * **Parameters** * string year = "2011" @@ -203,4 +217,4 @@ Fits the upper mass sideband (defined by `range`) with an exponential, creates t * bool scan = false * bool fineScan = false * bool directScan = false -* **Return** +* **Return** \ No newline at end of file