Angular analysis of B+->K*+(K+pi0)mumu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.8 KiB

  1. #define ROOEXPANDGAUSS_CXX
  2. #include "RooExpAndGauss.hpp"
  3. #include "RooRealVar.h"
  4. ClassImp(RooExpAndGauss)
  5. // default constructor to make RooFit workspaces happy
  6. /*
  7. RooExpAndGauss::RooExpAndGauss():
  8. RooAbsPdf("RooExpAndGaussDefault", "RooExpAndGauss Default"),
  9. x("xRV", "x", 0.0, 1.0),
  10. sh_mean("sh_mean", "sh_mean", 0.0, 1.0),
  11. sh_sigma("sh_sigma","sh_sigma", 0.0, 1.0),
  12. sh_trans("sh_trans","sh_trans", 0.0, 1.0)
  13. {
  14. }
  15. */
  16. RooExpAndGauss::RooExpAndGauss()
  17. {
  18. RooRealVar xRV("xRV","x", 0.0, 1.0);
  19. RooRealVar sh_meanRV("sh_meanRV", "sh_mean", 0.0, 1.0);
  20. RooRealVar sh_sigmaRV("sh_sigmaRV","sh_sigma", 0.0, 1.0);
  21. RooRealVar sh_transRV("sh_transRV","sh_trans", 0.0, 1.0);
  22. RooExpAndGauss("RooExpAndGauss", "RooExpAndGauss", xRV, sh_meanRV, sh_sigmaRV, sh_transRV);
  23. }
  24. RooExpAndGauss::RooExpAndGauss(const char *name, const char *title,
  25. RooAbsReal& _x,
  26. RooAbsReal& _sh_mean,
  27. RooAbsReal& _sh_sigma,
  28. RooAbsReal& _sh_trans) :
  29. RooAbsPdf(name,title),
  30. x("x","x",this,_x),
  31. sh_mean("sh_mean","sh_mean",this,_sh_mean),
  32. sh_sigma("sh_sigma","sh_sigma",this,_sh_sigma),
  33. sh_trans("sh_trans","sh_trans",this,_sh_trans)
  34. {
  35. }
  36. RooExpAndGauss::RooExpAndGauss(const RooExpAndGauss& other, const char* name) :
  37. RooAbsPdf(other,name),
  38. x("x",this,other.x),
  39. sh_mean("sh_mean",this,other.sh_mean),
  40. sh_sigma("sh_sigma",this,other.sh_sigma),
  41. sh_trans("sh_trans",this,other.sh_trans)
  42. {
  43. }
  44. Double_t RooExpAndGauss::evaluate() const
  45. {
  46. double beta = (sh_mean - sh_trans)/(sh_sigma*sh_sigma);
  47. double c = exp(-0.5*pow((sh_trans-sh_mean)/sh_sigma,2))*exp(-beta*sh_trans);
  48. if (x <= sh_trans){
  49. return c*exp(beta*x);
  50. };
  51. return exp(-0.5*pow((x-sh_mean)/sh_sigma,2)); //think a 1/2 was missed before BsMuMuPy v4.4
  52. }