1 #ifndef Alignment_OfflineValidation_FitWithRooFit_h 2 #define Alignment_OfflineValidation_FitWithRooFit_h 5 #include "RooGlobalFunc.h" 11 #include "RooRealVar.h" 12 #include "RooDataSet.h" 13 #include "RooGaussian.h" 14 #include "RooVoigtian.h" 15 #include "RooExponential.h" 17 #include "RooDataHist.h" 18 #include "RooAddPdf.h" 19 #include "RooChebychev.h" 20 #include "RooGenericPdf.h" 21 #include "RooGaussModel.h" 22 #include "RooAddModel.h" 23 #include "RooPolynomial.h" 24 #include "RooCBShape.h" 25 #include "RooMinimizer.h" 26 #include "RooBreitWigner.h" 27 #include "RooFFTConvPdf.h" 48 typedef std::pair<RooRealVar, RooDataHist*> rooPair;
79 rooPair
importTH1(TH1*
histo,
const double& inputXmin,
const double& inputXmax);
82 const TString signalType,
83 const TString backgroundType,
84 const double&
xMin = 0.,
85 const double&
xMax = 0.,
86 bool sumW2Error =
false);
91 const TString&
name =
"mean",
92 const TString&
title =
"mean");
97 const TString&
name =
"mean2",
98 const TString&
title =
"mean2");
103 const TString&
name =
"mean3",
104 const TString&
title =
"mean3");
109 const TString&
name =
"sigma",
110 const TString&
title =
"sigma");
115 const TString&
name =
"sigma2",
116 const TString&
title =
"sigma2");
121 const TString&
name =
"sigma3",
122 const TString&
title =
"sigma3");
127 const TString&
name =
"gamma",
128 const TString&
title =
"gamma");
133 const TString&
name =
"GaussFrac",
134 const TString&
title =
"GaussFrac");
139 const TString&
name =
"GaussFrac2",
140 const TString&
title =
"GaussFrac2");
145 const TString&
name =
"expCoeffa0",
146 const TString&
title =
"expCoeffa0");
151 const TString&
name =
"expCoeffa1",
152 const TString&
title =
"expCoeffa1");
157 const TString&
name =
"expCoeffa2",
158 const TString&
title =
"expCoeffa2");
163 const TString&
name =
"fsig",
164 const TString&
title =
"signal fraction");
169 const TString&
name =
"a0",
170 const TString&
title =
"a0");
175 const TString&
name =
"a1",
176 const TString&
title =
"a1");
181 const TString&
name =
"a2",
182 const TString&
title =
"a2");
187 const TString&
name =
"a3",
188 const TString&
title =
"a3");
193 const TString&
name =
"a4",
194 const TString&
title =
"a4");
199 const TString&
name =
"a5",
200 const TString&
title =
"a5");
205 const TString&
name =
"a6",
206 const TString&
title =
"a6");
211 const TString&
name =
"alpha",
212 const TString&
title =
"alpha");
215 const double&
value,
const double&
min,
const double&
max,
const TString&
name =
"n",
const TString&
title =
"n");
220 const TString&
name =
"fGCB",
221 const TString&
title =
"fGCB");
236 inline RooRealVar*
a0() {
return a0_; }
237 inline RooRealVar*
a1() {
return a1_; }
238 inline RooRealVar*
a2() {
return a2_; }
239 inline RooRealVar*
a3() {
return a3_; }
240 inline RooRealVar*
a4() {
return a4_; }
241 inline RooRealVar*
a5() {
return a5_; }
242 inline RooRealVar*
a6() {
return a6_; }
244 inline RooRealVar*
n() {
return n_; }
251 RooAbsPdf*
buildModel(RooRealVar*
x,
const TString& signalType,
const TString& backgroundType);
void initGaussFrac2(const double &value, const double &min, const double &max, const TString &name="GaussFrac2", const TString &title="GaussFrac2")
void initGaussFrac(const double &value, const double &min, const double &max, const TString &name="GaussFrac", const TString &title="GaussFrac")
void initA6(const double &value, const double &min, const double &max, const TString &name="a6", const TString &title="a6")
double initVal_expCoeffa0
void initA1(const double &value, const double &min, const double &max, const TString &name="a1", const TString &title="a1")
void initFsig(const double &value, const double &min, const double &max, const TString &name="fsig", const TString &title="signal fraction")
RooRealVar * expCoeffa0()
void fit(TH1 *histo, const TString signalType, const TString backgroundType, const double &xMin=0., const double &xMax=0., bool sumW2Error=false)
RooAbsPdf * buildModel(RooRealVar *x, const TString &signalType, const TString &backgroundType)
Build the model to fit.
RooAbsPdf * buildSignalModel(RooRealVar *x, const TString &signalType)
Build the model for the specified signal type.
void initGamma(const double &value, const double &min, const double &max, const TString &name="gamma", const TString &title="gamma")
void initA3(const double &value, const double &min, const double &max, const TString &name="a3", const TString &title="a3")
double initVal_expCoeffa1
double initVal_gaussFrac2
void reinitializeParameters()
RooRealVar * gaussFrac2()
void initMean3(const double &value, const double &min, const double &max, const TString &name="mean3", const TString &title="mean3")
void initA4(const double &value, const double &min, const double &max, const TString &name="a4", const TString &title="a4")
RooRealVar * expCoeffa1()
void initMean(const double &value, const double &min, const double &max, const TString &name="mean", const TString &title="mean")
RooAbsPdf * buildBackgroundModel(RooRealVar *x, const TString &backgroundType)
Build the model for the specified background type.
void initN(const double &value, const double &min, const double &max, const TString &name="n", const TString &title="n")
double initVal_expCoeffa2
rooPair importTH1(TH1 *histo, const double &inputXmin, const double &inputXmax)
void initA0(const double &value, const double &min, const double &max, const TString &name="a0", const TString &title="a0")
void initAlpha(const double &value, const double &min, const double &max, const TString &name="alpha", const TString &title="alpha")
void initSigma3(const double &value, const double &min, const double &max, const TString &name="sigma3", const TString &title="sigma3")
void initA5(const double &value, const double &min, const double &max, const TString &name="a5", const TString &title="a5")
RooRealVar * expCoeffa2()
void initExpCoeffA0(const double &value, const double &min, const double &max, const TString &name="expCoeffa0", const TString &title="expCoeffa0")
void initExpCoeffA1(const double &value, const double &min, const double &max, const TString &name="expCoeffa1", const TString &title="expCoeffa1")
void initA2(const double &value, const double &min, const double &max, const TString &name="a2", const TString &title="a2")
void initSigma2(const double &value, const double &min, const double &max, const TString &name="sigma2", const TString &title="sigma2")
void initFGCB(const double &value, const double &min, const double &max, const TString &name="fGCB", const TString &title="fGCB")
void initExpCoeffA2(const double &value, const double &min, const double &max, const TString &name="expCoeffa2", const TString &title="expCoeffa2")
void initSigma(const double &value, const double &min, const double &max, const TString &name="sigma", const TString &title="sigma")
void initMean2(const double &value, const double &min, const double &max, const TString &name="mean2", const TString &title="mean2")