From 1926404c14c01836e24e8fe295fbfe370f017b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Renata=20Kopecn=C3=A1?= Date: Sun, 30 Jan 2022 18:28:09 +0100 Subject: [PATCH] Update 'nTrackWeights.cpp' --- nTrackWeights.md => nTrackWeights.cpp.md | 32 +++++++++++------------- 1 file changed, 15 insertions(+), 17 deletions(-) rename nTrackWeights.md => nTrackWeights.cpp.md (64%) diff --git a/nTrackWeights.md b/nTrackWeights.cpp.md similarity index 64% rename from nTrackWeights.md rename to nTrackWeights.cpp.md index 701a8d6..c2c7b15 100644 --- a/nTrackWeights.md +++ b/nTrackWeights.cpp.md @@ -1,29 +1,27 @@ - - -## Global variables: - - +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) # Functions and their parameters: ### TH1D \*get_hist_MC_w() - +Clones the `*hist` and sets the name of the histogram. * **Parameters** * TH1D \*hist * string name * bool is2D * **Return** - + * An initialised histogram for MC weights. + * ### TH1D \*get_hist() - +Makes a new histogram used for the weights. * **Parameters** * string name - * bool is2D + * bool is2D (Use one or two variables to get the weights?) * bool isMC * **Return** + * An initilized histogram for the weights. ### void getWeightHist() - +Reads the weight from the tree, fills them into a histogram which is normalised and inverted. * **Parameters** * TChain \*tree * string weightName @@ -32,29 +30,27 @@ * string TMmethod * bool KshortDecayInVelo * bool gammaTM -* **Return** ### 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** * double &w * double &delta_w * int bin * bool TM * TH1D \*h_w -* **Return** ### double getDelta_w2D() - * **Parameters** * double w * double delta_w * double w2D * double delta_w2D * **Return** - + Adds toghether the errors of first and second weight + ### int quickFitAll() - +Creates sWeights in data. Takes the model and performes B mass fit (see [[B mass model|B mass model]] for details). * **Parameters** * string SignalShape = "OneCB" * string BckShape = "SingleExponential" @@ -63,9 +59,10 @@ * bool ConstrainParameters = true * int Run = 1 * **Return** + * 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. * **Parameters** * string year = "2011" * const bool ReferenceChannel = false @@ -74,6 +71,7 @@ * bool KshortDecayInVelo = true * bool sWeightUse = true * **Return** + * 0 if something fails, otherwise 1. ### int NtrackWeightAllKplus()