CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Protected Attributes
FitWithRooFit Class Reference

#include <FitWithRooFit.h>

Public Member Functions

RooRealVar * a0 ()
 
RooRealVar * a1 ()
 
RooRealVar * a2 ()
 
RooRealVar * a3 ()
 
RooRealVar * a4 ()
 
RooRealVar * a5 ()
 
RooRealVar * a6 ()
 
RooRealVar * alpha ()
 
std::unique_ptr< RooAbsPdf > buildBackgroundModel (RooRealVar *x, const TString &backgroundType)
 Build the model for the specified background type. More...
 
std::unique_ptr< RooAbsPdf > buildModel (RooRealVar *x, const TString &signalType, const TString &backgroundType)
 Build the model to fit. More...
 
std::unique_ptr< RooAbsPdf > buildSignalModel (RooRealVar *x, const TString &signalType)
 Build the model for the specified signal type. More...
 
RooRealVar * expCoeffa0 ()
 
RooRealVar * expCoeffa1 ()
 
RooRealVar * expCoeffa2 ()
 
RooRealVar * fGCB ()
 
void fit (TH1 *histo, const TString signalType, const TString backgroundType, double xMin=0., double xMax=0., bool sumW2Error=false)
 
RooRealVar * fsig ()
 
RooRealVar * gamma ()
 
RooRealVar * gaussFrac ()
 
RooRealVar * gaussFrac2 ()
 
std::unique_ptr< RooDataHist > importTH1 (TH1 *histo, double xMin, double xMax)
 
void initA0 (double value, double min, double max, const TString &name="a0", const TString &title="a0")
 
void initA1 (double value, double min, double max, const TString &name="a1", const TString &title="a1")
 
void initA2 (double value, double min, double max, const TString &name="a2", const TString &title="a2")
 
void initA3 (double value, double min, double max, const TString &name="a3", const TString &title="a3")
 
void initA4 (double value, double min, double max, const TString &name="a4", const TString &title="a4")
 
void initA5 (double value, double min, double max, const TString &name="a5", const TString &title="a5")
 
void initA6 (double value, double min, double max, const TString &name="a6", const TString &title="a6")
 
void initAlpha (double value, double min, double max, const TString &name="alpha", const TString &title="alpha")
 
void initExpCoeffA0 (double value, double min, double max, const TString &name="expCoeffa0", const TString &title="expCoeffa0")
 
void initExpCoeffA1 (double value, double min, double max, const TString &name="expCoeffa1", const TString &title="expCoeffa1")
 
void initExpCoeffA2 (double value, double min, double max, const TString &name="expCoeffa2", const TString &title="expCoeffa2")
 
void initFGCB (double value, double min, double max, const TString &name="fGCB", const TString &title="fGCB")
 
void initFsig (double value, double min, double max, const TString &name="fsig", const TString &title="signal fraction")
 
void initGamma (double value, double min, double max, const TString &name="gamma", const TString &title="gamma")
 
void initGaussFrac (double value, double min, double max, const TString &name="GaussFrac", const TString &title="GaussFrac")
 
void initGaussFrac2 (double value, double min, double max, const TString &name="GaussFrac2", const TString &title="GaussFrac2")
 
void initMean (double value, double min, double max, const TString &name="mean", const TString &title="mean")
 
void initMean2 (double value, double min, double max, const TString &name="mean2", const TString &title="mean2")
 
void initMean3 (double value, double min, double max, const TString &name="mean3", const TString &title="mean3")
 
void initN (double value, double min, double max, const TString &name="n", const TString &title="n")
 
void initSigma (double value, double min, double max, const TString &name="sigma", const TString &title="sigma")
 
void initSigma2 (double value, double min, double max, const TString &name="sigma2", const TString &title="sigma2")
 
void initSigma3 (double value, double min, double max, const TString &name="sigma3", const TString &title="sigma3")
 
RooRealVar * mean ()
 
RooRealVar * mean2 ()
 
RooRealVar * mean3 ()
 
RooRealVar * n ()
 
void reinitializeParameters ()
 
RooRealVar * sigma ()
 
RooRealVar * sigma2 ()
 
RooRealVar * sigma3 ()
 

Public Attributes

bool useChi2_ = false
 

Protected Attributes

std::unique_ptr< RooRealVar > a0_
 
std::unique_ptr< RooRealVar > a1_
 
std::unique_ptr< RooRealVar > a2_
 
std::unique_ptr< RooRealVar > a3_
 
std::unique_ptr< RooRealVar > a4_
 
std::unique_ptr< RooRealVar > a5_
 
std::unique_ptr< RooRealVar > a6_
 
std::unique_ptr< RooRealVar > alpha_
 
std::unique_ptr< RooRealVar > expCoeffa0_
 
std::unique_ptr< RooRealVar > expCoeffa1_
 
std::unique_ptr< RooRealVar > expCoeffa2_
 
std::unique_ptr< RooRealVar > fGCB_
 
std::unique_ptr< RooRealVar > fsig_
 
std::unique_ptr< RooRealVar > gamma_
 
std::unique_ptr< RooRealVar > gaussFrac2_
 
std::unique_ptr< RooRealVar > gaussFrac_
 
double initVal_a0 = 0.0
 
double initVal_a1 = 0.0
 
double initVal_a2 = 0.0
 
double initVal_a3 = 0.0
 
double initVal_a4 = 0.0
 
double initVal_a5 = 0.0
 
double initVal_a6 = 0.0
 
double initVal_alpha = 0.0
 
double initVal_expCoeffa0 = 0.0
 
double initVal_expCoeffa1 = 0.0
 
double initVal_expCoeffa2 = 0.0
 
double initVal_fGCB = 0.0
 
double initVal_fsig = 0.0
 
double initVal_gamma = 0.0
 
double initVal_gaussFrac = 0.0
 
double initVal_gaussFrac2 = 0.0
 
double initVal_mean = 0.0
 
double initVal_mean2 = 0.0
 
double initVal_mean3 = 0.0
 
double initVal_n = 0.0
 
double initVal_sigma = 0.0
 
double initVal_sigma2 = 0.0
 
double initVal_sigma3 = 0.0
 
std::unique_ptr< RooRealVar > mean2_
 
std::unique_ptr< RooRealVar > mean3_
 
std::unique_ptr< RooRealVar > mean_
 
std::unique_ptr< RooRealVar > n_
 
std::unique_ptr< RooRealVar > sigma2_
 
std::unique_ptr< RooRealVar > sigma3_
 
std::unique_ptr< RooRealVar > sigma_
 

Detailed Description

This class allows to use RooFit to perform a fit on a TH1 histogram.
The currently implemented functions are:

Definition at line 46 of file FitWithRooFit.h.

Member Function Documentation

◆ a0()

RooRealVar* FitWithRooFit::a0 ( )
inline

Definition at line 100 of file FitWithRooFit.h.

References a0_.

100 { return a0_.get(); }
std::unique_ptr< RooRealVar > a0_

◆ a1()

RooRealVar* FitWithRooFit::a1 ( )
inline

Definition at line 101 of file FitWithRooFit.h.

References a1_.

101 { return a1_.get(); }
std::unique_ptr< RooRealVar > a1_

◆ a2()

RooRealVar* FitWithRooFit::a2 ( )
inline

Definition at line 102 of file FitWithRooFit.h.

References a2_.

102 { return a2_.get(); }
std::unique_ptr< RooRealVar > a2_

◆ a3()

RooRealVar* FitWithRooFit::a3 ( )
inline

Definition at line 103 of file FitWithRooFit.h.

References a3_.

103 { return a3_.get(); }
std::unique_ptr< RooRealVar > a3_

◆ a4()

RooRealVar* FitWithRooFit::a4 ( )
inline

Definition at line 104 of file FitWithRooFit.h.

References a4_.

104 { return a4_.get(); }
std::unique_ptr< RooRealVar > a4_

◆ a5()

RooRealVar* FitWithRooFit::a5 ( )
inline

Definition at line 105 of file FitWithRooFit.h.

References a5_.

105 { return a5_.get(); }
std::unique_ptr< RooRealVar > a5_

◆ a6()

RooRealVar* FitWithRooFit::a6 ( )
inline

Definition at line 106 of file FitWithRooFit.h.

References a6_.

106 { return a6_.get(); }
std::unique_ptr< RooRealVar > a6_

◆ alpha()

RooRealVar* FitWithRooFit::alpha ( )
inline

Definition at line 107 of file FitWithRooFit.h.

References alpha_.

107 { return alpha_.get(); }
std::unique_ptr< RooRealVar > alpha_

◆ buildBackgroundModel()

std::unique_ptr< RooAbsPdf > FitWithRooFit::buildBackgroundModel ( RooRealVar *  x,
const TString &  backgroundType 
)

Build the model for the specified background type.

Definition at line 407 of file FitWithRooFit.cc.

References a0_, a1_, a2_, a3_, a4_, a5_, a6_, beamvalidation::exit(), expCoeffa0_, expCoeffa1_, expCoeffa2_, fsig_, and x.

Referenced by buildModel().

407  {
408  if (backgroundType == "exponential") {
409  // Add an exponential for the background
410  if ((expCoeffa1_ == nullptr) || (fsig_ == nullptr)) {
411  edm::LogError("FitWithRooFit")
412  << "Error: one or more parameters are not initialized. Please be sure to initialize expCoeffa1 and fsig";
413  exit(1);
414  }
415  return std::make_unique<RooExponential>("exponential", "exponential", *x, *expCoeffa1_);
416  }
417 
418  if (backgroundType == "exponentialpol") {
419  // Add an exponential for the background
420  if ((expCoeffa0_ == nullptr) || (expCoeffa1_ == nullptr) || (expCoeffa2_ == nullptr) || (fsig_ == nullptr)) {
421  edm::LogError("FitWithRooFit")
422  << "Error: one or more parameters are not initialized. Please be sure to initialize expCoeff and fsig";
423  exit(1);
424  }
425  return std::make_unique<RooGenericPdf>("exponential",
426  "exponential",
427  "TMath::Exp(@1+@2*@0+@3*@0*@0)",
428  RooArgList{*x, *expCoeffa0_, *expCoeffa1_, *expCoeffa2_});
429  }
430 
431  else if (backgroundType == "chebychev0") {
432  // Add a linear background
433  if (a0_ == nullptr) {
434  edm::LogError("FitWithRooFit")
435  << "Error: one or more parameters are not initialized. Please be sure to initialize a0";
436  exit(1);
437  }
438  return std::make_unique<RooChebychev>("chebychev0", "chebychev0", *x, *a0_);
439  } else if (backgroundType == "chebychev1") {
440  // Add a 2nd order chebychev polynomial background
441  if ((a0_ == nullptr) || (a1_ == nullptr)) {
442  edm::LogError("FitWithRooFit")
443  << "Error: one or more parameters are not initialized. Please be sure to initialize a0 and a1";
444  exit(1);
445  }
446  return std::make_unique<RooChebychev>("chebychev1", "chebychev1", *x, RooArgList{*a0_, *a1_});
447  } else if (backgroundType == "chebychev3") {
448  // Add a 3rd order chebychev polynomial background
449  if ((a0_ == nullptr) || (a1_ == nullptr) || (a2_ == nullptr) || (a3_ == nullptr)) {
450  edm::LogError("FitWithRooFit")
451  << "Error: one or more parameters are not initialized. Please be sure to initialize a0, a1, a2 and a3";
452  exit(1);
453  }
454  return std::make_unique<RooChebychev>("3rdOrderPol", "3rdOrderPol", *x, RooArgList{*a0_, *a1_, *a2_, *a3_});
455  }
456 
457  else if (backgroundType == "chebychev6") {
458  // Add a 6th order chebychev polynomial background
459  if ((a0_ == nullptr) || (a1_ == nullptr) || (a2_ == nullptr) || (a3_ == nullptr) || (a4_ == nullptr) ||
460  (a5_ == nullptr) || (a6_ == nullptr)) {
461  edm::LogError("FitWithRooFit")
462  << "Error: one or more parameters are not initialized. Please be sure to initialize a0, a1, a2, a3, "
463  "a4, a5 and a6";
464  exit(1);
465  }
466  return std::make_unique<RooChebychev>(
467  "6thOrderPol", "6thOrderPol", *x, RooArgList{*a0_, *a1_, *a2_, *a3_, *a4_, *a5_, *a6_});
468  }
469  return nullptr;
470 }
std::unique_ptr< RooRealVar > fsig_
Log< level::Error, false > LogError
std::unique_ptr< RooRealVar > a0_
std::unique_ptr< RooRealVar > a1_
std::unique_ptr< RooRealVar > a5_
std::unique_ptr< RooRealVar > a6_
std::unique_ptr< RooRealVar > a4_
std::unique_ptr< RooRealVar > a2_
std::unique_ptr< RooRealVar > a3_
std::unique_ptr< RooRealVar > expCoeffa0_
std::unique_ptr< RooRealVar > expCoeffa1_
std::unique_ptr< RooRealVar > expCoeffa2_
def exit(msg="")

◆ buildModel()

std::unique_ptr< RooAbsPdf > FitWithRooFit::buildModel ( RooRealVar *  x,
const TString &  signalType,
const TString &  backgroundType 
)

Build the model to fit.

Definition at line 473 of file FitWithRooFit.cc.

References buildBackgroundModel(), buildSignalModel(), makeMuonMisalignmentScenario::components, beamvalidation::exit(), fsig_, ReggeGribovPartonMC_EposLHC_2760GeV_PbPb_cfi::model, eostools::move(), and x.

Referenced by fit().

475  {
476  std::unique_ptr<RooAbsPdf> model;
477 
478  std::unique_ptr<RooAbsPdf> signal = buildSignalModel(x, signalType);
479  std::unique_ptr<RooAbsPdf> background = buildBackgroundModel(x, backgroundType);
480 
481  if ((signal != nullptr) && (background != nullptr)) {
482  // Combine signal and background pdfs
483  edm::LogPrint("FitWithRooFit") << "Building model with signal and backgound";
484  RooArgList components{*signal.release(), *background.release()};
485  model = std::make_unique<RooAddPdf>("model", "model", components, *fsig_);
486  model->addOwnedComponents(components);
487  } else if (signal != nullptr) {
488  edm::LogPrint("FitWithRooFit") << "Building model with signal";
489  model = std::move(signal);
490  } else if (background != nullptr) {
491  edm::LogPrint("FitWithRooFit") << "Building model with backgound";
492  model = std::move(background);
493  } else {
494  edm::LogWarning("FitWithRooFit") << "Nothing to fit";
495  exit(0);
496  }
497  return model;
498 }
std::unique_ptr< RooRealVar > fsig_
std::unique_ptr< RooAbsPdf > buildSignalModel(RooRealVar *x, const TString &signalType)
Build the model for the specified signal type.
std::unique_ptr< RooAbsPdf > buildBackgroundModel(RooRealVar *x, const TString &backgroundType)
Build the model for the specified background type.
Log< level::Warning, true > LogPrint
Log< level::Warning, false > LogWarning
def move(src, dest)
Definition: eostools.py:511
def exit(msg="")

◆ buildSignalModel()

std::unique_ptr< RooAbsPdf > FitWithRooFit::buildSignalModel ( RooRealVar *  x,
const TString &  signalType 
)

Build the model for the specified signal type.

Definition at line 243 of file FitWithRooFit.cc.

References alpha_, makeMuonMisalignmentScenario::components, beamvalidation::exit(), fGCB_, gamma_, gaussFrac2_, gaussFrac_, mean2_, mean3_, mean_, n_, MillePedeFileConverter_cfg::out, sigma2_, sigma3_, sigma_, and x.

Referenced by buildModel().

243  {
244  if (signalType == "gaussian") {
245  // Fit a Gaussian p.d.f to the data
246  if ((mean_ == nullptr) || (sigma_ == nullptr)) {
247  edm::LogError("FitWithRooFit")
248  << "Error: one or more parameters are not initialized. Please be sure to initialize mean and sigma";
249  exit(1);
250  }
251  return std::make_unique<RooGaussian>("gauss", "gauss", *x, *mean_, *sigma_);
252  } else if (signalType == "doubleGaussian") {
253  // Fit with double gaussian
254  if ((mean_ == nullptr) || (sigma_ == nullptr) || (sigma2_ == nullptr)) {
255  edm::LogError("FitWithRooFit")
256  << "Error: one or more parameters are not initialized. Please be sure to initialize mean, sigma and sigma2";
257  exit(1);
258  }
259  RooGaussModel* gaussModel = new RooGaussModel("gaussModel", "gaussModel", *x, *mean_, *sigma_);
260  RooGaussModel* gaussModel2 = new RooGaussModel("gaussModel2", "gaussModel2", *x, *mean_, *sigma2_);
261  RooArgList components{*gaussModel, *gaussModel2};
262  auto out = std::make_unique<RooAddModel>("doubleGaussian", "double gaussian", components, *gaussFrac_);
263  out->addOwnedComponents(components);
264  return out;
265  } else if (signalType == "tripleGaussian") {
266  // Fit with triple gaussian
267  if ((mean_ == nullptr) || (mean2_ == nullptr) || (mean3_ == nullptr) || (sigma_ == nullptr) ||
268  (sigma2_ == nullptr) || (sigma3_ == nullptr)) {
269  edm::LogError("FitWithRooFit")
270  << "Error: one or more parameters are not initialized. Please be sure to initialize mean, mean2, "
271  "mean3, sigma, sigma2, sigma3";
272  exit(1);
273  }
274  RooGaussModel* gaussModel = new RooGaussModel("gaussModel", "gaussModel", *x, *mean_, *sigma_);
275  RooGaussModel* gaussModel2 = new RooGaussModel("gaussModel2", "gaussModel2", *x, *mean2_, *sigma2_);
276  RooGaussModel* gaussModel3 = new RooGaussModel("gaussModel3", "gaussModel3", *x, *mean3_, *sigma3_);
277  RooArgList components{*gaussModel, *gaussModel2, *gaussModel3};
278  auto out = std::make_unique<RooAddModel>(
279  "tripleGaussian", "triple gaussian", components, RooArgList{*gaussFrac_, *gaussFrac2_});
280  out->addOwnedComponents(components);
281  return out;
282  } else if (signalType == "breitWigner") {
283  // Fit a Breit-Wigner
284  if ((mean_ == nullptr) || (gamma_ == nullptr)) {
285  edm::LogError("FitWithRooFit")
286  << "Error: one or more parameters are not initialized. Please be sure to initialize mean and gamma";
287  exit(1);
288  }
289  return std::make_unique<RooBreitWigner>("breiWign", "breitWign", *x, *mean_, *gamma_);
290  } else if (signalType == "relBreitWigner") {
291  // Fit a relativistic Breit-Wigner
292  if ((mean_ == nullptr) || (gamma_ == nullptr)) {
293  edm::LogError("FitWithRooFit")
294  << "Error: one or more parameters are not initialized. Please be sure to initialize mean and gamma";
295  exit(1);
296  }
297  return std::make_unique<RooGenericPdf>("Relativistic Breit-Wigner",
298  "RBW",
299  "@0/(pow(@0*@0 - @1*@1,2) + @2*@2*@0*@0*@0*@0/(@1*@1))",
300  RooArgList{*x, *mean_, *gamma_});
301  } else if (signalType == "voigtian") {
302  // Fit a Voigtian
303  if ((mean_ == nullptr) || (sigma_ == nullptr) || (gamma_ == nullptr)) {
304  edm::LogError("FitWithRooFit")
305  << "Error: one or more parameters are not initialized. Please be sure to initialize mean, sigma and gamma";
306  exit(1);
307  }
308  return std::make_unique<RooVoigtian>("voigt", "voigt", *x, *mean_, *gamma_, *sigma_);
309  } else if (signalType == "crystalBall") {
310  // Fit a CrystalBall
311  if ((mean_ == nullptr) || (sigma_ == nullptr) || (alpha_ == nullptr) || (n_ == nullptr)) {
312  edm::LogError("FitWithRooFit")
313  << "Error: one or more parameters are not initialized. Please be sure to initialize mean, sigma, "
314  "alpha and n";
315  exit(1);
316  }
317  return std::make_unique<RooCBShape>("crystalBall", "crystalBall", *x, *mean_, *sigma_, *alpha_, *n_);
318  } else if (signalType == "breitWignerTimesCB") {
319  // Fit a Breit Wigner convoluted with a CrystalBall
320  if ((mean_ == nullptr) || (mean2_ == nullptr) || (sigma_ == nullptr) || (gamma_ == nullptr) ||
321  (alpha_ == nullptr) || (n_ == nullptr)) {
322  edm::LogError("FitWithRooFit")
323  << "Error: one or more parameters are not initialized. Please be sure to initialize mean, mean2, "
324  "sigma, gamma, alpha and n";
325  exit(1);
326  }
327  RooAbsPdf* bw = new RooBreitWigner("breiWigner", "breitWigner", *x, *mean_, *gamma_);
328  RooAbsPdf* cb = new RooCBShape("crystalBall", "crystalBall", *x, *mean2_, *sigma_, *alpha_, *n_);
329  auto out = std::make_unique<RooFFTConvPdf>("breitWignerTimesCB", "breitWignerTimesCB", *x, *bw, *cb);
330  out->addOwnedComponents({*bw, *cb});
331  return out;
332  } else if (signalType == "relBreitWignerTimesCB") {
333  // Fit a relativistic Breit Wigner convoluted with a CrystalBall
334  if ((mean_ == nullptr) || (mean2_ == nullptr) || (sigma_ == nullptr) || (gamma_ == nullptr) ||
335  (alpha_ == nullptr) || (n_ == nullptr)) {
336  edm::LogError("FitWithRooFit")
337  << "Error: one or more parameters are not initialized. Please be sure to initialize mean, mean2, "
338  "sigma, gamma, alpha and n";
339  exit(1);
340  }
341  RooGenericPdf* bw = new RooGenericPdf("Relativistic Breit-Wigner",
342  "RBW",
343  "@0/(pow(@0*@0 - @1*@1,2) + @2*@2*@0*@0*@0*@0/(@1*@1))",
344  {*x, *mean_, *gamma_});
345  RooAbsPdf* cb = new RooCBShape("crystalBall", "crystalBall", *x, *mean2_, *sigma_, *alpha_, *n_);
346  auto out = std::make_unique<RooFFTConvPdf>("relBreitWignerTimesCB", "relBreitWignerTimesCB", *x, *bw, *cb);
347  out->addOwnedComponents({*bw, *cb});
348  return out;
349  } else if (signalType == "gaussianPlusCrystalBall") {
350  // Fit a Gaussian + CrystalBall with the same mean
351  if ((mean_ == nullptr) || (sigma_ == nullptr) || (alpha_ == nullptr) || (n_ == nullptr) || (sigma2_ == nullptr) ||
352  (fGCB_ == nullptr)) {
353  edm::LogError("FitWithRooFit")
354  << "Error: one or more parameters are not initialized. Please be sure to initialize mean, sigma, "
355  "sigma2, alpha, n and fGCB";
356  exit(1);
357  }
358  RooAbsPdf* tempCB = new RooCBShape("crystalBall", "crystalBall", *x, *mean_, *sigma_, *alpha_, *n_);
359  RooAbsPdf* tempGaussian = new RooGaussian("gauss", "gauss", *x, *mean_, *sigma2_);
360  RooArgList components{*tempCB, *tempGaussian};
361 
362  auto out = std::make_unique<RooAddPdf>("gaussianPlusCrystalBall", "gaussianPlusCrystalBall", components, *fGCB_);
363  out->addOwnedComponents(components);
364  return out;
365  } else if (signalType == "voigtianPlusCrystalBall") {
366  // Fit a Voigtian + CrystalBall with the same mean
367  if ((mean_ == nullptr) || (sigma_ == nullptr) || (gamma_ == nullptr) || (alpha_ == nullptr) || (n_ == nullptr) ||
368  (sigma2_ == nullptr) || (fGCB_ == nullptr)) {
369  edm::LogError("FitWithRooFit")
370  << "Error: one or more parameters are not initialized. Please be sure to initialize mean, gamma, "
371  "sigma, sigma2, alpha, n and fGCB";
372  exit(1);
373  }
374  RooAbsPdf* tempVoigt = new RooVoigtian("voigt", "voigt", *x, *mean_, *gamma_, *sigma_);
375  RooAbsPdf* tempCB = new RooCBShape("crystalBall", "crystalBall", *x, *mean_, *sigma2_, *alpha_, *n_);
376  RooArgList components{*tempVoigt, *tempCB};
377 
378  auto out = std::make_unique<RooAddPdf>("voigtianPlusCrystalBall", "voigtianPlusCrystalBall", components, *fGCB_);
379  out->addOwnedComponents(components);
380  return out;
381  } else if (signalType == "breitWignerPlusCrystalBall") {
382  // Fit a Breit-Wigner + CrystalBall with the same mean
383  if ((mean_ == nullptr) || (gamma_ == nullptr) || (alpha_ == nullptr) || (n_ == nullptr) || (sigma2_ == nullptr) ||
384  (fGCB_ == nullptr)) {
385  edm::LogError("FitWithRooFit")
386  << "Error: one or more parameters are not initialized. Please be sure to initialize mean, gamma, "
387  "sigma, alpha, n and fGCB";
388  exit(1);
389  }
390  RooAbsPdf* tempBW = new RooBreitWigner("breitWign", "breitWign", *x, *mean_, *gamma_);
391  RooAbsPdf* tempCB = new RooCBShape("crystalBall", "crystalBall", *x, *mean_, *sigma2_, *alpha_, *n_);
392  RooArgList components{*tempCB, *tempBW};
393 
394  auto out =
395  std::make_unique<RooAddPdf>("breitWignerPlusCrystalBall", "breitWignerPlusCrystalBall", components, *fGCB_);
396  out->addOwnedComponents(components);
397  return out;
398  }
399 
400  else if (signalType != "") {
401  edm::LogError("FitWithRooFit") << "Unknown signal function: " << signalType << ". Signal will not be in the model";
402  }
403  return nullptr;
404 }
std::unique_ptr< RooRealVar > sigma3_
std::unique_ptr< RooRealVar > mean_
std::unique_ptr< RooRealVar > mean2_
Log< level::Error, false > LogError
std::unique_ptr< RooRealVar > mean3_
std::unique_ptr< RooRealVar > n_
std::unique_ptr< RooRealVar > sigma_
std::unique_ptr< RooRealVar > gaussFrac2_
std::unique_ptr< RooRealVar > sigma2_
std::unique_ptr< RooRealVar > gaussFrac_
std::unique_ptr< RooRealVar > gamma_
std::unique_ptr< RooRealVar > fGCB_
std::unique_ptr< RooRealVar > alpha_
def exit(msg="")

◆ expCoeffa0()

RooRealVar* FitWithRooFit::expCoeffa0 ( )
inline

Definition at line 96 of file FitWithRooFit.h.

References expCoeffa0_.

96 { return expCoeffa0_.get(); }
std::unique_ptr< RooRealVar > expCoeffa0_

◆ expCoeffa1()

RooRealVar* FitWithRooFit::expCoeffa1 ( )
inline

Definition at line 97 of file FitWithRooFit.h.

References expCoeffa1_.

97 { return expCoeffa1_.get(); }
std::unique_ptr< RooRealVar > expCoeffa1_

◆ expCoeffa2()

RooRealVar* FitWithRooFit::expCoeffa2 ( )
inline

Definition at line 98 of file FitWithRooFit.h.

References expCoeffa2_.

98 { return expCoeffa2_.get(); }
std::unique_ptr< RooRealVar > expCoeffa2_

◆ fGCB()

RooRealVar* FitWithRooFit::fGCB ( )
inline

Definition at line 109 of file FitWithRooFit.h.

References fGCB_.

109 { return fGCB_.get(); }
std::unique_ptr< RooRealVar > fGCB_

◆ fit()

void FitWithRooFit::fit ( TH1 *  histo,
const TString  signalType,
const TString  backgroundType,
double  xMin = 0.,
double  xMax = 0.,
bool  sumW2Error = false 
)

Definition at line 18 of file FitWithRooFit.cc.

References buildModel(), nano_mu_local_reco_cff::chi2, cuy::dh, timingPdfMaker::histo, importTH1(), DataMixerDataOnData_cff::Label, visualization-live-secondInstance_cfg::m, ReggeGribovPartonMC_EposLHC_2760GeV_PbPb_cfi::model, reinitializeParameters(), useChi2_, x, multiplicitycorr_cfi::xMax, and photonAnalyzer_cfi::xMin.

Referenced by trackingPlots.Iteration::modules(), and ZMassBinFit_OldTool().

19  {
21 
22  std::unique_ptr<RooDataHist> dh = importTH1(histo, xMin, xMax);
23  RooRealVar x(*static_cast<RooRealVar*>(dh->get()->find("x")));
24 
25  // Make plot of binned dataset showing Poisson error bars (RooFit default)
26  RooPlot* frame = x.frame(RooFit::Title("di-muon mass M(#mu^{+}#mu^{-}) [GeV]"));
27  frame->SetName(TString(histo->GetName()) + "_frame");
28  dh->plotOn(frame);
29 
30  // Build the composite model
31  std::unique_ptr<RooAbsPdf> model = buildModel(&x, signalType, backgroundType);
32 
33  std::unique_ptr<RooAbsReal> chi2{model->createChi2(*dh, RooFit::DataError(RooAbsData::SumW2))};
34 
35  // Fit the composite model
36  // -----------------------
37  // Fit with likelihood
38  if (!useChi2_) {
39  model->fitTo(*dh, RooFit::SumW2Error(sumW2Error));
40  }
41  // Fit with chi^2
42  else {
43  edm::LogWarning("FitWithRooFit") << "FITTING WITH CHI^2";
44  RooMinimizer m(*chi2);
45  m.migrad();
46  m.hesse();
47  // RooFitResult* r_chi2_wgt = m.save();
48  }
49  model->plotOn(frame, RooFit::LineColor(kRed));
50  model->plotOn(frame, RooFit::Components(backgroundType), RooFit::LineStyle(kDashed));
51  model->paramOn(frame,
52  RooFit::Label("fit result"),
53  RooFit::Layout(0.65, 0.90, 0.90),
54  RooFit::Format("NEU", RooFit::AutoPrecision(2)));
55 
56  // TODO: fix next lines to get the prob(chi2) (ndof should be dynamically set according to the choosen pdf)
57  // double chi2 = xframe.chiSquare("model","data",ndof);
58  // double ndoff = xframeGetNbinsX();
59  // double chi2prob = TMath::Prob(chi2,ndoff);
60 
61  // P l o t a n d f i t a R o o D a t a H i s t w i t h i n t e r n a l e r r o r s
62  // ---------------------------------------------------------------------------------------------
63 
64  // If histogram has custom error (i.e. its contents is does not originate from a Poisson process
65  // but e.g. is a sum of weighted events) you can data with symmetric 'sum-of-weights' error instead
66  // (same error bars as shown by ROOT)
67  RooPlot* frame2 = x.frame(RooFit::Title("di-muon mass M(#mu^{+}#mu^{-}) [GeV]"));
68  dh->plotOn(frame2, RooFit::DataError(RooAbsData::SumW2));
69  model->plotOn(frame2, RooFit::LineColor(kRed));
70  model->plotOn(frame2, RooFit::Components(backgroundType), RooFit::LineStyle(kDashed));
71  model->paramOn(frame2,
72  RooFit::Label("fit result"),
73  RooFit::Layout(0.65, 0.90, 0.90),
74  RooFit::Format("NEU", RooFit::AutoPrecision(2)));
75 
76  // Please note that error bars shown (Poisson or SumW2) are for visualization only, the are NOT used
77  // in a maximum likelihood fit
78  //
79  // A (binned) ML fit will ALWAYS assume the Poisson error interpretation of data (the mathematical definition
80  // of likelihood does not take any external definition of errors). Data with non-unit weights can only be correctly
81  // fitted with a chi^2 fit (see rf602_chi2fit.C)
82 
83  // Draw all frames on a canvas
84  // if( canvas == 0 ) {
85  // canvas = new TCanvas("rf102_dataimport","rf102_dataimport",800,800);
86  // canvas->cd(1);
87  // }
88  // canvas->Divide(2,1);
89  // canvas->cd(1) ; frame->Draw();
90  // canvas->cd(2) ; frame2->Draw();
91 
92  frame2->Draw();
93 }
void reinitializeParameters()
std::unique_ptr< RooAbsPdf > buildModel(RooRealVar *x, const TString &signalType, const TString &backgroundType)
Build the model to fit.
std::unique_ptr< RooDataHist > importTH1(TH1 *histo, double xMin, double xMax)
Definition: FitWithRooFit.cc:6
Log< level::Warning, false > LogWarning
dh
Definition: cuy.py:354

◆ fsig()

RooRealVar* FitWithRooFit::fsig ( )
inline

Definition at line 99 of file FitWithRooFit.h.

References fsig_.

99 { return fsig_.get(); }
std::unique_ptr< RooRealVar > fsig_

◆ gamma()

RooRealVar* FitWithRooFit::gamma ( )
inline

Definition at line 93 of file FitWithRooFit.h.

References gamma_.

Referenced by ZMassBinFit_OldTool().

93 { return gamma_.get(); }
std::unique_ptr< RooRealVar > gamma_

◆ gaussFrac()

RooRealVar* FitWithRooFit::gaussFrac ( )
inline

Definition at line 94 of file FitWithRooFit.h.

References gaussFrac_.

94 { return gaussFrac_.get(); }
std::unique_ptr< RooRealVar > gaussFrac_

◆ gaussFrac2()

RooRealVar* FitWithRooFit::gaussFrac2 ( )
inline

Definition at line 95 of file FitWithRooFit.h.

References gaussFrac2_.

95 { return gaussFrac2_.get(); }
std::unique_ptr< RooRealVar > gaussFrac2_

◆ importTH1()

std::unique_ptr< RooDataHist > FitWithRooFit::importTH1 ( TH1 *  histo,
double  xMin,
double  xMax 
)

Definition at line 6 of file FitWithRooFit.cc.

References timingPdfMaker::histo, x, multiplicitycorr_cfi::xMax, and photonAnalyzer_cfi::xMin.

Referenced by fit().

6  {
7  if ((xMin == xMax) && xMin == 0) {
8  xMin = histo->GetXaxis()->GetXmin();
9  xMax = histo->GetXaxis()->GetXmax();
10  }
11  // Declare observable x
12  RooRealVar x("InvMass", "di-muon mass M(#mu^{+}#mu^{-}) [GeV]", xMin, xMax);
13  // Create a binned dataset that imports contents of TH1 and associates its contents to observable 'x'
14  return std::make_unique<RooDataHist>("dh", "dh", x, RooFit::Import(*histo));
15 }

◆ initA0()

void FitWithRooFit::initA0 ( double  value,
double  min,
double  max,
const TString &  name = "a0",
const TString &  title = "a0" 
)

◆ initA1()

void FitWithRooFit::initA1 ( double  value,
double  min,
double  max,
const TString &  name = "a1",
const TString &  title = "a1" 
)

◆ initA2()

void FitWithRooFit::initA2 ( double  value,
double  min,
double  max,
const TString &  name = "a2",
const TString &  title = "a2" 
)

◆ initA3()

void FitWithRooFit::initA3 ( double  value,
double  min,
double  max,
const TString &  name = "a3",
const TString &  title = "a3" 
)

◆ initA4()

void FitWithRooFit::initA4 ( double  value,
double  min,
double  max,
const TString &  name = "a4",
const TString &  title = "a4" 
)

◆ initA5()

void FitWithRooFit::initA5 ( double  value,
double  min,
double  max,
const TString &  name = "a5",
const TString &  title = "a5" 
)

◆ initA6()

void FitWithRooFit::initA6 ( double  value,
double  min,
double  max,
const TString &  name = "a6",
const TString &  title = "a6" 
)

◆ initAlpha()

void FitWithRooFit::initAlpha ( double  value,
double  min,
double  max,
const TString &  name = "alpha",
const TString &  title = "alpha" 
)

◆ initExpCoeffA0()

void FitWithRooFit::initExpCoeffA0 ( double  value,
double  min,
double  max,
const TString &  name = "expCoeffa0",
const TString &  title = "expCoeffa0" 
)

◆ initExpCoeffA1()

void FitWithRooFit::initExpCoeffA1 ( double  value,
double  min,
double  max,
const TString &  name = "expCoeffa1",
const TString &  title = "expCoeffa1" 
)

◆ initExpCoeffA2()

void FitWithRooFit::initExpCoeffA2 ( double  value,
double  min,
double  max,
const TString &  name = "expCoeffa2",
const TString &  title = "expCoeffa2" 
)

◆ initFGCB()

void FitWithRooFit::initFGCB ( double  value,
double  min,
double  max,
const TString &  name = "fGCB",
const TString &  title = "fGCB" 
)

◆ initFsig()

void FitWithRooFit::initFsig ( double  value,
double  min,
double  max,
const TString &  name = "fsig",
const TString &  title = "signal fraction" 
)

◆ initGamma()

void FitWithRooFit::initGamma ( double  value,
double  min,
double  max,
const TString &  name = "gamma",
const TString &  title = "gamma" 
)

◆ initGaussFrac()

void FitWithRooFit::initGaussFrac ( double  value,
double  min,
double  max,
const TString &  name = "GaussFrac",
const TString &  title = "GaussFrac" 
)

◆ initGaussFrac2()

void FitWithRooFit::initGaussFrac2 ( double  value,
double  min,
double  max,
const TString &  name = "GaussFrac2",
const TString &  title = "GaussFrac2" 
)

◆ initMean()

void FitWithRooFit::initMean ( double  value,
double  min,
double  max,
const TString &  name = "mean",
const TString &  title = "mean" 
)

◆ initMean2()

void FitWithRooFit::initMean2 ( double  value,
double  min,
double  max,
const TString &  name = "mean2",
const TString &  title = "mean2" 
)

◆ initMean3()

void FitWithRooFit::initMean3 ( double  value,
double  min,
double  max,
const TString &  name = "mean3",
const TString &  title = "mean3" 
)

◆ initN()

void FitWithRooFit::initN ( double  value,
double  min,
double  max,
const TString &  name = "n",
const TString &  title = "n" 
)

◆ initSigma()

void FitWithRooFit::initSigma ( double  value,
double  min,
double  max,
const TString &  name = "sigma",
const TString &  title = "sigma" 
)

◆ initSigma2()

void FitWithRooFit::initSigma2 ( double  value,
double  min,
double  max,
const TString &  name = "sigma2",
const TString &  title = "sigma2" 
)

◆ initSigma3()

void FitWithRooFit::initSigma3 ( double  value,
double  min,
double  max,
const TString &  name = "sigma3",
const TString &  title = "sigma3" 
)

◆ mean()

RooRealVar* FitWithRooFit::mean ( )
inline

Definition at line 87 of file FitWithRooFit.h.

References mean_.

Referenced by ZMassBinFit_OldTool().

87 { return mean_.get(); }
std::unique_ptr< RooRealVar > mean_

◆ mean2()

RooRealVar* FitWithRooFit::mean2 ( )
inline

Definition at line 88 of file FitWithRooFit.h.

References mean2_.

Referenced by ZMassBinFit_OldTool().

88 { return mean2_.get(); }
std::unique_ptr< RooRealVar > mean2_

◆ mean3()

RooRealVar* FitWithRooFit::mean3 ( )
inline

Definition at line 89 of file FitWithRooFit.h.

References mean3_.

89 { return mean3_.get(); }
std::unique_ptr< RooRealVar > mean3_

◆ n()

RooRealVar* FitWithRooFit::n ( )
inline

Definition at line 108 of file FitWithRooFit.h.

References n_.

108 { return n_.get(); }
std::unique_ptr< RooRealVar > n_

◆ reinitializeParameters()

void FitWithRooFit::reinitializeParameters ( )

Definition at line 211 of file FitWithRooFit.cc.

References a0_, a1_, a2_, a3_, a4_, a5_, a6_, alpha_, expCoeffa0_, expCoeffa1_, expCoeffa2_, fGCB_, fsig_, gamma_, gaussFrac2_, gaussFrac_, initVal_a0, initVal_a1, initVal_a2, initVal_a3, initVal_a4, initVal_a5, initVal_a6, initVal_alpha, initVal_expCoeffa0, initVal_expCoeffa1, initVal_expCoeffa2, initVal_fGCB, initVal_fsig, initVal_gamma, initVal_gaussFrac, initVal_gaussFrac2, initVal_mean, initVal_mean2, initVal_mean3, initVal_n, initVal_sigma, initVal_sigma2, initVal_sigma3, mean2_, mean3_, mean_, n_, sigma2_, sigma3_, sigma_, heppy_batch::val, and trigObjTnPSource_cfi::var.

Referenced by fit().

211  {
212  auto initParam = [](std::unique_ptr<RooRealVar>& var, double val) {
213  if (var)
214  var->setVal(val);
215  };
216 
217  initParam(mean_, initVal_mean);
218  initParam(mean2_, initVal_mean2);
219  initParam(mean3_, initVal_mean3);
220  initParam(sigma_, initVal_sigma);
221  initParam(sigma2_, initVal_sigma2);
222  initParam(sigma3_, initVal_sigma3);
223  initParam(gamma_, initVal_gamma);
224  initParam(gaussFrac_, initVal_gaussFrac);
225  initParam(gaussFrac2_, initVal_gaussFrac2);
226  initParam(expCoeffa0_, initVal_expCoeffa0);
227  initParam(expCoeffa1_, initVal_expCoeffa1);
228  initParam(expCoeffa2_, initVal_expCoeffa2);
229  initParam(fsig_, initVal_fsig);
230  initParam(a0_, initVal_a0);
231  initParam(a1_, initVal_a1);
232  initParam(a2_, initVal_a2);
233  initParam(a3_, initVal_a3);
234  initParam(a4_, initVal_a4);
235  initParam(a5_, initVal_a5);
236  initParam(a6_, initVal_a6);
237  initParam(alpha_, initVal_alpha);
238  initParam(n_, initVal_n);
239  initParam(fGCB_, initVal_fGCB);
240 }
double initVal_expCoeffa0
std::unique_ptr< RooRealVar > fsig_
std::unique_ptr< RooRealVar > sigma3_
std::unique_ptr< RooRealVar > mean_
std::unique_ptr< RooRealVar > mean2_
double initVal_mean2
std::unique_ptr< RooRealVar > a0_
std::unique_ptr< RooRealVar > a1_
std::unique_ptr< RooRealVar > mean3_
std::unique_ptr< RooRealVar > a5_
std::unique_ptr< RooRealVar > n_
double initVal_expCoeffa1
double initVal_mean
double initVal_gamma
double initVal_alpha
double initVal_gaussFrac2
std::unique_ptr< RooRealVar > a6_
double initVal_sigma3
std::unique_ptr< RooRealVar > sigma_
std::unique_ptr< RooRealVar > a4_
double initVal_sigma2
std::unique_ptr< RooRealVar > gaussFrac2_
double initVal_expCoeffa2
std::unique_ptr< RooRealVar > a2_
std::unique_ptr< RooRealVar > sigma2_
std::unique_ptr< RooRealVar > gaussFrac_
std::unique_ptr< RooRealVar > gamma_
std::unique_ptr< RooRealVar > fGCB_
std::unique_ptr< RooRealVar > a3_
std::unique_ptr< RooRealVar > expCoeffa0_
std::unique_ptr< RooRealVar > expCoeffa1_
double initVal_fGCB
double initVal_fsig
double initVal_gaussFrac
std::unique_ptr< RooRealVar > expCoeffa2_
std::unique_ptr< RooRealVar > alpha_
double initVal_mean3
double initVal_sigma

◆ sigma()

RooRealVar* FitWithRooFit::sigma ( )
inline

Definition at line 90 of file FitWithRooFit.h.

References sigma_.

Referenced by ZMassBinFit_OldTool().

90 { return sigma_.get(); }
std::unique_ptr< RooRealVar > sigma_

◆ sigma2()

RooRealVar* FitWithRooFit::sigma2 ( )
inline

Definition at line 91 of file FitWithRooFit.h.

References sigma2_.

91 { return sigma2_.get(); }
std::unique_ptr< RooRealVar > sigma2_

◆ sigma3()

RooRealVar* FitWithRooFit::sigma3 ( )
inline

Definition at line 92 of file FitWithRooFit.h.

References sigma3_.

92 { return sigma3_.get(); }
std::unique_ptr< RooRealVar > sigma3_

Member Data Documentation

◆ a0_

std::unique_ptr<RooRealVar> FitWithRooFit::a0_
protected

Definition at line 134 of file FitWithRooFit.h.

Referenced by a0(), buildBackgroundModel(), initA0(), and reinitializeParameters().

◆ a1_

std::unique_ptr<RooRealVar> FitWithRooFit::a1_
protected

Definition at line 135 of file FitWithRooFit.h.

Referenced by a1(), buildBackgroundModel(), initA1(), and reinitializeParameters().

◆ a2_

std::unique_ptr<RooRealVar> FitWithRooFit::a2_
protected

Definition at line 136 of file FitWithRooFit.h.

Referenced by a2(), buildBackgroundModel(), initA2(), and reinitializeParameters().

◆ a3_

std::unique_ptr<RooRealVar> FitWithRooFit::a3_
protected

Definition at line 137 of file FitWithRooFit.h.

Referenced by a3(), buildBackgroundModel(), initA3(), and reinitializeParameters().

◆ a4_

std::unique_ptr<RooRealVar> FitWithRooFit::a4_
protected

Definition at line 138 of file FitWithRooFit.h.

Referenced by a4(), buildBackgroundModel(), initA4(), and reinitializeParameters().

◆ a5_

std::unique_ptr<RooRealVar> FitWithRooFit::a5_
protected

Definition at line 139 of file FitWithRooFit.h.

Referenced by a5(), buildBackgroundModel(), initA5(), and reinitializeParameters().

◆ a6_

std::unique_ptr<RooRealVar> FitWithRooFit::a6_
protected

Definition at line 140 of file FitWithRooFit.h.

Referenced by a6(), buildBackgroundModel(), initA6(), and reinitializeParameters().

◆ alpha_

std::unique_ptr<RooRealVar> FitWithRooFit::alpha_
protected

Definition at line 141 of file FitWithRooFit.h.

Referenced by alpha(), buildSignalModel(), initAlpha(), and reinitializeParameters().

◆ expCoeffa0_

std::unique_ptr<RooRealVar> FitWithRooFit::expCoeffa0_
protected

◆ expCoeffa1_

std::unique_ptr<RooRealVar> FitWithRooFit::expCoeffa1_
protected

◆ expCoeffa2_

std::unique_ptr<RooRealVar> FitWithRooFit::expCoeffa2_
protected

◆ fGCB_

std::unique_ptr<RooRealVar> FitWithRooFit::fGCB_
protected

Definition at line 143 of file FitWithRooFit.h.

Referenced by buildSignalModel(), fGCB(), initFGCB(), and reinitializeParameters().

◆ fsig_

std::unique_ptr<RooRealVar> FitWithRooFit::fsig_
protected

◆ gamma_

std::unique_ptr<RooRealVar> FitWithRooFit::gamma_
protected

Definition at line 127 of file FitWithRooFit.h.

Referenced by buildSignalModel(), gamma(), initGamma(), and reinitializeParameters().

◆ gaussFrac2_

std::unique_ptr<RooRealVar> FitWithRooFit::gaussFrac2_
protected

◆ gaussFrac_

std::unique_ptr<RooRealVar> FitWithRooFit::gaussFrac_
protected

◆ initVal_a0

double FitWithRooFit::initVal_a0 = 0.0
protected

Definition at line 159 of file FitWithRooFit.h.

Referenced by initA0(), and reinitializeParameters().

◆ initVal_a1

double FitWithRooFit::initVal_a1 = 0.0
protected

Definition at line 160 of file FitWithRooFit.h.

Referenced by initA1(), and reinitializeParameters().

◆ initVal_a2

double FitWithRooFit::initVal_a2 = 0.0
protected

Definition at line 161 of file FitWithRooFit.h.

Referenced by initA2(), and reinitializeParameters().

◆ initVal_a3

double FitWithRooFit::initVal_a3 = 0.0
protected

Definition at line 162 of file FitWithRooFit.h.

Referenced by initA3(), and reinitializeParameters().

◆ initVal_a4

double FitWithRooFit::initVal_a4 = 0.0
protected

Definition at line 163 of file FitWithRooFit.h.

Referenced by initA4(), and reinitializeParameters().

◆ initVal_a5

double FitWithRooFit::initVal_a5 = 0.0
protected

Definition at line 164 of file FitWithRooFit.h.

Referenced by initA5(), and reinitializeParameters().

◆ initVal_a6

double FitWithRooFit::initVal_a6 = 0.0
protected

Definition at line 165 of file FitWithRooFit.h.

Referenced by initA6(), and reinitializeParameters().

◆ initVal_alpha

double FitWithRooFit::initVal_alpha = 0.0
protected

Definition at line 166 of file FitWithRooFit.h.

Referenced by initAlpha(), and reinitializeParameters().

◆ initVal_expCoeffa0

double FitWithRooFit::initVal_expCoeffa0 = 0.0
protected

Definition at line 155 of file FitWithRooFit.h.

Referenced by initExpCoeffA0(), and reinitializeParameters().

◆ initVal_expCoeffa1

double FitWithRooFit::initVal_expCoeffa1 = 0.0
protected

Definition at line 156 of file FitWithRooFit.h.

Referenced by initExpCoeffA1(), and reinitializeParameters().

◆ initVal_expCoeffa2

double FitWithRooFit::initVal_expCoeffa2 = 0.0
protected

Definition at line 157 of file FitWithRooFit.h.

Referenced by initExpCoeffA2(), and reinitializeParameters().

◆ initVal_fGCB

double FitWithRooFit::initVal_fGCB = 0.0
protected

Definition at line 168 of file FitWithRooFit.h.

Referenced by initFGCB(), and reinitializeParameters().

◆ initVal_fsig

double FitWithRooFit::initVal_fsig = 0.0
protected

Definition at line 158 of file FitWithRooFit.h.

Referenced by initFsig(), and reinitializeParameters().

◆ initVal_gamma

double FitWithRooFit::initVal_gamma = 0.0
protected

Definition at line 152 of file FitWithRooFit.h.

Referenced by initGamma(), and reinitializeParameters().

◆ initVal_gaussFrac

double FitWithRooFit::initVal_gaussFrac = 0.0
protected

Definition at line 153 of file FitWithRooFit.h.

Referenced by initGaussFrac(), and reinitializeParameters().

◆ initVal_gaussFrac2

double FitWithRooFit::initVal_gaussFrac2 = 0.0
protected

Definition at line 154 of file FitWithRooFit.h.

Referenced by initGaussFrac2(), and reinitializeParameters().

◆ initVal_mean

double FitWithRooFit::initVal_mean = 0.0
protected

Definition at line 146 of file FitWithRooFit.h.

Referenced by initMean(), and reinitializeParameters().

◆ initVal_mean2

double FitWithRooFit::initVal_mean2 = 0.0
protected

Definition at line 147 of file FitWithRooFit.h.

Referenced by initMean2(), and reinitializeParameters().

◆ initVal_mean3

double FitWithRooFit::initVal_mean3 = 0.0
protected

Definition at line 148 of file FitWithRooFit.h.

Referenced by initMean3(), and reinitializeParameters().

◆ initVal_n

double FitWithRooFit::initVal_n = 0.0
protected

Definition at line 167 of file FitWithRooFit.h.

Referenced by initN(), and reinitializeParameters().

◆ initVal_sigma

double FitWithRooFit::initVal_sigma = 0.0
protected

Definition at line 149 of file FitWithRooFit.h.

Referenced by initSigma(), and reinitializeParameters().

◆ initVal_sigma2

double FitWithRooFit::initVal_sigma2 = 0.0
protected

Definition at line 150 of file FitWithRooFit.h.

Referenced by initSigma2(), and reinitializeParameters().

◆ initVal_sigma3

double FitWithRooFit::initVal_sigma3 = 0.0
protected

Definition at line 151 of file FitWithRooFit.h.

Referenced by initSigma3(), and reinitializeParameters().

◆ mean2_

std::unique_ptr<RooRealVar> FitWithRooFit::mean2_
protected

Definition at line 122 of file FitWithRooFit.h.

Referenced by buildSignalModel(), initMean2(), mean2(), and reinitializeParameters().

◆ mean3_

std::unique_ptr<RooRealVar> FitWithRooFit::mean3_
protected

Definition at line 123 of file FitWithRooFit.h.

Referenced by buildSignalModel(), initMean3(), mean3(), and reinitializeParameters().

◆ mean_

std::unique_ptr<RooRealVar> FitWithRooFit::mean_
protected

Definition at line 121 of file FitWithRooFit.h.

Referenced by buildSignalModel(), initMean(), mean(), and reinitializeParameters().

◆ n_

std::unique_ptr<RooRealVar> FitWithRooFit::n_
protected

Definition at line 142 of file FitWithRooFit.h.

Referenced by buildSignalModel(), initN(), n(), and reinitializeParameters().

◆ sigma2_

std::unique_ptr<RooRealVar> FitWithRooFit::sigma2_
protected

Definition at line 125 of file FitWithRooFit.h.

Referenced by buildSignalModel(), initSigma2(), reinitializeParameters(), and sigma2().

◆ sigma3_

std::unique_ptr<RooRealVar> FitWithRooFit::sigma3_
protected

Definition at line 126 of file FitWithRooFit.h.

Referenced by buildSignalModel(), initSigma3(), reinitializeParameters(), and sigma3().

◆ sigma_

std::unique_ptr<RooRealVar> FitWithRooFit::sigma_
protected

Definition at line 124 of file FitWithRooFit.h.

Referenced by buildSignalModel(), initSigma(), reinitializeParameters(), and sigma().

◆ useChi2_

bool FitWithRooFit::useChi2_ = false

Definition at line 117 of file FitWithRooFit.h.

Referenced by fit(), and ZMassBinFit_OldTool().