Update 'Efficiency.cpp'
parent
66ccb4129e
commit
657d2af4aa
@ -1,5 +1,43 @@
|
||||
The efficiency class and helper functions are saved in a [[separate file|Efficiency-Class]]. In this file, the functions for saving and plotting the efficiencies are defined.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Global variables:](#global-variables)
|
||||
* [Functions](#functions)
|
||||
* [Helpers](#helpers)
|
||||
* [Double_t getLowBDTcut()](#double_t-getlowbdtcut)
|
||||
* [TH1D *convertTGraph()](#th1d-converttgraph)
|
||||
* [L0Muon trigger efficiency](#l0muon-trigger-efficiency)
|
||||
* [TH1D * getL0MuonEfficiency()](#th1d--getl0muonefficiency)
|
||||
* [int getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies)
|
||||
* [int getAllL0MuonEfficienciesAllYears()](#int-getalll0muonefficienciesallyears)
|
||||
* [MVA efficiency scans](#mva-efficiency-scans)
|
||||
* [int ScanBDTEfficiency()](#int-scanbdtefficiency)
|
||||
* [int ScanBDTEfficiencyAllYears()](#int-scanbdtefficiencyallyears)
|
||||
* [int ScanMultipleCandidatesEfficiencyAllYearsAllSamples()](#int-scanmultiplecandidatesefficiencyallyearsallsamples)
|
||||
* [int ScanBDTEfficiencyAllSig ()](#int-scanbdtefficiencyallsig-)
|
||||
* [int ScanBDTEfficiencyAllPHSP()](#int-scanbdtefficiencyallphsp)
|
||||
* [int ScanBDTEfficiencyAllRef ()](#int-scanbdtefficiencyallref-)
|
||||
* [int ScanBDTEfficiencyAll()](#int-scanbdtefficiencyall)
|
||||
* [int plotBDTEfficiency()](#int-plotbdtefficiency)
|
||||
* [int plotBDTEffciencyInAngles()](#int-plotbdteffciencyinangles)
|
||||
* [Selection efficiency](#selection-efficiency)
|
||||
* [TGraphErrors *getSelectionEffTGraph()](#tgrapherrors-getselectionefftgraph)
|
||||
* [TGraphErrors *getSelectionEffTGraph()](#tgrapherrors-getselectionefftgraph-1)
|
||||
* [int plotSelectionEfficiency()](#int-plotselectionefficiency)
|
||||
* [int plotSelectionEfficiencyAllYearsAll()](#int-plotselectionefficiencyallyearsall)
|
||||
* [int plotSelectionEfficiencyAll()](#int-plotselectionefficiencyall)
|
||||
* [int plotSelectionEfficiencyAll()](#int-plotselectionefficiencyall-1)
|
||||
* [Truth matching efficiency from counting](#truth-matching-efficiency-from-counting)
|
||||
* [TGraphErrors *getTMeffTGraph()](#tgrapherrors-gettmefftgraph)
|
||||
* [int plotTruthMatchingEfficiencyAllYearsAll()](#int-plottruthmatchingefficiencyallyearsall)
|
||||
* [int plotTruthMatchingEfficiencyAllYearsAll()](#int-plottruthmatchingefficiencyallyearsall-1)
|
||||
* [Truth matching efficiency from B+ mass fit](#truth-matching-efficiency-from-b-mass-fit)
|
||||
* [TGraphErrors *getTMeffTGraph()](#tgrapherrors-gettmefftgraph-1)
|
||||
* [int plotTruthMatchingEfficiency()](#int-plottruthmatchingefficiency)
|
||||
* [Running everything](#running-everything)
|
||||
* [int runAllEff()](#int-runalleff)
|
||||
|
||||
|
||||
|
||||
## Global variables:
|
||||
@ -58,6 +96,7 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
## MVA efficiency scans
|
||||
|
||||
### int ScanBDTEfficiency()
|
||||
Scans the MVA efficiency in the steps of `defaultBDTstep` starting from [getLowBDTcut()](#double_t-getlowbdtcut). Plotsand saves the scan.
|
||||
|
||||
* **Parameters**
|
||||
* string year
|
||||
@ -73,7 +112,7 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
* 1 if everything is fine, 0 if something fails
|
||||
|
||||
### int ScanBDTEfficiencyAllYears()
|
||||
|
||||
Calls [ScanBDTEfficiency()](#int-scanbdtefficiency) for all years.
|
||||
* **Parameters**
|
||||
* bool UseOnlyMuMuEvents
|
||||
* bool PHSP
|
||||
@ -83,7 +122,7 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
* 1 if everything is fine, 0 if something fails
|
||||
|
||||
### int ScanMultipleCandidatesEfficiencyAllYearsAllSamples()
|
||||
|
||||
Calls [ScanBDTEfficiencyAllYears()](#int-scanbdtefficiencyallyears) for all samples.
|
||||
* **Parameters**
|
||||
* bool weighted
|
||||
* bool IncludeMultipleEff
|
||||
@ -91,7 +130,7 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
* 1 if everything is fine, 0 if something fails
|
||||
|
||||
### int ScanBDTEfficiencyAllSig ()
|
||||
|
||||
Calls [ScanBDTEfficiency()](#int-scanbdtefficiency) using signal MC for all years or Run(s).
|
||||
* **Parameters**
|
||||
* int Run
|
||||
* Double_t BDTstep
|
||||
@ -102,7 +141,7 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
* 1 if everything is fine, 0 if something fails
|
||||
|
||||
### int ScanBDTEfficiencyAllPHSP()
|
||||
|
||||
Calls [ScanBDTEfficiency()](#int-scanbdtefficiency) using PHSP MC for all years or Run(s).
|
||||
* **Parameters**
|
||||
* int Run
|
||||
* Double_t BDTstep
|
||||
@ -113,7 +152,7 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
* 1 if everything is fine, 0 if something fails
|
||||
|
||||
### int ScanBDTEfficiencyAllRef ()
|
||||
|
||||
Calls [ScanBDTEfficiency()](#int-scanbdtefficiency) using reference MC for all years or Run(s).
|
||||
* **Parameters**
|
||||
* int Run
|
||||
* Double_t BDTstep
|
||||
@ -125,13 +164,12 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
|
||||
### int ScanBDTEfficiencyAll()
|
||||
|
||||
* **Parameters**
|
||||
*
|
||||
Calls [ScanBDTEfficiencyAllSig()](#int-scanbdtefficiencyallsig), [ScanBDTEfficiencyAllPHSP()](#int-scanbdtefficiencyallphsp), and [ScanBDTEfficiencyAllRef()](#int-scanbdtefficiencyallref), for Run 1 and 2.
|
||||
* **Return**
|
||||
* 1 if everything is fine, 0 if something fails
|
||||
|
||||
### int plotBDTEfficiency()
|
||||
|
||||
Calculates the MVA efficiency for given MVA response in bins of `sExtraVar`. For the details how to define `sExtraVar` see the [TM efficiency class definition](https://git.physi.uni-heidelberg.de/kopecna/EWP-BplusToKstMuMu-AngAna/wiki/MassFit.cpp#tmefficiencyclass).
|
||||
* **Parameters**
|
||||
* string year
|
||||
* int Run
|
||||
@ -146,7 +184,7 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
* 1 if everything is fine, 0 if something fails
|
||||
|
||||
### int plotBDTEffciencyInAngles()
|
||||
|
||||
Calls [plotBDTEfficiency()](#int-plotbdtefficiency) for Q2, theta_k, theta_l and phi.
|
||||
* **Parameters**
|
||||
* string year
|
||||
* int Run
|
||||
@ -155,6 +193,7 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
|
||||
## Selection efficiency
|
||||
|
||||
|
||||
### TGraphErrors \*getSelectionEffTGraph()
|
||||
|
||||
* **Parameters**
|
||||
@ -167,6 +206,7 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
* string customTMbrach
|
||||
* bool gammaTM
|
||||
* **Return**
|
||||
* A TGraph filled with the selection efficiency per year for the given sample.
|
||||
|
||||
### TGraphErrors \*getSelectionEffTGraph()
|
||||
|
||||
@ -183,9 +223,10 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
* bool weighted
|
||||
* string sExtraVar
|
||||
* **Return**
|
||||
* A TGraph filled with the selection efficiency in bins of [sExtraVar](https://git.physi.uni-heidelberg.de/kopecna/EWP-BplusToKstMuMu-AngAna/wiki/MassFit.cpp#tmefficiencyclass) for the given sample.
|
||||
|
||||
### int plotSelectionEfficiency()
|
||||
|
||||
Calls [getSelectionEffTGraph()](#tgrapherrors-getselectionefftgraph), makes the TGraph pretty and saves the plot.
|
||||
* **Parameters**
|
||||
* bool full
|
||||
* string year
|
||||
@ -201,7 +242,7 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
* 1 if everything is fine, 0 if something fails
|
||||
|
||||
### int plotSelectionEfficiencyAllYearsAll()
|
||||
|
||||
Calls [plotSelectionEfficiency()](#int-plotselectionefficiency) for the resonant and rare sample, plots them together and saves the plot.
|
||||
* **Parameters**
|
||||
* bool full
|
||||
* bool RemoveMultiple
|
||||
@ -211,21 +252,8 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
* **Return**
|
||||
* 1 if everything is fine, 0 if something fails
|
||||
|
||||
### // TGraphErrors \*effGraphPHSP = getSelectionEffTGraph()
|
||||
|
||||
* **Parameters**
|
||||
* full
|
||||
* false
|
||||
* true
|
||||
* KshortDecaysInVelo
|
||||
* RemoveMultiple
|
||||
* weighted
|
||||
* customTMbrach
|
||||
* gammaTM);
|
||||
* **Return**
|
||||
|
||||
### int plotSelectionEfficiencyAll()
|
||||
|
||||
Calls [plotSelectionEfficiency()](#int-plotselectionefficiency-1) for all years and Run 1 and Run 2
|
||||
* **Parameters**
|
||||
* bool full
|
||||
* bool UseOnlyMuMuEvents
|
||||
@ -238,12 +266,13 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
|
||||
### int plotSelectionEfficiencyAll()
|
||||
|
||||
Calls [plotSelectionEfficiencyAll()](#int-plotselectionefficiencyall) in Q2,
|
||||
* **Parameters**
|
||||
* bool full
|
||||
* **Return**
|
||||
* 1 if everything is fine, 0 if something fails
|
||||
|
||||
## Truth matching efficiency
|
||||
## Truth matching efficiency from counting
|
||||
|
||||
### TGraphErrors \*getTMeffTGraph()
|
||||
|
||||
@ -256,8 +285,10 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
* string customTMbrach
|
||||
* bool gammaTM
|
||||
* **Return**
|
||||
* A TGraph filled with the truth matching efficiency per year for the given sample.
|
||||
|
||||
### int plotTruthMatchingEfficiencyAllYearsAll()
|
||||
Plots the truth matching efficiency for the resonant and rare sample, plots them together and saves the plot.
|
||||
|
||||
* **Parameters**
|
||||
* bool RemoveMultiple
|
||||
@ -268,12 +299,15 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
* 1 if everything is fine, 0 if something fails
|
||||
|
||||
### int plotTruthMatchingEfficiencyAllYearsAll()
|
||||
|
||||
Calls [plotTruthMatchingEfficiencyAllYearsAll()](#int-plottruthmatchingefficiencyallyearsall) with/out removing multiple candidates and with/out weighting.
|
||||
* **Parameters**
|
||||
* bool gammaTM
|
||||
* string customTMbranch
|
||||
* **Return**
|
||||
* 1 if everything is fine, 0 if something fails
|
||||
* 1 if everything is fine, 0 if something fails
|
||||
|
||||
## Truth matching efficiency from B+ mass fit
|
||||
|
||||
|
||||
### TGraphErrors \*getTMeffTGraph()
|
||||
|
||||
@ -288,8 +322,10 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
* bool weighted
|
||||
* string sExtraVar
|
||||
* **Return**
|
||||
* A TGraph filled with the truth matching efficiency per year for the given sample.
|
||||
|
||||
### int plotTruthMatchingEfficiency()
|
||||
Calls [getTMeffTGraph()](#tgrapherrors-gettmefftgraph-1) in bins of `sExtraVar`, makes the TGraph pretty and saves the plot.
|
||||
|
||||
* **Parameters**
|
||||
* string year
|
||||
@ -298,14 +334,13 @@ Calls [getAllL0MuonEfficiencies()](#int-getalll0muonefficiencies) for all years.
|
||||
* bool PHSP
|
||||
* string sExtraVar
|
||||
* string customTMbranch
|
||||
* bool gammaTM //TODO sigEff
|
||||
* bool gammaTM
|
||||
* **Return**
|
||||
* 1 if everything is fine, 0 if something fails
|
||||
|
||||
## Running everything
|
||||
|
||||
### int runAllEff()
|
||||
|
||||
* **Parameters**
|
||||
*
|
||||
Calls [plotSelectionEfficiencyAllYearsAll()](#int-plotselectionefficiencyallyearsall), [plotSelectionEfficiencyAll](#int-plotselectionefficiencyall), [plotSelectionEfficiencyAll](#int-plotselectionefficiencyall) and [ScanBDTEfficiencyAll](#int-scanbdtefficiencyall)
|
||||
* **Return**
|
||||
* Always 1
|
||||
|
Loading…
Reference in New Issue
Block a user