Table of Contents
- Classes
- Functions and their parameters:
- void YieldInfo::addYield()
- double GetBackgroundFromSidebandFit()
- double GetMVAefficiency()
- double GetSelectionEfficiency()
- string GetBackgroundFunction()
- YieldInfo GetSigAndBkgEstimation()
- YieldInfo GetSigAndBkgEstimationFromData()
- int SaveTGraphs()
- int ScanSignalAndBckgndEstimation()
- int ScanSignalAndBckgndEstimationPerYear()
- int ScanSignalAndBckgndEstimationAllYears()
- int ScanSignalAndBckgndEstimationSimple()
- int ScanSignalAndBckgndEstimationSimplePerYear()
- int ScanSignalAndBckgndEstimationSimpleAllYears()
- double getMaxBDTresponse()
- int optimizeBDTCut()
Table of Contents
- Global variables
- Classes
- Functions and their parameters:
- void YieldInfo::addYield()
- double GetBackgroundFromSidebandFit()
- double GetMVAefficiency()
- double GetSelectionEfficiency()
- string GetBackgroundFunction()
- YieldInfo GetSigAndBkgEstimation()
- YieldInfo GetSigAndBkgEstimationFromData()
- int SaveTGraphs()
- int ScanSignalAndBckgndEstimation()
- int ScanSignalAndBckgndEstimationPerYear()
- int ScanSignalAndBckgndEstimationAllYears()
- int ScanSignalAndBckgndEstimationSimple()
- int ScanSignalAndBckgndEstimationSimplePerYear()
- int ScanSignalAndBckgndEstimationSimpleAllYears()
- double getMaxBDTresponse()
- int optimizeBDTCut()
Global variables
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?)
Classes
YieldInfo
- Public members:
- string year (what year, default = "")
- double sigYield (rare signal yield, default = 0)
- double sigYieldErr (rare signal yield, default = 0)
- double refYield (reference yield, default = 0)
- double refYieldErr (rare yield, default = 0)
- double bkgYield (rare background yield, default = 0)
- double bkgYieldErr (rare background yield, default = 0)
- double sigEff (rare signal efficiency, default = 0)
- double refEff (reference efficiency, default = 0)
- double allSigEvts (number of rare events (sig+bkg), default = 0)
- Functions:
- YieldInfo() //default constructor, sets everything to 0
- void addYield(YieldInfo addInfo) //Adds up yields
- ~YieldInfo() //destuctor
Functions and their parameters:
void YieldInfo::addYield()
Takes the addInfo
and adds up the yields. Aka bkgYield = self.bkgYield + addInfo.bkgYield
. For now, also the efficiencies are add together even though it doesn't make much sense. Or any sense.
- Parameters
- YieldInfo addInfo
double GetBackgroundFromSidebandFit()
Fits the upper mass sideband (defined by range
) with an exponential, creates the plot of the fit and returns the background yield.
- Parameters
- TChain *Tree
- double range
- string cut
- string path
- Return
- Background yield (exponential fit to upper mass sideband)
double GetMVAefficiency()
- Parameters
- string year
- int Run
- bool KshortDecaysInVelo
- bool UseLowQ2Range
- bool IncludeMultipleEff
- bool sig
- double TMVAcut
- Return
- The MVA efficiency for given TMVA cut read from efficiency file created by Efficiency.cpp
double GetSelectionEfficiency()
- Parameters
- string year
- int Run
- bool KshortDecaysInVelo
- bool UseLowQ2Range
- bool RemoveMultiple
- bool sig
- Return
- The selection efficiency for given TMVA cut read from efficiency file created by 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 = 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 reference and signal yields directly from the fit.
- Parameters
- string year = "2011"
- int Run = 0
- int randomSubset = 0
- bool KshortDecaysInVelo = false
- bool UseLowQ2Range = false
- Double_t TMVAcut = -1.0
- 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() to plot and save the signal and background yields, the significance and the total amount of events.
- Parameters
- string path
- bool fineScan
- string year
- int Run
- string basicPath
- TGraphErrors *yieldGraph
- TGraphErrors *bkgGraph
- TGraphErrors *bkgGraphFromAllEvts
- TGraphErrors *refYieldGraph
- TGraphErrors *allEvtsInSig
- TGraphErrors *significance
- TGraphErrors *significanceFromAllEvts
- Return
- Always 1
int ScanSignalAndBckgndEstimation()
comment: # (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 (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() 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
- int Run
- Double_t BDTstep
- bool KshortDecaysInVelo
- bool UseLowQ2Range
- 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()
Calls ScanSignalAndBckgndEstimation() for the given year.
- Parameters
- string year = "2011"
- Double_t BDTstep = 0.01
- bool KshortDecaysInVelo = true
- bool UseLowQ2Range = false
- bool scan = false
- bool fineScan = false
- Return
- Always 1
int ScanSignalAndBckgndEstimationAllYears()
Calls ScanSignalAndBckgndEstimationPerYear() for all years.
- Parameters
- Double_t BDTstep = 0.01
- bool KshortDecaysInVelo = true
- bool UseLowQ2Range = false
- bool scan = false
- bool fineScan = true
- Return
- Always 1
int ScanSignalAndBckgndEstimationSimple()
comment: # (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 (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(), are saved as TGraphs.
- Parameters
- string year = "2011"
- int Run = 1
- Double_t BDTstep = 0.01
- int randomSubset = 0
- bool KshortDecaysInVelo = true
- bool UseLowQ2Range = false
- bool scan = false
- bool fineScan = true
- Return
- Always 1
int ScanSignalAndBckgndEstimationSimplePerYear()
comment: # (ScanSignalAndBckgndEstimationSimplePerYear()) Calls ScanSignalAndBckgndEstimationSimple() for given year.
- Parameters
- string year = "2011"
- Double_t BDTstep = 0.01
- int randomSubset = 0
- bool KshortDecaysInVelo = true
- bool UseLowQ2Range = false
- bool scan = false
- bool fineScan = true
- Return
- Always 1
int ScanSignalAndBckgndEstimationSimpleAllYears()
comment: # (ScanSignalAndBckgndEstimationSimpleAllYears()) Calls ScanSignalAndBckgndEstimationSimplePerYear() for all years.
- Parameters
- Double_t BDTstep = 0.01
- int randomSubset = 0
- bool KshortDecaysInVelo = true
- bool UseLowQ2Range = false
- bool scan = false
- bool fineScan = true
- Return
- Always 1
double getMaxBDTresponse()
comment: # (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
- bool fineScan = false
- bool directScan = false
- int randomSubset = 0
- bool KshortDecaysInVelo = true
- bool UseLowQ2Range = false
- Return
- 1 if everything is okay, 0 if something fails
int optimizeBDTCut()
comment: # (optimizeBDTCut()) Calls ScanSignalAndBckgndEstimation() for the given year OR run and then get the MVA response corresponding to maximal significance by calling getMaxBDTresponse()).
- Parameters
- string year = "2011"
- int Run = 0
- bool KshortDecaysInVelo = true
- Double_t BDTstep = 0.01
- bool UseRandomSubset = false
- bool UseLowQ2Range = false
- bool scan = false
- bool fineScan = false
- bool directScan = false
- Return
- MVA response corresponding to maximal significance