YCrossFit 1.0
A C++/ROOT Library for the analysis of the differential cross section of the Y(1S,2S,3S) resonances in two muons
|
Function for fitting the data and displying the canvas. More...
#include "RooRealVar.h"
#include "RooGaussian.h"
#include "RooPolynomial.h"
#include "RooBreitWigner.h"
#include "RooAddPdf.h"
#include "RooAbsPdf.h"
#include "TCanvas.h"
#include "TAxis.h"
#include "RooPlot.h"
#include "TH1.h"
#include "RooGenericPdf.h"
#include "RooFitResult.h"
#include "RooDataHist.h"
#include "RooHist.h"
#include "TRootCanvas.h"
#include "TApplication.h"
#include "TLatex.h"
#include "SpectrumPlot.h"
#include "TStyle.h"
#include "TString.h"
#include <string.h>
#include <filesystem>
#include "TROOT.h"
Go to the source code of this file.
Functions | |
TString | formatPtString (float pmr=std::nanf("1"), float pMr=std::nanf("1")) |
Formatting the string to be displayed on the canvas regarding the cuts made on pt. More... | |
TString | formatYString (float ymr=std::nanf("1"), float yMr=std::nanf("1")) |
Formatting the string to be displayed on the canvas regarding the cuts made on y. More... | |
RooFitResult * | fitRoo (TH1 *hh, int mr=0, int fr=0, float pmr=std::nanf("1"), float pMr=std::nanf("1"), float ymr=std::nanf("1"), float yMr=std::nanf("1"), std::string fnr="YResonancesFit", int vr=0, int cr=0) |
Implementation of the fit function. More... | |
Function for fitting the data and displying the canvas.
RooFitResult * fitRoo | ( | TH1 * | hh, |
int | mr = 0 , |
||
int | fr = 0 , |
||
float | pmr = std::nanf("1") , |
||
float | pMr = std::nanf("1") , |
||
float | ymr = std::nanf("1") , |
||
float | yMr = std::nanf("1") , |
||
std::string | fnr = "YResonancesFit" , |
||
int | vr = 0 , |
||
int | cr = 0 |
||
) |
Implementation of the fit function.
Define a model function as sum of a quadratic background and three peak signals that can be chosen between breit wigner, gaussian, or t-student. Fit the histogram in input with the model function and print the result on the terminal. The data, the fitted model and its components are drawn on the canvas. On the canvas are also printed the cuts on tranverse momentum and rapidity, and the luminosity and CM energy as well. The result is saved in a pdf file with the name defined by parameter nfr. If the mode is set to "fit" an application with the canvas is displayed.
hh | histogram to be fitted |
fr | reference of fitFunction defined in main |
pmr | recerence of ptm (minimum pt) defined in main |
pMr | recerence of ptM (maximum pt) defined in main |
ymr | recerence of ym (minimum rapidity) defined in main |
yMr | recerence of yM (maximum rapidity) defined in main |
nfr | recerence of nameFile defined in main |
vr | reference of varaible verbose defined in main |
cr | canvas flag: if on, do not display application |
TString formatPtString | ( | float | pmr = std::nanf("1") , |
float | pMr = std::nanf("1") |
||
) |
Formatting the string to be displayed on the canvas regarding the cuts made on pt.
If there are no custom cut, the default ones are printed.
pmr | recerence of ptm (minimum pt) defined in main |
pMr | recerence of ptM (maximum pt) defined in main |
TString formatYString | ( | float | ymr = std::nanf("1") , |
float | yMr = std::nanf("1") |
||
) |
Formatting the string to be displayed on the canvas regarding the cuts made on y.
If there are no custom cut, the default ones are printed.
ymr | recerence of ym (minimum rapidity) defined in main |
yMr | recerence of yM (maximum rapidity) defined in main |