CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 415 of file FitWithRooFit.cc.

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

Referenced by buildModel().

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

483  {
484  std::unique_ptr<RooAbsPdf> model;
485 
486  std::unique_ptr<RooAbsPdf> signal = buildSignalModel(x, signalType);
487  std::unique_ptr<RooAbsPdf> background = buildBackgroundModel(x, backgroundType);
488 
489  if ((signal != nullptr) && (background != nullptr)) {
490  // Combine signal and background pdfs
491  edm::LogPrint("FitWithRooFit") << "Building model with signal and backgound";
492  RooArgList components{*signal.release(), *background.release()};
493  model = std::make_unique<RooAddPdf>("model", "model", components, *fsig_);
494  model->addOwnedComponents(components);
495  } else if (signal != nullptr) {
496  edm::LogPrint("FitWithRooFit") << "Building model with signal";
497  model = std::move(signal);
498  } else if (background != nullptr) {
499  edm::LogPrint("FitWithRooFit") << "Building model with backgound";
500  model = std::move(background);
501  } else {
502  edm::LogWarning("FitWithRooFit") << "Nothing to fit";
503  exit(0);
504  }
505  return model;
506 }
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 251 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().

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

19  {
21 
22  std::unique_ptr<RooDataHist> dh = importTH1(histo, xMin, xMax);
23  RooRealVar x(*static_cast<RooRealVar*>(dh->get()->find("InvMass")));
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  // use RooFit::PrintLevel(-1) to reduce output to screen
40  model->fitTo(*dh, RooFit::SumW2Error(sumW2Error), RooFit::PrintLevel(-1));
41  }
42  // Fit with chi^2
43  else {
44  edm::LogWarning("FitWithRooFit") << "FITTING WITH CHI^2";
45  RooMinimizer m(*chi2);
46  m.migrad();
47  m.hesse();
48  // RooFitResult* r_chi2_wgt = m.save();
49  }
50 
51  model->plotOn(frame, RooFit::LineColor(kRed));
52 
53  // this causes segfaults when the fit causes a Warning in <ROOT::Math::Fitter::CalculateHessErrors>: Error when calculating Hessian
54  //model->plotOn(frame, RooFit::Components(backgroundType), RooFit::LineStyle(kDashed));
55 
56  model->paramOn(frame,
57  RooFit::Label("fit result"),
58  RooFit::Layout(0.65, 0.90, 0.90),
59  RooFit::Format("NEU", RooFit::AutoPrecision(2)));
60 
61  // TODO: fix next lines to get the prob(chi2) (ndof should be dynamically set according to the choosen pdf)
62  // double chi2 = xframe.chiSquare("model","data",ndof);
63  // double ndoff = xframeGetNbinsX();
64  // double chi2prob = TMath::Prob(chi2,ndoff);
65 
66  // 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
67  // ---------------------------------------------------------------------------------------------
68 
69  // If histogram has custom error (i.e. its contents is does not originate from a Poisson process
70  // but e.g. is a sum of weighted events) you can data with symmetric 'sum-of-weights' error instead
71  // (same error bars as shown by ROOT)
72 
73  RooPlot* frame2 = x.frame(RooFit::Title("di-muon mass M(#mu^{+}#mu^{-}) [GeV]"));
74  dh->plotOn(frame2, RooFit::DataError(RooAbsData::SumW2));
75  model->plotOn(frame2, RooFit::LineColor(kRed));
76 
77  // this causes segfaults when the fit causes a Warning in <ROOT::Math::Fitter::CalculateHessErrors>: Error when calculating Hessian
78  //model->plotOn(frame2, RooFit::Components(backgroundType), RooFit::LineStyle(kDashed));
79  model->paramOn(frame2,
80  RooFit::Label("fit result"),
81  RooFit::Layout(0.65, 0.90, 0.90),
82  RooFit::Format("NEU", RooFit::AutoPrecision(2)));
83 
84  // Please note that error bars shown (Poisson or SumW2) are for visualization only, the are NOT used
85  // in a maximum likelihood fit
86  //
87  // A (binned) ML fit will ALWAYS assume the Poisson error interpretation of data (the mathematical definition
88  // of likelihood does not take any external definition of errors). Data with non-unit weights can only be correctly
89  // fitted with a chi^2 fit (see rf602_chi2fit.C)
90 
91  // Draw all frames on a canvas
92  // if( canvas == 0 ) {
93  // canvas = new TCanvas("rf102_dataimport","rf102_dataimport",800,800);
94  // canvas->cd(1);
95  // }
96  // canvas->Divide(2,1);
97  // canvas->cd(1) ; frame->Draw();
98  // canvas->cd(2) ; frame2->Draw();
99 
100  frame2->Draw();
101 }
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_.

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_.

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

◆ mean2()

RooRealVar* FitWithRooFit::mean2 ( )
inline

Definition at line 88 of file FitWithRooFit.h.

References mean2_.

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 219 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().

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

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().