Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:33:21

0001  /***************************************************************************** 
0002   * Project: RooFit                                                           * 
0003   *                                                                           * 
0004   * This code was autogenerated by RooClassFactory                            * 
0005   *****************************************************************************/ 
0006 
0007  // Your description goes here... 
0008 
0009  #include "Riostream.h" 
0010 
0011  #include "CMSBkgLineShape.h" 
0012  #include "RooAbsReal.h" 
0013  #include "RooAbsCategory.h" 
0014  #include <math.h> 
0015  #include "TMath.h" 
0016  #include "RooMath.h"
0017 
0018  ClassImp(CMSBkgLineShape); 
0019 
0020  CMSBkgLineShape::CMSBkgLineShape(const char *name, const char *title, 
0021                         RooAbsReal& _x,
0022                         RooAbsReal& _alpha,
0023                         RooAbsReal& _beta,
0024                         RooAbsReal& _peak,
0025                         RooAbsReal& _gamma) :
0026    RooAbsPdf(name,title), 
0027    x("x","x",this,_x),
0028    alpha("alpha","alpha",this,_alpha),
0029    beta("beta","beta",this,_beta),
0030    peak("peak","peak",this,_peak),
0031    gamma("gamma","gamma",this,_gamma)
0032  { 
0033  } 
0034 
0035 
0036  CMSBkgLineShape::CMSBkgLineShape(const CMSBkgLineShape& other, const char* name) :  
0037    RooAbsPdf(other,name), 
0038    x("x",this,other.x),
0039    alpha("alpha",this,other.alpha),
0040    beta("beta",this,other.beta),
0041    peak("peak",this,other.peak),
0042    gamma("gamma",this,other.gamma)
0043  { 
0044  } 
0045 
0046 
0047 
0048  Double_t CMSBkgLineShape::evaluate() const 
0049  { 
0050 
0051    Double_t erf = RooMath::erfc((alpha - x) * beta);
0052    Double_t u = (x - peak)*gamma;
0053 
0054    if(u < -70) u = 1e20;
0055    else if( u>70 ) u = 0;
0056    else u = exp(-u);   //exponential decay
0057    return erf*u;
0058  } 
0059 
0060 
0061