JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
MELADoubleCB Class Reference

#include <MELACombinePdfs.h>

Inheritance diagram for MELADoubleCB:
Collaboration diagram for MELADoubleCB:

Public Member Functions

 MELADoubleCB ()
 
 MELADoubleCB (const char *name, const char *title, RooAbsReal &_x, RooAbsReal &_mean, RooAbsReal &_width, RooAbsReal &_alpha1, RooAbsReal &_n1, RooAbsReal &_alpha2, RooAbsReal &_n2)
 
 MELADoubleCB (const MELADoubleCB &other, const char *name=0)
 
virtual TObject * clone (const char *newname) const
 
virtual ~MELADoubleCB ()
 
Int_t getAnalyticalIntegral (RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
 
Double_t analyticalIntegral (Int_t code, const char *rangeName=0) const
 

Protected Member Functions

Double_t evaluate () const
 

Protected Attributes

RooRealProxy x
 
RooRealProxy mean
 
RooRealProxy width
 
RooRealProxy alpha1
 
RooRealProxy n1
 
RooRealProxy alpha2
 
RooRealProxy n2
 

Detailed Description

Definition at line 102 of file MELACombinePdfs.h.

Constructor & Destructor Documentation

◆ MELADoubleCB() [1/3]

MELADoubleCB::MELADoubleCB ( )

Definition at line 1998 of file MELACombinePdfs.cc.

1998 {}

◆ MELADoubleCB() [2/3]

MELADoubleCB::MELADoubleCB ( const char *  name,
const char *  title,
RooAbsReal &  _x,
RooAbsReal &  _mean,
RooAbsReal &  _width,
RooAbsReal &  _alpha1,
RooAbsReal &  _n1,
RooAbsReal &  _alpha2,
RooAbsReal &  _n2 
)

Definition at line 2000 of file MELACombinePdfs.cc.

2008  :
2009  RooAbsPdf(name, title),
2010  x("x", "x", this, _x),
2011  mean("mean", "mean", this, _mean),
2012  width("width", "width", this, _width),
2013  alpha1("alpha1", "alpha1", this, _alpha1),
2014  n1("n1", "n1", this, _n1),
2015  alpha2("alpha2", "alpha2", this, _alpha2),
2016  n2("n2", "n2", this, _n2)
2017 {}

◆ MELADoubleCB() [3/3]

MELADoubleCB::MELADoubleCB ( const MELADoubleCB other,
const char *  name = 0 
)

Definition at line 2020 of file MELACombinePdfs.cc.

2020  :
2021 RooAbsPdf(other, name),
2022 x("x", this, other.x),
2023 mean("mean", this, other.mean),
2024 width("width", this, other.width),
2025 alpha1("alpha1", this, other.alpha1),
2026 n1("n1", this, other.n1),
2027 alpha2("alpha2", this, other.alpha2),
2028 n2("n2", this, other.n2)
2029 {}

◆ ~MELADoubleCB()

virtual MELADoubleCB::~MELADoubleCB ( )
inlinevirtual

Definition at line 117 of file MELACombinePdfs.h.

117 {}

Member Function Documentation

◆ analyticalIntegral()

Double_t MELADoubleCB::analyticalIntegral ( Int_t  code,
const char *  rangeName = 0 
) const

Definition at line 2057 of file MELACombinePdfs.cc.

2057  {
2058  assert(code==1);
2059 
2060  double central=0;
2061  double left=0;
2062  double right=0;
2063 
2064  static const Double_t root2 = sqrt(2);
2065  static const Double_t rootPiBy2 = sqrt(atan2(0.0, -1.0)/2.0);
2066  Double_t xscale = root2*width;
2067 
2068  //compute gaussian contribution
2069  double central_low =max(x.min(rangeName), mean - alpha1*width);
2070  double central_high=min(x.max(rangeName), mean + alpha2*width);
2071  if (central_low < central_high) // is the gaussian part in range?
2072  central = rootPiBy2*width*(TMath::Erf((central_high-mean)/xscale)-TMath::Erf((central_low-mean)/xscale));
2073 
2074  //compute left tail;
2075  double A1 = pow(n1/fabs(alpha1), n1)*exp(-alpha1*alpha1/2);
2076  double B1 = n1/fabs(alpha1)-fabs(alpha1);
2077 
2078  double left_low=x.min(rangeName);
2079  double left_high=min(x.max(rangeName), mean - alpha1*width);
2080  if (left_low < left_high){ //is the left tail in range?
2081  if (fabs(n1-1.0)>1.e-5)
2082  left = A1/(-n1+1.0)*width*(pow(B1-(left_low-mean)/width, -n1+1.)-pow(B1-(left_high-mean)/width, -n1+1.));
2083  else
2084  left = A1*width*(log(B1-(left_low-mean)/width) - log(B1-(left_high-mean)/width));
2085  }
2086 
2087  //compute right tail;
2088  double A2 = pow(n2/fabs(alpha2), n2)*exp(-alpha2*alpha2/2);
2089  double B2 = n2/fabs(alpha2)-fabs(alpha2);
2090 
2091  double right_low=max(x.min(rangeName), mean + alpha2*width);
2092  double right_high=x.max(rangeName);
2093  if (right_low < right_high){ //is the right tail in range?
2094  if (fabs(n2-1.0)>1.e-5)
2095  right = A2/(-n2+1.0)*width*(pow(B2+(right_high-mean)/width, -n2+1.)-pow(B2+(right_low-mean)/width, -n2+1.));
2096  else
2097  right = A2*width*(log(B2+(right_high-mean)/width) - log(B2+(right_low-mean)/width));
2098  }
2099 
2100  return left+central+right;
2101 }

◆ clone()

virtual TObject* MELADoubleCB::clone ( const char *  newname) const
inlinevirtual

Definition at line 116 of file MELACombinePdfs.h.

116 { return new MELADoubleCB(*this, newname); }

◆ evaluate()

double MELADoubleCB::evaluate ( ) const
protected

Definition at line 2031 of file MELACombinePdfs.cc.

2031  {
2032  double t = (x-mean)/width;
2033  if (t>-alpha1 && t<alpha2){
2034  return exp(-0.5*t*t);
2035  }
2036  else if (t<-alpha1){
2037  double A1 = pow(n1/fabs(alpha1), n1)*exp(-alpha1*alpha1/2);
2038  double B1 = n1/fabs(alpha1)-fabs(alpha1);
2039  return A1*pow(B1-t, -n1);
2040  }
2041  else if (t>alpha2){
2042  double A2 = pow(n2/fabs(alpha2), n2)*exp(-alpha2*alpha2/2);
2043  double B2 = n2/fabs(alpha2)-fabs(alpha2);
2044  return A2*pow(B2+t, -n2);
2045  }
2046  else{
2047  cout << "ERROR evaluating range..." << endl;
2048  return 99;
2049  }
2050 }

◆ getAnalyticalIntegral()

Int_t MELADoubleCB::getAnalyticalIntegral ( RooArgSet &  allVars,
RooArgSet &  analVars,
const char *  rangeName = 0 
) const

Definition at line 2052 of file MELACombinePdfs.cc.

2052  {
2053  if (matchArgs(allVars, analVars, x)) return 1;
2054  return 0;
2055 }

Member Data Documentation

◆ alpha1

RooRealProxy MELADoubleCB::alpha1
protected

Definition at line 126 of file MELACombinePdfs.h.

◆ alpha2

RooRealProxy MELADoubleCB::alpha2
protected

Definition at line 128 of file MELACombinePdfs.h.

◆ mean

RooRealProxy MELADoubleCB::mean
protected

Definition at line 124 of file MELACombinePdfs.h.

◆ n1

RooRealProxy MELADoubleCB::n1
protected

Definition at line 127 of file MELACombinePdfs.h.

◆ n2

RooRealProxy MELADoubleCB::n2
protected

Definition at line 129 of file MELACombinePdfs.h.

◆ width

RooRealProxy MELADoubleCB::width
protected

Definition at line 125 of file MELACombinePdfs.h.

◆ x

RooRealProxy MELADoubleCB::x
protected

Definition at line 123 of file MELACombinePdfs.h.


The documentation for this class was generated from the following files:
MELADoubleCB::mean
RooRealProxy mean
Definition: MELACombinePdfs.h:124
MELADoubleCB::alpha2
RooRealProxy alpha2
Definition: MELACombinePdfs.h:128
MELADoubleCB::width
RooRealProxy width
Definition: MELACombinePdfs.h:125
MELADoubleCB::alpha1
RooRealProxy alpha1
Definition: MELACombinePdfs.h:126
MELADoubleCB::MELADoubleCB
MELADoubleCB()
Definition: MELACombinePdfs.cc:1998
MELADoubleCB::n2
RooRealProxy n2
Definition: MELACombinePdfs.h:129
MELADoubleCB::x
RooRealProxy x
Definition: MELACombinePdfs.h:123
dd_global::cout
integer cout
Definition: DD_global.F90:21
MELADoubleCB::n1
RooRealProxy n1
Definition: MELACombinePdfs.h:127