Table of Contents
- Functions and their parameters:
- TH1D *get_hist_MC_w()
- TH1D *get_hist()
- void getWeightHist()
- void fillWeightHist()
- double getDelta_w2D()
- int quickFitAll()
- int NtrackWeight()
- int NtrackWeightAllKplus()
- int WeightYear()
- int WeightAll()
- int ReweightMCOnly()
- int ReweightSignalMC()
- int ReweightPHSPMC()
- int ReweightReferenceMC()
- int ReweightAllMC()
- int ReweightAll()
- int GetSignalAndBckgndEstimation()
In this file, the sWeghts for data and MC are calculated and saved. The variables used to create weights are defined in 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(). The weighting is called in WeightYear().
Table of Contents
- Functions and their parameters:
- TH1D *get_hist_MC_w()
- TH1D *get_hist()
- void getWeightHist()
- void fillWeightHist()
- double getDelta_w2D()
- int quickFitAll()
- int NtrackWeight()
- int NtrackWeightAllKplus()
- int WeightYear()
- int WeightAll()
- int ReweightMCOnly()
- int ReweightSignalMC()
- int ReweightPHSPMC()
- int ReweightReferenceMC()
- int ReweightAllMC()
- int ReweightAll()
- int GetSignalAndBckgndEstimation()
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 (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
- TH1D *hist
- TH1D *hist_w
- string TMmethod
- bool KshortDecayInVelo
- bool gammaTM
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
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 for details).
- Parameters
- string SignalShape = "OneCB"
- string BckShape = "SingleExponential"
- bool sWeight=true
- bool GetShapeFromMC = true
- 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. It loads the first (and second) weighting variables into a histogram, calls fillWeightHist(), fills new branches with the weights into new tuple which is saved.
- Parameters
- string year = "2011"
- const bool ReferenceChannel = false
- bool PHSP = false
- bool ReweightInBplusPT = true
- bool KshortDecayInVelo = true
- bool sWeightUse = true
- Return
- 0 if something fails, otherwise 1.
int NtrackWeightAllKplus()
Calls 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() and 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() 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() for given MC sample.
- Parameters
- string year = "2011"
- bool ReferenceChannel = false
- bool PHSP = false
- bool WeightBplusPT = true
- bool sWeight = true
- Return
- 0 if something fails, otherwise 1.
int ReweightSignalMC()
Calls 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() 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() 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() ReweightAllMC() for the given run.
- Parameters
- bool WeightBplusPT = true
- Int_t Run = 1
- 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.