Update 'nTrackWeights.cpp'
parent
fa2927652f
commit
1926404c14
@ -1,29 +1,27 @@
|
|||||||
|
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)
|
||||||
|
|
||||||
## Global variables:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Functions and their parameters:
|
# Functions and their parameters:
|
||||||
### TH1D \*get_hist_MC_w()
|
### TH1D \*get_hist_MC_w()
|
||||||
|
Clones the `*hist` and sets the name of the histogram.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* TH1D \*hist
|
* TH1D \*hist
|
||||||
* string name
|
* string name
|
||||||
* bool is2D
|
* bool is2D
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* An initialised histogram for MC weights.
|
||||||
|
*
|
||||||
### TH1D \*get_hist()
|
### TH1D \*get_hist()
|
||||||
|
Makes a new histogram used for the weights.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* string name
|
* string name
|
||||||
* bool is2D
|
* bool is2D (Use one or two variables to get the weights?)
|
||||||
* bool isMC
|
* bool isMC
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* An initilized histogram for the weights.
|
||||||
|
|
||||||
### void getWeightHist()
|
### void getWeightHist()
|
||||||
|
Reads the weight from the tree, fills them into a histogram which is normalised and inverted.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* TChain \*tree
|
* TChain \*tree
|
||||||
* string weightName
|
* string weightName
|
||||||
@ -32,29 +30,27 @@
|
|||||||
* string TMmethod
|
* string TMmethod
|
||||||
* bool KshortDecayInVelo
|
* bool KshortDecayInVelo
|
||||||
* bool gammaTM
|
* bool gammaTM
|
||||||
* **Return**
|
|
||||||
|
|
||||||
### void fillWeightHist()
|
### void fillWeightHist()
|
||||||
|
Takes the histogram `h_w` and loads the bin content into `w` and the error into `delta_w`. If TM is true, those will be set into 1 and -1, respectively.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* double &w
|
* double &w
|
||||||
* double &delta_w
|
* double &delta_w
|
||||||
* int bin
|
* int bin
|
||||||
* bool TM
|
* bool TM
|
||||||
* TH1D \*h_w
|
* TH1D \*h_w
|
||||||
* **Return**
|
|
||||||
|
|
||||||
### double getDelta_w2D()
|
### double getDelta_w2D()
|
||||||
|
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* double w
|
* double w
|
||||||
* double delta_w
|
* double delta_w
|
||||||
* double w2D
|
* double w2D
|
||||||
* double delta_w2D
|
* double delta_w2D
|
||||||
* **Return**
|
* **Return**
|
||||||
|
Adds toghether the errors of first and second weight
|
||||||
|
|
||||||
### int quickFitAll()
|
### int quickFitAll()
|
||||||
|
Creates sWeights in data. Takes the model and performes B mass fit (see [[B mass model|B mass model]] for details).
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* string SignalShape = "OneCB"
|
* string SignalShape = "OneCB"
|
||||||
* string BckShape = "SingleExponential"
|
* string BckShape = "SingleExponential"
|
||||||
@ -63,9 +59,10 @@
|
|||||||
* bool ConstrainParameters = true
|
* bool ConstrainParameters = true
|
||||||
* int Run = 1
|
* int Run = 1
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* 0 if something fails, otherwise 1.
|
||||||
|
|
||||||
### int NtrackWeight()
|
### 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.
|
||||||
* **Parameters**
|
* **Parameters**
|
||||||
* string year = "2011"
|
* string year = "2011"
|
||||||
* const bool ReferenceChannel = false
|
* const bool ReferenceChannel = false
|
||||||
@ -74,6 +71,7 @@
|
|||||||
* bool KshortDecayInVelo = true
|
* bool KshortDecayInVelo = true
|
||||||
* bool sWeightUse = true
|
* bool sWeightUse = true
|
||||||
* **Return**
|
* **Return**
|
||||||
|
* 0 if something fails, otherwise 1.
|
||||||
|
|
||||||
### int NtrackWeightAllKplus()
|
### int NtrackWeightAllKplus()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user