1 #ifndef Alignment_OfflineValidation_FitWithRooFit_h 2 #define Alignment_OfflineValidation_FitWithRooFit_h 4 #include "RooGlobalFunc.h" 9 #include "RooRealVar.h" 10 #include "RooDataSet.h" 11 #include "RooGaussian.h" 12 #include "RooVoigtian.h" 13 #include "RooExponential.h" 15 #include "RooDataHist.h" 16 #include "RooAddPdf.h" 17 #include "RooChebychev.h" 18 #include "RooFitResult.h" 19 #include "RooGenericPdf.h" 20 #include "RooGaussModel.h" 21 #include "RooAddModel.h" 22 #include "RooPolynomial.h" 23 #include "RooCBShape.h" 24 #include "RooMinimizer.h" 25 #include "RooBreitWigner.h" 26 #include "RooFFTConvPdf.h" 51 const TString signalType,
52 const TString backgroundType,
55 bool sumW2Error =
false);
65 double value,
double min,
double max,
const TString&
name =
"GaussFrac",
const TString&
title =
"GaussFrac");
67 double value,
double min,
double max,
const TString&
name =
"GaussFrac2",
const TString&
title =
"GaussFrac2");
69 double value,
double min,
double max,
const TString&
name =
"expCoeffa0",
const TString&
title =
"expCoeffa0");
71 double value,
double min,
double max,
const TString&
name =
"expCoeffa1",
const TString&
title =
"expCoeffa1");
73 double value,
double min,
double max,
const TString&
name =
"expCoeffa2",
const TString&
title =
"expCoeffa2");
75 double value,
double min,
double max,
const TString&
name =
"fsig",
const TString&
title =
"signal fraction");
100 inline RooRealVar*
a0() {
return a0_.get(); }
101 inline RooRealVar*
a1() {
return a1_.get(); }
102 inline RooRealVar*
a2() {
return a2_.get(); }
103 inline RooRealVar*
a3() {
return a3_.get(); }
104 inline RooRealVar*
a4() {
return a4_.get(); }
105 inline RooRealVar*
a5() {
return a5_.get(); }
106 inline RooRealVar*
a6() {
return a6_.get(); }
108 inline RooRealVar*
n() {
return n_.get(); }
113 std::unique_ptr<RooAbsPdf>
buildSignalModel(RooRealVar*
x,
const TString& signalType);
115 std::unique_ptr<RooAbsPdf>
buildModel(RooRealVar*
x,
const TString& signalType,
const TString& backgroundType);
134 std::unique_ptr<RooRealVar>
a0_;
135 std::unique_ptr<RooRealVar>
a1_;
136 std::unique_ptr<RooRealVar>
a2_;
137 std::unique_ptr<RooRealVar>
a3_;
138 std::unique_ptr<RooRealVar>
a4_;
139 std::unique_ptr<RooRealVar>
a5_;
140 std::unique_ptr<RooRealVar>
a6_;
142 std::unique_ptr<RooRealVar>
n_;
void initA0(double value, double min, double max, const TString &name="a0", const TString &title="a0")
double initVal_expCoeffa0
void initGamma(double value, double min, double max, const TString &name="gamma", const TString &title="gamma")
std::unique_ptr< RooRealVar > fsig_
void initA5(double value, double min, double max, const TString &name="a5", const TString &title="a5")
void initSigma(double value, double min, double max, const TString &name="sigma", const TString &title="sigma")
std::unique_ptr< RooRealVar > sigma3_
void initSigma2(double value, double min, double max, const TString &name="sigma2", const TString &title="sigma2")
std::unique_ptr< RooRealVar > mean_
std::unique_ptr< RooRealVar > mean2_
void initMean3(double value, double min, double max, const TString &name="mean3", const TString &title="mean3")
void initGaussFrac2(double value, double min, double max, const TString &name="GaussFrac2", const TString &title="GaussFrac2")
void initA1(double value, double min, double max, const TString &name="a1", const TString &title="a1")
void initFGCB(double value, double min, double max, const TString &name="fGCB", const TString &title="fGCB")
void initA2(double value, double min, double max, const TString &name="a2", const TString &title="a2")
RooRealVar * expCoeffa0()
void initA6(double value, double min, double max, const TString &name="a6", const TString &title="a6")
std::unique_ptr< RooRealVar > a0_
void initMean2(double value, double min, double max, const TString &name="mean2", const TString &title="mean2")
std::unique_ptr< RooRealVar > a1_
std::unique_ptr< RooRealVar > mean3_
std::unique_ptr< RooRealVar > a5_
std::unique_ptr< RooRealVar > n_
std::unique_ptr< RooAbsPdf > buildSignalModel(RooRealVar *x, const TString &signalType)
Build the model for the specified signal type.
double initVal_expCoeffa1
double initVal_gaussFrac2
void reinitializeParameters()
std::unique_ptr< RooRealVar > a6_
void initN(double value, double min, double max, const TString &name="n", const TString &title="n")
std::unique_ptr< RooRealVar > sigma_
RooRealVar * gaussFrac2()
std::unique_ptr< RooAbsPdf > buildBackgroundModel(RooRealVar *x, const TString &backgroundType)
Build the model for the specified background type.
std::unique_ptr< RooRealVar > a4_
void initFsig(double value, double min, double max, const TString &name="fsig", const TString &title="signal fraction")
RooRealVar * expCoeffa1()
void initExpCoeffA1(double value, double min, double max, const TString &name="expCoeffa1", const TString &title="expCoeffa1")
std::unique_ptr< RooRealVar > gaussFrac2_
std::unique_ptr< RooAbsPdf > buildModel(RooRealVar *x, const TString &signalType, const TString &backgroundType)
Build the model to fit.
double initVal_expCoeffa2
std::unique_ptr< RooRealVar > a2_
std::unique_ptr< RooRealVar > sigma2_
void initAlpha(double value, double min, double max, const TString &name="alpha", const TString &title="alpha")
void fit(TH1 *histo, const TString signalType, const TString backgroundType, double xMin=0., double xMax=0., bool sumW2Error=false)
std::unique_ptr< RooDataHist > importTH1(TH1 *histo, double xMin, double xMax)
std::unique_ptr< RooRealVar > gaussFrac_
std::unique_ptr< RooRealVar > gamma_
RooRealVar * expCoeffa2()
std::unique_ptr< RooRealVar > fGCB_
std::unique_ptr< RooRealVar > a3_
void initGaussFrac(double value, double min, double max, const TString &name="GaussFrac", const TString &title="GaussFrac")
std::unique_ptr< RooRealVar > expCoeffa0_
std::unique_ptr< RooRealVar > expCoeffa1_
void initExpCoeffA2(double value, double min, double max, const TString &name="expCoeffa2", const TString &title="expCoeffa2")
void initSigma3(double value, double min, double max, const TString &name="sigma3", const TString &title="sigma3")
void initA3(double value, double min, double max, const TString &name="a3", const TString &title="a3")
void initExpCoeffA0(double value, double min, double max, const TString &name="expCoeffa0", const TString &title="expCoeffa0")
std::unique_ptr< RooRealVar > expCoeffa2_
std::unique_ptr< RooRealVar > alpha_
void initMean(double value, double min, double max, const TString &name="mean", const TString &title="mean")
void initA4(double value, double min, double max, const TString &name="a4", const TString &title="a4")