Update 'nTrackWeights.cpp'

Renata Kopecná 2022-01-30 20:02:23 +01:00
parent 1926404c14
commit f2abf20751

@ -1,4 +1,25 @@
In this file, the sWeghts for data and MC are calculated and saved. The variables used to create weights are defined in [[GlobalFunctions.hh|GlobalFunctions.hh]] as `firstMCweight` and `secondMCweight`. The number of bins in the histograms, their names and range are also defined there. The main function that performs the weighting is [NtrackWeight()](#int-nstrackweight)
In this file, the sWeghts for data and MC are calculated and saved. The variables used to create weights are defined in [[GlobalFunctions.hh|GlobalFunctions.hh]] as `firstMCweight` and `secondMCweight`. The number of bins in the histograms, their names and range are also defined there. The main function that performs the weighting is [NtrackWeight()](#int-nstrackweight). The weighting is called in [WeightYear()](#int-weightyear).
## Table of Contents
* [Functions and their parameters:](#functions-and-their-parameters)
* [TH1D *get_hist_MC_w()](#th1d-get_hist_mc_w)
* [TH1D *get_hist()](#th1d-get_hist)
* [void getWeightHist()](#void-getweighthist)
* [void fillWeightHist()](#void-fillweighthist)
* [double getDelta_w2D()](#double-getdelta_w2d)
* [int quickFitAll()](#int-quickfitall)
* [int NtrackWeight()](#int-ntrackweight)
* [int NtrackWeightAllKplus()](#int-ntrackweightallkplus)
* [int WeightYear()](#int-weightyear)
* [int WeightAll()](#int-weightall)
* [int ReweightMCOnly()](#int-reweightmconly)
* [int ReweightSignalMC()](#int-reweightsignalmc)
* [int ReweightPHSPMC()](#int-reweightphspmc)
* [int ReweightReferenceMC()](#int-reweightreferencemc)
* [int ReweightAllMC()](#int-reweightallmc)
* [int ReweightAll()](#int-reweightall)
* [int GetSignalAndBckgndEstimation()](#int-getsignalandbckgndestimation)
# Functions and their parameters:
@ -62,7 +83,7 @@ Creates sWeights in data. Takes the model and performes B mass fit (see [[B mass
* 0 if something fails, otherwise 1.
### int NtrackWeight()
Calculates and saves weights in the MC samples. User can deside whether to use weights only from a multiplicity variable or also use the second weighting variables.
Calculates and saves weights in the MC samples. User can deside whether to use weights only from a multiplicity variable or also use the second weighting variables. It loads the first (and second) weighting variables into a histogram, calls [fillWeightHist()](#void-fillweighthist), fills new branches with the weights into new tuple which is saved.
* **Parameters**
* string year = "2011"
* const bool ReferenceChannel = false
@ -74,32 +95,36 @@ Calculates and saves weights in the MC samples. User can deside whether to use w
* 0 if something fails, otherwise 1.
### int NtrackWeightAllKplus()
Calls [NtrackWeight()](#int-ntrackweight) for all years.
* **Parameters**
* const bool ReferenceChannel = false
* bool PHSP = false
* bool ReweightInBplusPT = true
* **Return**
* 0 if something fails, otherwise 1.
*
### int WeightYear()
Performs [quickFitAll()](#int-quickfitall) and [NtrackWeight()](#int-ntrackweight) for given year.
* **Parameters**
* string year = "2011"
* bool WeightBplusPT = true
* bool GetShapeFromMC = true
* bool sWeight = true
* **Return**
* 0 if something fails, otherwise 1.
### int WeightAll()
Calls [WeightYear()](#int-weightyear) for all years in the given run.
* **Parameters**
* bool WeightBplusPT = true
* Int_t Run = 1
* bool sWeight = true
* **Return**
* 0 if something fails, otherwise 1.
### int ReweightMCOnly()
Calls [NtrackWeight()](#int-ntrackweight) for given MC sample.
* **Parameters**
* string year = "2011"
* bool ReferenceChannel = false
@ -107,50 +132,57 @@ Calculates and saves weights in the MC samples. User can deside whether to use w
* bool WeightBplusPT = true
* bool sWeight = true
* **Return**
* 0 if something fails, otherwise 1.
### int ReweightSignalMC()
Calls [ReweightMCOnly()](#int-reweightmconly) for signal MC.
* **Parameters**
* bool WeightBplusPT = true
* Int_t Run = 1
* bool sWeight = true
* **Return**
* 0 if something fails, otherwise 1.
### int ReweightPHSPMC()
Calls [ReweightMCOnly()](#int-reweightmconly) for PHSP MC.
* **Parameters**
* bool WeightBplusPT = true
* Int_t Run = 1
* bool sWeight = true
* **Return**
* 0 if something fails, otherwise 1.
*
### int ReweightReferenceMC()
Calls [ReweightMCOnly()](#int-reweightmconly) for reference MC.
* **Parameters**
* bool WeightBplusPT = true
* Int_t Run = 1
* bool sWeight = true
* **Return**
* 0 if something fails, otherwise 1.
### int ReweightAllMC()
Performs weighting of signal MC, PHSP MC and reference MC.
* **Parameters**
* bool WeightBplusPT = true
* Int_t Run = 1
* bool sWeight = true
* **Return**
* 0 if something fails, otherwise 1.
### int ReweightAll()
Calls [WeightAll()](#int-weightall) [ReweightAllMC()](#int-reweightallmc) for the given run.
* **Parameters**
* bool WeightBplusPT = true
* Int_t Run = 1
* bool sWeight = true
* bool sWeig
* 0 if something fails, otherwise 1.ht = true
* **Return**
### int GetSignalAndBckgndEstimation()
Obsolete function that used to be used to get the signal nad background estimation.
* **Parameters**
* bool KshortDecaysInVelo = true
* Int_t Run = 1 //assumes S = N - B
* **Return**
* 0 if something fails, otherwise 1.